1 /* Old and broken stuff that we still enable by default, but don't document
2  * and certainly don't recommend.
3  *
4  * 30/6/09
5  * 	- from vips.h
6  */
7 
8 /*
9 
10     This file is part of VIPS.
11 
12     VIPS is free software; you can redistribute it and/or modify
13     it under the terms of the GNU Lesser General Public License as published by
14     the Free Software Foundation; either version 2 of the License, or
15     (at your option) any later version.
16 
17     This program is distributed in the hope that it will be useful,
18     but WITHOUT ANY WARRANTY; without even the implied warranty of
19     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20     GNU Lesser General Public License for more details.
21 
22     You should have received a copy of the GNU Lesser General Public License
23     along with this program; if not, write to the Free Software
24     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25     02110-1301  USA
26 
27  */
28 
29 /*
30 
31     These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
32 
33  */
34 
35 #ifndef IM_ALMOSTDEPRECATED_H
36 #define IM_ALMOSTDEPRECATED_H
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif /*__cplusplus*/
41 
42 /* Was public, now deprecated.
43  */
44 typedef enum {
45 	IM_BBITS_BYTE = 8,
46 	IM_BBITS_SHORT = 16,
47 	IM_BBITS_INT = 32,
48 	IM_BBITS_FLOAT = 32,
49 	IM_BBITS_COMPLEX = 64,
50 	IM_BBITS_DOUBLE = 64,
51 	IM_BBITS_DPCOMPLEX = 128
52 } VipsBBits;
53 
54 /* Used to define a region of interest for im_extract() etc. Too boring to be
55  * public API, see im_extract_area() etc.
56  */
57 typedef struct {
58 	int xstart;
59 	int ystart;
60 	int xsize;
61 	int ysize;
62 	int chsel;      /* 1 2 3 or 0, for r g b or all respectively
63 			 *(channel select)	*/
64 } IMAGE_BOX;
65 
66 int im_extract( IMAGE *, IMAGE *, IMAGE_BOX * );
67 DOUBLEMASK *im_measure( IMAGE *im, IMAGE_BOX *box, int h, int v,
68 	int *sel, int nsel, const char *name );
69 
70 gboolean im_isuint( IMAGE *im );
71 gboolean im_isint( IMAGE *im );
72 gboolean im_isfloat( IMAGE *im );
73 gboolean im_isscalar( IMAGE *im );
74 gboolean im_iscomplex( IMAGE *im );
75 
76 int im_c2ps( IMAGE *in, IMAGE *out );
77 
78 int im_clip( IMAGE *in, IMAGE *out );
79 
80 #define MASK_IDEAL_HIGHPASS IM_MASK_IDEAL_HIGHPASS
81 #define MASK_IDEAL_LOWPASS IM_MASK_IDEAL_LOWPASS
82 #define MASK_BUTTERWORTH_HIGHPASS IM_MASK_BUTTERWORTH_HIGHPASS
83 #define MASK_BUTTERWORTH_LOWPASS IM_MASK_BUTTERWORTH_LOWPASS
84 #define MASK_GAUSS_HIGHPASS IM_MASK_GAUSS_HIGHPASS
85 #define MASK_GAUSS_LOWPASS IM_MASK_GAUSS_LOWPASS
86 
87 #define MASK_IDEAL_RINGPASS IM_MASK_IDEAL_RINGPASS
88 #define MASK_IDEAL_RINGREJECT IM_MASK_IDEAL_RINGREJECT
89 #define MASK_BUTTERWORTH_RINGPASS IM_MASK_BUTTERWORTH_RINGPASS
90 #define MASK_BUTTERWORTH_RINGREJECT IM_MASK_BUTTERWORTH_RINGREJECT
91 #define MASK_GAUSS_RINGPASS IM_MASK_GAUSS_RINGPASS
92 #define MASK_GAUSS_RINGREJECT IM_MASK_GAUSS_RINGREJECT
93 
94 #define MASK_IDEAL_BANDPASS IM_MASK_IDEAL_BANDPASS
95 #define MASK_IDEAL_BANDREJECT IM_MASK_IDEAL_BANDREJECT
96 #define MASK_BUTTERWORTH_BANDPASS IM_MASK_BUTTERWORTH_BANDPASS
97 #define MASK_BUTTERWORTH_BANDREJECT IM_MASK_BUTTERWORTH_BANDREJECT
98 #define MASK_GAUSS_BANDPASS IM_MASK_GAUSS_BANDPASS
99 #define MASK_GAUSS_BANDREJECT IM_MASK_GAUSS_BANDREJECT
100 
101 #define MASK_FRACTAL_FLT IM_MASK_FRACTAL_FLT
102 
103 #define MaskType ImMaskType
104 
105 /* Copy and swap types.
106  */
107 typedef enum {
108 	IM_ARCH_NATIVE,
109 	IM_ARCH_BYTE_SWAPPED,
110 	IM_ARCH_LSB_FIRST,
111 	IM_ARCH_MSB_FIRST
112 } im_arch_type;
113 
114 gboolean im_isnative( im_arch_type arch );
115 int im_copy_from( IMAGE *in, IMAGE *out, im_arch_type architecture );
116 
117 /* Backwards compatibility macros.
118  */
119 #define im_clear_error_string() im_error_clear()
120 #define im_errorstring() im_error_buffer()
121 
122 /* Deprecated API.
123  */
124 void im_errormsg( const char *fmt, ... )
125 	__attribute__((format(printf, 1, 2)));
126 void im_verrormsg( const char *fmt, va_list ap );
127 void im_errormsg_system( int err, const char *fmt, ... )
128 	__attribute__((format(printf, 2, 3)));
129 void im_diagnostics( const char *fmt, ... )
130 	__attribute__((format(printf, 1, 2)));
131 void im_warning( const char *fmt, ... )
132 	__attribute__((format(printf, 1, 2)));
133 
134 int im_iterate( VipsImage *im,
135 	VipsStartFn start, im_generate_fn generate, VipsStopFn stop,
136 	void *a, void *b
137 );
138 
139 /* Async rendering.
140  */
141 int im_render_priority( VipsImage *in, VipsImage *out, VipsImage *mask,
142 	int width, int height, int max,
143 	int priority,
144 	void (*notify)( VipsImage *, VipsRect *, void * ), void *client );
145 int im_cache( VipsImage *in, VipsImage *out, int width, int height, int max );
146 
147 /* Deprecated operations.
148  */
149 int im_cmulnorm( IMAGE *in1, IMAGE *in2, IMAGE *out );
150 int im_fav4( IMAGE **, IMAGE * );
151 int im_gadd( double, IMAGE *, double, IMAGE *, double, IMAGE *);
152 int im_litecor( IMAGE *, IMAGE *, IMAGE *, int, double );
153 int im_render_fade( IMAGE *in, IMAGE *out, IMAGE *mask,
154 	int width, int height, int max,
155 	int fps, int steps,
156 	int priority,
157 	void (*notify)( IMAGE *, VipsRect *, void * ), void *client );
158 int im_render( IMAGE *in, IMAGE *out, IMAGE *mask,
159 	int width, int height, int max,
160 	void (*notify)( IMAGE *, VipsRect *, void * ), void *client );
161 
162 int im_cooc_matrix( IMAGE *im, IMAGE *m,
163 	int xp, int yp, int xs, int ys, int dx, int dy, int flag );
164 int im_cooc_asm( IMAGE *m, double *asmoment );
165 int im_cooc_contrast( IMAGE *m, double *contrast );
166 int im_cooc_correlation( IMAGE *m, double *correlation );
167 int im_cooc_entropy( IMAGE *m, double *entropy );
168 
169 int im_glds_matrix( IMAGE *im, IMAGE *m,
170 	int xpos, int ypos, int xsize, int ysize, int dx, int dy );
171 int im_glds_asm( IMAGE *m, double *asmoment );
172 int im_glds_contrast( IMAGE *m, double *contrast );
173 int im_glds_entropy( IMAGE *m, double *entropy );
174 int im_glds_mean( IMAGE *m, double *mean );
175 
176 int im_dif_std(IMAGE *im, int xpos, int ypos, int xsize, int ysize, int dx, int dy, double *pmean, double *pstd);
177 int im_simcontr( IMAGE *out, int xsize, int ysize );
178 int im_spatres( IMAGE *in,  IMAGE *out, int step );
179 
180 int im_stretch3( IMAGE *in, IMAGE *out, double dx, double dy );
181 
182 /* Renamed operations.
183  */
184 
185 /* arithmetic
186  */
187 int im_remainderconst_vec( IMAGE *in, IMAGE *out, int n, double *c );
188 
189 /* boolean
190  */
191 int im_andconst( IMAGE *, IMAGE *, double );
192 int im_and_vec( IMAGE *, IMAGE *, int, double * );
193 int im_orconst( IMAGE *, IMAGE *, double );
194 int im_or_vec( IMAGE *, IMAGE *, int, double * );
195 int im_eorconst( IMAGE *, IMAGE *, double );
196 int im_eor_vec( IMAGE *, IMAGE *, int, double * );
197 
198 /* mosaicing
199  */
200 int im_affine( IMAGE *in, IMAGE *out,
201 	double a, double b, double c, double d, double dx, double dy,
202 	int ox, int oy, int ow, int oh );
203 int im_similarity( IMAGE *in, IMAGE *out,
204 	double a, double b, double dx, double dy );
205 int im_similarity_area( IMAGE *in, IMAGE *out,
206 	double a, double b, double dx, double dy,
207 	int ox, int oy, int ow, int oh );
208 
209 /* colour
210  */
211 int im_icc_export( IMAGE *in, IMAGE *out,
212 	const char *output_profile_filename, int intent );
213 
214 /* conversion
215  */
216 int im_clip2dcm( IMAGE *in, IMAGE *out );
217 int im_clip2cm( IMAGE *in, IMAGE *out );
218 int im_clip2us( IMAGE *in, IMAGE *out );
219 int im_clip2ui( IMAGE *in, IMAGE *out );
220 int im_clip2s( IMAGE *in, IMAGE *out );
221 int im_clip2i( IMAGE *in, IMAGE *out );
222 int im_clip2d( IMAGE *in, IMAGE *out );
223 int im_clip2f( IMAGE *in, IMAGE *out );
224 int im_clip2c( IMAGE *in, IMAGE *out );
225 
226 int im_slice( IMAGE *in, IMAGE *out, double, double );
227 int im_thresh( IMAGE *in, IMAGE *out, double );
228 
229 int im_print( const char *message );
230 
231 int im_convsub( IMAGE *in, IMAGE *out, INTMASK *mask, int xskip, int yskip );
232 
233 int im_bernd( const char *tiffname, int x, int y, int w, int h );
234 
235 int im_resize_linear( IMAGE *, IMAGE *, int, int );
236 
237 int im_convf( IMAGE *in, IMAGE *out, DOUBLEMASK *mask );
238 int im_convsepf( IMAGE *in, IMAGE *out, DOUBLEMASK *mask );
239 int im_conv_raw( IMAGE *in, IMAGE *out, INTMASK *mask );
240 int im_convf_raw( IMAGE *in, IMAGE *out, DOUBLEMASK *mask );
241 int im_convsep_raw( IMAGE *in, IMAGE *out, INTMASK *mask );
242 int im_convsepf_raw( IMAGE *in, IMAGE *out, DOUBLEMASK *mask );
243 int im_fastcor_raw( IMAGE *in, IMAGE *ref, IMAGE *out );
244 int im_spcor_raw( IMAGE *in, IMAGE *ref, IMAGE *out );
245 int im_gradcor_raw( IMAGE *in, IMAGE *ref, IMAGE *out );
246 int im_contrast_surface_raw( IMAGE *in, IMAGE *out,
247 	int half_win_size, int spacing );
248 
249 int im_stdif_raw( IMAGE *in, IMAGE *out,
250 	double a, double m0, double b, double s0, int xwin, int ywin );
251 int im_lhisteq_raw( IMAGE *in, IMAGE *out, int xwin, int ywin );
252 
253 int im_erode_raw( IMAGE *in, IMAGE *out, INTMASK *m );
254 int im_dilate_raw( IMAGE *in, IMAGE *out, INTMASK *m );
255 int im_rank_raw( IMAGE *in, IMAGE *out, int xsize, int ysize, int order );
256 
257 /* inplace
258  */
259 int im_circle( IMAGE *im, int cx, int cy, int radius, int intensity );
260 int im_line( IMAGE *, int, int, int, int, int );
261 int im_segment( IMAGE *test, IMAGE *mask, int *segments );
262 int im_paintrect( IMAGE *im, VipsRect *r, PEL *ink );
263 int im_insertplace( IMAGE *main, IMAGE *sub, int x, int y );
264 
265 int im_flood_copy( IMAGE *in, IMAGE *out, int x, int y, PEL *ink );
266 int im_flood_blob_copy( IMAGE *in, IMAGE *out, int x, int y, PEL *ink );
267 int im_flood_other_copy( IMAGE *test, IMAGE *mark, IMAGE *out,
268 	int x, int y, int serial );
269 
270 int im_flood( IMAGE *im, int x, int y, PEL *ink, VipsRect *dout );
271 int im_flood_blob( IMAGE *im, int x, int y, PEL *ink, VipsRect *dout );
272 int im_flood_other( IMAGE *test, IMAGE *mark,
273 	int x, int y, int serial, VipsRect *dout );
274 
275 int im_fastline( IMAGE *im, int x1, int y1, int x2, int y2, PEL *pel );
276 int im_fastlineuser( IMAGE *im,
277 	int x1, int y1, int x2, int y2,
278 	VipsPlotFn fn, void *client1, void *client2, void *client3 );
279 
280 int im_plotmask( IMAGE *im, int ix, int iy, PEL *ink, PEL *mask, VipsRect *r );
281 int im_readpoint( IMAGE *im, int x, int y, PEL *pel );
282 int im_plotpoint( IMAGE *im, int x, int y, PEL *pel );
283 
284 int im_smudge( IMAGE *image, int ix, int iy, VipsRect *r );
285 int im_smear( IMAGE *im, int ix, int iy, VipsRect *r );
286 
287 void vips_warn( const char *domain, const char *fmt, ... )
288 	__attribute__((format(printf, 2, 3)));
289 void vips_vwarn( const char *domain, const char *fmt, va_list ap );
290 void vips_info_set( gboolean info );
291 void vips_info( const char *domain, const char *fmt, ... )
292 	__attribute__((format(printf, 2, 3)));
293 void vips_vinfo( const char *domain, const char *fmt, va_list ap );
294 
295 VipsAngle vips_autorot_get_angle( VipsImage *image );
296 
297 /* iofuncs
298  */
299 int vips_free( void *buf );
300 
301 #ifdef __cplusplus
302 }
303 #endif /*__cplusplus*/
304 
305 #endif /*IM_ALMOSTDEPRECATED_H*/
306