arithmetic.h 15 KB

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