| almostdeprecated.h | | almostdeprecated.h | |
| | | | |
| skipping to change at line 65 | | skipping to change at line 65 | |
| */ | | */ | |
| typedef struct { | | typedef struct { | |
| int xstart; | | int xstart; | |
| int ystart; | | int ystart; | |
| int xsize; | | int xsize; | |
| int ysize; | | int ysize; | |
| int chsel; /* 1 2 3 or 0, for r g b or all respectively | | int chsel; /* 1 2 3 or 0, for r g b or all respectively | |
| *(channel select) */ | | *(channel select) */ | |
| } IMAGE_BOX; | | } IMAGE_BOX; | |
| | | | |
|
| /* Compatibility typedefs. | | | |
| */ | | | |
| typedef VipsDemandStyle im_demand_type; | | | |
| typedef VipsProgress im_time_t; | | | |
| typedef VipsImage IMAGE; | | | |
| | | | |
| int im_extract( IMAGE *, IMAGE *, IMAGE_BOX * ); | | int im_extract( IMAGE *, IMAGE *, IMAGE_BOX * ); | |
| DOUBLEMASK *im_measure( IMAGE *im, IMAGE_BOX *box, int h, int v, | | DOUBLEMASK *im_measure( IMAGE *im, IMAGE_BOX *box, int h, int v, | |
| int *sel, int nsel, const char *name ); | | int *sel, int nsel, const char *name ); | |
| | | | |
| gboolean im_isuint( IMAGE *im ); | | gboolean im_isuint( IMAGE *im ); | |
| gboolean im_isint( IMAGE *im ); | | gboolean im_isint( IMAGE *im ); | |
| gboolean im_isfloat( IMAGE *im ); | | gboolean im_isfloat( IMAGE *im ); | |
| gboolean im_isscalar( IMAGE *im ); | | gboolean im_isscalar( IMAGE *im ); | |
| gboolean im_iscomplex( IMAGE *im ); | | gboolean im_iscomplex( IMAGE *im ); | |
| | | | |
| | | | |
| skipping to change at line 139 | | skipping to change at line 133 | |
| void im_errormsg( const char *fmt, ... ) | | void im_errormsg( const char *fmt, ... ) | |
| __attribute__((format(printf, 1, 2))); | | __attribute__((format(printf, 1, 2))); | |
| void im_verrormsg( const char *fmt, va_list ap ); | | void im_verrormsg( const char *fmt, va_list ap ); | |
| void im_errormsg_system( int err, const char *fmt, ... ) | | void im_errormsg_system( int err, const char *fmt, ... ) | |
| __attribute__((format(printf, 2, 3))); | | __attribute__((format(printf, 2, 3))); | |
| void im_diagnostics( const char *fmt, ... ) | | void im_diagnostics( const char *fmt, ... ) | |
| __attribute__((format(printf, 1, 2))); | | __attribute__((format(printf, 1, 2))); | |
| void im_warning( const char *fmt, ... ) | | void im_warning( const char *fmt, ... ) | |
| __attribute__((format(printf, 1, 2))); | | __attribute__((format(printf, 1, 2))); | |
| | | | |
|
| | | int im_iterate( VipsImage *im, | |
| | | VipsStartFn start, VipsGenerateFn generate, VipsStopFn stop, | |
| | | void *a, void *b | |
| | | ); | |
| | | | |
| | | /* Async rendering. | |
| | | */ | |
| | | int im_render_priority( VipsImage *in, VipsImage *out, VipsImage *mask, | |
| | | int width, int height, int max, | |
| | | int priority, | |
| | | void (*notify)( VipsImage *, VipsRect *, void * ), void *client ); | |
| | | int im_cache( VipsImage *in, VipsImage *out, int width, int height, int max | |
| | | ); | |
| | | | |
| /* Deprecated operations. | | /* Deprecated operations. | |
| */ | | */ | |
| int im_cmulnorm( IMAGE *in1, IMAGE *in2, IMAGE *out ); | | int im_cmulnorm( IMAGE *in1, IMAGE *in2, IMAGE *out ); | |
| int im_fav4( IMAGE **, IMAGE * ); | | int im_fav4( IMAGE **, IMAGE * ); | |
| int im_gadd( double, IMAGE *, double, IMAGE *, double, IMAGE *); | | int im_gadd( double, IMAGE *, double, IMAGE *, double, IMAGE *); | |
| int im_litecor( IMAGE *, IMAGE *, IMAGE *, int, double ); | | int im_litecor( IMAGE *, IMAGE *, IMAGE *, int, double ); | |
| int im_render_fade( IMAGE *in, IMAGE *out, IMAGE *mask, | | int im_render_fade( IMAGE *in, IMAGE *out, IMAGE *mask, | |
| int width, int height, int max, | | int width, int height, int max, | |
| int fps, int steps, | | int fps, int steps, | |
| int priority, | | int priority, | |
|
| void (*notify)( IMAGE *, Rect *, void * ), void *client ); | | void (*notify)( IMAGE *, VipsRect *, void * ), void *client ); | |
| int im_render( IMAGE *in, IMAGE *out, IMAGE *mask, | | int im_render( IMAGE *in, IMAGE *out, IMAGE *mask, | |
| int width, int height, int max, | | int width, int height, int max, | |
|
| void (*notify)( IMAGE *, Rect *, void * ), void *client ); | | void (*notify)( IMAGE *, VipsRect *, void * ), void *client ); | |
| | | | |
| | | int im_cooc_matrix( IMAGE *im, IMAGE *m, | |
| | | int xp, int yp, int xs, int ys, int dx, int dy, int flag ); | |
| | | int im_cooc_asm( IMAGE *m, double *asmoment ); | |
| | | int im_cooc_contrast( IMAGE *m, double *contrast ); | |
| | | int im_cooc_correlation( IMAGE *m, double *correlation ); | |
| | | int im_cooc_entropy( IMAGE *m, double *entropy ); | |
| | | | |
| | | int im_glds_matrix( IMAGE *im, IMAGE *m, | |
| | | int xpos, int ypos, int xsize, int ysize, int dx, int dy ); | |
| | | int im_glds_asm( IMAGE *m, double *asmoment ); | |
| | | int im_glds_contrast( IMAGE *m, double *contrast ); | |
| | | int im_glds_entropy( IMAGE *m, double *entropy ); | |
| | | int im_glds_mean( IMAGE *m, double *mean ); | |
| | | | |
| | | int im_dif_std(); | |
| | | int im_simcontr( IMAGE *out, int xsize, int ysize ); | |
| | | int im_spatres( IMAGE *in, IMAGE *out, int step ); | |
| | | | |
| | | int im_stretch3( IMAGE *in, IMAGE *out, double dx, double dy ); | |
| | | | |
| /* Renamed operations. | | /* Renamed operations. | |
| */ | | */ | |
| | | | |
| /* arithmetic | | /* arithmetic | |
| */ | | */ | |
| int im_remainderconst_vec( IMAGE *in, IMAGE *out, int n, double *c ); | | int im_remainderconst_vec( IMAGE *in, IMAGE *out, int n, double *c ); | |
| | | | |
| /* boolean | | /* boolean | |
| */ | | */ | |
| | | | |
| skipping to change at line 234 | | skipping to change at line 261 | |
| | | | |
| int im_erode_raw( IMAGE *in, IMAGE *out, INTMASK *m ); | | int im_erode_raw( IMAGE *in, IMAGE *out, INTMASK *m ); | |
| int im_dilate_raw( IMAGE *in, IMAGE *out, INTMASK *m ); | | int im_dilate_raw( IMAGE *in, IMAGE *out, INTMASK *m ); | |
| int im_rank_raw( IMAGE *in, IMAGE *out, int xsize, int ysize, int order ); | | int im_rank_raw( IMAGE *in, IMAGE *out, int xsize, int ysize, int order ); | |
| | | | |
| /* inplace | | /* inplace | |
| */ | | */ | |
| int im_circle( IMAGE *im, int cx, int cy, int radius, int intensity ); | | int im_circle( IMAGE *im, int cx, int cy, int radius, int intensity ); | |
| int im_line( IMAGE *, int, int, int, int, int ); | | int im_line( IMAGE *, int, int, int, int, int ); | |
| int im_segment( IMAGE *test, IMAGE *mask, int *segments ); | | int im_segment( IMAGE *test, IMAGE *mask, int *segments ); | |
|
| int im_paintrect( IMAGE *im, Rect *r, PEL *ink ); | | int im_paintrect( IMAGE *im, VipsRect *r, PEL *ink ); | |
| int im_insertplace( IMAGE *main, IMAGE *sub, int x, int y ); | | int im_insertplace( IMAGE *main, IMAGE *sub, int x, int y ); | |
| | | | |
| int im_flood_copy( IMAGE *in, IMAGE *out, int x, int y, PEL *ink ); | | int im_flood_copy( IMAGE *in, IMAGE *out, int x, int y, PEL *ink ); | |
| int im_flood_blob_copy( IMAGE *in, IMAGE *out, int x, int y, PEL *ink ); | | int im_flood_blob_copy( IMAGE *in, IMAGE *out, int x, int y, PEL *ink ); | |
| int im_flood_other_copy( IMAGE *test, IMAGE *mark, IMAGE *out, | | int im_flood_other_copy( IMAGE *test, IMAGE *mark, IMAGE *out, | |
| int x, int y, int serial ); | | int x, int y, int serial ); | |
| | | | |
|
| int im_flood( IMAGE *im, int x, int y, PEL *ink, Rect *dout ); | | int im_flood( IMAGE *im, int x, int y, PEL *ink, VipsRect *dout ); | |
| int im_flood_blob( IMAGE *im, int x, int y, PEL *ink, Rect *dout ); | | int im_flood_blob( IMAGE *im, int x, int y, PEL *ink, VipsRect *dout ); | |
| int im_flood_other( IMAGE *test, IMAGE *mark, | | int im_flood_other( IMAGE *test, IMAGE *mark, | |
|
| int x, int y, int serial, Rect *dout ); | | int x, int y, int serial, VipsRect *dout ); | |
| | | | |
| int im_fastline( IMAGE *im, int x1, int y1, int x2, int y2, PEL *pel ); | | int im_fastline( IMAGE *im, int x1, int y1, int x2, int y2, PEL *pel ); | |
| int im_fastlineuser( IMAGE *im, | | int im_fastlineuser( IMAGE *im, | |
| int x1, int y1, int x2, int y2, | | int x1, int y1, int x2, int y2, | |
| int (*fn)(), void *client1, void *client2, void *client3 ); | | int (*fn)(), void *client1, void *client2, void *client3 ); | |
| | | | |
|
| int im_plotmask( IMAGE *im, int ix, int iy, PEL *ink, PEL *mask, Rect *r ); | | int im_plotmask( IMAGE *im, int ix, int iy, PEL *ink, PEL *mask, VipsRect *
r ); | |
| int im_readpoint( IMAGE *im, int x, int y, PEL *pel ); | | int im_readpoint( IMAGE *im, int x, int y, PEL *pel ); | |
| int im_plotpoint( IMAGE *im, int x, int y, PEL *pel ); | | int im_plotpoint( IMAGE *im, int x, int y, PEL *pel ); | |
| | | | |
|
| int im_smudge( IMAGE *image, int ix, int iy, Rect *r ); | | int im_smudge( IMAGE *image, int ix, int iy, VipsRect *r ); | |
| int im_smear( IMAGE *im, int ix, int iy, Rect *r ); | | int im_smear( IMAGE *im, int ix, int iy, VipsRect *r ); | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif /*__cplusplus*/ | | #endif /*__cplusplus*/ | |
| | | | |
| #endif /*IM_ALMOSTDEPRECATED_H*/ | | #endif /*IM_ALMOSTDEPRECATED_H*/ | |
| | | | |
End of changes. 9 change blocks. |
| 15 lines changed or deleted | | 43 lines changed or added | |
|
| arithmetic.h | | arithmetic.h | |
| | | | |
| skipping to change at line 42 | | skipping to change at line 42 | |
| | | | |
| #ifndef IM_ARITHMETIC_H | | #ifndef IM_ARITHMETIC_H | |
| #define IM_ARITHMETIC_H | | #define IM_ARITHMETIC_H | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif /*__cplusplus*/ | | #endif /*__cplusplus*/ | |
| | | | |
| /* arithmetic | | /* arithmetic | |
| */ | | */ | |
|
| DOUBLEMASK *im_measure_area( IMAGE *im, | | DOUBLEMASK *im_measure_area( VipsImage *im, | |
| int left, int top, int width, int height, | | int left, int top, int width, int height, | |
| int h, int v, | | int h, int v, | |
| int *sel, int nsel, const char *name ); | | int *sel, int nsel, const char *name ); | |
|
| DOUBLEMASK *im_stats( IMAGE *in ); | | DOUBLEMASK *im_stats( VipsImage *in ); | |
| int im_max( IMAGE *in, double *out ); | | int im_max( VipsImage *in, double *out ); | |
| int im_min( IMAGE *in, double *out ); | | int im_min( VipsImage *in, double *out ); | |
| int im_avg( IMAGE *in, double *out ); | | int im_avg( VipsImage *in, double *out ); | |
| int im_deviate( IMAGE *in, double *out ); | | int im_deviate( VipsImage *in, double *out ); | |
| int im_maxpos( IMAGE *in, int *xpos, int *ypos, double *out ); | | int im_maxpos( VipsImage *in, int *xpos, int *ypos, double *out ); | |
| int im_minpos( IMAGE *in, int *xpos, int *ypos, double *out ); | | int im_minpos( VipsImage *in, int *xpos, int *ypos, double *out ); | |
| int im_maxpos_avg( IMAGE *im, double *xpos, double *ypos, double *out ); | | int im_maxpos_avg( VipsImage *im, double *xpos, double *ypos, double *out ) | |
| int im_maxpos_vec( IMAGE *im, int *xpos, int *ypos, double *maxima, int n ) | | ; | |
| ; | | int im_maxpos_vec( VipsImage *im, int *xpos, int *ypos, double *maxima, int | |
| int im_minpos_vec( IMAGE *im, int *xpos, int *ypos, double *minima, int n ) | | n ); | |
| ; | | int im_minpos_vec( VipsImage *im, int *xpos, int *ypos, double *minima, int | |
| int im_bandmean( IMAGE *in, IMAGE *out ); | | n ); | |
| | | int im_bandmean( VipsImage *in, VipsImage *out ); | |
| int im_add( IMAGE *in1, IMAGE *in2, IMAGE *out ); | | | |
| int im_subtract( IMAGE *in1, IMAGE *in2, IMAGE *out ); | | int im_add( VipsImage *in1, VipsImage *in2, VipsImage *out ); | |
| int im_invert( IMAGE *in, IMAGE *out ); | | int im_subtract( VipsImage *in1, VipsImage *in2, VipsImage *out ); | |
| int im_lintra( double a, IMAGE *in, double b, IMAGE *out ); | | int im_invert( VipsImage *in, VipsImage *out ); | |
| int im_lintra_vec( int n, double *a, IMAGE *in, double *b, IMAGE *out ); | | int im_lintra( double a, VipsImage *in, double b, VipsImage *out ); | |
| int im_multiply( IMAGE *in1, IMAGE *in2, IMAGE *out ); | | int im_lintra_vec( int n, double *a, VipsImage *in, double *b, VipsImage *o | |
| int im_divide( IMAGE *in1, IMAGE *in2, IMAGE *out ); | | ut ); | |
| int im_remainder( IMAGE *in1, IMAGE *in2, IMAGE *out ); | | int im_multiply( VipsImage *in1, VipsImage *in2, VipsImage *out ); | |
| int im_remainder_vec( IMAGE *in, IMAGE *out, int n, double *c ); | | int im_divide( VipsImage *in1, VipsImage *in2, VipsImage *out ); | |
| int im_remainderconst( IMAGE *in, IMAGE *out, double c ); | | int im_remainder( VipsImage *in1, VipsImage *in2, VipsImage *out ); | |
| int im_recomb( IMAGE *in, IMAGE *out, DOUBLEMASK *recomb ); | | int im_remainder_vec( VipsImage *in, VipsImage *out, int n, double *c ); | |
| | | int im_remainderconst( VipsImage *in, VipsImage *out, double c ); | |
| int im_sign( IMAGE *in, IMAGE *out ); | | int im_recomb( VipsImage *in, VipsImage *out, DOUBLEMASK *recomb ); | |
| int im_abs( IMAGE *in, IMAGE *out ); | | | |
| int im_floor( IMAGE *in, IMAGE *out ); | | int im_sign( VipsImage *in, VipsImage *out ); | |
| int im_rint( IMAGE *in, IMAGE *out ); | | int im_abs( VipsImage *in, VipsImage *out ); | |
| int im_ceil( IMAGE *in, IMAGE *out ); | | int im_floor( VipsImage *in, VipsImage *out ); | |
| | | int im_rint( VipsImage *in, VipsImage *out ); | |
| | | int im_ceil( VipsImage *in, VipsImage *out ); | |
| | | | |
|
| int im_linreg( IMAGE **ins, IMAGE *out, double *xs ); | | int im_linreg( VipsImage **ins, VipsImage *out, double *xs ); | |
| int im_point( IMAGE *im, VipsInterpolate *interpolate, | | int im_point( VipsImage *im, VipsInterpolate *interpolate, | |
| | | double x, double y, int band, double *out ); | |
| | | int im_point_bilinear( VipsImage *im, | |
| double x, double y, int band, double *out ); | | double x, double y, int band, double *out ); | |
|
| int im_point_bilinear( IMAGE *im, double x, double y, int band, double *out
); | | | |
| | | | |
|
| int im_powtra( IMAGE *in, IMAGE *out, double e ); | | int im_powtra( VipsImage *in, VipsImage *out, double e ); | |
| int im_powtra_vec( IMAGE *in, IMAGE *out, int n, double *e ); | | int im_powtra_vec( VipsImage *in, VipsImage *out, int n, double *e ); | |
| int im_exptra( IMAGE *in, IMAGE *out ); | | int im_exptra( VipsImage *in, VipsImage *out ); | |
| int im_exp10tra( IMAGE *in, IMAGE *out ); | | int im_exp10tra( VipsImage *in, VipsImage *out ); | |
| int im_expntra( IMAGE *in, IMAGE *out, double e ); | | int im_expntra( VipsImage *in, VipsImage *out, double e ); | |
| int im_expntra_vec( IMAGE *in, IMAGE *out, int n, double *e ); | | int im_expntra_vec( VipsImage *in, VipsImage *out, int n, double *e ); | |
| int im_logtra( IMAGE *in, IMAGE *out ); | | int im_logtra( VipsImage *in, VipsImage *out ); | |
| int im_log10tra( IMAGE *in, IMAGE *out ); | | int im_log10tra( VipsImage *in, VipsImage *out ); | |
| | | | |
| int im_sintra( IMAGE *in, IMAGE *out ); | | int im_sintra( VipsImage *in, VipsImage *out ); | |
| int im_costra( IMAGE *in, IMAGE *out ); | | int im_costra( VipsImage *in, VipsImage *out ); | |
| int im_tantra( IMAGE *in, IMAGE *out ); | | int im_tantra( VipsImage *in, VipsImage *out ); | |
| int im_asintra( IMAGE *in, IMAGE *out ); | | int im_asintra( VipsImage *in, VipsImage *out ); | |
| int im_acostra( IMAGE *in, IMAGE *out ); | | int im_acostra( VipsImage *in, VipsImage *out ); | |
| int im_atantra( IMAGE *in, IMAGE *out ); | | int im_atantra( VipsImage *in, VipsImage *out ); | |
| | | | |
|
| int im_cross_phase( IMAGE *a, IMAGE *b, IMAGE *out ); | | int im_cross_phase( VipsImage *a, VipsImage *b, VipsImage *out ); | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif /*__cplusplus*/ | | #endif /*__cplusplus*/ | |
| | | | |
| #endif /*IM_ARITHMETIC_H*/ | | #endif /*IM_ARITHMETIC_H*/ | |
| | | | |
End of changes. 6 change blocks. |
| 51 lines changed or deleted | | 54 lines changed or added | |
|
| colour.h | | colour.h | |
| | | | |
| skipping to change at line 119 | | skipping to change at line 119 | |
| float im_col_Cucs2C( float Cucs ); | | float im_col_Cucs2C( float Cucs ); | |
| float im_col_Ch2hucs( float C, float h ); | | float im_col_Ch2hucs( float C, float h ); | |
| float im_col_Chucs2h( float C, float hucs ); | | float im_col_Chucs2h( float C, float hucs ); | |
| double im_col_ab2h( double a, double b ); | | double im_col_ab2h( double a, double b ); | |
| | | | |
| float im_col_dECMC( | | float im_col_dECMC( | |
| float L1, float a1, float b1, float L2, float a2, float b2 ); | | float L1, float a1, float b1, float L2, float a2, float b2 ); | |
| float im_col_dE00( | | float im_col_dE00( | |
| float L1, float a1, float b1, float L2, float a2, float b2 ); | | float L1, float a1, float b1, float L2, float a2, float b2 ); | |
| | | | |
|
| int im_LCh2Lab( IMAGE *in, IMAGE *out ); | | int im_LCh2Lab( VipsImage *in, VipsImage *out ); | |
| int im_LabQ2XYZ( IMAGE *in, IMAGE *out ); | | int im_LabQ2XYZ( VipsImage *in, VipsImage *out ); | |
| int im_rad2float( IMAGE *in, IMAGE *out ); | | int im_rad2float( VipsImage *in, VipsImage *out ); | |
| int im_float2rad( IMAGE *in, IMAGE *out ); | | int im_float2rad( VipsImage *in, VipsImage *out ); | |
| int im_LCh2UCS( IMAGE *in, IMAGE *out ); | | int im_LCh2UCS( VipsImage *in, VipsImage *out ); | |
| int im_Lab2LCh( IMAGE *in, IMAGE *out ); | | int im_Lab2LCh( VipsImage *in, VipsImage *out ); | |
| int im_Lab2LabQ( IMAGE *in, IMAGE *out ); | | int im_Lab2LabQ( VipsImage *in, VipsImage *out ); | |
| int im_Lab2LabS( IMAGE *in, IMAGE *out ); | | int im_Lab2LabS( VipsImage *in, VipsImage *out ); | |
| int im_Lab2XYZ( IMAGE *in, IMAGE *out ); | | int im_Lab2XYZ( VipsImage *in, VipsImage *out ); | |
| int im_Lab2XYZ_temp( IMAGE *in, IMAGE *out, double X0, double Y0, double Z0 | | int im_Lab2XYZ_temp( VipsImage *in, VipsImage *out, | |
| ); | | double X0, double Y0, double Z0 ); | |
| int im_Lab2UCS( IMAGE *in, IMAGE *out ); | | int im_Lab2UCS( VipsImage *in, VipsImage *out ); | |
| int im_LabQ2Lab( IMAGE *in, IMAGE *out ); | | int im_LabQ2Lab( VipsImage *in, VipsImage *out ); | |
| int im_LabQ2LabS( IMAGE *in, IMAGE *out ); | | int im_LabQ2LabS( VipsImage *in, VipsImage *out ); | |
| int im_LabS2LabQ( IMAGE *in, IMAGE *out ); | | int im_LabS2LabQ( VipsImage *in, VipsImage *out ); | |
| int im_LabS2Lab( IMAGE *in, IMAGE *out ); | | int im_LabS2Lab( VipsImage *in, VipsImage *out ); | |
| int im_UCS2XYZ( IMAGE *in, IMAGE *out ); | | int im_UCS2XYZ( VipsImage *in, VipsImage *out ); | |
| int im_UCS2LCh( IMAGE *in, IMAGE *out ); | | int im_UCS2LCh( VipsImage *in, VipsImage *out ); | |
| int im_UCS2Lab( IMAGE *in, IMAGE *out ); | | int im_UCS2Lab( VipsImage *in, VipsImage *out ); | |
| int im_XYZ2Lab( IMAGE *in, IMAGE *out ); | | int im_XYZ2Lab( VipsImage *in, VipsImage *out ); | |
| int im_XYZ2Lab_temp( IMAGE *in, IMAGE *out, double X0, double Y0, double Z0 | | int im_XYZ2Lab_temp( VipsImage *in, VipsImage *out, | |
| ); | | double X0, double Y0, double Z0 ); | |
| int im_XYZ2UCS( IMAGE *in, IMAGE *out ); | | int im_XYZ2UCS( VipsImage *in, VipsImage *out ); | |
| int im_sRGB2XYZ( IMAGE *in, IMAGE *out ); | | int im_sRGB2XYZ( VipsImage *in, VipsImage *out ); | |
| int im_XYZ2sRGB( IMAGE *in, IMAGE *out ); | | int im_XYZ2sRGB( VipsImage *in, VipsImage *out ); | |
| int im_Yxy2XYZ( IMAGE *in, IMAGE *out ); | | int im_Yxy2XYZ( VipsImage *in, VipsImage *out ); | |
| int im_XYZ2Yxy( IMAGE *in, IMAGE *out ); | | int im_XYZ2Yxy( VipsImage *in, VipsImage *out ); | |
| | | | |
| int im_dECMC_fromLab( IMAGE *in1, IMAGE *in2, IMAGE *out ); | | int im_dECMC_fromLab( VipsImage *in1, VipsImage *in2, VipsImage *out ); | |
| int im_dE00_fromLab( IMAGE *in1, IMAGE *in2, IMAGE *out ); | | int im_dE00_fromLab( VipsImage *in1, VipsImage *in2, VipsImage *out ); | |
| int im_dE_fromXYZ( IMAGE *in1, IMAGE *in2, IMAGE *out ); | | int im_dE_fromXYZ( VipsImage *in1, VipsImage *in2, VipsImage *out ); | |
| int im_dE_fromLab( IMAGE *in1, IMAGE *in2, IMAGE *out ); | | int im_dE_fromLab( VipsImage *in1, VipsImage *in2, VipsImage *out ); | |
| | | | |
|
| int im_lab_morph( IMAGE *in, IMAGE *out, | | int im_lab_morph( VipsImage *in, VipsImage *out, | |
| DOUBLEMASK *mask, | | DOUBLEMASK *mask, | |
| double L_offset, double L_scale, | | double L_offset, double L_scale, | |
| double a_scale, double b_scale ); | | double a_scale, double b_scale ); | |
| | | | |
| void im_col_make_tables_UCS( void ); | | void im_col_make_tables_UCS( void ); | |
| | | | |
| /* Render intents for icc wrappers. | | /* Render intents for icc wrappers. | |
| */ | | */ | |
| typedef enum { | | typedef enum { | |
| IM_INTENT_PERCEPTUAL = 0, | | IM_INTENT_PERCEPTUAL = 0, | |
| IM_INTENT_RELATIVE_COLORIMETRIC, | | IM_INTENT_RELATIVE_COLORIMETRIC, | |
| IM_INTENT_SATURATION, | | IM_INTENT_SATURATION, | |
| IM_INTENT_ABSOLUTE_COLORIMETRIC | | IM_INTENT_ABSOLUTE_COLORIMETRIC | |
| } VipsIntent; | | } VipsIntent; | |
| | | | |
| int im_icc_present( void ); | | int im_icc_present( void ); | |
|
| int im_icc_transform( IMAGE *in, IMAGE *out, | | int im_icc_transform( VipsImage *in, VipsImage *out, | |
| const char *input_profile_filename, | | const char *input_profile_filename, | |
| const char *output_profile_filename, | | const char *output_profile_filename, | |
| VipsIntent intent ); | | VipsIntent intent ); | |
|
| int im_icc_import( IMAGE *in, IMAGE *out, | | int im_icc_import( VipsImage *in, VipsImage *out, | |
| const char *input_profile_filename, VipsIntent intent ); | | const char *input_profile_filename, VipsIntent intent ); | |
|
| int im_icc_import_embedded( IMAGE *in, IMAGE *out, VipsIntent intent ); | | int im_icc_import_embedded( VipsImage *in, VipsImage *out, VipsIntent inten | |
| int im_icc_export_depth( IMAGE *in, IMAGE *out, int depth, | | t ); | |
| | | int im_icc_export_depth( VipsImage *in, VipsImage *out, int depth, | |
| const char *output_profile_filename, VipsIntent intent ); | | const char *output_profile_filename, VipsIntent intent ); | |
|
| int im_icc_ac2rc( IMAGE *in, IMAGE *out, const char *profile_filename ); | | int im_icc_ac2rc( VipsImage *in, VipsImage *out, const char *profile_filena
me ); | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif /*__cplusplus*/ | | #endif /*__cplusplus*/ | |
| | | | |
| #endif /*IM_COLOUR_H*/ | | #endif /*IM_COLOUR_H*/ | |
| | | | |
End of changes. 6 change blocks. |
| 38 lines changed or deleted | | 39 lines changed or added | |
|
| conversion.h | | conversion.h | |
| | | | |
| skipping to change at line 40 | | skipping to change at line 40 | |
| | | | |
| */ | | */ | |
| | | | |
| #ifndef IM_CONVERSION_H | | #ifndef IM_CONVERSION_H | |
| #define IM_CONVERSION_H | | #define IM_CONVERSION_H | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif /*__cplusplus*/ | | #endif /*__cplusplus*/ | |
| | | | |
|
| DOUBLEMASK *im_vips2mask( IMAGE *in, const char *filename ); | | DOUBLEMASK *im_vips2mask( VipsImage *in, const char *filename ); | |
| int im_mask2vips( DOUBLEMASK *in, IMAGE *out ); | | int im_mask2vips( DOUBLEMASK *in, VipsImage *out ); | |
| | | | |
|
| int im_copy( IMAGE *in, IMAGE *out ); | | int im_copy( VipsImage *in, VipsImage *out ); | |
| int im_copy_set( IMAGE *in, IMAGE *out, | | int im_copy_set( VipsImage *in, VipsImage *out, | |
| VipsType type, float xres, float yres, int xoffset, int yoffset ); | | VipsInterpretation interpretation, | |
| int im_copy_set_meta( IMAGE *in, IMAGE *out, const char *field, GValue *val | | float xres, float yres, int xoffset, int yoffset ); | |
| ue ); | | int im_copy_set_meta( VipsImage *in, VipsImage *out, | |
| int im_copy_morph( IMAGE *in, IMAGE *out, | | const char *field, GValue *value ); | |
| int bands, VipsBandFmt bandfmt, VipsCoding coding ); | | int im_copy_morph( VipsImage *in, VipsImage *out, | |
| int im_copy_swap( IMAGE *in, IMAGE *out ); | | int bands, VipsBandFormat format, VipsCoding coding ); | |
| int im_copy_native( IMAGE *in, IMAGE *out, gboolean is_msb_first ); | | int im_copy_swap( VipsImage *in, VipsImage *out ); | |
| int im_copy_file( IMAGE *in, IMAGE *out ); | | int im_copy_native( VipsImage *in, VipsImage *out, gboolean is_msb_first ); | |
| | | int im_copy_file( VipsImage *in, VipsImage *out ); | |
| int im_clip2fmt( IMAGE *in, IMAGE *out, VipsBandFmt fmt ); | | | |
| int im_scale( IMAGE *in, IMAGE *out ); | | int im_clip2fmt( VipsImage *in, VipsImage *out, VipsBandFormat fmt ); | |
| int im_msb( IMAGE *in, IMAGE *out ); | | int im_scale( VipsImage *in, VipsImage *out ); | |
| int im_msb_band( IMAGE *in, IMAGE *out, int band ); | | int im_msb( VipsImage *in, VipsImage *out ); | |
| | | int im_msb_band( VipsImage *in, VipsImage *out, int band ); | |
| int im_c2amph( IMAGE *in, IMAGE *out ); | | | |
| int im_c2rect( IMAGE *in, IMAGE *out ); | | int im_c2amph( VipsImage *in, VipsImage *out ); | |
| int im_ri2c( IMAGE *in1, IMAGE *in2, IMAGE *out ); | | int im_c2rect( VipsImage *in, VipsImage *out ); | |
| int im_c2imag( IMAGE *in, IMAGE *out ); | | int im_ri2c( VipsImage *in1, VipsImage *in2, VipsImage *out ); | |
| int im_c2real( IMAGE *in, IMAGE *out ); | | int im_c2imag( VipsImage *in, VipsImage *out ); | |
| int im_scaleps( IMAGE *in, IMAGE *out ); | | int im_c2real( VipsImage *in, VipsImage *out ); | |
| | | int im_scaleps( VipsImage *in, VipsImage *out ); | |
| | | | |
|
| int im_falsecolour( IMAGE *in, IMAGE *out ); | | int im_falsecolour( VipsImage *in, VipsImage *out ); | |
| int im_gaussnoise( IMAGE *out, int x, int y, double mean, double sigma ); | | int im_gaussnoise( VipsImage *out, int x, int y, double mean, double sigma | |
| | | ); | |
| | | | |
|
| int im_black( IMAGE *out, int x, int y, int bands ); | | int im_black( VipsImage *out, int x, int y, int bands ); | |
| int im_text( IMAGE *out, const char *text, const char *font, | | int im_text( VipsImage *out, const char *text, const char *font, | |
| int width, int alignment, int dpi ); | | int width, int alignment, int dpi ); | |
| | | | |
|
| int im_extract_band( IMAGE *in, IMAGE *out, int band ); | | int im_extract_band( VipsImage *in, VipsImage *out, int band ); | |
| int im_extract_bands( IMAGE *in, IMAGE *out, int band, int nbands ); | | int im_extract_bands( VipsImage *in, VipsImage *out, int band, int nbands ) | |
| int im_extract_area( IMAGE *in, IMAGE *out, | | ; | |
| | | int im_extract_area( VipsImage *in, VipsImage *out, | |
| int left, int top, int width, int height ); | | int left, int top, int width, int height ); | |
|
| int im_extract_areabands( IMAGE *in, IMAGE *out, | | int im_extract_areabands( VipsImage *in, VipsImage *out, | |
| int left, int top, int width, int height, int band, int nbands ); | | int left, int top, int width, int height, int band, int nbands ); | |
|
| int im_embed( IMAGE *in, IMAGE *out, | | int im_embed( VipsImage *in, VipsImage *out, | |
| int type, int x, int y, int width, int height ); | | int type, int x, int y, int width, int height ); | |
|
| int im_bandjoin( IMAGE *in1, IMAGE *in2, IMAGE *out ); | | int im_bandjoin( VipsImage *in1, VipsImage *in2, VipsImage *out ); | |
| int im_gbandjoin( IMAGE **in, IMAGE *out, int n ); | | int im_gbandjoin( VipsImage **in, VipsImage *out, int n ); | |
| int im_insert( IMAGE *main, IMAGE *sub, IMAGE *out, int x, int y ); | | int im_insert( VipsImage *main, VipsImage *sub, VipsImage *out, int x, int | |
| int im_insert_noexpand( IMAGE *main, IMAGE *sub, IMAGE *out, int x, int y ) | | y ); | |
| ; | | int im_insert_noexpand( VipsImage *main, VipsImage *sub, VipsImage *out, in | |
| int im_insertset( IMAGE *main, IMAGE *sub, IMAGE *out, int n, int *x, int * | | t x, int y ); | |
| y ); | | int im_insertset( VipsImage *main, VipsImage *sub, VipsImage *out, int n, i | |
| int im_lrjoin( IMAGE *left, IMAGE *right, IMAGE *out ); | | nt *x, int *y ); | |
| int im_tbjoin( IMAGE *top, IMAGE *bottom, IMAGE *out ); | | int im_lrjoin( VipsImage *left, VipsImage *right, VipsImage *out ); | |
| int im_replicate( IMAGE *in, IMAGE *out, int across, int down ); | | int im_tbjoin( VipsImage *top, VipsImage *bottom, VipsImage *out ); | |
| int im_grid( IMAGE *in, IMAGE *out, int tile_height, int across, int down ) | | int im_replicate( VipsImage *in, VipsImage *out, int across, int down ); | |
| ; | | int im_grid( VipsImage *in, VipsImage *out, int tile_height, int across, in | |
| int im_wrap( IMAGE *in, IMAGE *out, int x, int y ); | | t down ); | |
| | | int im_wrap( VipsImage *in, VipsImage *out, int x, int y ); | |
| int im_fliphor( IMAGE *in, IMAGE *out ); | | | |
| int im_flipver( IMAGE *in, IMAGE *out ); | | int im_fliphor( VipsImage *in, VipsImage *out ); | |
| int im_rot90( IMAGE *in, IMAGE *out ); | | int im_flipver( VipsImage *in, VipsImage *out ); | |
| int im_rot180( IMAGE *in, IMAGE *out ); | | int im_rot90( VipsImage *in, VipsImage *out ); | |
| int im_rot270( IMAGE *in, IMAGE *out ); | | int im_rot180( VipsImage *in, VipsImage *out ); | |
| | | int im_rot270( VipsImage *in, VipsImage *out ); | |
| | | | |
|
| int im_subsample( IMAGE *in, IMAGE *out, int xshrink, int yshrink ); | | int im_subsample( VipsImage *in, VipsImage *out, int xshrink, int yshrink ) | |
| int im_zoom( IMAGE *in, IMAGE *out, int xfac, int yfac ); | | ; | |
| | | int im_zoom( VipsImage *in, VipsImage *out, int xfac, int yfac ); | |
| | | | |
|
| int im_system( IMAGE *im, const char *cmd, char **out ); | | int im_system( VipsImage *im, const char *cmd, char **out ); | |
| IMAGE *im_system_image( IMAGE *im, | | VipsImage *im_system_image( VipsImage *im, | |
| const char *in_format, const char *out_format, const char *cmd_forma
t, | | const char *in_format, const char *out_format, const char *cmd_forma
t, | |
| char **log ); | | char **log ); | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif /*__cplusplus*/ | | #endif /*__cplusplus*/ | |
| | | | |
| #endif /*IM_CONVERSION_H*/ | | #endif /*IM_CONVERSION_H*/ | |
| | | | |
End of changes. 10 change blocks. |
| 56 lines changed or deleted | | 61 lines changed or added | |
|
| error.h | | error.h | |
| | | | |
| skipping to change at line 30 | | skipping to change at line 30 | |
| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 U
SA | | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 U
SA | |
| | | | |
| */ | | */ | |
| | | | |
| /* | | /* | |
| | | | |
| These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk | | These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk | |
| | | | |
| */ | | */ | |
| | | | |
|
| #ifndef IM_ERROR_H | | #ifndef VIPS_ERROR_H | |
| #define IM_ERROR_H | | #define VIPS_ERROR_H | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif /*__cplusplus*/ | | #endif /*__cplusplus*/ | |
| | | | |
|
| const char *im_error_buffer( void ); | | const char *vips_error_buffer( void ); | |
| void im_error_clear( void ); | | void vips_error_clear( void ); | |
| | | | |
|
| void im_error( const char *domain, const char *fmt, ... ) | | void vips_error( const char *domain, const char *fmt, ... ) | |
| __attribute__((format(printf, 2, 3))); | | __attribute__((format(printf, 2, 3))); | |
|
| void im_verror( const char *domain, const char *fmt, va_list ap ); | | void vips_verror( const char *domain, const char *fmt, va_list ap ); | |
| void im_error_system( int err, const char *domain, const char *fmt, ... ) | | void vips_error_system( int err, const char *domain, const char *fmt, ... ) | |
| __attribute__((format(printf, 3, 4))); | | __attribute__((format(printf, 3, 4))); | |
|
| void im_verror_system( int err, const char *domain, | | void vips_verror_system( int err, const char *domain, | |
| const char *fmt, va_list ap ); | | const char *fmt, va_list ap ); | |
|
| void im_warn( const char *domain, const char *fmt, ... ) | | void vips_error_g( GError **error ); | |
| | | void vips_warn( const char *domain, const char *fmt, ... ) | |
| __attribute__((format(printf, 2, 3))); | | __attribute__((format(printf, 2, 3))); | |
|
| void im_vwarn( const char *domain, const char *fmt, va_list ap ); | | void vips_vwarn( const char *domain, const char *fmt, va_list ap ); | |
| void im_diag( const char *domain, const char *fmt, ... ) | | void vips_diag( const char *domain, const char *fmt, ... ) | |
| __attribute__((format(printf, 2, 3))); | | __attribute__((format(printf, 2, 3))); | |
|
| void im_vdiag( const char *domain, const char *fmt, va_list ap ); | | void vips_vdiag( const char *domain, const char *fmt, va_list ap ); | |
| | | | |
|
| void error_exit( const char *fmt, ... ) | | void vips_error_exit( const char *fmt, ... ) | |
| __attribute__((noreturn, format(printf, 1, 2))); | | __attribute__((noreturn, format(printf, 1, 2))); | |
| | | | |
|
| | | int vips_check_uncoded( const char *domain, VipsImage *im ); | |
| | | int vips_check_coding_known( const char *domain, VipsImage *im ); | |
| | | int vips_check_coding_labq( const char *domain, VipsImage *im ); | |
| | | int vips_check_coding_rad( const char *domain, VipsImage *im ); | |
| | | int vips_check_coding_noneorlabq( const char *domain, VipsImage *im ); | |
| | | int vips_check_coding_same( const char *domain, VipsImage *im1, VipsImage * | |
| | | im2 ); | |
| | | int vips_check_mono( const char *domain, VipsImage *im ); | |
| | | int vips_check_bands_1or3( const char *domain, VipsImage *in ); | |
| | | int vips_check_bands( const char *domain, VipsImage *im, int bands ); | |
| | | int vips_check_bands_1orn( const char *domain, VipsImage *im1, VipsImage *i | |
| | | m2 ); | |
| | | int vips_check_bands_1orn_unary( const char *domain, VipsImage *im, int n ) | |
| | | ; | |
| | | int vips_check_bands_same( const char *domain, VipsImage *im1, VipsImage *i | |
| | | m2 ); | |
| | | int vips_check_bandno( const char *domain, VipsImage *im, int bandno ); | |
| | | int vips_check_int( const char *domain, VipsImage *im ); | |
| | | int vips_check_uint( const char *domain, VipsImage *im ); | |
| | | int vips_check_uintorf( const char *domain, VipsImage *im ); | |
| | | int vips_check_noncomplex( const char *domain, VipsImage *im ); | |
| | | int vips_check_complex( const char *domain, VipsImage *im ); | |
| | | int vips_check_format( const char *domain, VipsImage *im, VipsBandFormat fm | |
| | | t ); | |
| | | int vips_check_u8or16( const char *domain, VipsImage *im ); | |
| | | int vips_check_8or16( const char *domain, VipsImage *im ); | |
| | | int vips_check_u8or16orf( const char *domain, VipsImage *im ); | |
| | | int vips_check_format_same( const char *domain, VipsImage *im1, VipsImage * | |
| | | im2 ); | |
| | | int vips_check_size_same( const char *domain, VipsImage *im1, VipsImage *im | |
| | | 2 ); | |
| | | int vips_check_vector( const char *domain, int n, VipsImage *im ); | |
| | | int vips_check_hist( const char *domain, VipsImage *im ); | |
| | | int vips_check_imask( const char *domain, INTMASK *mask ); | |
| | | int vips_check_dmask( const char *domain, DOUBLEMASK *mask ); | |
| | | int vips_check_dmask_1d( const char *domain, DOUBLEMASK *mask ); | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif /*__cplusplus*/ | | #endif /*__cplusplus*/ | |
| | | | |
|
| #endif /*!IM_ERROR_H*/ | | #endif /*VIPS_ERROR_H*/ | |
| | | | |
End of changes. 11 change blocks. |
| 13 lines changed or deleted | | 51 lines changed or added | |
|
| format.h | | format.h | |
| | | | |
| skipping to change at line 57 | | skipping to change at line 57 | |
| #define VIPS_IS_FORMAT_CLASS( klass ) \ | | #define VIPS_IS_FORMAT_CLASS( klass ) \ | |
| (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_FORMAT )) | | (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_FORMAT )) | |
| #define VIPS_FORMAT_GET_CLASS( obj ) \ | | #define VIPS_FORMAT_GET_CLASS( obj ) \ | |
| (G_TYPE_INSTANCE_GET_CLASS( (obj), \ | | (G_TYPE_INSTANCE_GET_CLASS( (obj), \ | |
| VIPS_TYPE_FORMAT, VipsFormatClass )) | | VIPS_TYPE_FORMAT, VipsFormatClass )) | |
| | | | |
| /* Image file properties. | | /* Image file properties. | |
| */ | | */ | |
| typedef enum { | | typedef enum { | |
| VIPS_FORMAT_NONE = 0, /* No flags set */ | | VIPS_FORMAT_NONE = 0, /* No flags set */ | |
|
| VIPS_FORMAT_PARTIAL = 1 /* Lazy read OK (eg. tiled tiff) */ | | VIPS_FORMAT_PARTIAL = 1, /* Lazy read OK (eg. tiled tiff) */ | |
| | | VIPS_FORMAT_BIGENDIAN = 2 /* Most-significant byte first */ | |
| } VipsFormatFlags; | | } VipsFormatFlags; | |
| | | | |
| /* Don't instantiate these things, just use the class stuff. | | /* Don't instantiate these things, just use the class stuff. | |
| */ | | */ | |
| | | | |
| typedef struct _VipsFormat { | | typedef struct _VipsFormat { | |
| VipsObject parent_object; | | VipsObject parent_object; | |
| /*< public >*/ | | /*< public >*/ | |
| | | | |
| } VipsFormat; | | } VipsFormat; | |
| | | | |
| typedef struct _VipsFormatClass { | | typedef struct _VipsFormatClass { | |
| VipsObjectClass parent_class; | | VipsObjectClass parent_class; | |
| | | | |
| /*< public >*/ | | /*< public >*/ | |
| /* Is a file in this format. | | /* Is a file in this format. | |
| */ | | */ | |
| gboolean (*is_a)( const char * ); | | gboolean (*is_a)( const char * ); | |
| | | | |
|
| /* Read just the header into the IMAGE. | | /* Read just the header into the VipsImage. | |
| */ | | */ | |
|
| int (*header)( const char *, IMAGE * ); | | int (*header)( const char *, VipsImage * ); | |
| | | | |
| /* Load the whole image. | | /* Load the whole image. | |
| */ | | */ | |
|
| int (*load)( const char *, IMAGE * ); | | int (*load)( const char *, VipsImage * ); | |
| | | | |
|
| /* Write the IMAGE to the file in this format. | | /* Write the VipsImage to the file in this format. | |
| */ | | */ | |
|
| int (*save)( IMAGE *, const char * ); | | int (*save)( VipsImage *, const char * ); | |
| | | | |
| /* Get the flags for this file in this format. | | /* Get the flags for this file in this format. | |
| */ | | */ | |
| VipsFormatFlags (*get_flags)( const char * ); | | VipsFormatFlags (*get_flags)( const char * ); | |
| | | | |
| /* Loop over formats in this order, default 0. We need this because | | /* Loop over formats in this order, default 0. We need this because | |
| * some formats can be read by several loaders (eg. tiff can be read | | * some formats can be read by several loaders (eg. tiff can be read | |
| * by the libMagick loader as well as by the tiff loader), and we wa
nt | | * by the libMagick loader as well as by the tiff loader), and we wa
nt | |
| * to make sure the better loader comes first. | | * to make sure the better loader comes first. | |
| */ | | */ | |
| | | | |
| skipping to change at line 110 | | skipping to change at line 111 | |
| /* Null-terminated list of allowed suffixes, eg. ".tif", ".tiff". | | /* Null-terminated list of allowed suffixes, eg. ".tif", ".tiff". | |
| */ | | */ | |
| const char **suffs; | | const char **suffs; | |
| } VipsFormatClass; | | } VipsFormatClass; | |
| | | | |
| GType vips_format_get_type( void ); | | GType vips_format_get_type( void ); | |
| | | | |
| /* Map over and find formats. This uses type introspection to loop over | | /* Map over and find formats. This uses type introspection to loop over | |
| * subclasses of VipsFormat. | | * subclasses of VipsFormat. | |
| */ | | */ | |
|
| void *vips_format_map( VSListMap2Fn fn, void *a, void *b ); | | void *vips_format_map( VipsSListMap2Fn fn, void *a, void *b ); | |
| VipsFormatClass *vips_format_for_file( const char *filename ); | | VipsFormatClass *vips_format_for_file( const char *filename ); | |
| VipsFormatClass *vips_format_for_name( const char *filename ); | | VipsFormatClass *vips_format_for_name( const char *filename ); | |
| | | | |
| VipsFormatFlags vips_format_get_flags( VipsFormatClass *format, | | VipsFormatFlags vips_format_get_flags( VipsFormatClass *format, | |
| const char *filename ); | | const char *filename ); | |
| | | | |
| /* Read/write an image convenience functions. | | /* Read/write an image convenience functions. | |
| */ | | */ | |
|
| int vips_format_read( const char *filename, IMAGE *out ); | | int vips_format_read( const char *filename, VipsImage *out ); | |
| int vips_format_write( IMAGE *in, const char *filename ); | | int vips_format_write( VipsImage *in, const char *filename ); | |
| | | | |
| /* Low-level read/write operations. | | /* Low-level read/write operations. | |
| */ | | */ | |
|
| int im_jpeg2vips( const char *filename, IMAGE *out ); | | int im_jpeg2vips( const char *filename, VipsImage *out ); | |
| int im_vips2jpeg( IMAGE *in, const char *filename ); | | int im_bufjpeg2vips( void *buf, size_t len, | |
| int im_vips2mimejpeg( IMAGE *in, int qfac ); | | VipsImage *out, gboolean header_only ); | |
| int im_vips2bufjpeg( IMAGE *in, IMAGE *out, int qfac, char **obuf, int *ole | | int im_vips2jpeg( VipsImage *in, const char *filename ); | |
| n ); | | int im_vips2mimejpeg( VipsImage *in, int qfac ); | |
| | | int im_vips2bufjpeg( VipsImage *in, VipsImage *out, | |
| int im_tiff2vips( const char *filename, IMAGE *out ); | | int qfac, char **obuf, int *olen ); | |
| int im_vips2tiff( IMAGE *in, const char *filename ); | | | |
| int im_tile_cache( IMAGE *in, IMAGE *out, | | int im_tiff2vips( const char *filename, VipsImage *out ); | |
| | | int im_vips2tiff( VipsImage *in, const char *filename ); | |
| | | int im_tile_cache( VipsImage *in, VipsImage *out, | |
| int tile_width, int tile_height, int max_tiles ); | | int tile_width, int tile_height, int max_tiles ); | |
| | | | |
|
| int im_magick2vips( const char *filename, IMAGE *out ); | | int im_magick2vips( const char *filename, VipsImage *out ); | |
| | | | |
|
| int im_exr2vips( const char *filename, IMAGE *out ); | | int im_exr2vips( const char *filename, VipsImage *out ); | |
| | | | |
|
| int im_ppm2vips( const char *filename, IMAGE *out ); | | int im_ppm2vips( const char *filename, VipsImage *out ); | |
| int im_vips2ppm( IMAGE *in, const char *filename ); | | int im_vips2ppm( VipsImage *in, const char *filename ); | |
| | | | |
|
| int im_analyze2vips( const char *filename, IMAGE *out ); | | int im_analyze2vips( const char *filename, VipsImage *out ); | |
| | | | |
|
| int im_csv2vips( const char *filename, IMAGE *out ); | | int im_csv2vips( const char *filename, VipsImage *out ); | |
| int im_vips2csv( IMAGE *in, const char *filename ); | | int im_vips2csv( VipsImage *in, const char *filename ); | |
| | | | |
|
| int im_png2vips( const char *filename, IMAGE *out ); | | int im_png2vips( const char *filename, VipsImage *out ); | |
| int im_vips2png( IMAGE *in, const char *filename ); | | int im_vips2png( VipsImage *in, const char *filename ); | |
| int im_vips2bufpng( IMAGE *in, IMAGE *out, | | int im_vips2bufpng( VipsImage *in, VipsImage *out, | |
| int compression, int interlace, char **obuf, size_t *olen ); | | int compression, int interlace, char **obuf, size_t *olen ); | |
| | | | |
|
| int im_raw2vips( const char *filename, IMAGE *out, | | int im_raw2vips( const char *filename, VipsImage *out, | |
| int width, int height, int bpp, int offset ); | | int width, int height, int bpp, int offset ); | |
|
| int im_vips2raw( IMAGE *in, int fd ); | | int im_vips2raw( VipsImage *in, int fd ); | |
| | | | |
|
| int im_mat2vips( const char *filename, IMAGE *out ); | | int im_mat2vips( const char *filename, VipsImage *out ); | |
| | | | |
|
| int im_rad2vips( const char *filename, IMAGE *out ); | | int im_rad2vips( const char *filename, VipsImage *out ); | |
| int im_vips2rad( IMAGE *in, const char *filename ); | | int im_vips2rad( VipsImage *in, const char *filename ); | |
| | | | |
| | | int im_fits2vips( const char *filename, VipsImage *out ); | |
| | | int im_vips2fits( VipsImage *in, const char *filename ); | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif /*__cplusplus*/ | | #endif /*__cplusplus*/ | |
| | | | |
| #endif /*IM_FORMAT_H*/ | | #endif /*IM_FORMAT_H*/ | |
| | | | |
End of changes. 19 change blocks. |
| 33 lines changed or deleted | | 39 lines changed or added | |
|
| header.h | | header.h | |
| | | | |
| skipping to change at line 33 | | skipping to change at line 33 | |
| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 U
SA | | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 U
SA | |
| | | | |
| */ | | */ | |
| | | | |
| /* | | /* | |
| | | | |
| These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk | | These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk | |
| | | | |
| */ | | */ | |
| | | | |
|
| #ifndef IM_HEADER_H | | #ifndef VIPS_HEADER_H | |
| #define IM_HEADER_H | | #define VIPS_HEADER_H | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif /*__cplusplus*/ | | #endif /*__cplusplus*/ | |
| | | | |
|
| int im_header_int( IMAGE *im, const char *field, int *out ); | | /** | |
| int im_header_double( IMAGE *im, const char *field, double *out ); | | * VIPS_META_EXIF_NAME: | |
| int im_header_string( IMAGE *im, const char *field, char **out ); | | * | |
| int im_header_as_string( IMAGE *im, const char *field, char **out ); | | * The name that JPEG read and write operations use for the image's EXIF da | |
| GType im_header_get_typeof( IMAGE *im, const char *field ); | | ta. | |
| int im_header_get( IMAGE *im, const char *field, GValue *value_copy ); | | */ | |
| | | #define VIPS_META_EXIF_NAME "exif-data" | |
| | | | |
| | | /** | |
| | | * VIPS_META_ICC_NAME: | |
| | | * | |
| | | * The name we use to attach an ICC profile. The file read and write | |
| | | * operations for TIFF, JPEG, PNG and others use this item of metadata to | |
| | | * attach and save ICC profiles. The profile is updated by the | |
| | | * vips_icc_transform() operations. | |
| | | */ | |
| | | #define VIPS_META_ICC_NAME "icc-profile-data" | |
| | | | |
| | | /** | |
| | | * VIPS_META_XML: | |
| | | * | |
| | | * The original XML that was used to code the metadata after reading a VIPS | |
| | | * format file. | |
| | | */ | |
| | | #define VIPS_META_XML "xml-header" | |
| | | | |
| | | /** | |
| | | * VIPS_META_RESOLUTION_UNIT: | |
| | | * | |
| | | * The JPEG and TIFF read and write operations use this to record the | |
| | | * file's preferred unit for resolution. | |
| | | */ | |
| | | #define VIPS_META_RESOLUTION_UNIT "resolution-unit" | |
| | | | |
| | | int vips_format_sizeof( VipsBandFormat format ); | |
| | | | |
| | | int vips_image_get_width( VipsImage *image ); | |
| | | int vips_image_get_height( VipsImage *image ); | |
| | | int vips_image_get_bands( VipsImage *image ); | |
| | | VipsBandFormat vips_image_get_format( VipsImage *image ); | |
| | | VipsCoding vips_image_get_coding( VipsImage *image ); | |
| | | VipsInterpretation vips_image_get_interpretation( VipsImage *image ); | |
| | | double vips_image_get_xres( VipsImage *image ); | |
| | | double vips_image_get_yres( VipsImage *image ); | |
| | | int vips_image_get_xoffset( VipsImage *image ); | |
| | | int vips_image_get_yoffset( VipsImage *image ); | |
| | | const char *vips_image_get_filename( VipsImage *image ); | |
| | | const char *vips_image_get_mode( VipsImage *image ); | |
| | | void *vips_image_get_data( VipsImage *image );; | |
| | | | |
| | | void vips_image_init_fields( VipsImage *image, | |
| | | int xsize, int ysize, int bands, | |
| | | VipsBandFormat format, VipsCoding coding, | |
| | | VipsInterpretation interpretation, | |
| | | float xres, float yres ); | |
| | | | |
| | | int vips_image_copy_fields_array( VipsImage *out, VipsImage *in[] ); | |
| | | int vips_image_copy_fieldsv( VipsImage *out, VipsImage *in1, ... ) | |
| | | __attribute__((sentinel)); | |
| | | int vips_image_copy_fields( VipsImage *out, VipsImage *in ); | |
| | | | |
| | | int vips_image_set( VipsImage *image, const char *field, GValue *value ); | |
| | | int vips_image_get( VipsImage *image, const char *field, GValue *value_copy | |
| | | ); | |
| | | GType vips_image_get_typeof( VipsImage *image, const char *field ); | |
| | | gboolean vips_image_remove( VipsImage *image, const char *field ); | |
| | | typedef void *(*VipsImageMapFn)( VipsImage *image, | |
| | | const char *field, GValue *value, void *a ); | |
| | | void *vips_image_map( VipsImage *im, VipsImageMapFn fn, void *a ); | |
| | | | |
| | | /** | |
| | | * VIPS_TYPE_SAVE_STRING: | |
| | | * | |
| | | * The #GType for an "vips_save_string". | |
| | | */ | |
| | | #define VIPS_TYPE_SAVE_STRING (vips_save_string_get_type()) | |
| | | GType vips_save_string_get_type( void ); | |
| | | const char *vips_save_string_get( const GValue *value ); | |
| | | void vips_save_string_set( GValue *value, const char *str ); | |
| | | void vips_save_string_setf( GValue *value, const char *fmt, ... ) | |
| | | __attribute__((format(printf, 2, 3))); | |
| | | | |
| | | /** | |
| | | * VIPS_TYPE_AREA: | |
| | | * | |
| | | * The #GType for an #vips_area. | |
| | | */ | |
| | | #define VIPS_TYPE_AREA (vips_area_get_type()) | |
| | | GType vips_area_get_type( void ); | |
| | | | |
| | | /** | |
| | | * VIPS_TYPE_REF_STRING: | |
| | | * | |
| | | * The #GType for an #vips_refstring. | |
| | | */ | |
| | | #define VIPS_TYPE_REF_STRING (vips_ref_string_get_type()) | |
| | | GType vips_ref_string_get_type( void ); | |
| | | int vips_ref_string_set( GValue *value, const char *str ); | |
| | | const char *vips_ref_string_get( const GValue *value ); | |
| | | size_t vips_ref_string_get_length( const GValue *value ); | |
| | | | |
| | | /** | |
| | | * VIPS_TYPE_BLOB: | |
| | | * | |
| | | * The #GType for an #vips_blob. | |
| | | */ | |
| | | | |
| | | /* Also used for eg. vips_local() and friends. | |
| | | */ | |
| | | typedef int (*VipsCallbackFn)( void *a, void *b ); | |
| | | | |
|
| typedef void *(*im_header_map_fn)( IMAGE *, const char *, GValue *, void * | | #define VIPS_TYPE_BLOB (vips_blob_get_type()) | |
| ); | | GType vips_blob_get_type( void ); | |
| void *im_header_map( IMAGE *im, im_header_map_fn fn, void *a ); | | void *vips_blob_get( const GValue *value, size_t *length ); | |
| | | int vips_blob_set( GValue *value, VipsCallbackFn free_fn, | |
| | | void *data, size_t length ); | |
| | | | |
| | | int vips_image_set_area( VipsImage *image, | |
| | | const char *field, VipsCallbackFn free_fn, void *data ); | |
| | | int vips_image_get_area( VipsImage *image, const char *field, void **data ) | |
| | | ; | |
| | | int vips_image_set_string( VipsImage *image, | |
| | | const char *field, const char *str ); | |
| | | int vips_image_get_string( VipsImage *image, const char *field, char **str | |
| | | ); | |
| | | int vips_image_set_blob( VipsImage *image, const char *field, | |
| | | VipsCallbackFn free_fn, void *data, size_t length ); | |
| | | int vips_image_get_blob( VipsImage *image, const char *field, | |
| | | void **data, size_t *length ); | |
| | | | |
| | | int vips_image_get_int( VipsImage *image, const char *field, int *out ); | |
| | | int vips_image_set_int( VipsImage *image, const char *field, int i ); | |
| | | int vips_image_get_double( VipsImage *image, const char *field, double *out | |
| | | ); | |
| | | int vips_image_set_double( VipsImage *image, const char *field, double d ); | |
| | | int vips_image_get_string( VipsImage *image, const char *field, char **out | |
| | | ); | |
| | | int vips_image_set_string( VipsImage *image, | |
| | | const char *field, const char *str ); | |
| | | int vips_image_get_as_string( VipsImage *image, const char *field, char **o | |
| | | ut ); | |
| | | GType vips_image_get_typeof( VipsImage *image, const char *field ); | |
| | | | |
|
| int im_histlin( IMAGE *im, const char *fmt, ... ) | | int vips_image_history_printf( VipsImage *image, const char *format, ... ) | |
| __attribute__((format(printf, 2, 3))); | | __attribute__((format(printf, 2, 3))); | |
|
| int im_updatehist( IMAGE *out, const char *name, int argc, char *argv[] ); | | int vips_image_history_args( VipsImage *image, | |
| const char *im_history_get( IMAGE *im ); | | const char *name, int argc, char *argv[] ); | |
| | | const char *vips_image_get_history( VipsImage *image ); | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif /*__cplusplus*/ | | #endif /*__cplusplus*/ | |
| | | | |
|
| #endif /*IM_HEADER_H*/ | | #endif /*VIPS_HEADER_H*/ | |
| | | | |
End of changes. 6 change blocks. |
| 14 lines changed or deleted | | 147 lines changed or added | |
|
| histograms_lut.h | | histograms_lut.h | |
| | | | |
| skipping to change at line 40 | | skipping to change at line 40 | |
| | | | |
| */ | | */ | |
| | | | |
| #ifndef IM_HIST_H | | #ifndef IM_HIST_H | |
| #define IM_HIST_H | | #define IM_HIST_H | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif /*__cplusplus*/ | | #endif /*__cplusplus*/ | |
| | | | |
|
| int im_histgr( IMAGE *in, IMAGE *out, int bandno ); | | int im_histgr( VipsImage *in, VipsImage *out, int bandno ); | |
| int im_histnD( IMAGE *in, IMAGE *out, int bins ); | | int im_histnD( VipsImage *in, VipsImage *out, int bins ); | |
| int im_hist_indexed( IMAGE *index, IMAGE *value, IMAGE *out ); | | int im_hist_indexed( VipsImage *index, VipsImage *value, VipsImage *out ); | |
| | | | |
| int im_identity( IMAGE *lut, int bands ); | | int im_identity( VipsImage *lut, int bands ); | |
| int im_identity_ushort( IMAGE *lut, int bands, int sz ); | | int im_identity_ushort( VipsImage *lut, int bands, int sz ); | |
| int im_invertlut( DOUBLEMASK *input, IMAGE *output, int lut_size ); | | int im_invertlut( DOUBLEMASK *input, VipsImage *output, int lut_size ); | |
| int im_buildlut( DOUBLEMASK *input, IMAGE *output ); | | int im_buildlut( DOUBLEMASK *input, VipsImage *output ); | |
| int im_project( IMAGE *in, IMAGE *hout, IMAGE *vout ); | | int im_project( VipsImage *in, VipsImage *hout, VipsImage *vout ); | |
| | | | |
| int im_histnorm( IMAGE *in, IMAGE *out ); | | int im_histnorm( VipsImage *in, VipsImage *out ); | |
| int im_histcum( IMAGE *in, IMAGE *out ); | | int im_histcum( VipsImage *in, VipsImage *out ); | |
| int im_histeq( IMAGE *in, IMAGE *out ); | | int im_histeq( VipsImage *in, VipsImage *out ); | |
| int im_histspec( IMAGE *in, IMAGE *ref, IMAGE *out ); | | int im_histspec( VipsImage *in, VipsImage *ref, VipsImage *out ); | |
| int im_ismonotonic( IMAGE *lut, int *out ); | | int im_ismonotonic( VipsImage *lut, int *out ); | |
| int im_histplot( IMAGE *in, IMAGE *out ); | | int im_histplot( VipsImage *in, VipsImage *out ); | |
| | | | |
| int im_maplut( IMAGE *in, IMAGE *out, IMAGE *lut ); | | int im_maplut( VipsImage *in, VipsImage *out, VipsImage *lut ); | |
| | | | |
| int im_hist( IMAGE *in, IMAGE *out, int bandno ); | | int im_hist( VipsImage *in, VipsImage *out, int bandno ); | |
| int im_hsp( IMAGE *in, IMAGE *ref, IMAGE *out ); | | int im_hsp( VipsImage *in, VipsImage *ref, VipsImage *out ); | |
| int im_gammacorrect( IMAGE *in, IMAGE *out, double exponent ); | | int im_gammacorrect( VipsImage *in, VipsImage *out, double exponent ); | |
| int im_mpercent( IMAGE *in, double percent, int *out ); | | int im_mpercent( VipsImage *in, double percent, int *out ); | |
| int im_mpercent_hist( IMAGE *hist, double percent, int *out ); | | int im_mpercent_hist( VipsImage *hist, double percent, int *out ); | |
| | | | |
| int im_heq( IMAGE *in, IMAGE *out, int bandno ); | | int im_heq( VipsImage *in, VipsImage *out, int bandno ); | |
| int im_lhisteq( IMAGE *in, IMAGE *out, int xwin, int ywin ); | | int im_lhisteq( VipsImage *in, VipsImage *out, int xwin, int ywin ); | |
| int im_stdif( IMAGE *in, IMAGE *out, | | int im_stdif( VipsImage *in, VipsImage *out, | |
| double a, double m0, double b, double s0, int xwin, int ywin ); | | double a, double m0, double b, double s0, int xwin, int ywin ); | |
| | | | |
|
| int im_tone_build_range( IMAGE *out, | | int im_tone_build_range( VipsImage *out, | |
| int in_max, int out_max, | | int in_max, int out_max, | |
| double Lb, double Lw, double Ps, double Pm, double Ph, | | double Lb, double Lw, double Ps, double Pm, double Ph, | |
| double S, double M, double H ); | | double S, double M, double H ); | |
|
| int im_tone_build( IMAGE *out, | | int im_tone_build( VipsImage *out, | |
| double Lb, double Lw, double Ps, double Pm, double Ph, | | double Lb, double Lw, double Ps, double Pm, double Ph, | |
| double S, double M, double H ); | | double S, double M, double H ); | |
|
| int im_tone_analyse( IMAGE *in, IMAGE *out, | | int im_tone_analyse( VipsImage *in, VipsImage *out, | |
| double Ps, double Pm, double Ph, double S, double M, double H ); | | double Ps, double Pm, double Ph, double S, double M, double H ); | |
|
| int im_tone_map( IMAGE *in, IMAGE *out, IMAGE *lut ); | | int im_tone_map( VipsImage *in, VipsImage *out, VipsImage *lut ); | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif /*__cplusplus*/ | | #endif /*__cplusplus*/ | |
| | | | |
| #endif /*IM_HIST_H*/ | | #endif /*IM_HIST_H*/ | |
| | | | |
End of changes. 5 change blocks. |
| 32 lines changed or deleted | | 32 lines changed or added | |
|
| image.h | | image.h | |
| /* VIPS image class. | | /* VIPS image class. | |
| * | | * | |
| * 7/7/09 | | * 7/7/09 | |
| * - from vips.h | | * - from vips.h | |
|
| | | * 2/3/11 | |
| | | * - move to GObject | |
| */ | | */ | |
| | | | |
| /* | | /* | |
| | | | |
| This file is part of VIPS. | | This file is part of VIPS. | |
| | | | |
| VIPS is free software; you can redistribute it and/or modify | | VIPS is free software; you can redistribute it and/or modify | |
| it under the terms of the GNU Lesser General Public License as publishe
d by | | it under the terms of the GNU Lesser General Public License as publishe
d by | |
| the Free Software Foundation; either version 2 of the License, or | | the Free Software Foundation; either version 2 of the License, or | |
| (at your option) any later version. | | (at your option) any later version. | |
| | | | |
| skipping to change at line 33 | | skipping to change at line 35 | |
| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 U
SA | | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 U
SA | |
| | | | |
| */ | | */ | |
| | | | |
| /* | | /* | |
| | | | |
| These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk | | These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk | |
| | | | |
| */ | | */ | |
| | | | |
|
| #ifndef IM_IMAGE_H | | #ifndef VIPS_IMAGE_H | |
| #define IM_IMAGE_H | | #define VIPS_IMAGE_H | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif /*__cplusplus*/ | | #endif /*__cplusplus*/ | |
| | | | |
|
| /* Needed for 'unused' below. Remove this when we remove that. | | | |
| */ | | | |
| #include <time.h> | | | |
| | | | |
| /* If you read MSB first, you get these two values. | | /* If you read MSB first, you get these two values. | |
| * intel order: byte 0 = b6 | | * intel order: byte 0 = b6 | |
| * SPARC order: byte 0 = 08 | | * SPARC order: byte 0 = 08 | |
| */ | | */ | |
|
| #define IM_MAGIC_INTEL (0xb6a6f208U) | | #define VIPS_MAGIC_INTEL (0xb6a6f208U) | |
| #define IM_MAGIC_SPARC (0x08f2a6b6U) | | #define VIPS_MAGIC_SPARC (0x08f2a6b6U) | |
| | | | |
|
| /* Demand style from im_generate(). See im_demand_hint(). | | /** | |
| | | * VipsDemandStyle: | |
| | | * @VIPS_DEMAND_STYLE_SMALLTILE: demand in small (typically 64x64 pixel) ti | |
| | | les | |
| | | * @VIPS_DEMAND_STYLE_FATSTRIP: demand in fat (typically 10 pixel high) str | |
| | | ips | |
| | | * @VIPS_DEMAND_STYLE_THINSTRIP: demand in thin (typically 1 pixel high) st | |
| | | rips | |
| | | * @VIPS_DEMAND_STYLE_ANY: demand geometry does not matter | |
| | | * | |
| | | * See vips_demand_hint(). Operations can hint to the VIPS image IO system | |
| | | about | |
| | | * the kind of demand geometry they prefer. | |
| | | * | |
| | | * These demand styles are given below in order of increasing | |
| | | * restrictiveness. When demanding output from a pipeline, | |
| | | * vips_image_generate() | |
| | | * will use the most restrictive of the styles requested by the operations | |
| | | * in the pipeline. | |
| | | * | |
| | | * VIPS_DEMAND_STYLE_THINSTRIP --- This operation would like to output stri | |
| | | ps | |
| | | * the width of the image and a few pels high. This is option suitable for | |
| | | * point-to-point operations, such as those in the arithmetic package. | |
| | | * | |
| | | * This option is only efficient for cases where each output pel depends | |
| | | * upon the pel in the corresponding position in the input image. | |
| | | * | |
| | | * VIPS_DEMAND_STYLE_FATSTRIP --- This operation would like to output strip | |
| | | s | |
| | | * the width of the image and as high as possible. This option is suitable | |
| | | * for area operations which do not violently transform coordinates, such | |
| | | * as im_conv(). | |
| | | * | |
| | | * VIPS_DEMAND_STYLE_SMALLTILE --- This is the most general demand format. | |
| | | * Output is demanded in small (around 100x100 pel) sections. This style wo | |
| | | rks | |
| | | * reasonably efficiently, even for bizzare operations like 45 degree rotat | |
| | | e. | |
| | | * | |
| | | * VIPS_DEMAND_STYLE_ANY --- This image is not being demand-read from a dis | |
| | | c | |
| | | * file (even indirectly) so any demand style is OK. It's used for things l | |
| | | ike | |
| | | * im_black() where the pixels are calculated. | |
| | | * | |
| | | * See also: vips_demand_hint(). | |
| */ | | */ | |
| typedef enum { | | typedef enum { | |
|
| IM_SMALLTILE, | | VIPS_DEMAND_STYLE_SMALLTILE, | |
| IM_FATSTRIP, | | VIPS_DEMAND_STYLE_FATSTRIP, | |
| IM_THINSTRIP, | | VIPS_DEMAND_STYLE_THINSTRIP, | |
| IM_ANY | | VIPS_DEMAND_STYLE_ANY | |
| } VipsDemandStyle; | | } VipsDemandStyle; | |
| | | | |
|
| | | /* Types of image descriptor we may have. The type field is advisory only: | |
| | | it | |
| | | * does not imply that any fields in IMAGE have valid data. | |
| | | */ | |
| typedef enum { | | typedef enum { | |
|
| IM_TYPE_MULTIBAND = 0, | | VIPS_IMAGE_NONE, /* no type set */ | |
| IM_TYPE_B_W = 1, | | VIPS_IMAGE_SETBUF, /* malloced memory array */ | |
| IM_TYPE_HISTOGRAM = 10, | | VIPS_IMAGE_SETBUF_FOREIGN, /* memory array, don't free on close | |
| IM_TYPE_FOURIER = 24, | | */ | |
| IM_TYPE_XYZ = 12, | | VIPS_IMAGE_OPENIN, /* input from fd with a window */ | |
| IM_TYPE_LAB = 13, | | VIPS_IMAGE_MMAPIN, /* memory mapped input file */ | |
| IM_TYPE_CMYK = 15, | | VIPS_IMAGE_MMAPINRW, /* memory mapped read/write file */ | |
| IM_TYPE_LABQ = 16, | | VIPS_IMAGE_OPENOUT, /* output to fd */ | |
| IM_TYPE_RGB = 17, | | VIPS_IMAGE_PARTIAL /* partial image */ | |
| IM_TYPE_UCS = 18, | | } VipsImageType; | |
| IM_TYPE_LCH = 19, | | | |
| IM_TYPE_LABS = 21, | | /** | |
| IM_TYPE_sRGB = 22, | | * VipsInterpretation: | |
| IM_TYPE_YXY = 23, | | * @VIPS_TYPE_MULTIBAND: generic many-band image | |
| IM_TYPE_RGB16 = 25, | | * @VIPS_TYPE_B_W: some kind of single-band image | |
| IM_TYPE_GREY16 = 26 | | * @VIPS_TYPE_HISTOGRAM: a 1D image such as a histogram or lookup table | |
| } VipsType; | | * @VIPS_TYPE_FOURIER: image is in fourier space | |
| | | * @VIPS_TYPE_XYZ: the first three bands are colours in CIE XYZ colourspace | |
| | | * @VIPS_TYPE_LAB: pixels are in CIE Lab space | |
| | | * @VIPS_TYPE_CMYK: the first four bands are in CMYK space | |
| | | * @VIPS_TYPE_LABQ: implies #VIPS_CODING_LABQ | |
| | | * @VIPS_TYPE_RGB: generic RGB space | |
| | | * @VIPS_TYPE_UCS: a uniform colourspace based on CMC | |
| | | * @VIPS_TYPE_LCH: pixels are in CIE LCh space | |
| | | * @VIPS_TYPE_LABS: pixels are CIE LAB coded as three signed 16-bit values | |
| | | * @VIPS_TYPE_sRGB: pixels are sRGB | |
| | | * @VIPS_TYPE_YXY: pixels are CIE Yxy | |
| | | * @VIPS_TYPE_RGB16: generic 16-bit RGB | |
| | | * @VIPS_TYPE_GREY16: generic 16-bit mono | |
| | | * | |
| | | * How the values in an image should be interpreted. For example, a | |
| | | * three-band float image of type #VIPS_TYPE_LAB should have its pixels | |
| | | * interpreted as coordinates in CIE Lab space. | |
| | | * | |
| | | * These values are set by operations as hints to user-interfaces built on | |
| | | top | |
| | | * of VIPS to help them show images to the user in a meaningful way. | |
| | | * Operations do not use these values to decide their action. | |
| | | * | |
| | | * The gaps in the numbering are historical and must be maintained. Allocat | |
| | | e | |
| | | * new numbers from the end. | |
| | | */ | |
| typedef enum { | | typedef enum { | |
|
| IM_BANDFMT_NOTSET = -1, | | VIPS_INTERPRETATION_MULTIBAND = 0, | |
| IM_BANDFMT_UCHAR = 0, | | VIPS_INTERPRETATION_B_W = 1, | |
| IM_BANDFMT_CHAR = 1, | | VIPS_INTERPRETATION_HISTOGRAM = 10, | |
| IM_BANDFMT_USHORT = 2, | | VIPS_INTERPRETATION_FOURIER = 24, | |
| IM_BANDFMT_SHORT = 3, | | VIPS_INTERPRETATION_XYZ = 12, | |
| IM_BANDFMT_UINT = 4, | | VIPS_INTERPRETATION_LAB = 13, | |
| IM_BANDFMT_INT = 5, | | VIPS_INTERPRETATION_CMYK = 15, | |
| IM_BANDFMT_FLOAT = 6, | | VIPS_INTERPRETATION_LABQ = 16, | |
| IM_BANDFMT_COMPLEX = 7, | | VIPS_INTERPRETATION_RGB = 17, | |
| IM_BANDFMT_DOUBLE = 8, | | VIPS_INTERPRETATION_UCS = 18, | |
| IM_BANDFMT_DPCOMPLEX = 9, | | VIPS_INTERPRETATION_LCH = 19, | |
| IM_BANDFMT_LAST = 10 | | VIPS_INTERPRETATION_LABS = 21, | |
| } VipsBandFmt; | | VIPS_INTERPRETATION_sRGB = 22, | |
| | | VIPS_INTERPRETATION_YXY = 23, | |
| | | VIPS_INTERPRETATION_RGB16 = 25, | |
| | | VIPS_INTERPRETATION_GREY16 = 26 | |
| | | } VipsInterpretation; | |
| | | | |
| | | /** | |
| | | * VipsBandFormat: | |
| | | * @VIPS_FORMAT_NOTSET: invalid setting | |
| | | * @VIPS_FORMAT_UCHAR: unsigned char format | |
| | | * @VIPS_FORMAT_CHAR: char format | |
| | | * @VIPS_FORMAT_USHORT: unsigned short format | |
| | | * @VIPS_FORMAT_SHORT: short format | |
| | | * @VIPS_FORMAT_UINT: unsigned int format | |
| | | * @VIPS_FORMAT_INT: int format | |
| | | * @VIPS_FORMAT_FLOAT: float format | |
| | | * @VIPS_FORMAT_COMPLEX: complex (two floats) format | |
| | | * @VIPS_FORMAT_DOUBLE: double float format | |
| | | * @VIPS_FORMAT_DPCOMPLEX: double complex (two double) format | |
| | | * | |
| | | * The format used for each band element. | |
| | | * | |
| | | * Each corresponnds to a native C type for the current machine. For exampl | |
| | | e, | |
| | | * #VIPS_FORMAT_USHORT is <type>unsigned short</type>. | |
| | | */ | |
| typedef enum { | | typedef enum { | |
|
| IM_CODING_NONE = 0, | | VIPS_FORMAT_NOTSET = -1, | |
| IM_CODING_LABQ = 2, | | VIPS_FORMAT_UCHAR = 0, | |
| IM_CODING_RAD = 6 | | VIPS_FORMAT_CHAR = 1, | |
| | | VIPS_FORMAT_USHORT = 2, | |
| | | VIPS_FORMAT_SHORT = 3, | |
| | | VIPS_FORMAT_UINT = 4, | |
| | | VIPS_FORMAT_INT = 5, | |
| | | VIPS_FORMAT_FLOAT = 6, | |
| | | VIPS_FORMAT_COMPLEX = 7, | |
| | | VIPS_FORMAT_DOUBLE = 8, | |
| | | VIPS_FORMAT_DPCOMPLEX = 9, | |
| | | VIPS_FORMAT_LAST = 10 | |
| | | } VipsBandFormat; | |
| | | | |
| | | /** | |
| | | * VipsCoding: | |
| | | * @VIPS_CODING_NONE: pixels are not coded | |
| | | * @VIPS_CODING_LABQ: pixels encode 3 float CIELAB values as 4 uchar | |
| | | * @VIPS_CODING_RAD: pixels encode 3 float RGB as 4 uchar (Radiance coding) | |
| | | * | |
| | | * How pixels are coded. | |
| | | * | |
| | | * Normally, pixels are uncoded and can be manipulated as you would expect. | |
| | | * However some file formats code pixels for compression, and sometimes it' | |
| | | s | |
| | | * useful to be able to manipulate images in the coded format. | |
| | | * | |
| | | * The gaps in the numbering are historical and must be maintained. Allocat | |
| | | e | |
| | | * new numbers from the end. | |
| | | */ | |
| | | typedef enum { | |
| | | VIPS_CODING_NONE = 0, | |
| | | VIPS_CODING_LABQ = 2, | |
| | | VIPS_CODING_RAD = 6 | |
| } VipsCoding; | | } VipsCoding; | |
| | | | |
|
| /* Struct we keep a record of execution time in. Passed to eval callback, s
o | | /* Struct we keep a record of execution time in. Passed to eval signal so | |
| * it can assess progress. | | * it can assess progress. | |
|
| * | | | |
| * The 'unused' field is there for binary compatibility, remove this when w | | | |
| e | | | |
| * break ABI. Though, at least on windows, sizeof(time_t) can vary with | | | |
| * compiler flags, so we might break ABI anyway. Remove the #include <time. | | | |
| h> | | | |
| * when we remove this. | | | |
| */ | | */ | |
| typedef struct { | | typedef struct { | |
| /*< private >*/ | | /*< private >*/ | |
| struct _VipsImage *im; /* Image we are part of */ | | struct _VipsImage *im; /* Image we are part of */ | |
|
| time_t unused; /* FIXME ... for binary compatibility */ | | | |
| /*< public >*/ | | /*< public >*/ | |
| int run; /* Time we have been running */ | | int run; /* Time we have been running */ | |
| int eta; /* Estimated seconds of computation left */ | | int eta; /* Estimated seconds of computation left */ | |
| gint64 tpels; /* Number of pels we expect to calculate */ | | gint64 tpels; /* Number of pels we expect to calculate */ | |
| gint64 npels; /* Number of pels calculated so far */ | | gint64 npels; /* Number of pels calculated so far */ | |
| int percent; /* Percent complete */ | | int percent; /* Percent complete */ | |
| GTimer *start; /* Start time */ | | GTimer *start; /* Start time */ | |
| } VipsProgress; | | } VipsProgress; | |
| | | | |
|
| | | #define VIPS_TYPE_IMAGE (vips_image_get_type()) | |
| | | #define VIPS_IMAGE( obj ) \ | |
| | | (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ | |
| | | VIPS_TYPE_IMAGE, VipsImage )) | |
| | | #define VIPS_IMAGE_CLASS( klass ) \ | |
| | | (G_TYPE_CHECK_CLASS_CAST( (klass), \ | |
| | | VIPS_TYPE_IMAGE, VipsImageClass)) | |
| | | #define VIPS_IS_IMAGE( obj ) \ | |
| | | (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_IMAGE )) | |
| | | #define VIPS_IS_IMAGE_CLASS( klass ) \ | |
| | | (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_IMAGE )) | |
| | | #define VIPS_IMAGE_GET_CLASS( obj ) \ | |
| | | (G_TYPE_INSTANCE_GET_CLASS( (obj), \ | |
| | | VIPS_TYPE_IMAGE, VipsImageClass )) | |
| | | | |
| typedef struct _VipsImage { | | typedef struct _VipsImage { | |
|
| /*< public >*/ | | VipsObject parent_object; | |
| /* Fields from file header. | | | |
| | | /*< private >*/ | |
| | | | |
| | | /* We have to keep these names for compatibility with the old API. | |
| | | * Don't use them though, use vips_image_get_width() and friends. | |
| */ | | */ | |
|
| | | | |
| int Xsize; /* image width, in pixels */ | | int Xsize; /* image width, in pixels */ | |
| int Ysize; /* image height, in pixels */ | | int Ysize; /* image height, in pixels */ | |
| int Bands; /* number of image bands */ | | int Bands; /* number of image bands */ | |
|
| /*< private >*/ | | | |
| /* No longer used. | | VipsBandFormat BandFmt; /* pixel format */ | |
| */ | | VipsCoding Coding; /* pixel coding */ | |
| int Bbits; /* was number of bits in this format */ | | VipsInterpretation Type;/* pixel interpretation */ | |
| /*< public >*/ | | | |
| VipsBandFmt BandFmt; /* #VipsBandFmt describing the pixel format | | | |
| */ | | | |
| VipsCoding Coding; /* #VipsCoding describing the pixel coding * | | | |
| / | | | |
| VipsType Type; /* #VipsType hinting at pixel interpretation | | | |
| */ | | | |
| float Xres; /* horizontal pixels per millimetre */ | | float Xres; /* horizontal pixels per millimetre */ | |
| float Yres; /* vertical pixels per millimetre */ | | float Yres; /* vertical pixels per millimetre */ | |
|
| /*< private >*/ | | | |
| /* No longer used. | | int Xoffset; /* image origin hint */ | |
| | | int Yoffset; /* image origin hint */ | |
| | | | |
| | | /* No longer used, the names are here for compat with very, very old | |
| | | * code. | |
| */ | | */ | |
| int Length; | | int Length; | |
| short Compression; | | short Compression; | |
| short Level; | | short Level; | |
|
| /*< public >*/ | | int Bbits; /* was number of bits in this format */ | |
| int Xoffset; /* image origin hint */ | | | |
| int Yoffset; /* image origin hint */ | | | |
| | | | |
|
| /* Derived fields that user can fiddle with. | | /* Old code expects to see this member, newer code has a param on | |
| | | * eval(). | |
| */ | | */ | |
|
| /*< private >*/ | | VipsProgress *time; | |
| char *Hist; /* don't use ... call im_history_get() */ | | | |
| /*< public >*/ | | /* Derived fields that some code can fiddle with. New code should us | |
| | | e | |
| | | * vips_image_get_history() and friends. | |
| | | */ | |
| | | char *Hist; /* don't use, see vips_image_get_history() * | |
| | | / | |
| char *filename; /* pointer to copy of filename */ | | char *filename; /* pointer to copy of filename */ | |
| char *data; /* start of image data for WIO */ | | char *data; /* start of image data for WIO */ | |
|
| VipsProgress *time; /* evaluation progress */ | | int kill; /* set to non-zero to block eval */ | |
| int kill; /* set to non-zero to block partial eval */ | | | |
| | | | |
|
| /*< private >*/ | | /* Everything below this private and only used internally by | |
| im_desc_type dtype; /* descriptor type */ | | * VipsImage. | |
| | | */ | |
| | | | |
| | | char *mode; /* mode string passed to _new() */ | |
| | | VipsImageType dtype; /* descriptor type */ | |
| int fd; /* file descriptor */ | | int fd; /* file descriptor */ | |
| char *baseaddr; /* pointer to the start of an mmap file */ | | char *baseaddr; /* pointer to the start of an mmap file */ | |
| size_t length; /* size of mmap area */ | | size_t length; /* size of mmap area */ | |
|
| GSList *closefns; /* list of close callbacks */ | | | |
| GSList *evalfns; /* list of eval callbacks */ | | | |
| GSList *evalendfns; /* list of eval end callbacks */ | | | |
| int closing; /* true for this descriptor is closing */ | | | |
| int close_pending; /* true for this descriptor is a zombie */ | | | |
| guint32 magic; /* magic from header, endian-ness of image *
/ | | guint32 magic; /* magic from header, endian-ness of image *
/ | |
| | | | |
|
| /* Partial image stuff. All private! All these fields are initialise | | /* Partial image stuff. All these fields are initialised | |
| d | | * to NULL and ignored unless set by vips_image_generate() etc. | |
| * to NULL and ignored unless set by im_generate() or im_partial(). | | | |
| */ | | */ | |
| void *(*start)(); /* user-supplied start function */ | | void *(*start)(); /* user-supplied start function */ | |
| int (*generate)(); /* user-supplied generate function */ | | int (*generate)(); /* user-supplied generate function */ | |
| int (*stop)(); /* user-supplied stop function */ | | int (*stop)(); /* user-supplied stop function */ | |
| void *client1; /* user arguments */ | | void *client1; /* user arguments */ | |
| void *client2; | | void *client2; | |
| GMutex *sslock; /* start-stop lock */ | | GMutex *sslock; /* start-stop lock */ | |
| GSList *regions; /* list of regions current for this image */ | | GSList *regions; /* list of regions current for this image */ | |
| VipsDemandStyle dhint; /* demand style hint */ | | VipsDemandStyle dhint; /* demand style hint */ | |
| | | | |
|
| /* Extra user-defined fields ... see im_meta_get_int() etc. | | /* Extra user-defined fields ... see vips_image_get() etc. | |
| */ | | */ | |
|
| GHashTable *Meta; /* GhashTable of GValue */ | | GHashTable *meta; /* GhashTable of GValue */ | |
| GSList *Meta_traverse; /* Traverse order for Meta */ | | GSList *meta_traverse; /* traverse order for Meta */ | |
| | | | |
| /* Part of mmap() read ... the sizeof() the header we skip from the | | /* Part of mmap() read ... the sizeof() the header we skip from the | |
|
| * file start. Usually IM_SIZEOF_HEADER, but can be something else | | * file start. Usually VIPS_SIZEOF_HEADER, but can be something else | |
| * for binary file read. | | * for binary file read. | |
| */ | | */ | |
| int sizeof_header; | | int sizeof_header; | |
| | | | |
| /* If this is a large disc image, don't map the whole thing, instead | | /* If this is a large disc image, don't map the whole thing, instead | |
| * have a set of windows shared between the regions active on the | | * have a set of windows shared between the regions active on the | |
|
| * image. List of im_window_t. | | * image. List of VipsWindow. | |
| */ | | */ | |
| GSList *windows; | | GSList *windows; | |
| | | | |
| /* Upstream/downstream relationships, built from args to | | /* Upstream/downstream relationships, built from args to | |
|
| * im_demand_hint(). | | * vips_demand_hint(). | |
| * | | * | |
|
| * We use these to invalidate downstream pixel buffers on | | * We use these to invalidate downstream pixel buffers. | |
| * im_invalidate(). Use 'serial' to spot circular dependencies. | | * Use 'serial' to spot circular dependencies. | |
| * | | * | |
| * See also hint_set below. | | * See also hint_set below. | |
| */ | | */ | |
| GSList *upstream; | | GSList *upstream; | |
| GSList *downstream; | | GSList *downstream; | |
| int serial; | | int serial; | |
| | | | |
| /* Keep a list of recounted GValue strings so we can share hist | | /* Keep a list of recounted GValue strings so we can share hist | |
| * efficiently. | | * efficiently. | |
| */ | | */ | |
| GSList *history_list; | | GSList *history_list; | |
| | | | |
| /* The VipsImage (if any) we should signal eval progress on. | | /* The VipsImage (if any) we should signal eval progress on. | |
| */ | | */ | |
|
| struct _VipsImage *progress; | | struct _VipsImage *progress_signal; | |
| | | | |
| /* Some more callbacks. | | | |
| */ | | | |
| GSList *evalstartfns; /* list of start eval callbacks */ | | | |
| GSList *preclosefns; /* list of pre-close callbacks */ | | | |
| GSList *invalidatefns; /* list of invalidate callbacks */ | | | |
| | | | |
| /* Record the file length here. We use this to stop ourselves mappin
g | | /* Record the file length here. We use this to stop ourselves mappin
g | |
| * things beyond the end of the file in the case that the file has | | * things beyond the end of the file in the case that the file has | |
| * been truncated. | | * been truncated. | |
| * | | * | |
| * gint64 so that we can guarantee to work even on systems with | | * gint64 so that we can guarantee to work even on systems with | |
| * strange ideas about large files. | | * strange ideas about large files. | |
| */ | | */ | |
| gint64 file_length; | | gint64 file_length; | |
| | | | |
|
| /* Set this when im_demand_hint_array() is called, and check in any | | /* Set this when vips_demand_hint_array() is called, and check in an
y | |
| * operation that will demand pixels from the image. | | * operation that will demand pixels from the image. | |
| * | | * | |
|
| * We use im_demand_hint_array() to build the tree of | | * We use vips_demand_hint_array() to build the tree of | |
| * upstream/downstream relationships, so it's a mandatory thing. | | * upstream/downstream relationships, so it's a mandatory thing. | |
| */ | | */ | |
| gboolean hint_set; | | gboolean hint_set; | |
| | | | |
|
| /* Post-close callbacks happen on finalize. Eg. deleting the file | | /* Delete-on-close is hard to do with signals and callbacks since we | |
| * associated with this temp image. | | * really need to do this in finalize after the fd has been closed, | |
| | | * but you can't emit signals then. | |
| | | * | |
| | | * Also keep a private copy of the filename string to be deleted, | |
| | | * since image->filename will be freed in _dispose(). | |
| */ | | */ | |
|
| GSList *postclosefns; | | gboolean delete_on_close; | |
| | | char *delete_on_close_filename; | |
| | | | |
|
| /* Written callbacks are triggered when an image has been written to | | | |
| . | | | |
| * Used by eg. im_open("x.jpg", "w") to do the final write to jpeg. | | | |
| */ | | | |
| GSList *writtenfns; | | | |
| } VipsImage; | | } VipsImage; | |
| | | | |
|
| extern const size_t im__sizeof_bandfmt[]; | | typedef struct _VipsImageClass { | |
| | | VipsObjectClass parent_class; | |
| | | | |
| | | /* Signals we emit. | |
| | | */ | |
| | | | |
| | | /* Evaluation is starting. | |
| | | */ | |
| | | void (*preeval)( VipsImage *image, VipsProgress *progress ); | |
| | | | |
| | | /* Evaluation progress. | |
| | | */ | |
| | | void (*eval)( VipsImage *image, VipsProgress *progress ); | |
| | | | |
| | | /* Evaluation is ending. | |
| | | */ | |
| | | void (*posteval)( VipsImage *image, VipsProgress *progress ); | |
| | | | |
| | | /* An image has been written to. | |
| | | * Used by eg. vips_image_new_mode("x.jpg", "w") to do the | |
| | | * final write to jpeg. | |
| | | * Set *result to non-zero to indicate an error on write. | |
| | | */ | |
| | | void (*written)( VipsImage *image, int *result ); | |
| | | | |
| | | /* An image has been modified in some way and all caches | |
| | | * need dropping. | |
| | | */ | |
| | | void (*invalidate)( VipsImage *image ); | |
| | | | |
| | | } VipsImageClass; | |
| | | | |
| | | GType vips_image_get_type( void ); | |
| | | | |
| | | extern const size_t vips__image_sizeof_bandformat[]; | |
| | | | |
| /* Pixel address calculation macros. | | /* Pixel address calculation macros. | |
| */ | | */ | |
|
| #define IM_IMAGE_SIZEOF_ELEMENT(I) \ | | #define VIPS_IMAGE_SIZEOF_ELEMENT( I ) \ | |
| (im__sizeof_bandfmt[(I)->BandFmt]) | | (vips__image_sizeof_bandformat[(I)->BandFmt]) | |
| #define IM_IMAGE_SIZEOF_PEL(I) \ | | #define VIPS_IMAGE_SIZEOF_PEL( I ) \ | |
| (IM_IMAGE_SIZEOF_ELEMENT(I) * (I)->Bands) | | (VIPS_IMAGE_SIZEOF_ELEMENT( I ) * (I)->Bands) | |
| #define IM_IMAGE_SIZEOF_LINE(I) \ | | #define VIPS_IMAGE_SIZEOF_LINE( I ) \ | |
| (IM_IMAGE_SIZEOF_PEL(I) * (I)->Xsize) | | (VIPS_IMAGE_SIZEOF_PEL( I ) * (I)->Xsize) | |
| #define IM_IMAGE_N_ELEMENTS(I) \ | | #define VIPS_IMAGE_SIZEOF_IMAGE( I ) \ | |
| | | (VIPS_IMAGE_SIZEOF_LINE( I ) * (I)->Ysize) | |
| | | #define VIPS_IMAGE_N_ELEMENTS( I ) \ | |
| ((I)->Bands * (I)->Xsize) | | ((I)->Bands * (I)->Xsize) | |
| | | | |
|
| /* If DEBUG is defined, add bounds checking. | | /* If VIPS_DEBUG is defined, add bounds checking. | |
| */ | | */ | |
|
| #ifdef DEBUG | | #ifdef VIPS_DEBUG | |
| #define IM_IMAGE_ADDR(I,X,Y) \ | | #define VIPS_IMAGE_ADDR( I, X, Y ) \ | |
| ( ((X) >= 0 && (X) < (I)->Xsize && \ | | ( ((X) >= 0 && (X) < (I)->Xsize && \ | |
| (Y) >= 0 && (Y) < (I)->Ysize) ? \ | | (Y) >= 0 && (Y) < (I)->Ysize) ? \ | |
| ((I)->data + \ | | ((I)->data + \ | |
|
| (Y) * IM_IMAGE_SIZEOF_LINE(I) + \ | | (Y) * VIPS_IMAGE_SIZEOF_LINE( I ) + \ | |
| (X) * IM_IMAGE_SIZEOF_PEL(I)) : \ | | (X) * VIPS_IMAGE_SIZEOF_PEL( I )) : \ | |
| (fprintf( stderr, \ | | (fprintf( stderr, \ | |
|
| "IM_IMAGE_ADDR: point out of bounds, " \ | | "VIPS_IMAGE_ADDR: point out of bounds, " \ | |
| "file \"%s\", line %d\n" \ | | "file \"%s\", line %d\n" \ | |
| "(point x=%d, y=%d\n" \ | | "(point x=%d, y=%d\n" \ | |
|
| " should have been within Rect left=%d, top=%d, " \ | | " should have been within VipsRect left=%d, top=%d, " \ | |
| "width=%d, height=%d)\n", \ | | "width=%d, height=%d)\n", \ | |
| __FILE__, __LINE__, \ | | __FILE__, __LINE__, \ | |
| (X), (Y), \ | | (X), (Y), \ | |
| 0, 0, \ | | 0, 0, \ | |
| (I)->Xsize, \ | | (I)->Xsize, \ | |
| (I)->Ysize ), abort(), (char *) NULL) \ | | (I)->Ysize ), abort(), (char *) NULL) \ | |
| ) | | ) | |
|
| #else /*DEBUG*/ | | #else /*!VIPS_DEBUG*/ | |
| #define IM_IMAGE_ADDR(I,X,Y) \ | | #define VIPS_IMAGE_ADDR( I, X, Y ) \ | |
| ((I)->data + \ | | ((I)->data + \ | |
|
| (Y) * IM_IMAGE_SIZEOF_LINE(I) + \ | | (Y) * VIPS_IMAGE_SIZEOF_LINE( I ) + \ | |
| (X) * IM_IMAGE_SIZEOF_PEL(I)) | | (X) * VIPS_IMAGE_SIZEOF_PEL( I )) | |
| #endif /*DEBUG*/ | | #endif /*VIPS_DEBUG*/ | |
| | | | |
| const char *im_get_argv0( void ); | | int vips_image_written( VipsImage *image ); | |
| int im_init_world( const char *argv0 ); | | | |
| GOptionGroup *im_get_option_group( void ); | | void vips_image_invalidate_all( VipsImage *image ); | |
| | | | |
| const char *im_version_string( void ); | | void vips_image_preeval( VipsImage *image ); | |
| int im_version( int flag ); | | void vips_image_eval( VipsImage *image, int w, int h ); | |
| | | void vips_image_posteval( VipsImage *image ); | |
| const char *im_guess_prefix( const char *argv0, const char *env_name ); | | void vips_image_set_progress( VipsImage *image, gboolean progress ); | |
| const char *im_guess_libdir( const char *argv0, const char *env_name ); | | | |
| | | gboolean vips_image_get_kill( VipsImage *image ); | |
| VipsImage *im_open( const char *filename, const char *mode ); | | void vips_image_set_kill( VipsImage *image, gboolean kill ); | |
| | | | |
| #define im_open_local( IM, NAME, MODE ) \ | | VipsImage *vips_image_new( void ); | |
| ((IMAGE *) im_local( (IM), \ | | int vips_image_new_array( VipsObject *parent, VipsImage **images, int n ); | |
| (im_construct_fn) im_open, (im_callback_fn) im_close, \ | | VipsImage *vips_image_new_mode( const char *filename, const char *mode ); | |
| (void *) (NAME), (void *) (MODE), NULL )) | | VipsImage *vips_image_new_from_file( const char *filename ); | |
| | | VipsImage *vips_image_new_from_file_raw( const char *filename, | |
| /* Strange double cast stops bogus warnings from gcc 4.1 | | | |
| */ | | | |
| #define im_open_local_array( IM, OUT, N, NAME, MODE ) \ | | | |
| (im_local_array( (IM), (void **)((void*)(OUT)), (N),\ | | | |
| (im_construct_fn) im_open, (im_callback_fn) im_close, \ | | | |
| (void *) (NAME), (void *) (MODE), NULL )) | | | |
| | | | |
| int im_close( VipsImage *im ); | | | |
| | | | |
| void im_invalidate( VipsImage *im ); | | | |
| | | | |
| void im_initdesc( VipsImage *image, | | | |
| int xsize, int ysize, int bands, int bandbits, | | | |
| VipsBandFmt bandfmt, VipsCoding coding, VipsType type, | | | |
| float xres, float yres, | | | |
| int xo, int yo ); | | | |
| | | | |
| int im_cp_desc( VipsImage *out, VipsImage *in ); | | | |
| int im_cp_descv( VipsImage *out, VipsImage *in1, ... ) | | | |
| __attribute__((sentinel)); | | | |
| int im_cp_desc_array( VipsImage *out, VipsImage *in[] ); | | | |
| | | | |
| VipsImage *im_binfile( const char *name, | | | |
| int xsize, int ysize, int bands, int offset ); | | int xsize, int ysize, int bands, int offset ); | |
|
| VipsImage *im_image( void *buffer, | | VipsImage *vips_image_new_from_memory( void *buffer, | |
| int xsize, int ysize, int bands, VipsBandFmt bandfmt ); | | int xsize, int ysize, int bands, VipsBandFormat bandfmt ); | |
| | | void vips_image_set_delete_on_close( VipsImage *image, | |
| | | gboolean delete_on_close ); | |
| | | VipsImage *vips_image_new_disc_temp( const char *format ); | |
| | | int vips_image_write( VipsImage *image, const char *filename ); | |
| | | | |
| | | gboolean vips_image_isMSBfirst( VipsImage *image ); | |
| | | gboolean vips_image_isfile( VipsImage *image ); | |
| | | gboolean vips_image_ispartial( VipsImage *image ); | |
| | | | |
| | | int vips_image_write_line( VipsImage *image, int ypos, PEL *linebuffer ); | |
| | | | |
| | | int vips_image_wio_input( VipsImage *image ); | |
| | | int vips_image_wio_output( VipsImage *image ); | |
| | | int vips_image_inplace( VipsImage *image ); | |
| | | int vips_image_pio_input( VipsImage *image ); | |
| | | int vips_image_pio_output( VipsImage *image ); | |
| | | | |
| | | gboolean vips_band_format_isint( VipsBandFormat format ); | |
| | | gboolean vips_band_format_isuint( VipsBandFormat format ); | |
| | | gboolean vips_band_format_isfloat( VipsBandFormat format ); | |
| | | gboolean vips_band_format_iscomplex( VipsBandFormat format ); | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif /*__cplusplus*/ | | #endif /*__cplusplus*/ | |
| | | | |
|
| #endif /*IM_IMAGE_H*/ | | #endif /*VIPS_IMAGE_H*/ | |
| | | | |
End of changes. 48 change blocks. |
| 179 lines changed or deleted | | 347 lines changed or added | |
|
| mosaicing.h | | mosaicing.h | |
| | | | |
| skipping to change at line 40 | | skipping to change at line 40 | |
| | | | |
| */ | | */ | |
| | | | |
| #ifndef IM_MOSAICING_H | | #ifndef IM_MOSAICING_H | |
| #define IM_MOSAICING_H | | #define IM_MOSAICING_H | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif /*__cplusplus*/ | | #endif /*__cplusplus*/ | |
| | | | |
|
| int im_lrmerge( IMAGE *ref, IMAGE *sec, IMAGE *out, | | int im_lrmerge( VipsImage *ref, VipsImage *sec, VipsImage *out, | |
| int dx, int dy, int mwidth ); | | int dx, int dy, int mwidth ); | |
|
| int im_tbmerge( IMAGE *ref, IMAGE *sec, IMAGE *out, | | int im_tbmerge( VipsImage *ref, VipsImage *sec, VipsImage *out, | |
| int dx, int dy, int mwidth ); | | int dx, int dy, int mwidth ); | |
| | | | |
|
| int im_lrmerge1( IMAGE *ref, IMAGE *sec, IMAGE *out, | | int im_lrmerge1( VipsImage *ref, VipsImage *sec, VipsImage *out, | |
| int xr1, int yr1, int xs1, int ys1, | | int xr1, int yr1, int xs1, int ys1, | |
| int xr2, int yr2, int xs2, int ys2, | | int xr2, int yr2, int xs2, int ys2, | |
| int mwidth ); | | int mwidth ); | |
|
| int im_tbmerge1( IMAGE *ref, IMAGE *sec, IMAGE *out, | | int im_tbmerge1( VipsImage *ref, VipsImage *sec, VipsImage *out, | |
| int xr1, int yr1, int xs1, int ys1, | | int xr1, int yr1, int xs1, int ys1, | |
| int xr2, int yr2, int xs2, int ys2, | | int xr2, int yr2, int xs2, int ys2, | |
| int mwidth ); | | int mwidth ); | |
| | | | |
|
| int im_lrmosaic( IMAGE *ref, IMAGE *sec, IMAGE *out, | | int im_lrmosaic( VipsImage *ref, VipsImage *sec, VipsImage *out, | |
| int bandno, | | int bandno, | |
| int xref, int yref, int xsec, int ysec, | | int xref, int yref, int xsec, int ysec, | |
|
| int halfcorrelation, int halfarea, | | int hwindowsize, int hsearchsize, | |
| int balancetype, | | int balancetype, | |
| int mwidth ); | | int mwidth ); | |
|
| int im_tbmosaic( IMAGE *ref, IMAGE *sec, IMAGE *out, | | int im_tbmosaic( VipsImage *ref, VipsImage *sec, VipsImage *out, | |
| int bandno, | | int bandno, | |
| int xref, int yref, int xsec, int ysec, | | int xref, int yref, int xsec, int ysec, | |
|
| int halfcorrelation, int halfarea, | | int hwindowsize, int hsearchsize, | |
| int balancetype, | | int balancetype, | |
| int mwidth ); | | int mwidth ); | |
| | | | |
|
| int im_lrmosaic1( IMAGE *ref, IMAGE *sec, IMAGE *out, | | int im_lrmosaic1( VipsImage *ref, VipsImage *sec, VipsImage *out, | |
| int bandno, | | int bandno, | |
| int xr1, int yr1, int xs1, int ys1, | | int xr1, int yr1, int xs1, int ys1, | |
| int xr2, int yr2, int xs2, int ys2, | | int xr2, int yr2, int xs2, int ys2, | |
|
| int halfcorrelation, int halfarea, | | int hwindowsize, int hsearchsize, | |
| int balancetype, | | int balancetype, | |
| int mwidth ); | | int mwidth ); | |
|
| int im_tbmosaic1( IMAGE *ref, IMAGE *sec, IMAGE *out, | | int im_tbmosaic1( VipsImage *ref, VipsImage *sec, VipsImage *out, | |
| int bandno, | | int bandno, | |
| int xr1, int yr1, int xs1, int ys1, | | int xr1, int yr1, int xs1, int ys1, | |
| int xr2, int yr2, int xs2, int ys2, | | int xr2, int yr2, int xs2, int ys2, | |
|
| int halfcorrelation, int halfarea, | | int hwindowsize, int hsearchsize, | |
| int balancetype, | | int balancetype, | |
| int mwidth ); | | int mwidth ); | |
| | | | |
|
| int im_global_balance( IMAGE *in, IMAGE *out, double gamma ); | | int im_global_balance( VipsImage *in, VipsImage *out, double gamma ); | |
| int im_global_balancef( IMAGE *in, IMAGE *out, double gamma ); | | int im_global_balancef( VipsImage *in, VipsImage *out, double gamma ); | |
| | | | |
|
| int im_correl( IMAGE *ref, IMAGE *sec, | | int im_correl( VipsImage *ref, VipsImage *sec, | |
| int xref, int yref, int xsec, int ysec, | | int xref, int yref, int xsec, int ysec, | |
| int hwindowsize, int hsearchsize, | | int hwindowsize, int hsearchsize, | |
| double *correlation, int *x, int *y ); | | double *correlation, int *x, int *y ); | |
|
| int im_remosaic( IMAGE *in, IMAGE *out, | | int im_remosaic( VipsImage *in, VipsImage *out, | |
| const char *old_str, const char *new_str ); | | const char *old_str, const char *new_str ); | |
| | | | |
|
| int im_align_bands( IMAGE *in, IMAGE *out ); | | int im_align_bands( VipsImage *in, VipsImage *out ); | |
| int im_maxpos_subpel( IMAGE *in, double *x, double *y ); | | int im_maxpos_subpel( VipsImage *in, double *x, double *y ); | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif /*__cplusplus*/ | | #endif /*__cplusplus*/ | |
| | | | |
| #endif /*IM_MOSAICING_H*/ | | #endif /*IM_MOSAICING_H*/ | |
| | | | |
End of changes. 16 change blocks. |
| 18 lines changed or deleted | | 18 lines changed or added | |
|
| object.h | | object.h | |
| | | | |
| skipping to change at line 37 | | skipping to change at line 37 | |
| | | | |
| */ | | */ | |
| | | | |
| #ifndef VIPS_OBJECT_H | | #ifndef VIPS_OBJECT_H | |
| #define VIPS_OBJECT_H | | #define VIPS_OBJECT_H | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif /*__cplusplus*/ | | #endif /*__cplusplus*/ | |
| | | | |
|
| | | /* Handy! | |
| | | */ | |
| | | #define VIPS_UNREF( X ) VIPS_FREEF( g_object_unref, (X) ) | |
| | | | |
| typedef struct _VipsObject VipsObject; | | typedef struct _VipsObject VipsObject; | |
| typedef struct _VipsObjectClass VipsObjectClass; | | typedef struct _VipsObjectClass VipsObjectClass; | |
| | | | |
| /* Track extra stuff for arguments to objects | | /* Track extra stuff for arguments to objects | |
| */ | | */ | |
| | | | |
|
| /* Flags we associate with each argument. | | /** | |
| | | * VipsArgumentFlags: | |
| | | * @VIPS_ARGUMENT_NONE: no flags | |
| | | * @VIPS_ARGUMENT_REQUIRED: must be set in the constructor | |
| | | * @VIPS_ARGUMENT_CONSTRUCT: can only be set in the constructor | |
| | | * @VIPS_ARGUMENT_SET_ONCE: can only be set once | |
| | | * @VIPS_ARGUMENT_INPUT: is an input argument (one we depend on) | |
| | | * @VIPS_ARGUMENT_OUTPUT: is an output argument (depends on us) | |
| | | * | |
| | | * Flags we associate with each object argument. | |
| | | * | |
| | | * Have separate input & output flags. Both set is an error; neither set is | |
| | | OK. | |
| | | * | |
| | | * Input gobjects are automatically reffed, output gobjects automatically r | |
| | | ef | |
| | | * us. We also automatically watch for "destroy" and unlink. | |
| */ | | */ | |
|
| typedef enum _VipsArgumentFlags { | | typedef enum { | |
| VIPS_ARGUMENT_NONE = 0, | | VIPS_ARGUMENT_NONE = 0, | |
|
| | | | |
| /* Must be set in the constructor. | | | |
| */ | | | |
| VIPS_ARGUMENT_REQUIRED = 1, | | VIPS_ARGUMENT_REQUIRED = 1, | |
|
| | | | |
| /* Can only be set in the constructor. | | | |
| */ | | | |
| VIPS_ARGUMENT_CONSTRUCT = 2, | | VIPS_ARGUMENT_CONSTRUCT = 2, | |
|
| | | | |
| /* Can only be set once. | | | |
| */ | | | |
| VIPS_ARGUMENT_SET_ONCE = 4, | | VIPS_ARGUMENT_SET_ONCE = 4, | |
|
| | | | |
| /* Have input & output flags. Both set is an error; neither set is O | | | |
| K. | | | |
| */ | | | |
| | | | |
| /* Is an input argument (one we depend on) ... if it's a gobject, we | | | |
| * should ref it. In our _dispose(), we should unref it. | | | |
| */ | | | |
| VIPS_ARGUMENT_INPUT = 8, | | VIPS_ARGUMENT_INPUT = 8, | |
|
| | | | |
| /* Is an output argument (one that depends on us) ... if it's a | | | |
| * gobject, we should ref ourselves. We watch "destroy" on the | | | |
| * argument: if it goes, we unref ourselves. If we dispose, we | | | |
| * disconnect the signal. | | | |
| */ | | | |
| VIPS_ARGUMENT_OUTPUT = 16 | | VIPS_ARGUMENT_OUTPUT = 16 | |
| } VipsArgumentFlags; | | } VipsArgumentFlags; | |
| | | | |
| /* Useful flag combinations. User-visible ones are: | | /* Useful flag combinations. User-visible ones are: | |
| | | | |
|
| VIPS_ARGUMENT_REQURED_INPUT Eg. the "left" argument for an add operation | | VIPS_ARGUMENT_REQUIRED_INPUT Eg. the "left" argument for an add operation | |
| | | | |
| VIPS_ARGUMENT_OPTIONAL_INPUT Eg. the "caption" for an object | | VIPS_ARGUMENT_OPTIONAL_INPUT Eg. the "caption" for an object | |
| | | | |
|
| VIPS_ARGUMENT_REQURED_OUTPUT Eg. the "result" of an add operation | | VIPS_ARGUMENT_OUTPUT Eg. the "result" of an add operation | |
| | | | |
| VIPS_ARGUMENT_OPTIONAL_OUTPUT Eg. the "width" of an image | | | |
| | | | |
| Other combinations are used internally, eg. supplying the cast-table for
an | | Other combinations are used internally, eg. supplying the cast-table for
an | |
| arithmetic operation | | arithmetic operation | |
| | | | |
| */ | | */ | |
| | | | |
| #define VIPS_ARGUMENT_REQUIRED_INPUT \ | | #define VIPS_ARGUMENT_REQUIRED_INPUT \ | |
|
| (VIPS_ARGUMENT_INPUT | VIPS_ARGUMENT_REQUIRED | \ | | (VIPS_ARGUMENT_INPUT | \ | |
| VIPS_ARGUMENT_CONSTRUCT | VIPS_ARGUMENT_SET_ONCE) | | VIPS_ARGUMENT_REQUIRED | \ | |
| | | VIPS_ARGUMENT_CONSTRUCT | \ | |
| | | VIPS_ARGUMENT_SET_ONCE) | |
| | | | |
| #define VIPS_ARGUMENT_OPTIONAL_INPUT \ | | #define VIPS_ARGUMENT_OPTIONAL_INPUT \ | |
| (VIPS_ARGUMENT_INPUT | \ | | (VIPS_ARGUMENT_INPUT | \ | |
|
| VIPS_ARGUMENT_CONSTRUCT | VIPS_ARGUMENT_SET_ONCE) | | VIPS_ARGUMENT_CONSTRUCT | \ | |
| | | | |
| #define VIPS_ARGUMENT_REQUIRED_OUTPUT \ | | | |
| (VIPS_ARGUMENT_OUTPUT | VIPS_ARGUMENT_REQUIRED | \ | | | |
| VIPS_ARGUMENT_SET_ONCE) | | VIPS_ARGUMENT_SET_ONCE) | |
| | | | |
|
| #define VIPS_ARGUMENT_OPTIONAL_OUTPUT \ | | #define VIPS_ARGUMENT_REQUIRED_OUTPUT \ | |
| (VIPS_ARGUMENT_OUTPUT | \ | | (VIPS_ARGUMENT_OUTPUT | \ | |
|
| | | VIPS_ARGUMENT_REQUIRED | \ | |
| | | VIPS_ARGUMENT_CONSTRUCT | \ | |
| VIPS_ARGUMENT_SET_ONCE) | | VIPS_ARGUMENT_SET_ONCE) | |
| | | | |
| /* Keep one of these for every argument. | | /* Keep one of these for every argument. | |
| */ | | */ | |
| typedef struct _VipsArgument { | | typedef struct _VipsArgument { | |
| GParamSpec *pspec; /* pspec for this argument */ | | GParamSpec *pspec; /* pspec for this argument */ | |
| | | | |
| /* More stuff, see below */ | | /* More stuff, see below */ | |
| } VipsArgument; | | } VipsArgument; | |
| | | | |
| | | | |
| skipping to change at line 141 | | skipping to change at line 136 | |
| VipsArgument parent; | | VipsArgument parent; | |
| | | | |
| /* The object we are attached to. | | /* The object we are attached to. | |
| */ | | */ | |
| VipsObject *object; | | VipsObject *object; | |
| | | | |
| /* Has been set. | | /* Has been set. | |
| */ | | */ | |
| gboolean assigned; | | gboolean assigned; | |
| | | | |
|
| /* If this is an output argument, keep the id of our "destroy" handl
er | | /* If this is an output argument, keep the id of our "close" handler | |
| * here. | | * here. | |
| */ | | */ | |
|
| gulong destroy_id; | | gulong close_id; | |
| } VipsArgumentInstance; | | } VipsArgumentInstance; | |
| | | | |
| /* Need to look up our VipsArgument structs from a pspec. Just hash the | | /* Need to look up our VipsArgument structs from a pspec. Just hash the | |
| * pointer (ie. we assume pspecs are never shared, is this correct?) | | * pointer (ie. we assume pspecs are never shared, is this correct?) | |
| */ | | */ | |
| typedef GHashTable VipsArgumentTable; | | typedef GHashTable VipsArgumentTable; | |
| | | | |
| VipsArgumentInstance *vips__argument_get_instance( VipsArgumentClass *, | | VipsArgumentInstance *vips__argument_get_instance( VipsArgumentClass *, | |
| VipsObject *); | | VipsObject *); | |
| VipsArgument *vips__argument_table_lookup( VipsArgumentTable *, | | VipsArgument *vips__argument_table_lookup( VipsArgumentTable *, | |
| GParamSpec *); | | GParamSpec *); | |
|
| | | void vips__object_set_member( VipsObject *object, GParamSpec *pspec, | |
| | | GObject **member, GObject *argument ); | |
| typedef void *(*VipsArgumentMapFn)( VipsObject *, GParamSpec *, | | typedef void *(*VipsArgumentMapFn)( VipsObject *, GParamSpec *, | |
| VipsArgumentClass *, VipsArgumentInstance *, void *a, void *b ); | | VipsArgumentClass *, VipsArgumentInstance *, void *a, void *b ); | |
| void *vips_argument_map( VipsObject *object, | | void *vips_argument_map( VipsObject *object, | |
| VipsArgumentMapFn fn, void *a, void *b ); | | VipsArgumentMapFn fn, void *a, void *b ); | |
|
| | | void vips_argument_dispose_all( VipsObject *object ); | |
| | | | |
| | | /* We have to loop over an objects args in several places, and we can't alw | |
| | | ays | |
| | | * use vips_argument_map(), the preferred looper. Have the loop code as a | |
| | | * macro as well for these odd cases. | |
| | | */ | |
| | | #define VIPS_ARGUMENT_FOR_ALL( OBJECT, PSPEC, ARG_CLASS, ARG_INSTANCE ) { \ | |
| | | VipsObjectClass *object_class = VIPS_OBJECT_GET_CLASS( OBJECT ); \ | |
| | | GSList *p; \ | |
| | | \ | |
| | | for( p = object_class->argument_table_traverse; p; p = p->next ) { \ | |
| | | VipsArgumentClass *ARG_CLASS = \ | |
| | | (VipsArgumentClass *) p->data; \ | |
| | | VipsArgument *argument = (VipsArgument *) argument_class; \ | |
| | | GParamSpec *PSPEC = argument->pspec; \ | |
| | | VipsArgumentInstance *ARG_INSTANCE = \ | |
| | | vips__argument_get_instance( argument_class, \ | |
| | | VIPS_OBJECT( OBJECT ) ); \ | |
| | | \ | |
| | | /* We have many props on the arg table ... filter out the \ | |
| | | * ones for this class. \ | |
| | | */ \ | |
| | | if( g_object_class_find_property( \ | |
| | | G_OBJECT_CLASS( object_class ), \ | |
| | | g_param_spec_get_name( PSPEC ) ) == PSPEC ) { | |
| | | | |
| | | #define VIPS_ARGUMENT_FOR_ALL_END } } } | |
| | | | |
| #define VIPS_TYPE_OBJECT (vips_object_get_type()) | | #define VIPS_TYPE_OBJECT (vips_object_get_type()) | |
| #define VIPS_OBJECT( obj ) \ | | #define VIPS_OBJECT( obj ) \ | |
| (G_TYPE_CHECK_INSTANCE_CAST( (obj), VIPS_TYPE_OBJECT, VipsObject )) | | (G_TYPE_CHECK_INSTANCE_CAST( (obj), VIPS_TYPE_OBJECT, VipsObject )) | |
| #define VIPS_OBJECT_CLASS( klass ) \ | | #define VIPS_OBJECT_CLASS( klass ) \ | |
| (G_TYPE_CHECK_CLASS_CAST( (klass), VIPS_TYPE_OBJECT, VipsObjectClass
)) | | (G_TYPE_CHECK_CLASS_CAST( (klass), VIPS_TYPE_OBJECT, VipsObjectClass
)) | |
| #define VIPS_IS_OBJECT( obj ) \ | | #define VIPS_IS_OBJECT( obj ) \ | |
| (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_OBJECT )) | | (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_OBJECT )) | |
| #define VIPS_IS_OBJECT_CLASS( klass ) \ | | #define VIPS_IS_OBJECT_CLASS( klass ) \ | |
| (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_OBJECT )) | | (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_OBJECT )) | |
| | | | |
| skipping to change at line 187 | | skipping to change at line 211 | |
| | | | |
| /* Table of argument instances for this class and any derived classe
s. | | /* Table of argument instances for this class and any derived classe
s. | |
| */ | | */ | |
| VipsArgumentTable *argument_table; | | VipsArgumentTable *argument_table; | |
| | | | |
| /* Class properties (see below), duplicated in the instance so we ca
n | | /* Class properties (see below), duplicated in the instance so we ca
n | |
| * get at them easily via the property system. | | * get at them easily via the property system. | |
| */ | | */ | |
| char *nickname; | | char *nickname; | |
| char *description; | | char *description; | |
|
| | | | |
| | | /* The pre/post/close callbacks are all fire-once. | |
| | | */ | |
| | | gboolean preclose; | |
| | | gboolean close; | |
| | | gboolean postclose; | |
| }; | | }; | |
| | | | |
| struct _VipsObjectClass { | | struct _VipsObjectClass { | |
| GObjectClass parent_class; | | GObjectClass parent_class; | |
| | | | |
| /* Build the object ... all argument properties have been set, | | /* Build the object ... all argument properties have been set, | |
| * now build the thing. | | * now build the thing. | |
| */ | | */ | |
| int (*build)( VipsObject *object ); | | int (*build)( VipsObject *object ); | |
| | | | |
| /* Try to print something about the class, handy for help displays. | | /* Try to print something about the class, handy for help displays. | |
| */ | | */ | |
| void (*print_class)( struct _VipsObjectClass *, VipsBuf * ); | | void (*print_class)( struct _VipsObjectClass *, VipsBuf * ); | |
| | | | |
| /* Try to print something about the object, handy for debugging. | | /* Try to print something about the object, handy for debugging. | |
| */ | | */ | |
| void (*print)( VipsObject *, VipsBuf * ); | | void (*print)( VipsObject *, VipsBuf * ); | |
| | | | |
|
| | | /* Sanity-check the object. Print messages and stuff. | |
| | | * Handy for debugging. | |
| | | */ | |
| | | void (*sanity)( VipsObject *, VipsBuf * ); | |
| | | | |
| | | /* Rewind. Save and restore any stuff that needs to survive a | |
| | | * dispose(). | |
| | | */ | |
| | | void (*rewind)( VipsObject * ); | |
| | | | |
| | | /* Just before close, everything is still alive. | |
| | | */ | |
| | | void (*preclose)( VipsObject * ); | |
| | | | |
| | | /* Close, time to free stuff. | |
| | | */ | |
| | | void (*close)( VipsObject * ); | |
| | | | |
| | | /* Post-close, everything is dead, except the VipsObject pointer. | |
| | | * Useful for eg. deleting the file associated with a temp image. | |
| | | */ | |
| | | void (*postclose)( VipsObject * ); | |
| | | | |
| | | /* The CLI interface. Implement these four to get CLI input and outp | |
| | | ut | |
| | | * for your object. | |
| | | */ | |
| | | | |
| | | /* Given a command-line arg (eg. a filename), make an instance of th | |
| | | e | |
| | | * object. Just do the g_object_new(), don't call _build(). | |
| | | * | |
| | | * Don't call this directly, see vips_object_new_from_string(). | |
| | | */ | |
| | | VipsObject *(*new_from_string)( const char *string ); | |
| | | | |
| | | /* The inverse of ^^. Given an object, output what ->new_from_string | |
| | | () | |
| | | * would have been given to make that object. | |
| | | */ | |
| | | void (*to_string)( VipsObject *, VipsBuf * ); | |
| | | | |
| | | /* Does this output arg need an arg from the command line? Image | |
| | | * output, for example, needs a filename to write to. | |
| | | */ | |
| | | gboolean output_needs_arg; | |
| | | | |
| | | /* Write the object to the string. Return 0 for success, or -1 on | |
| | | * error, setting vips_error(). string is NULL if output_needs_arg() | |
| | | * was FALSE. | |
| | | */ | |
| | | int (*output_to_arg)( VipsObject *object, const char *string ); | |
| | | | |
| /* Class nickname, eg. "VipsInterpolateBicubic" has "bicubic" as a | | /* Class nickname, eg. "VipsInterpolateBicubic" has "bicubic" as a | |
| * nickname. Not internationalised. | | * nickname. Not internationalised. | |
| */ | | */ | |
| const char *nickname; | | const char *nickname; | |
| | | | |
| /* Class description. Used for help messages, so internationalised. | | /* Class description. Used for help messages, so internationalised. | |
| */ | | */ | |
| const char *description; | | const char *description; | |
| | | | |
| /* Table of arguments for this class and any derived classes. Order | | /* Table of arguments for this class and any derived classes. Order | |
| * is important, so keep a traverse list too. We can't rely on the | | * is important, so keep a traverse list too. We can't rely on the | |
| * ordering given by g_object_class_list_properties() since it comes | | * ordering given by g_object_class_list_properties() since it comes | |
| * from a hash :-( | | * from a hash :-( | |
| */ | | */ | |
| VipsArgumentTable *argument_table; | | VipsArgumentTable *argument_table; | |
| GSList *argument_table_traverse; | | GSList *argument_table_traverse; | |
| }; | | }; | |
| | | | |
|
| | | gboolean vips_pspec_value_is_null( GParamSpec *pspec, const GValue *value )
; | |
| void vips_object_set_property( GObject *gobject, | | void vips_object_set_property( GObject *gobject, | |
| guint property_id, const GValue *value, GParamSpec *pspec ); | | guint property_id, const GValue *value, GParamSpec *pspec ); | |
| void vips_object_get_property( GObject *gobject, | | void vips_object_get_property( GObject *gobject, | |
| guint property_id, GValue *value, GParamSpec *pspec ); | | guint property_id, GValue *value, GParamSpec *pspec ); | |
| | | | |
|
| | | void vips_object_preclose( VipsObject *object ); | |
| int vips_object_build( VipsObject *object ); | | int vips_object_build( VipsObject *object ); | |
| void vips_object_print_class( VipsObjectClass *klass ); | | void vips_object_print_class( VipsObjectClass *klass ); | |
| void vips_object_print( VipsObject *object ); | | void vips_object_print( VipsObject *object ); | |
|
| | | void vips_object_print_name( VipsObject *object ); | |
| | | gboolean vips_object_sanity( VipsObject *object ); | |
| | | | |
| GType vips_object_get_type( void ); | | GType vips_object_get_type( void ); | |
| | | | |
| void vips_object_class_install_argument( VipsObjectClass *, | | void vips_object_class_install_argument( VipsObjectClass *, | |
| GParamSpec *pspec, VipsArgumentFlags flags, guint offset ); | | GParamSpec *pspec, VipsArgumentFlags flags, guint offset ); | |
|
| | | int vips_object_set_argument_from_string( VipsObject *object, | |
| | | const char *name, const char *value ); | |
| | | gboolean vips_object_get_argument_needs_string( VipsObject *object, | |
| | | const char *name ); | |
| | | int vips_object_get_argument_to_string( VipsObject *object, | |
| | | const char *name, const char *arg ); | |
| | | int vips_object_set_required( VipsObject *object, const char *value ); | |
| | | | |
| typedef void *(*VipsObjectSetArguments)( VipsObject *, void *, void * ); | | typedef void *(*VipsObjectSetArguments)( VipsObject *, void *, void * ); | |
| VipsObject *vips_object_new( GType type, | | VipsObject *vips_object_new( GType type, | |
| VipsObjectSetArguments set, void *a, void *b ); | | VipsObjectSetArguments set, void *a, void *b ); | |
| | | | |
|
| VipsObject *vips_object_new_from_string( const char *base, const char *str | | VipsObject *vips_object_new_from_string( VipsObjectClass *object_class, | |
| ); | | const char *p ); | |
| void vips_object_to_string( VipsObject *object, VipsBuf *buf ); | | void vips_object_to_string( VipsObject *object, VipsBuf *buf ); | |
| | | | |
|
| | | void *vips_object_map( VipsSListMap2Fn fn, void *a, void *b ); | |
| | | | |
| | | typedef void *(*VipsTypeMap)( GType, void * ); | |
| | | typedef void *(*VipsTypeMap2)( GType, void *, void * ); | |
| | | typedef void *(*VipsClassMap)( VipsObjectClass *, void * ); | |
| | | void *vips_type_map( GType base, VipsTypeMap2 fn, void *a, void *b ); | |
| | | void *vips_type_map_all( GType base, VipsTypeMap fn, void *a ); | |
| | | void *vips_class_map_all( GType base, VipsClassMap fn, void *a ); | |
| | | int vips_class_depth( VipsObjectClass *klass ); | |
| | | VipsObjectClass *vips_class_find( const char *basename, const char *nicknam | |
| | | e ); | |
| | | GType vips_type_find( const char *basename, const char *nickname ); | |
| | | | |
| | | void vips_object_local_cb( VipsObject *vobject, GObject *gobject ); | |
| | | #define vips_object_local( V, G ) \ | |
| | | (g_signal_connect( V, "close", \ | |
| | | G_CALLBACK( vips_object_local_cb ), G ), 0) | |
| | | | |
| | | void vips_object_print_all( void ); | |
| | | void vips_object_sanity_all( void ); | |
| | | | |
| | | void vips_object_rewind( VipsObject *object ); | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif /*__cplusplus*/ | | #endif /*__cplusplus*/ | |
| | | | |
| #endif /*VIPS_OBJECT_H*/ | | #endif /*VIPS_OBJECT_H*/ | |
| | | | |
End of changes. 26 change blocks. |
| 40 lines changed or deleted | | 159 lines changed or added | |
|
| private.h | | private.h | |
| | | | |
| skipping to change at line 35 | | skipping to change at line 35 | |
| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 U
SA | | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 U
SA | |
| | | | |
| */ | | */ | |
| | | | |
| /* | | /* | |
| | | | |
| These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk | | These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk | |
| | | | |
| */ | | */ | |
| | | | |
|
| #ifndef IM_PRIVATE_H | | #ifndef VIPS_PRIVATE_H | |
| #define IM_PRIVATE_H | | #define VIPS_PRIVATE_H | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif /*__cplusplus*/ | | #endif /*__cplusplus*/ | |
| | | | |
|
| #define IM_SPARE (8) | | #define VIPS_SPARE (8) | |
| | | | |
| /* Private to iofuncs: the minimum number of scanlines we add above and bel
ow | | /* Private to iofuncs: the minimum number of scanlines we add above and bel
ow | |
| * the window as a margin for slop. | | * the window as a margin for slop. | |
| */ | | */ | |
|
| #define IM__WINDOW_MARGIN_PIXELS (128) | | #define VIPS__WINDOW_MARGIN_PIXELS (128) | |
| | | | |
| /* Private to iofuncs: add at least this many bytes above and below the win
dow. | | /* Private to iofuncs: add at least this many bytes above and below the win
dow. | |
| * There's no point mapping just a few KB of a small image. | | * There's no point mapping just a few KB of a small image. | |
| */ | | */ | |
|
| #define IM__WINDOW_MARGIN_BYTES (1024 * 1024 * 10) | | #define VIPS__WINDOW_MARGIN_BYTES (1024 * 1024 * 10) | |
| | | | |
| /* sizeof() a VIPS header on disc. | | /* sizeof() a VIPS header on disc. | |
| */ | | */ | |
|
| #define IM_SIZEOF_HEADER (64) | | #define VIPS_SIZEOF_HEADER (64) | |
| | | | |
| typedef unsigned char PEL; /* useful datum */ | | typedef unsigned char PEL; /* useful datum */ | |
| | | | |
|
| /* Types of image descriptor we may have. The type field is advisory only: | | | |
| it | | | |
| * does not imply that any fields in IMAGE have valid data. | | | |
| */ | | | |
| typedef enum { | | | |
| IM_NONE, /* no type set */ | | | |
| IM_SETBUF, /* malloced memory array */ | | | |
| IM_SETBUF_FOREIGN, /* memory array, don't free on close */ | | | |
| IM_OPENIN, /* input from fd with a window */ | | | |
| IM_MMAPIN, /* memory mapped input file */ | | | |
| IM_MMAPINRW, /* memory mapped read/write file */ | | | |
| IM_OPENOUT, /* output to fd */ | | | |
| IM_PARTIAL /* partial image */ | | | |
| } im_desc_type; | | | |
| | | | |
| /* What we track for each mmap window. Have a list of these on an openin | | /* What we track for each mmap window. Have a list of these on an openin | |
|
| * IMAGE. | | * VipsImage. | |
| */ | | */ | |
| typedef struct { | | typedef struct { | |
| int ref_count; /* # of regions referencing us */ | | int ref_count; /* # of regions referencing us */ | |
|
| struct _VipsImage *im; /* IMAGE we are attached to */ | | struct _VipsImage *im; /* VipsImage we are attached to */ | |
| | | | |
| int top; /* Area of image we have mapped, in pixels *
/ | | int top; /* Area of image we have mapped, in pixels *
/ | |
| int height; | | int height; | |
| char *data; /* First pixel of line 'top' */ | | char *data; /* First pixel of line 'top' */ | |
| | | | |
| PEL *baseaddr; /* Base of window */ | | PEL *baseaddr; /* Base of window */ | |
| size_t length; /* Size of window */ | | size_t length; /* Size of window */ | |
|
| } im_window_t; | | } VipsWindow; | |
| | | | |
| /* window manager. | | /* window manager. | |
| */ | | */ | |
|
| im_window_t *im_window_ref( struct _VipsImage *im, int top, int height ); | | VipsWindow *vips_window_ref( struct _VipsImage *im, int top, int height ); | |
| int im_window_unref( im_window_t *window ); | | int vips_window_unref( VipsWindow *window ); | |
| void im_window_print( im_window_t *window ); | | void vips_window_print( VipsWindow *window ); | |
| | | | |
| /* Per-thread buffer cache. Held in a GPrivate. | | /* Per-thread buffer cache. Held in a GPrivate. | |
| */ | | */ | |
|
| typedef struct im__buffer_cache_t { | | typedef struct { | |
| GHashTable *hash; /* Hash to im_buffer_cache_list_t* */ | | GHashTable *hash; /* Hash to VipsBufferCacheList* */ | |
| GThread *thread; /* Just for sanity checking */ | | GThread *thread; /* Just for sanity checking */ | |
|
| } im_buffer_cache_t; | | } VipsBufferCache; | |
| | | | |
|
| /* Per-image buffer cache. Hash to this from im_buffer_cache_t. | | /* Per-image buffer cache. Hash to this from VipsBufferCache. | |
| * We can't store the GSList directly in the hash table, as GHashTable lack
s an | | * We can't store the GSList directly in the hash table, as GHashTable lack
s an | |
| * update operation and we'd need to _remove() and _insert() on every list | | * update operation and we'd need to _remove() and _insert() on every list | |
| * operation. | | * operation. | |
| */ | | */ | |
|
| typedef struct im__buffer_cache_list_t { | | typedef struct { | |
| GSList *buffers; /* GSList of im_buffer_t* */ | | GSList *buffers; /* GSList of VipsBuffer* */ | |
| GThread *thread; /* Just for sanity checking */ | | GThread *thread; /* Just for sanity checking */ | |
| struct _VipsImage *im; | | struct _VipsImage *im; | |
|
| im_buffer_cache_t *cache; | | VipsBufferCache *cache; | |
| } im_buffer_cache_list_t; | | } VipsBufferCacheList; | |
| | | | |
| /* What we track for each pixel buffer. | | /* What we track for each pixel buffer. | |
| */ | | */ | |
|
| typedef struct im__buffer_t { | | typedef struct { | |
| int ref_count; /* # of regions referencing us */ | | int ref_count; /* # of regions referencing us */ | |
|
| struct _VipsImage *im; /* IMAGE we are attached to */ | | struct _VipsImage *im; /* VipsImage we are attached to */ | |
| | | | |
|
| Rect area; /* Area this pixel buffer covers */ | | VipsRect area; /* Area this pixel buffer covers */ | |
| gboolean done; /* Calculated and in cache */ | | gboolean done; /* Calculated and in cache */ | |
|
| im_buffer_cache_t *cache; | | VipsBufferCache *cache; | |
| char *buf; /* Private malloc() area */ | | char *buf; /* Private malloc() area */ | |
| size_t bsize; /* Size of private malloc() */ | | size_t bsize; /* Size of private malloc() */ | |
|
| } im_buffer_t; | | } VipsBuffer; | |
| | | | |
|
| void im_buffer_done( im_buffer_t *buffer ); | | void vips_buffer_done( VipsBuffer *buffer ); | |
| void im_buffer_undone( im_buffer_t *buffer ); | | void vips_buffer_undone( VipsBuffer *buffer ); | |
| void im_buffer_unref( im_buffer_t *buffer ); | | void vips_buffer_unref( VipsBuffer *buffer ); | |
| im_buffer_t *im_buffer_new( struct _VipsImage *im, Rect *area ); | | VipsBuffer *vips_buffer_new( struct _VipsImage *im, VipsRect *area ); | |
| im_buffer_t *im_buffer_ref( struct _VipsImage *im, Rect *area ); | | VipsBuffer *vips_buffer_ref( struct _VipsImage *im, VipsRect *area ); | |
| im_buffer_t *im_buffer_unref_ref( im_buffer_t *buffer, | | VipsBuffer *vips_buffer_unref_ref( VipsBuffer *buffer, | |
| struct _VipsImage *im, Rect *area ); | | struct _VipsImage *im, VipsRect *area ); | |
| void im_buffer_print( im_buffer_t *buffer ); | | void vips_buffer_print( VipsBuffer *buffer ); | |
| | | | |
| /* Sections of region.h that are private to VIPS. | | /* Sections of region.h that are private to VIPS. | |
| */ | | */ | |
| | | | |
| /* Region types. | | /* Region types. | |
| */ | | */ | |
| typedef enum region_type { | | typedef enum region_type { | |
|
| IM_REGION_NONE, | | VIPS_REGION_NONE, | |
| IM_REGION_BUFFER, /* a pixel buffer */ | | VIPS_REGION_BUFFER, /* a pixel buffer */ | |
| IM_REGION_OTHER_REGION, /* memory on another region */ | | VIPS_REGION_OTHER_REGION, /* memory on another region */ | |
| IM_REGION_OTHER_IMAGE, /* memory on another image */ | | VIPS_REGION_OTHER_IMAGE,/* memory on another image */ | |
| IM_REGION_WINDOW /* mmap() buffer on fd on another image */ | | VIPS_REGION_WINDOW /* mmap() buffer on fd on another image */ | |
| } RegionType; | | } RegionType; | |
| | | | |
|
| /* Private to iofuncs: the size of the `tiles' requested by im_generate() | | /* Private to iofuncs: the size of the `tiles' requested by | |
| | | * vips_image_generate() | |
| * when acting as a data sink. | | * when acting as a data sink. | |
| */ | | */ | |
|
| #define IM__TILE_WIDTH (64) | | #define VIPS__TILE_WIDTH (512) | |
| #define IM__TILE_HEIGHT (64) | | #define VIPS__TILE_HEIGHT (512) | |
| | | | |
| /* The height of the strips for the other two request styles. | | /* The height of the strips for the other two request styles. | |
| */ | | */ | |
|
| #define IM__THINSTRIP_HEIGHT (1) | | #define VIPS__THINSTRIP_HEIGHT (1) | |
| #define IM__FATSTRIP_HEIGHT (16) | | #define VIPS__FATSTRIP_HEIGHT (16) | |
| | | | |
| /* Functions on regions. | | /* Functions on regions. | |
| */ | | */ | |
|
| struct _REGION; | | struct _VipsRegion; | |
| void im__region_take_ownership( struct _REGION *reg ); | | void vips__region_take_ownership( struct _VipsRegion *reg ); | |
| void im__region_check_ownership( struct _REGION *reg ); | | void vips__region_check_ownership( struct _VipsRegion *reg ); | |
| void im__region_no_ownership( struct _REGION *reg ); | | void vips__region_no_ownership( struct _VipsRegion *reg ); | |
| | | | |
| void im__copy_region( struct _REGION *reg, struct _REGION *dest, Rect *r, i | | | |
| nt x, int y ); | | | |
| void im__find_demand_size( struct _VipsImage *im, int *pw, int *ph ); | | | |
| | | | |
| int im__call_start( struct _REGION *reg ); | | | |
| void im__call_stop( struct _REGION *reg ); | | | |
| | | | |
| typedef int (*im_region_fill_fn)( struct _REGION *, void * ); | | | |
| int im_region_fill( struct _REGION *reg, Rect *r, im_region_fill_fn fn, voi | | | |
| d *a ); | | | |
| void im_region_print( struct _REGION *region ); | | | |
| | | | |
|
| int im_prepare_many( struct _REGION **reg, Rect *r ); | | int vips__region_start( struct _VipsRegion *reg ); | |
| | | void vips__region_stop( struct _VipsRegion *reg ); | |
| | | | |
| | | typedef int (*VipsRegionFillFn)( struct _VipsRegion *, void * ); | |
| | | int vips_region_fill( struct _VipsRegion *reg, | |
| | | VipsRect *r, VipsRegionFillFn fn, void *a ); | |
| | | | |
| | | /* The new name for im_setupout(), still used by some old code. | |
| | | */ | |
| | | int vips__image_write_prepare( struct _VipsImage *image ); | |
| | | | |
| | | /* Start up various packages. | |
| | | */ | |
| | | void vips_arithmetic_operation_init( void ); | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif /*__cplusplus*/ | | #endif /*__cplusplus*/ | |
| | | | |
|
| #endif /*IM_PRIVATE_H*/ | | #endif /*VIPS_PRIVATE_H*/ | |
| | | | |
End of changes. 28 change blocks. |
| 75 lines changed or deleted | | 62 lines changed or added | |
|
| region.h | | region.h | |
| /* Definitions for partial image regions. | | /* Definitions for partial image regions. | |
| * | | * | |
| * J.Cupitt, 8/4/93 | | * J.Cupitt, 8/4/93 | |
|
| | | * | |
| | | * 2/3/11 | |
| | | * - move to GObject | |
| */ | | */ | |
| | | | |
| /* | | /* | |
| | | | |
| This file is part of VIPS. | | This file is part of VIPS. | |
| | | | |
| VIPS is free software; you can redistribute it and/or modify | | VIPS is free software; you can redistribute it and/or modify | |
| it under the terms of the GNU Lesser General Public License as publishe
d by | | it under the terms of the GNU Lesser General Public License as publishe
d by | |
| the Free Software Foundation; either version 2 of the License, or | | the Free Software Foundation; either version 2 of the License, or | |
| (at your option) any later version. | | (at your option) any later version. | |
| | | | |
| skipping to change at line 32 | | skipping to change at line 35 | |
| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 U
SA | | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 U
SA | |
| | | | |
| */ | | */ | |
| | | | |
| /* | | /* | |
| | | | |
| These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk | | These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk | |
| | | | |
| */ | | */ | |
| | | | |
|
| #ifndef IM_REGION_H | | #ifndef VIPS_REGION_H | |
| #define IM_REGION_H | | #define VIPS_REGION_H | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif /*__cplusplus*/ | | #endif /*__cplusplus*/ | |
| | | | |
|
| | | #define VIPS_TYPE_REGION (vips_region_get_type()) | |
| | | #define VIPS_REGION( obj ) \ | |
| | | (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ | |
| | | VIPS_TYPE_REGION, VipsRegion )) | |
| | | #define VIPS_REGION_CLASS( klass ) \ | |
| | | (G_TYPE_CHECK_CLASS_CAST( (klass), \ | |
| | | VIPS_TYPE_REGION, VipsRegionClass)) | |
| | | #define VIPS_IS_REGION( obj ) \ | |
| | | (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_REGION )) | |
| | | #define VIPS_IS_REGION_CLASS( klass ) \ | |
| | | (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_REGION )) | |
| | | #define VIPS_REGION_GET_CLASS( obj ) \ | |
| | | (G_TYPE_INSTANCE_GET_CLASS( (obj), \ | |
| | | VIPS_TYPE_REGION, VipsRegionClass )) | |
| | | | |
| /* Sub-area of image. | | /* Sub-area of image. | |
| */ | | */ | |
|
| typedef struct _REGION { | | typedef struct _VipsRegion { | |
| | | VipsObject parent_object; | |
| | | | |
| /*< public >*/ | | /*< public >*/ | |
| /* Users may read these two fields. | | /* Users may read these two fields. | |
| */ | | */ | |
|
| IMAGE *im; /* Link back to parent image */ | | VipsImage *im; /* Link back to parent image */ | |
| Rect valid; /* Area of parent we can see */ | | VipsRect valid; /* Area of parent we can see */ | |
| | | | |
|
| /* The rest of REGION is private. | | /* The rest of VipsRegion is private. | |
| */ | | */ | |
| /*< private >*/ | | /*< private >*/ | |
| RegionType type; /* What kind of attachment */ | | RegionType type; /* What kind of attachment */ | |
| char *data; /* Off here to get data */ | | char *data; /* Off here to get data */ | |
| int bpl; /* Bytes-per-line for data */ | | int bpl; /* Bytes-per-line for data */ | |
| void *seq; /* Sequence we are using to fill region */ | | void *seq; /* Sequence we are using to fill region */ | |
| | | | |
| /* The thread that made this region. Used to assert() test that | | /* The thread that made this region. Used to assert() test that | |
| * regions are not being shared between threads. | | * regions are not being shared between threads. | |
| */ | | */ | |
| GThread *thread; | | GThread *thread; | |
| | | | |
| /* Ref to the window we use for this region, if any. | | /* Ref to the window we use for this region, if any. | |
| */ | | */ | |
|
| im_window_t *window; | | VipsWindow *window; | |
| | | | |
| /* Ref to the buffer we use for this region, if any. | | /* Ref to the buffer we use for this region, if any. | |
| */ | | */ | |
|
| im_buffer_t *buffer; | | VipsBuffer *buffer; | |
| | | | |
| /* The image this region is on has changed and caches need to be | | /* The image this region is on has changed and caches need to be | |
| * dropped. | | * dropped. | |
| */ | | */ | |
| gboolean invalid; | | gboolean invalid; | |
|
| } REGION; | | } VipsRegion; | |
| | | | |
| | | typedef struct _VipsRegionClass { | |
| | | VipsObjectClass parent_class; | |
| | | | |
| | | } VipsRegionClass; | |
| | | | |
| | | GType vips_region_get_type( void ); | |
| | | | |
| | | VipsRegion *vips_region_new( VipsImage *im ); | |
| | | | |
| | | int vips_region_buffer( VipsRegion *reg, VipsRect *r ); | |
| | | int vips_region_image( VipsRegion *reg, VipsRect *r ); | |
| | | int vips_region_region( VipsRegion *reg, VipsRegion *dest, | |
| | | VipsRect *r, int x, int y ); | |
| | | int vips_region_equalsregion( VipsRegion *reg1, VipsRegion *reg2 ); | |
| | | int vips_region_position( VipsRegion *reg, int x, int y ); | |
| | | | |
| | | void vips_region_paint( VipsRegion *reg, VipsRect *r, int value ); | |
| | | void vips_region_black( VipsRegion *reg ); | |
| | | void vips_region_copy( VipsRegion *reg, VipsRegion *dest, | |
| | | VipsRect *r, int x, int y ); | |
| | | | |
|
| REGION *im_region_create( IMAGE *im ); | | int vips_region_prepare( VipsRegion *reg, VipsRect *r ); | |
| void im_region_free( REGION *reg ); | | int vips_region_prepare_to( VipsRegion *reg, | |
| | | VipsRegion *dest, VipsRect *r, int x, int y ); | |
| | | int vips_region_prepare_many( VipsRegion **reg, VipsRect *r ); | |
| | | | |
|
| int im_region_buffer( REGION *reg, Rect *r ); | | /* Macros on VipsRegion. | |
| int im_region_image( REGION *reg, Rect *r ); | | * VIPS_REGION_LSKIP() add to move down line | |
| int im_region_region( REGION *reg, REGION *dest, Rect *r, int x, int y ); | | * VIPS_REGION_N_ELEMENTS() number of elements across region | |
| int im_region_equalsregion( REGION *reg1, REGION *reg2 ); | | * VIPS_REGION_SIZEOF_LINE() sizeof width of region | |
| int im_region_position( REGION *reg, int x, int y ); | | * VIPS_REGION_ADDR() address of pixel in region | |
| | | | |
| void im_region_paint( REGION *reg, Rect *r, int value ); | | | |
| void im_region_black( REGION *reg ); | | | |
| void im_region_copy( REGION *reg, REGION *dest, Rect *r, int x, int y ); | | | |
| | | | |
| /* Macros on REGIONs. | | | |
| * IM_REGION_LSKIP() add to move down line | | | |
| * IM_REGION_N_ELEMENTS() number of elements across region | | | |
| * IM_REGION_SIZEOF_LINE() sizeof width of region | | | |
| * IM_REGION_ADDR() address of pixel in region | | | |
| */ | | */ | |
|
| #define IM_REGION_LSKIP(R) \ | | #define VIPS_REGION_LSKIP( R ) \ | |
| ((size_t)((R)->bpl)) | | ((size_t)((R)->bpl)) | |
|
| #define IM_REGION_N_ELEMENTS(R) \ | | #define VIPS_REGION_N_ELEMENTS( R ) \ | |
| ((size_t)((R)->valid.width * (R)->im->Bands)) | | ((size_t)((R)->valid.width * (R)->im->Bands)) | |
|
| #define IM_REGION_SIZEOF_LINE(R) \ | | #define VIPS_REGION_SIZEOF_LINE( R ) \ | |
| ((size_t)((R)->valid.width * IM_IMAGE_SIZEOF_PEL((R)->im))) | | ((size_t)((R)->valid.width * VIPS_IMAGE_SIZEOF_PEL( (R)->im) )) | |
| | | | |
| /* If DEBUG is defined, add bounds checking. | | /* If DEBUG is defined, add bounds checking. | |
| */ | | */ | |
| #ifdef DEBUG | | #ifdef DEBUG | |
|
| #define IM_REGION_ADDR(R,X,Y) \ | | #define VIPS_REGION_ADDR( R, X, Y ) \ | |
| ( (im_rect_includespoint( &(R)->valid, (X), (Y) ))? \ | | ( (vips_rect_includespoint( &(R)->valid, (X), (Y) ))? \ | |
| ((R)->data + ((Y) - (R)->valid.top) * IM_REGION_LSKIP(R) + \ | | ((R)->data + ((Y) - (R)->valid.top) * VIPS_REGION_LSKIP(R) + \ | |
| ((X) - (R)->valid.left) * IM_IMAGE_SIZEOF_PEL((R)->im)): \ | | ((X) - (R)->valid.left) * VIPS_IMAGE_SIZEOF_PEL((R)->im)): \ | |
| (fprintf( stderr, \ | | (fprintf( stderr, \ | |
|
| "IM_REGION_ADDR: point out of bounds, " \ | | "VIPS_REGION_ADDR: point out of bounds, " \ | |
| "file \"%s\", line %d\n" \ | | "file \"%s\", line %d\n" \ | |
| "(point x=%d, y=%d\n" \ | | "(point x=%d, y=%d\n" \ | |
|
| " should have been within Rect left=%d, top=%d, " \ | | " should have been within VipsRect left=%d, top=%d, " \ | |
| "width=%d, height=%d)\n", \ | | "width=%d, height=%d)\n", \ | |
| __FILE__, __LINE__, \ | | __FILE__, __LINE__, \ | |
| (X), (Y), \ | | (X), (Y), \ | |
| (R)->valid.left, \ | | (R)->valid.left, \ | |
| (R)->valid.top, \ | | (R)->valid.top, \ | |
| (R)->valid.width, \ | | (R)->valid.width, \ | |
| (R)->valid.height ), abort(), (char *) NULL) \ | | (R)->valid.height ), abort(), (char *) NULL) \ | |
| ) | | ) | |
| #else /*DEBUG*/ | | #else /*DEBUG*/ | |
|
| #define IM_REGION_ADDR(R,X,Y) \ | | #define VIPS_REGION_ADDR( R, X, Y ) \ | |
| ((R)->data + \ | | ((R)->data + \ | |
|
| ((Y)-(R)->valid.top) * IM_REGION_LSKIP(R) + \ | | ((Y)-(R)->valid.top) * VIPS_REGION_LSKIP( R ) + \ | |
| ((X)-(R)->valid.left) * IM_IMAGE_SIZEOF_PEL((R)->im)) | | ((X)-(R)->valid.left) * VIPS_IMAGE_SIZEOF_PEL( (R)->im )) | |
| #endif /*DEBUG*/ | | #endif /*DEBUG*/ | |
| | | | |
|
| #define IM_REGION_ADDR_TOPLEFT(R) ( (R)->data ) | | #define VIPS_REGION_ADDR_TOPLEFT( R ) ((R)->data) | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif /*__cplusplus*/ | | #endif /*__cplusplus*/ | |
| | | | |
|
| #endif /*IM_REGION_H*/ | | #endif /*VIPS_REGION_H*/ | |
| | | | |
End of changes. 21 change blocks. |
| 40 lines changed or deleted | | 73 lines changed or added | |
|
| threadpool.h | | threadpool.h | |
| | | | |
| skipping to change at line 36 | | skipping to change at line 36 | |
| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 U
SA | | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 U
SA | |
| | | | |
| */ | | */ | |
| | | | |
| /* | | /* | |
| | | | |
| These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk | | These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk | |
| | | | |
| */ | | */ | |
| | | | |
|
| #ifndef IM_THREADPOOL_H | | #ifndef VIPS_THREADPOOL_H | |
| #define IM_THREADPOOL_H | | #define VIPS_THREADPOOL_H | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif /*__cplusplus*/ | | #endif /*__cplusplus*/ | |
| | | | |
| #include <vips/semaphore.h> | | #include <vips/semaphore.h> | |
| | | | |
| /* Per-thread state. Allocate functions can use these members to | | /* Per-thread state. Allocate functions can use these members to | |
| * communicate with work functions. | | * communicate with work functions. | |
| */ | | */ | |
| | | | |
| skipping to change at line 75 | | skipping to change at line 75 | |
| VipsObject parent_object; | | VipsObject parent_object; | |
| | | | |
| /*< public >*/ | | /*< public >*/ | |
| /* Image we run on. | | /* Image we run on. | |
| */ | | */ | |
| VipsImage *im; | | VipsImage *im; | |
| | | | |
| /* This region is created and destroyed by the threadpool for the | | /* This region is created and destroyed by the threadpool for the | |
| * use of the worker. | | * use of the worker. | |
| */ | | */ | |
|
| REGION *reg; | | VipsRegion *reg; | |
| | | | |
| /* Neither used nor set, do what you like with them. | | /* Neither used nor set, do what you like with them. | |
| */ | | */ | |
|
| Rect pos; | | VipsRect pos; | |
| int x, y; | | int x, y; | |
| | | | |
| /* The client data passed to the enclosing vips_threadpool_run(). | | /* The client data passed to the enclosing vips_threadpool_run(). | |
| */ | | */ | |
| void *a; | | void *a; | |
| | | | |
| } VipsThreadState; | | } VipsThreadState; | |
| | | | |
| typedef struct _VipsThreadStateClass { | | typedef struct _VipsThreadStateClass { | |
| VipsObjectClass parent_class; | | VipsObjectClass parent_class; | |
| | | | |
| skipping to change at line 129 | | skipping to change at line 129 | |
| | | | |
| int vips_threadpool_run( VipsImage *im, | | int vips_threadpool_run( VipsImage *im, | |
| VipsThreadStart start, | | VipsThreadStart start, | |
| VipsThreadpoolAllocate allocate, | | VipsThreadpoolAllocate allocate, | |
| VipsThreadpoolWork work, | | VipsThreadpoolWork work, | |
| VipsThreadpoolProgress progress, | | VipsThreadpoolProgress progress, | |
| void *a ); | | void *a ); | |
| void vips_get_tile_size( VipsImage *im, | | void vips_get_tile_size( VipsImage *im, | |
| int *tile_width, int *tile_height, int *nlines ); | | int *tile_width, int *tile_height, int *nlines ); | |
| | | | |
|
| typedef int (*VipsRegionWrite)( REGION *region, Rect *area, void *a ); | | typedef int (*VipsRegionWrite)( VipsRegion *region, VipsRect *area, void *a
); | |
| int vips_sink_disc( VipsImage *im, VipsRegionWrite write_fn, void *a ); | | int vips_sink_disc( VipsImage *im, VipsRegionWrite write_fn, void *a ); | |
| | | | |
| typedef void *(*VipsStart)( VipsImage *out, void *a, void *b ); | | typedef void *(*VipsStart)( VipsImage *out, void *a, void *b ); | |
|
| typedef int (*VipsGenerate)( REGION *out, void *seq, void *a, void *b ); | | typedef int (*VipsGenerate)( VipsRegion *out, void *seq, void *a, void *b )
; | |
| typedef int (*VipsStop)( void *seq, void *a, void *b ); | | typedef int (*VipsStop)( void *seq, void *a, void *b ); | |
| int vips_sink( VipsImage *im, | | int vips_sink( VipsImage *im, | |
| VipsStart start, VipsGenerate generate, VipsStop stop, | | VipsStart start, VipsGenerate generate, VipsStop stop, | |
| void *a, void *b ); | | void *a, void *b ); | |
| int vips_sink_tile( VipsImage *im, | | int vips_sink_tile( VipsImage *im, | |
| int tile_width, int tile_height, | | int tile_width, int tile_height, | |
| VipsStart start, VipsGenerate generate, VipsStop stop, | | VipsStart start, VipsGenerate generate, VipsStop stop, | |
| void *a, void *b ); | | void *a, void *b ); | |
| | | | |
|
| typedef void (*VipsSinkNotify)( VipsImage *im, Rect *rect, void *a ); | | typedef void (*VipsSinkNotify)( VipsImage *im, VipsRect *rect, void *a ); | |
| int vips_sink_screen( VipsImage *in, VipsImage *out, VipsImage *mask, | | int vips_sink_screen( VipsImage *in, VipsImage *out, VipsImage *mask, | |
| int tile_width, int tile_height, int max_tiles, | | int tile_width, int tile_height, int max_tiles, | |
| int priority, | | int priority, | |
| VipsSinkNotify notify, void *a ); | | VipsSinkNotify notify, void *a ); | |
|
| | | int vips_image_cache( VipsImage *in, VipsImage *out, | |
| | | int width, int height, int max ); | |
| | | | |
| int vips_sink_memory( VipsImage *im ); | | int vips_sink_memory( VipsImage *im ); | |
| | | | |
|
| void im__print_renders( void ); | | void vips__print_renders( void ); | |
| | | | |
|
| void im_concurrency_set( int concurrency ); | | void vips_concurrency_set( int concurrency ); | |
| int im_concurrency_get( void ); | | int vips_concurrency_get( void ); | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif /*__cplusplus*/ | | #endif /*__cplusplus*/ | |
| | | | |
|
| #endif /*IM_THREADPOOL_H*/ | | #endif /*VIPS_THREADPOOL_H*/ | |
| | | | |
End of changes. 10 change blocks. |
| 10 lines changed or deleted | | 12 lines changed or added | |
|
| util.h | | util.h | |
| | | | |
| skipping to change at line 34 | | skipping to change at line 34 | |
| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 U
SA | | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 U
SA | |
| | | | |
| */ | | */ | |
| | | | |
| /* | | /* | |
| | | | |
| These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk | | These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk | |
| | | | |
| */ | | */ | |
| | | | |
|
| #ifndef IM_UTIL_H | | #ifndef VIPS_UTIL_H | |
| #define IM_UTIL_H | | #define VIPS_UTIL_H | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif /*__cplusplus*/ | | #endif /*__cplusplus*/ | |
| | | | |
| #include <stdio.h> | | #include <stdio.h> | |
| | | | |
|
| /* Some platforms don't have M_PI in math.h :-( | | /* Some platforms don't have M_PI :-( | |
| */ | | */ | |
|
| #define IM_PI (3.14159265358979323846) | | #define VIPS_PI (3.14159265358979323846) | |
| | | | |
| /* Convert degrees->rads and vice-versa. | | /* Convert degrees->rads and vice-versa. | |
| */ | | */ | |
|
| #define IM_RAD( R ) (((R) / 360.0) * 2.0 * IM_PI) | | #define VIPS_RAD( R ) (((R) / 360.0) * 2.0 * VIPS_PI) | |
| #define IM_DEG( A ) (((A) / (2.0 * IM_PI)) * 360.0) | | #define VIPS_DEG( A ) (((A) / (2.0 * VIPS_PI)) * 360.0) | |
| | | | |
|
| #define IM_MAX( A, B ) ((A) > (B) ? (A) : (B)) | | #define VIPS_MAX( A, B ) ((A) > (B) ? (A) : (B)) | |
| #define IM_MIN( A, B ) ((A) < (B) ? (A) : (B)) | | #define VIPS_MIN( A, B ) ((A) < (B) ? (A) : (B)) | |
| #define IM_ABS( X ) (((X) >= 0) ? (X) : -(X)) | | #define VIPS_ABS( X ) (((X) >= 0) ? (X) : -(X)) | |
| | | | |
|
| #define IM_CLIP( A, V, B ) IM_MAX( (A), IM_MIN( (B), (V) ) ) | | #define VIPS_CLIP( A, V, B ) VIPS_MAX( (A), VIPS_MIN( (B), (V) ) ) | |
| #define IM_NUMBER( R ) ((int) (sizeof(R) / sizeof(R[0]))) | | #define VIPS_NUMBER( R ) ((int) (sizeof(R) / sizeof(R[0]))) | |
| | | | |
|
| #define IM_SWAP( TYPE, A, B ) \ | | #define VIPS_SWAP( TYPE, A, B ) \ | |
| G_STMT_START { \ | | G_STMT_START { \ | |
| TYPE t = (A); \ | | TYPE t = (A); \ | |
| (A) = (B); \ | | (A) = (B); \ | |
| (B) = t; \ | | (B) = t; \ | |
| } G_STMT_END | | } G_STMT_END | |
| | | | |
|
| #define IM_FREEF( F, S ) \ | | | |
| G_STMT_START { \ | | | |
| if( S ) { \ | | | |
| (void) F( (S) ); \ | | | |
| (S) = 0; \ | | | |
| } \ | | | |
| } G_STMT_END | | | |
| | | | |
| /* Can't just use IM_FREEF(), we want the extra cast to void on the argumen | | | |
| t | | | |
| * to im_free() to make sure we can work for "const char *" variables. | | | |
| */ | | | |
| #define IM_FREE( S ) \ | | | |
| G_STMT_START { \ | | | |
| if( S ) { \ | | | |
| (void) im_free( (void *) (S) ); \ | | | |
| (S) = 0; \ | | | |
| } \ | | | |
| } G_STMT_END | | | |
| | | | |
| #define IM_SETSTR( S, V ) \ | | | |
| G_STMT_START { \ | | | |
| const char *sst = (V); \ | | | |
| \ | | | |
| if( (S) != sst ) { \ | | | |
| if( !(S) || !sst || strcmp( (S), sst ) != 0 ) { \ | | | |
| IM_FREE( S ); \ | | | |
| if( sst ) \ | | | |
| (S) = im_strdup( NULL, sst ); \ | | | |
| } \ | | | |
| } \ | | | |
| } G_STMT_END | | | |
| | | | |
| /* Duff's device. Do OPERation N times in a 16-way unrolled loop. | | /* Duff's device. Do OPERation N times in a 16-way unrolled loop. | |
| */ | | */ | |
|
| #define IM_UNROLL( N, OPER ) \ | | #define VIPS_UNROLL( N, OPER ) \ | |
| G_STMT_START { \ | | G_STMT_START { \ | |
| if( (N) ) { \ | | if( (N) ) { \ | |
| int duff_count = ((N) + 15) / 16; \ | | int duff_count = ((N) + 15) / 16; \ | |
| \ | | \ | |
| switch( (N) % 16 ) { \ | | switch( (N) % 16 ) { \ | |
| case 0: do { OPER; \ | | case 0: do { OPER; \ | |
| case 15: OPER; \ | | case 15: OPER; \ | |
| case 14: OPER; \ | | case 14: OPER; \ | |
| case 13: OPER; \ | | case 13: OPER; \ | |
| case 12: OPER; \ | | case 12: OPER; \ | |
| | | | |
| skipping to change at line 129 | | skipping to change at line 97 | |
| case 3: OPER; \ | | case 3: OPER; \ | |
| case 2: OPER; \ | | case 2: OPER; \ | |
| case 1: OPER; \ | | case 1: OPER; \ | |
| } while( --duff_count > 0 ); \ | | } while( --duff_count > 0 ); \ | |
| } \ | | } \ | |
| } \ | | } \ | |
| } G_STMT_END | | } G_STMT_END | |
| | | | |
| /* Round a float to the nearest integer. Much faster than rint(). | | /* Round a float to the nearest integer. Much faster than rint(). | |
| */ | | */ | |
|
| #define IM_RINT( R ) ((int) ((R) > 0 ? ((R) + 0.5) : ((R) - 0.5))) | | #define VIPS_RINT( R ) ((int) ((R) > 0 ? ((R) + 0.5) : ((R) - 0.5))) | |
| | | | |
| /* Various integer range clips. Record over/under flows. | | /* Various integer range clips. Record over/under flows. | |
| */ | | */ | |
|
| #define IM_CLIP_UCHAR( V, SEQ ) \ | | #define VIPS_CLIP_UCHAR( V, SEQ ) \ | |
| G_STMT_START { \ | | G_STMT_START { \ | |
| if( (V) < 0 ) { \ | | if( (V) < 0 ) { \ | |
| (SEQ)->underflow++; \ | | (SEQ)->underflow++; \ | |
| (V) = 0; \ | | (V) = 0; \ | |
| } \ | | } \ | |
| else if( (V) > UCHAR_MAX ) { \ | | else if( (V) > UCHAR_MAX ) { \ | |
| (SEQ)->overflow++; \ | | (SEQ)->overflow++; \ | |
| (V) = UCHAR_MAX; \ | | (V) = UCHAR_MAX; \ | |
| } \ | | } \ | |
| } G_STMT_END | | } G_STMT_END | |
| | | | |
|
| #define IM_CLIP_USHORT( V, SEQ ) \ | | #define VIPS_CLIP_CHAR( V, SEQ ) \ | |
| G_STMT_START { \ | | G_STMT_START { \ | |
|
| if( (V) < 0 ) { \ | | if( (V) < SCHAR_MIN ) { \ | |
| (SEQ)->underflow++; \ | | (SEQ)->underflow++; \ | |
|
| (V) = 0; \ | | (V) = SCHAR_MIN; \ | |
| } \ | | } \ | |
|
| else if( (V) > USHRT_MAX ) { \ | | else if( (V) > SCHAR_MAX ) { \ | |
| (SEQ)->overflow++; \ | | (SEQ)->overflow++; \ | |
|
| (V) = USHRT_MAX; \ | | (V) = SCHAR_MAX; \ | |
| } \ | | } \ | |
| } G_STMT_END | | } G_STMT_END | |
| | | | |
|
| #define IM_CLIP_CHAR( V, SEQ ) \ | | #define VIPS_CLIP_USHORT( V, SEQ ) \ | |
| G_STMT_START { \ | | G_STMT_START { \ | |
|
| if( (V) < SCHAR_MIN ) { \ | | if( (V) < 0 ) { \ | |
| (SEQ)->underflow++; \ | | (SEQ)->underflow++; \ | |
|
| (V) = SCHAR_MIN; \ | | (V) = 0; \ | |
| } \ | | } \ | |
|
| else if( (V) > SCHAR_MAX ) { \ | | else if( (V) > USHRT_MAX ) { \ | |
| (SEQ)->overflow++; \ | | (SEQ)->overflow++; \ | |
|
| (V) = SCHAR_MAX; \ | | (V) = USHRT_MAX; \ | |
| } \ | | } \ | |
| } G_STMT_END | | } G_STMT_END | |
| | | | |
|
| #define IM_CLIP_SHORT( V, SEQ ) \ | | #define VIPS_CLIP_SHORT( V, SEQ ) \ | |
| G_STMT_START { \ | | G_STMT_START { \ | |
| if( (V) < SHRT_MIN ) { \ | | if( (V) < SHRT_MIN ) { \ | |
| (SEQ)->underflow++; \ | | (SEQ)->underflow++; \ | |
| (V) = SHRT_MIN; \ | | (V) = SHRT_MIN; \ | |
| } \ | | } \ | |
| else if( (V) > SHRT_MAX ) { \ | | else if( (V) > SHRT_MAX ) { \ | |
| (SEQ)->overflow++; \ | | (SEQ)->overflow++; \ | |
| (V) = SHRT_MAX; \ | | (V) = SHRT_MAX; \ | |
| } \ | | } \ | |
| } G_STMT_END | | } G_STMT_END | |
| | | | |
|
| #define IM_CLIP_NONE( V, SEQ ) {} | | #define VIPS_CLIP_NONE( V, SEQ ) {} | |
| | | | |
| typedef void *(*im_construct_fn)( void *, void *, void * ); | | | |
| | | | |
|
| void *im_local( VipsImage *im, | | /* Look up the const char * for an enum value. | |
| im_construct_fn cons, im_callback_fn dest, void *a, void *b, void *c | | | |
| ); | | | |
| int im_local_array( VipsImage *im, void **out, int n, | | | |
| im_construct_fn cons, im_callback_fn dest, void *a, void *b, void *c | | | |
| ); | | | |
| | | | |
| /* strtok replacement. | | | |
| */ | | */ | |
|
| char *im__break_token( char *str, char *brk ); | | #define VIPS_ENUM_STRING( ENUM, VALUE ) \ | |
| | | (g_enum_get_value( g_type_class_ref( ENUM ), VALUE )->value_name) | |
| | | #define VIPS_ENUM_NICK( ENUM, VALUE ) \ | |
| | | (g_enum_get_value( g_type_class_ref( ENUM ), VALUE )->value_nick) | |
| | | | |
| /* Like GFunc, but return a value. | | /* Like GFunc, but return a value. | |
| */ | | */ | |
|
| typedef void *(*VSListMap2Fn)( void *, void *, void * ); | | typedef void *(*VipsSListMap2Fn)( void *, void *, void * ); | |
| typedef void *(*VSListMap4Fn)( void *, void *, void *, void *, void * ); | | typedef void *(*VipsSListMap4Fn)( void *, void *, void *, void *, void * ); | |
| typedef void *(*VSListFold2Fn)( void *, void *, void *, void * ); | | typedef void *(*VipsSListFold2Fn)( void *, void *, void *, void * ); | |
| | | | |
| gboolean im_slist_equal( GSList *l1, GSList *l2 ); | | gboolean vips_slist_equal( GSList *l1, GSList *l2 ); | |
| void *im_slist_map2( GSList *list, VSListMap2Fn fn, void *a, void *b ); | | void *vips_slist_map2( GSList *list, VipsSListMap2Fn fn, void *a, void *b ) | |
| void *im_slist_map2_rev( GSList *list, VSListMap2Fn fn, void *a, void *b ); | | ; | |
| void *im_slist_map4( GSList *list, | | void *vips_slist_map2_rev( GSList *list, VipsSListMap2Fn fn, void *a, void | |
| VSListMap4Fn fn, void *a, void *b, void *c, void *d ); | | *b ); | |
| void *im_slist_fold2( GSList *list, void *start, | | void *vips_slist_map4( GSList *list, | |
| VSListFold2Fn fn, void *a, void *b ); | | VipsSListMap4Fn fn, void *a, void *b, void *c, void *d ); | |
| GSList *im_slist_filter( GSList *list, VSListMap2Fn fn, void *a, void *b ); | | void *vips_slist_fold2( GSList *list, void *start, | |
| void im_slist_free_all( GSList *list ); | | VipsSListFold2Fn fn, void *a, void *b ); | |
| | | GSList *vips_slist_filter( GSList *list, VipsSListMap2Fn fn, void *a, void | |
| void *im_map_equal( void *a, void *b ); | | *b ); | |
| | | void vips_slist_free_all( GSList *list ); | |
| void *im_hash_table_map( GHashTable *hash, VSListMap2Fn fn, void *a, void * | | void *vips_map_equal( void *a, void *b ); | |
| b ); | | | |
| | | void *vips_hash_table_map( GHashTable *hash, VipsSListMap2Fn fn, void *a, v | |
| typedef void *(*VipsTypeMap)( GType, void * ); | | oid *b ); | |
| typedef void *(*VipsTypeMap2)( GType, void *, void * ); | | | |
| typedef void *(*VipsClassMap)( VipsObjectClass *, void * ); | | char *vips_strncpy( char *dest, const char *src, int n ); | |
| void *vips_type_map( GType base, VipsTypeMap2 fn, void *a, void *b ); | | char *vips_strrstr( const char *haystack, const char *needle ); | |
| void *vips_type_map_concrete_all( GType base, VipsTypeMap fn, void *a ); | | gboolean vips_ispostfix( const char *a, const char *b ); | |
| void *vips_class_map_concrete_all( GType base, VipsClassMap fn, void *a ); | | gboolean vips_isprefix( const char *a, const char *b ); | |
| VipsObjectClass *vips_class_find( const char *basename, const char *nicknam | | char *vips_break_token( char *str, const char *brk ); | |
| e ); | | | |
| GType vips_type_find( const char *basename, const char *nickname ); | | int vips_vsnprintf( char *str, size_t size, const char *format, va_list ap | |
| | | ); | |
| char *im_strncpy( char *dest, const char *src, int n ); | | int vips_snprintf( char *str, size_t size, const char *format, ... ) | |
| char *im_strrstr( const char *haystack, const char *needle ); | | | |
| char *im_strdup( IMAGE *im, const char *str ); | | | |
| gboolean im_ispostfix( const char *a, const char *b ); | | | |
| gboolean im_isprefix( const char *a, const char *b ); | | | |
| int im_vsnprintf( char *str, size_t size, const char *format, va_list ap ); | | | |
| int im_snprintf( char *str, size_t size, const char *format, ... ) | | | |
| __attribute__((format(printf, 3, 4))); | | __attribute__((format(printf, 3, 4))); | |
|
| char *im_break_token( char *str, const char *brk ); | | | |
| | | | |
|
| const char *im_skip_dir( const char *filename ); | | void vips_filename_split( const char *path, char *name, char *mode ); | |
| void im_filename_split( const char *path, char *name, char *mode ); | | const char *vips_skip_dir( const char *filename ); | |
| void im_filename_suffix( const char *path, char *suffix ); | | void vips_filename_suffix( const char *path, char *suffix ); | |
| int im_filename_suffix_match( const char *path, const char *suffixes[] ); | | int vips_filename_suffix_match( const char *path, const char *suffixes[] ); | |
| char *im_getnextoption( char **in ); | | char *vips_getnextoption( char **in ); | |
| char *im_getsuboption( const char *buf ); | | char *vips_getsuboption( const char *buf ); | |
| | | | |
| gint64 im_file_length( int fd ); | | gint64 vips_file_length( int fd ); | |
| int im__write( int fd, const void *buf, size_t count ); | | int vips__write( int fd, const void *buf, size_t count ); | |
| | | | |
| FILE *im__file_open_read( const char *filename, const char *fallback_dir ); | | FILE *vips__file_open_read( const char *filename, | |
| FILE *im__file_open_write( const char *filename ); | | const char *fallback_dir, gboolean text_mode ); | |
| char *im__file_read( FILE *fp, const char *name, unsigned int *length_out ) | | FILE *vips__file_open_write( const char *filename, | |
| ; | | gboolean text_mode ); | |
| char *im__file_read_name( const char *name, const char *fallback_dir, | | char *vips__file_read( FILE *fp, const char *name, unsigned int *length_out | |
| | | ); | |
| | | char *vips__file_read_name( const char *name, const char *fallback_dir, | |
| unsigned int *length_out ); | | unsigned int *length_out ); | |
|
| int im__file_write( void *data, size_t size, size_t nmemb, FILE *stream ); | | int vips__file_write( void *data, size_t size, size_t nmemb, FILE *stream ) | |
| | | ; | |
| | | int vips__get_bytes( const char *filename, unsigned char buf[], int len ); | |
| | | | |
| | | GValue *vips__gvalue_ref_string_new( const char *text ); | |
| | | void vips__gslist_gvalue_free( GSList *list ); | |
| | | GSList *vips__gslist_gvalue_copy( const GSList *list ); | |
| | | GSList *vips__gslist_gvalue_merge( GSList *a, const GSList *b ); | |
| | | char *vips__gslist_gvalue_get( const GSList *list ); | |
| | | | |
| | | int vips__seek( int fd, gint64 pos ); | |
| | | int vips__ftruncate( int fd, gint64 pos ); | |
| | | int vips_existsf( const char *name, ... ) | |
| | | __attribute__((format(printf, 1, 2))); | |
| | | FILE *vips_popenf( const char *fmt, const char *mode, ... ) | |
| | | __attribute__((format(printf, 1, 3))); | |
| | | | |
|
| | | /** | |
| | | * VipsToken: | |
| | | * @VIPS_TOKEN_LEFT: left bracket | |
| | | * @VIPS_TOKEN_RIGHT: right bracket | |
| | | * @VIPS_TOKEN_STRING: string constant | |
| | | * @VIPS_TOKEN_EQUALS: equals sign | |
| | | * @VIPS_TOKEN_COMMA: comma | |
| | | * | |
| | | * Tokens returned by the vips lexical analyzer, see vips__token_get(). Thi | |
| | | s | |
| | | * is used to parse option strings for arguments. | |
| | | * | |
| | | * Left and right brackets can be any of (, {, [, <. | |
| | | * | |
| | | * Strings may be in double quotes, and may contain escaped quote character | |
| | | s, | |
| | | * for example string, "string" and "str\"ing". | |
| | | * | |
| | | */ | |
| typedef enum { | | typedef enum { | |
|
| VIPS_TOKEN_LEFT = 1, /* ({[ */ | | VIPS_TOKEN_LEFT = 1, | |
| VIPS_TOKEN_RIGHT, /* ]}) */ | | VIPS_TOKEN_RIGHT, | |
| VIPS_TOKEN_STRING, /* string or "str\"ing" */ | | VIPS_TOKEN_STRING, | |
| VIPS_TOKEN_EQUALS, /* = */ | | VIPS_TOKEN_EQUALS, | |
| VIPS_TOKEN_COMMA /* , */ | | VIPS_TOKEN_COMMA | |
| } VipsToken; | | } VipsToken; | |
| | | | |
| const char *vips__token_get( const char *buffer, | | const char *vips__token_get( const char *buffer, | |
| VipsToken *token, char *string, int size ); | | VipsToken *token, char *string, int size ); | |
| const char *vips__token_must( const char *buffer, VipsToken *token, | | const char *vips__token_must( const char *buffer, VipsToken *token, | |
| char *string, int size ); | | char *string, int size ); | |
| const char *vips__token_need( const char *buffer, VipsToken need_token, | | const char *vips__token_need( const char *buffer, VipsToken need_token, | |
| char *string, int size ); | | char *string, int size ); | |
| | | | |
|
| int im_existsf( const char *name, ... ) | | int vips_ispoweroftwo( int p ); | |
| __attribute__((format(printf, 1, 2))); | | int vips_amiMSBfirst( void ); | |
| FILE *im_popenf( const char *fmt, const char *mode, ... ) | | | |
| __attribute__((format(printf, 1, 3))); | | | |
| int im_ispoweroftwo( int p ); | | | |
| int im_isvips( const char *filename ); | | | |
| int im_amiMSBfirst( void ); | | | |
| | | | |
|
| char *im__temp_name( const char *format ); | | char *vips__temp_name( const char *format ); | |
| IMAGE *im__open_temp( const char *format ); | | | |
| | | | |
|
| int im_bits_of_fmt( VipsBandFmt fmt ); | | void vips__change_suffix( const char *name, char *out, int mx, | |
| | | const char *new_suff, const char **olds, int nolds ); | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif /*__cplusplus*/ | | #endif /*__cplusplus*/ | |
| | | | |
|
| #endif /*IM_UTIL_H*/ | | #endif /*VIPS_UTIL_H*/ | |
| | | | |
End of changes. 35 change blocks. |
| 139 lines changed or deleted | | 124 lines changed or added | |
|