1 /* Headers for arithmetic 2 * 3 * 30/6/09 4 * - from proto.h 5 */ 6 7 /* 8 9 This file is part of VIPS. 10 11 VIPS is free software; you can redistribute it and/or modify 12 it under the terms of the GNU Lesser General Public License as published by 13 the Free Software Foundation; either version 2 of the License, or 14 (at your option) any later version. 15 16 This program is distributed in the hope that it will be useful, 17 but WITHOUT ANY WARRANTY; without even the implied warranty of 18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 GNU Lesser General Public License for more details. 20 21 You should have received a copy of the GNU Lesser General Public License 22 along with this program; if not, write to the Free Software 23 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 24 02110-1301 USA 25 26 */ 27 28 /* 29 30 These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk 31 32 */ 33 34 #ifndef VIPS_ARITHMETIC_H 35 #define VIPS_ARITHMETIC_H 36 37 #ifdef __cplusplus 38 extern "C" { 39 #endif /*__cplusplus*/ 40 41 /** 42 * VipsOperationMath: 43 * @VIPS_OPERATION_MATH_SIN: sin(), angles in degrees 44 * @VIPS_OPERATION_MATH_COS: cos(), angles in degrees 45 * @VIPS_OPERATION_MATH_TAN: tan(), angles in degrees 46 * @VIPS_OPERATION_MATH_ASIN: asin(), angles in degrees 47 * @VIPS_OPERATION_MATH_ACOS: acos(), angles in degrees 48 * @VIPS_OPERATION_MATH_ATAN: atan(), angles in degrees 49 * @VIPS_OPERATION_MATH_LOG: log base e 50 * @VIPS_OPERATION_MATH_LOG10: log base 10 51 * @VIPS_OPERATION_MATH_EXP: e to the something 52 * @VIPS_OPERATION_MATH_EXP10: 10 to the something 53 * @VIPS_OPERATION_MATH_SINH: sinh(), angles in radians 54 * @VIPS_OPERATION_MATH_COSH: cosh(), angles in radians 55 * @VIPS_OPERATION_MATH_TANH: tanh(), angles in radians 56 * @VIPS_OPERATION_MATH_ASINH: asinh(), angles in radians 57 * @VIPS_OPERATION_MATH_ACOSH: acosh(), angles in radians 58 * @VIPS_OPERATION_MATH_ATANH: atanh(), angles in radians 59 * 60 * See also: vips_math(). 61 */ 62 typedef enum { 63 VIPS_OPERATION_MATH_SIN, 64 VIPS_OPERATION_MATH_COS, 65 VIPS_OPERATION_MATH_TAN, 66 VIPS_OPERATION_MATH_ASIN, 67 VIPS_OPERATION_MATH_ACOS, 68 VIPS_OPERATION_MATH_ATAN, 69 VIPS_OPERATION_MATH_LOG, 70 VIPS_OPERATION_MATH_LOG10, 71 VIPS_OPERATION_MATH_EXP, 72 VIPS_OPERATION_MATH_EXP10, 73 VIPS_OPERATION_MATH_SINH, 74 VIPS_OPERATION_MATH_COSH, 75 VIPS_OPERATION_MATH_TANH, 76 VIPS_OPERATION_MATH_ASINH, 77 VIPS_OPERATION_MATH_ACOSH, 78 VIPS_OPERATION_MATH_ATANH, 79 VIPS_OPERATION_MATH_LAST 80 } VipsOperationMath; 81 82 /** 83 * VipsOperationMath2: 84 * @VIPS_OPERATION_MATH2_POW: pow( left, right ) 85 * @VIPS_OPERATION_MATH2_WOP: pow( right, left ) 86 * @VIPS_OPERATION_MATH2_ATAN2: atan2( left, right ) 87 * 88 * See also: vips_math(). 89 */ 90 typedef enum { 91 VIPS_OPERATION_MATH2_POW, 92 VIPS_OPERATION_MATH2_WOP, 93 VIPS_OPERATION_MATH2_ATAN2, 94 VIPS_OPERATION_MATH2_LAST 95 } VipsOperationMath2; 96 97 /** 98 * VipsOperationRound: 99 * @VIPS_OPERATION_ROUND_RINT: round to nearest 100 * @VIPS_OPERATION_ROUND_FLOOR: largest integral value not greater than 101 * @VIPS_OPERATION_ROUND_CEIL: the smallest integral value not less than 102 * 103 * See also: vips_round(). 104 */ 105 typedef enum { 106 VIPS_OPERATION_ROUND_RINT, 107 VIPS_OPERATION_ROUND_CEIL, 108 VIPS_OPERATION_ROUND_FLOOR, 109 VIPS_OPERATION_ROUND_LAST 110 } VipsOperationRound; 111 112 /** 113 * VipsOperationRelational: 114 * @VIPS_OPERATION_RELATIONAL_EQUAL: == 115 * @VIPS_OPERATION_RELATIONAL_NOTEQ: != 116 * @VIPS_OPERATION_RELATIONAL_LESS: < 117 * @VIPS_OPERATION_RELATIONAL_LESSEQ: <= 118 * @VIPS_OPERATION_RELATIONAL_MORE: > 119 * @VIPS_OPERATION_RELATIONAL_MOREEQ: >= 120 * 121 * See also: vips_relational(). 122 */ 123 typedef enum { 124 VIPS_OPERATION_RELATIONAL_EQUAL, 125 VIPS_OPERATION_RELATIONAL_NOTEQ, 126 VIPS_OPERATION_RELATIONAL_LESS, 127 VIPS_OPERATION_RELATIONAL_LESSEQ, 128 VIPS_OPERATION_RELATIONAL_MORE, 129 VIPS_OPERATION_RELATIONAL_MOREEQ, 130 VIPS_OPERATION_RELATIONAL_LAST 131 } VipsOperationRelational; 132 133 /** 134 * VipsOperationBoolean: 135 * @VIPS_OPERATION_BOOLEAN_AND: & 136 * @VIPS_OPERATION_BOOLEAN_OR: | 137 * @VIPS_OPERATION_BOOLEAN_EOR: ^ 138 * @VIPS_OPERATION_BOOLEAN_LSHIFT: >> 139 * @VIPS_OPERATION_BOOLEAN_RSHIFT: << 140 * 141 * See also: vips_boolean(). 142 */ 143 typedef enum { 144 VIPS_OPERATION_BOOLEAN_AND, 145 VIPS_OPERATION_BOOLEAN_OR, 146 VIPS_OPERATION_BOOLEAN_EOR, 147 VIPS_OPERATION_BOOLEAN_LSHIFT, 148 VIPS_OPERATION_BOOLEAN_RSHIFT, 149 VIPS_OPERATION_BOOLEAN_LAST 150 } VipsOperationBoolean; 151 152 /** 153 * VipsOperationComplex: 154 * @VIPS_OPERATION_COMPLEX_POLAR: convert to polar coordinates 155 * @VIPS_OPERATION_COMPLEX_RECT: convert to rectangular coordinates 156 * @VIPS_OPERATION_COMPLEX_CONJ: complex conjugate 157 * 158 * See also: vips_complex(). 159 */ 160 typedef enum { 161 VIPS_OPERATION_COMPLEX_POLAR, 162 VIPS_OPERATION_COMPLEX_RECT, 163 VIPS_OPERATION_COMPLEX_CONJ, 164 VIPS_OPERATION_COMPLEX_LAST 165 } VipsOperationComplex; 166 167 /** 168 * VipsOperationComplex2: 169 * @VIPS_OPERATION_COMPLEX2_CROSS_PHASE: convert to polar coordinates 170 * 171 * See also: vips_complex2(). 172 */ 173 typedef enum { 174 VIPS_OPERATION_COMPLEX2_CROSS_PHASE, 175 VIPS_OPERATION_COMPLEX2_LAST 176 } VipsOperationComplex2; 177 178 /** 179 * VipsOperationComplexget: 180 * @VIPS_OPERATION_COMPLEXGET_REAL: get real component 181 * @VIPS_OPERATION_COMPLEXGET_IMAG: get imaginary component 182 * 183 * See also: vips_complexget(). 184 */ 185 typedef enum { 186 VIPS_OPERATION_COMPLEXGET_REAL, 187 VIPS_OPERATION_COMPLEXGET_IMAG, 188 VIPS_OPERATION_COMPLEXGET_LAST 189 } VipsOperationComplexget; 190 191 int vips_add( VipsImage *left, VipsImage *right, VipsImage **out, ... ) 192 __attribute__((sentinel)); 193 int vips_sum( VipsImage **in, VipsImage **out, int n, ... ) 194 __attribute__((sentinel)); 195 int vips_subtract( VipsImage *in1, VipsImage *in2, VipsImage **out, ... ) 196 __attribute__((sentinel)); 197 int vips_multiply( VipsImage *left, VipsImage *right, VipsImage **out, ... ) 198 __attribute__((sentinel)); 199 int vips_divide( VipsImage *left, VipsImage *right, VipsImage **out, ... ) 200 __attribute__((sentinel)); 201 int vips_linear( VipsImage *in, VipsImage **out, 202 const double *a, const double *b, int n, ... ) 203 __attribute__((sentinel)); 204 int vips_linear1( VipsImage *in, VipsImage **out, double a, double b, ... ) 205 __attribute__((sentinel)); 206 int vips_remainder( VipsImage *left, VipsImage *right, VipsImage **out, ... ) 207 __attribute__((sentinel)); 208 int vips_remainder_const( VipsImage *in, VipsImage **out, 209 const double *c, int n, ... ) 210 __attribute__((sentinel)); 211 int vips_remainder_const1( VipsImage *in, VipsImage **out, 212 double c, ... ) 213 __attribute__((sentinel)); 214 int vips_invert( VipsImage *in, VipsImage **out, ... ) 215 __attribute__((sentinel)); 216 int vips_abs( VipsImage *in, VipsImage **out, ... ) 217 __attribute__((sentinel)); 218 int vips_sign( VipsImage *in, VipsImage **out, ... ) 219 __attribute__((sentinel)); 220 int vips_round( VipsImage *in, VipsImage **out, VipsOperationRound round, ... ) 221 __attribute__((sentinel)); 222 int vips_floor( VipsImage *in, VipsImage **out, ... ) 223 __attribute__((sentinel)); 224 int vips_ceil( VipsImage *in, VipsImage **out, ... ) 225 __attribute__((sentinel)); 226 int vips_rint( VipsImage *in, VipsImage **out, ... ) 227 __attribute__((sentinel)); 228 229 int vips_math( VipsImage *in, VipsImage **out, 230 VipsOperationMath math, ... ) 231 __attribute__((sentinel)); 232 int vips_sin( VipsImage *in, VipsImage **out, ... ) 233 __attribute__((sentinel)); 234 int vips_cos( VipsImage *in, VipsImage **out, ... ) 235 __attribute__((sentinel)); 236 int vips_tan( VipsImage *in, VipsImage **out, ... ) 237 __attribute__((sentinel)); 238 int vips_asin( VipsImage *in, VipsImage **out, ... ) 239 __attribute__((sentinel)); 240 int vips_acos( VipsImage *in, VipsImage **out, ... ) 241 __attribute__((sentinel)); 242 int vips_atan( VipsImage *in, VipsImage **out, ... ) 243 __attribute__((sentinel)); 244 int vips_exp( VipsImage *in, VipsImage **out, ... ) 245 __attribute__((sentinel)); 246 int vips_exp10( VipsImage *in, VipsImage **out, ... ) 247 __attribute__((sentinel)); 248 int vips_log( VipsImage *in, VipsImage **out, ... ) 249 __attribute__((sentinel)); 250 int vips_log10( VipsImage *in, VipsImage **out, ... ) 251 __attribute__((sentinel)); 252 int vips_sinh( VipsImage *in, VipsImage **out, ... ) 253 __attribute__((sentinel)); 254 int vips_cosh( VipsImage *in, VipsImage **out, ... ) 255 __attribute__((sentinel)); 256 int vips_tanh( VipsImage *in, VipsImage **out, ... ) 257 __attribute__((sentinel)); 258 int vips_asinh( VipsImage *in, VipsImage **out, ... ) 259 __attribute__((sentinel)); 260 int vips_acosh( VipsImage *in, VipsImage **out, ... ) 261 __attribute__((sentinel)); 262 int vips_atanh( VipsImage *in, VipsImage **out, ... ) 263 __attribute__((sentinel)); 264 265 int vips_complex( VipsImage *in, VipsImage **out, 266 VipsOperationComplex cmplx, ... ) 267 __attribute__((sentinel)); 268 int vips_polar( VipsImage *in, VipsImage **out, ... ) 269 __attribute__((sentinel)); 270 int vips_rect( VipsImage *in, VipsImage **out, ... ) 271 __attribute__((sentinel)); 272 int vips_conj( VipsImage *in, VipsImage **out, ... ) 273 __attribute__((sentinel)); 274 275 int vips_complex2( VipsImage *left, VipsImage *right, VipsImage **out, 276 VipsOperationComplex2 cmplx, ... ) 277 __attribute__((sentinel)); 278 int vips_cross_phase( VipsImage *left, VipsImage *right, VipsImage **out, ... ) 279 __attribute__((sentinel)); 280 281 int vips_complexget( VipsImage *in, VipsImage **out, 282 VipsOperationComplexget get, ... ) 283 __attribute__((sentinel)); 284 int vips_real( VipsImage *in, VipsImage **out, ... ) 285 __attribute__((sentinel)); 286 int vips_imag( VipsImage *in, VipsImage **out, ... ) 287 __attribute__((sentinel)); 288 289 int vips_complexform( VipsImage *left, VipsImage *right, VipsImage **out, ... ) 290 __attribute__((sentinel)); 291 292 int vips_relational( VipsImage *left, VipsImage *right, VipsImage **out, 293 VipsOperationRelational relational, ... ) 294 __attribute__((sentinel)); 295 int vips_equal( VipsImage *left, VipsImage *right, VipsImage **out, ... ) 296 __attribute__((sentinel)); 297 int vips_notequal( VipsImage *left, VipsImage *right, VipsImage **out, ... ) 298 __attribute__((sentinel)); 299 int vips_less( VipsImage *left, VipsImage *right, VipsImage **out, ... ) 300 __attribute__((sentinel)); 301 int vips_lesseq( VipsImage *left, VipsImage *right, VipsImage **out, ... ) 302 __attribute__((sentinel)); 303 int vips_more( VipsImage *left, VipsImage *right, VipsImage **out, ... ) 304 __attribute__((sentinel)); 305 int vips_moreeq( VipsImage *left, VipsImage *right, VipsImage **out, ... ) 306 __attribute__((sentinel)); 307 int vips_relational_const( VipsImage *in, VipsImage **out, 308 VipsOperationRelational relational, const double *c, int n, ... ) 309 __attribute__((sentinel)); 310 int vips_equal_const( VipsImage *in, VipsImage **out, 311 const double *c, int n, ... ) 312 __attribute__((sentinel)); 313 int vips_notequal_const( VipsImage *in, VipsImage **out, 314 const double *c, int n, ... ) 315 __attribute__((sentinel)); 316 int vips_less_const( VipsImage *in, VipsImage **out, 317 const double *c, int n, ... ) 318 __attribute__((sentinel)); 319 int vips_lesseq_const( VipsImage *in, VipsImage **out, 320 const double *c, int n, ... ) 321 __attribute__((sentinel)); 322 int vips_more_const( VipsImage *in, VipsImage **out, 323 const double *c, int n, ... ) 324 __attribute__((sentinel)); 325 int vips_moreeq_const( VipsImage *in, VipsImage **out, 326 const double *c, int n, ... ) 327 __attribute__((sentinel)); 328 int vips_relational_const1( VipsImage *in, VipsImage **out, 329 VipsOperationRelational relational, double c, ... ) 330 __attribute__((sentinel)); 331 int vips_equal_const1( VipsImage *in, VipsImage **out, double c, ... ) 332 __attribute__((sentinel)); 333 int vips_notequal_const1( VipsImage *in, VipsImage **out, double c, ... ) 334 __attribute__((sentinel)); 335 int vips_less_const1( VipsImage *in, VipsImage **out, double c, ... ) 336 __attribute__((sentinel)); 337 int vips_lesseq_const1( VipsImage *in, VipsImage **out, double c, ... ) 338 __attribute__((sentinel)); 339 int vips_more_const1( VipsImage *in, VipsImage **out, double c, ... ) 340 __attribute__((sentinel)); 341 int vips_moreeq_const1( VipsImage *in, VipsImage **out, double c, ... ) 342 __attribute__((sentinel)); 343 344 int vips_boolean( VipsImage *left, VipsImage *right, VipsImage **out, 345 VipsOperationBoolean boolean, ... ) 346 __attribute__((sentinel)); 347 int vips_andimage( VipsImage *left, VipsImage *right, VipsImage **out, ... ) 348 __attribute__((sentinel)); 349 int vips_orimage( VipsImage *left, VipsImage *right, VipsImage **out, ... ) 350 __attribute__((sentinel)); 351 int vips_eorimage( VipsImage *left, VipsImage *right, VipsImage **out, ... ) 352 __attribute__((sentinel)); 353 int vips_lshift( VipsImage *left, VipsImage *right, VipsImage **out, ... ) 354 __attribute__((sentinel)); 355 int vips_rshift( VipsImage *left, VipsImage *right, VipsImage **out, ... ) 356 __attribute__((sentinel)); 357 358 int vips_boolean_const( VipsImage *in, VipsImage **out, 359 VipsOperationBoolean boolean, const double *c, int n, ... ) 360 __attribute__((sentinel)); 361 int vips_andimage_const( VipsImage *in, VipsImage **out, 362 const double *c, int n, ... ) 363 __attribute__((sentinel)); 364 int vips_orimage_const( VipsImage *in, VipsImage **out, 365 const double *c, int n, ... ) 366 __attribute__((sentinel)); 367 int vips_eorimage_const( VipsImage *in, VipsImage **out, 368 const double *c, int n, ... ) 369 __attribute__((sentinel)); 370 int vips_lshift_const( VipsImage *in, VipsImage **out, 371 const double *c, int n, ... ) 372 __attribute__((sentinel)); 373 int vips_rshift_const( VipsImage *in, VipsImage **out, 374 const double *c, int n, ... ) 375 __attribute__((sentinel)); 376 int vips_boolean_const1( VipsImage *in, VipsImage **out, 377 VipsOperationBoolean boolean, double c, ... ) 378 __attribute__((sentinel)); 379 int vips_andimage_const1( VipsImage *in, VipsImage **out, double c, ... ) 380 __attribute__((sentinel)); 381 int vips_orimage_const1( VipsImage *in, VipsImage **out, double c, ... ) 382 __attribute__((sentinel)); 383 int vips_eorimage_const1( VipsImage *in, VipsImage **out, double c, ... ) 384 __attribute__((sentinel)); 385 int vips_lshift_const1( VipsImage *in, VipsImage **out, double c, ... ) 386 __attribute__((sentinel)); 387 int vips_rshift_const1( VipsImage *in, VipsImage **out, double c, ... ) 388 __attribute__((sentinel)); 389 390 int vips_math2( VipsImage *left, VipsImage *right, VipsImage **out, 391 VipsOperationMath2 math2, ... ) 392 __attribute__((sentinel)); 393 int vips_pow( VipsImage *left, VipsImage *right, VipsImage **out, ... ) 394 __attribute__((sentinel)); 395 int vips_wop( VipsImage *left, VipsImage *right, VipsImage **out, ... ) 396 __attribute__((sentinel)); 397 int vips_atan2( VipsImage *left, VipsImage *right, VipsImage **out, ... ) 398 __attribute__((sentinel)); 399 int vips_math2_const( VipsImage *in, VipsImage **out, 400 VipsOperationMath2 math2, const double *c, int n, ... ) 401 __attribute__((sentinel)); 402 int vips_pow_const( VipsImage *in, VipsImage **out, 403 const double *c, int n, ... ) 404 __attribute__((sentinel)); 405 int vips_wop_const( VipsImage *in, VipsImage **out, 406 const double *c, int n, ... ) 407 __attribute__((sentinel)); 408 int vips_atan2_const( VipsImage *in, VipsImage **out, 409 const double *c, int n, ... ) 410 __attribute__((sentinel)); 411 int vips_math2_const1( VipsImage *in, VipsImage **out, 412 VipsOperationMath2 math2, double c, ... ) 413 __attribute__((sentinel)); 414 int vips_pow_const1( VipsImage *in, VipsImage **out, double c, ... ) 415 __attribute__((sentinel)); 416 int vips_wop_const1( VipsImage *in, VipsImage **out, double c, ... ) 417 __attribute__((sentinel)); 418 int vips_atan2_const1( VipsImage *in, VipsImage **out, double c, ... ) 419 __attribute__((sentinel)); 420 421 int vips_avg( VipsImage *in, double *out, ... ) 422 __attribute__((sentinel)); 423 int vips_deviate( VipsImage *in, double *out, ... ) 424 __attribute__((sentinel)); 425 int vips_min( VipsImage *in, double *out, ... ) 426 __attribute__((sentinel)); 427 int vips_max( VipsImage *in, double *out, ... ) 428 __attribute__((sentinel)); 429 int vips_stats( VipsImage *in, VipsImage **out, ... ) 430 __attribute__((sentinel)); 431 int vips_measure( VipsImage *in, VipsImage **out, int h, int v, ... ) 432 __attribute__((sentinel)); 433 int vips_find_trim( VipsImage *in, 434 int *left, int *top, int *width, int *height, ... ) 435 __attribute__((sentinel)); 436 int vips_getpoint( VipsImage *in, double **vector, int *n, int x, int y, ... ) 437 __attribute__((sentinel)); 438 int vips_hist_find( VipsImage *in, VipsImage **out, ... ) 439 __attribute__((sentinel)); 440 int vips_hist_find_ndim( VipsImage *in, VipsImage **out, ... ) 441 __attribute__((sentinel)); 442 int vips_hist_find_indexed( VipsImage *in, VipsImage *index, 443 VipsImage **out, ... ) 444 __attribute__((sentinel)); 445 int vips_hough_line( VipsImage *in, VipsImage **out, ... ) 446 __attribute__((sentinel)); 447 int vips_hough_circle( VipsImage *in, VipsImage **out, ... ) 448 __attribute__((sentinel)); 449 int vips_project( VipsImage *in, VipsImage **columns, VipsImage **rows, ... ) 450 __attribute__((sentinel)); 451 int vips_profile( VipsImage *in, VipsImage **columns, VipsImage **rows, ... ) 452 __attribute__((sentinel)); 453 454 #ifdef __cplusplus 455 } 456 #endif /*__cplusplus*/ 457 458 #endif /*VIPS_ARITHMETIC_H*/ 459