gimpdrawabletransform_pdb.c 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918
  1. /* LIBGIMP - The GIMP Library
  2. * Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
  3. *
  4. * gimpdrawabletransform_pdb.c
  5. *
  6. * This library is free software: you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 3 of the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with this library. If not, see
  18. * <http://www.gnu.org/licenses/>.
  19. */
  20. /* NOTE: This file is auto-generated by pdbgen.pl */
  21. #include "config.h"
  22. #include "gimp.h"
  23. /**
  24. * SECTION: gimpdrawabletransform
  25. * @title: gimpdrawabletransform
  26. * @short_description: Functions to perform transformatrions on drawables.
  27. *
  28. * Functions to perform transformatrions on drawables.
  29. **/
  30. /**
  31. * gimp_drawable_transform_flip_simple:
  32. * @drawable_ID: The affected drawable.
  33. * @flip_type: Type of flip.
  34. * @auto_center: Whether to automatically position the axis in the selection center.
  35. * @axis: coord. of flip axis.
  36. * @clip_result: Whether to clip results.
  37. *
  38. * Deprecated: Use gimp_item_transform_flip_simple() instead.
  39. *
  40. * Returns: The flipped drawable.
  41. *
  42. * Since: GIMP 2.2
  43. **/
  44. gint32
  45. gimp_drawable_transform_flip_simple (gint32 drawable_ID,
  46. GimpOrientationType flip_type,
  47. gboolean auto_center,
  48. gdouble axis,
  49. gboolean clip_result)
  50. {
  51. GimpParam *return_vals;
  52. gint nreturn_vals;
  53. gint32 ret_drawable_ID = -1;
  54. return_vals = gimp_run_procedure ("gimp-drawable-transform-flip-simple",
  55. &nreturn_vals,
  56. GIMP_PDB_DRAWABLE, drawable_ID,
  57. GIMP_PDB_INT32, flip_type,
  58. GIMP_PDB_INT32, auto_center,
  59. GIMP_PDB_FLOAT, axis,
  60. GIMP_PDB_INT32, clip_result,
  61. GIMP_PDB_END);
  62. if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
  63. ret_drawable_ID = return_vals[1].data.d_drawable;
  64. gimp_destroy_params (return_vals, nreturn_vals);
  65. return ret_drawable_ID;
  66. }
  67. /**
  68. * gimp_drawable_transform_flip:
  69. * @drawable_ID: The affected drawable.
  70. * @x0: horz. coord. of one end of axis.
  71. * @y0: vert. coord. of one end of axis.
  72. * @x1: horz. coord. of other end of axis.
  73. * @y1: vert. coord. of other end of axis.
  74. * @transform_direction: Direction of transformation.
  75. * @interpolation: Type of interpolation.
  76. * @supersample: This parameter is ignored, supersampling is performed based on the interpolation type.
  77. * @recursion_level: Maximum recursion level used for supersampling (3 is a nice value).
  78. * @clip_result: Whether to clip results.
  79. *
  80. * Deprecated: Use gimp_item_transform_flip() instead.
  81. *
  82. * Returns: The flipped drawable.
  83. *
  84. * Since: GIMP 2.2
  85. **/
  86. gint32
  87. gimp_drawable_transform_flip (gint32 drawable_ID,
  88. gdouble x0,
  89. gdouble y0,
  90. gdouble x1,
  91. gdouble y1,
  92. GimpTransformDirection transform_direction,
  93. GimpInterpolationType interpolation,
  94. gboolean supersample,
  95. gint recursion_level,
  96. gboolean clip_result)
  97. {
  98. GimpParam *return_vals;
  99. gint nreturn_vals;
  100. gint32 ret_drawable_ID = -1;
  101. return_vals = gimp_run_procedure ("gimp-drawable-transform-flip",
  102. &nreturn_vals,
  103. GIMP_PDB_DRAWABLE, drawable_ID,
  104. GIMP_PDB_FLOAT, x0,
  105. GIMP_PDB_FLOAT, y0,
  106. GIMP_PDB_FLOAT, x1,
  107. GIMP_PDB_FLOAT, y1,
  108. GIMP_PDB_INT32, transform_direction,
  109. GIMP_PDB_INT32, interpolation,
  110. GIMP_PDB_INT32, supersample,
  111. GIMP_PDB_INT32, recursion_level,
  112. GIMP_PDB_INT32, clip_result,
  113. GIMP_PDB_END);
  114. if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
  115. ret_drawable_ID = return_vals[1].data.d_drawable;
  116. gimp_destroy_params (return_vals, nreturn_vals);
  117. return ret_drawable_ID;
  118. }
  119. /**
  120. * gimp_drawable_transform_flip_default:
  121. * @drawable_ID: The affected drawable.
  122. * @x0: horz. coord. of one end of axis.
  123. * @y0: vert. coord. of one end of axis.
  124. * @x1: horz. coord. of other end of axis.
  125. * @y1: vert. coord. of other end of axis.
  126. * @interpolate: Whether to use interpolation and supersampling.
  127. * @clip_result: Whether to clip results.
  128. *
  129. * Deprecated: Use gimp_item_transform_flip() instead.
  130. *
  131. * Returns: The flipped drawable.
  132. *
  133. * Since: GIMP 2.2
  134. **/
  135. gint32
  136. gimp_drawable_transform_flip_default (gint32 drawable_ID,
  137. gdouble x0,
  138. gdouble y0,
  139. gdouble x1,
  140. gdouble y1,
  141. gboolean interpolate,
  142. gboolean clip_result)
  143. {
  144. GimpParam *return_vals;
  145. gint nreturn_vals;
  146. gint32 ret_drawable_ID = -1;
  147. return_vals = gimp_run_procedure ("gimp-drawable-transform-flip-default",
  148. &nreturn_vals,
  149. GIMP_PDB_DRAWABLE, drawable_ID,
  150. GIMP_PDB_FLOAT, x0,
  151. GIMP_PDB_FLOAT, y0,
  152. GIMP_PDB_FLOAT, x1,
  153. GIMP_PDB_FLOAT, y1,
  154. GIMP_PDB_INT32, interpolate,
  155. GIMP_PDB_INT32, clip_result,
  156. GIMP_PDB_END);
  157. if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
  158. ret_drawable_ID = return_vals[1].data.d_drawable;
  159. gimp_destroy_params (return_vals, nreturn_vals);
  160. return ret_drawable_ID;
  161. }
  162. /**
  163. * gimp_drawable_transform_perspective:
  164. * @drawable_ID: The affected drawable.
  165. * @x0: The new x coordinate of upper-left corner of original bounding box.
  166. * @y0: The new y coordinate of upper-left corner of original bounding box.
  167. * @x1: The new x coordinate of upper-right corner of original bounding box.
  168. * @y1: The new y coordinate of upper-right corner of original bounding box.
  169. * @x2: The new x coordinate of lower-left corner of original bounding box.
  170. * @y2: The new y coordinate of lower-left corner of original bounding box.
  171. * @x3: The new x coordinate of lower-right corner of original bounding box.
  172. * @y3: The new y coordinate of lower-right corner of original bounding box.
  173. * @transform_direction: Direction of transformation.
  174. * @interpolation: Type of interpolation.
  175. * @supersample: This parameter is ignored, supersampling is performed based on the interpolation type.
  176. * @recursion_level: Maximum recursion level used for supersampling (3 is a nice value).
  177. * @clip_result: How to clip results.
  178. *
  179. * Deprecated: Use gimp_item_transform_perspective() instead.
  180. *
  181. * Returns: The newly mapped drawable.
  182. *
  183. * Since: GIMP 2.2
  184. **/
  185. gint32
  186. gimp_drawable_transform_perspective (gint32 drawable_ID,
  187. gdouble x0,
  188. gdouble y0,
  189. gdouble x1,
  190. gdouble y1,
  191. gdouble x2,
  192. gdouble y2,
  193. gdouble x3,
  194. gdouble y3,
  195. GimpTransformDirection transform_direction,
  196. GimpInterpolationType interpolation,
  197. gboolean supersample,
  198. gint recursion_level,
  199. GimpTransformResize clip_result)
  200. {
  201. GimpParam *return_vals;
  202. gint nreturn_vals;
  203. gint32 ret_drawable_ID = -1;
  204. return_vals = gimp_run_procedure ("gimp-drawable-transform-perspective",
  205. &nreturn_vals,
  206. GIMP_PDB_DRAWABLE, drawable_ID,
  207. GIMP_PDB_FLOAT, x0,
  208. GIMP_PDB_FLOAT, y0,
  209. GIMP_PDB_FLOAT, x1,
  210. GIMP_PDB_FLOAT, y1,
  211. GIMP_PDB_FLOAT, x2,
  212. GIMP_PDB_FLOAT, y2,
  213. GIMP_PDB_FLOAT, x3,
  214. GIMP_PDB_FLOAT, y3,
  215. GIMP_PDB_INT32, transform_direction,
  216. GIMP_PDB_INT32, interpolation,
  217. GIMP_PDB_INT32, supersample,
  218. GIMP_PDB_INT32, recursion_level,
  219. GIMP_PDB_INT32, clip_result,
  220. GIMP_PDB_END);
  221. if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
  222. ret_drawable_ID = return_vals[1].data.d_drawable;
  223. gimp_destroy_params (return_vals, nreturn_vals);
  224. return ret_drawable_ID;
  225. }
  226. /**
  227. * gimp_drawable_transform_perspective_default:
  228. * @drawable_ID: The affected drawable.
  229. * @x0: The new x coordinate of upper-left corner of original bounding box.
  230. * @y0: The new y coordinate of upper-left corner of original bounding box.
  231. * @x1: The new x coordinate of upper-right corner of original bounding box.
  232. * @y1: The new y coordinate of upper-right corner of original bounding box.
  233. * @x2: The new x coordinate of lower-left corner of original bounding box.
  234. * @y2: The new y coordinate of lower-left corner of original bounding box.
  235. * @x3: The new x coordinate of lower-right corner of original bounding box.
  236. * @y3: The new y coordinate of lower-right corner of original bounding box.
  237. * @interpolate: Whether to use interpolation and supersampling.
  238. * @clip_result: How to clip results.
  239. *
  240. * Deprecated: Use gimp_item_transform_perspective() instead.
  241. *
  242. * Returns: The newly mapped drawable.
  243. *
  244. * Since: GIMP 2.2
  245. **/
  246. gint32
  247. gimp_drawable_transform_perspective_default (gint32 drawable_ID,
  248. gdouble x0,
  249. gdouble y0,
  250. gdouble x1,
  251. gdouble y1,
  252. gdouble x2,
  253. gdouble y2,
  254. gdouble x3,
  255. gdouble y3,
  256. gboolean interpolate,
  257. GimpTransformResize clip_result)
  258. {
  259. GimpParam *return_vals;
  260. gint nreturn_vals;
  261. gint32 ret_drawable_ID = -1;
  262. return_vals = gimp_run_procedure ("gimp-drawable-transform-perspective-default",
  263. &nreturn_vals,
  264. GIMP_PDB_DRAWABLE, drawable_ID,
  265. GIMP_PDB_FLOAT, x0,
  266. GIMP_PDB_FLOAT, y0,
  267. GIMP_PDB_FLOAT, x1,
  268. GIMP_PDB_FLOAT, y1,
  269. GIMP_PDB_FLOAT, x2,
  270. GIMP_PDB_FLOAT, y2,
  271. GIMP_PDB_FLOAT, x3,
  272. GIMP_PDB_FLOAT, y3,
  273. GIMP_PDB_INT32, interpolate,
  274. GIMP_PDB_INT32, clip_result,
  275. GIMP_PDB_END);
  276. if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
  277. ret_drawable_ID = return_vals[1].data.d_drawable;
  278. gimp_destroy_params (return_vals, nreturn_vals);
  279. return ret_drawable_ID;
  280. }
  281. /**
  282. * gimp_drawable_transform_rotate_simple:
  283. * @drawable_ID: The affected drawable.
  284. * @rotate_type: Type of rotation.
  285. * @auto_center: Whether to automatically rotate around the selection center.
  286. * @center_x: The hor. coordinate of the center of rotation.
  287. * @center_y: The vert. coordinate of the center of rotation.
  288. * @clip_result: Whether to clip results.
  289. *
  290. * Deprecated: Use gimp_item_transform_rotate_simple() instead.
  291. *
  292. * Returns: The rotated drawable.
  293. *
  294. * Since: GIMP 2.2
  295. **/
  296. gint32
  297. gimp_drawable_transform_rotate_simple (gint32 drawable_ID,
  298. GimpRotationType rotate_type,
  299. gboolean auto_center,
  300. gint center_x,
  301. gint center_y,
  302. gboolean clip_result)
  303. {
  304. GimpParam *return_vals;
  305. gint nreturn_vals;
  306. gint32 ret_drawable_ID = -1;
  307. return_vals = gimp_run_procedure ("gimp-drawable-transform-rotate-simple",
  308. &nreturn_vals,
  309. GIMP_PDB_DRAWABLE, drawable_ID,
  310. GIMP_PDB_INT32, rotate_type,
  311. GIMP_PDB_INT32, auto_center,
  312. GIMP_PDB_INT32, center_x,
  313. GIMP_PDB_INT32, center_y,
  314. GIMP_PDB_INT32, clip_result,
  315. GIMP_PDB_END);
  316. if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
  317. ret_drawable_ID = return_vals[1].data.d_drawable;
  318. gimp_destroy_params (return_vals, nreturn_vals);
  319. return ret_drawable_ID;
  320. }
  321. /**
  322. * gimp_drawable_transform_rotate:
  323. * @drawable_ID: The affected drawable.
  324. * @angle: The angle of rotation (radians).
  325. * @auto_center: Whether to automatically rotate around the selection center.
  326. * @center_x: The hor. coordinate of the center of rotation.
  327. * @center_y: The vert. coordinate of the center of rotation.
  328. * @transform_direction: Direction of transformation.
  329. * @interpolation: Type of interpolation.
  330. * @supersample: This parameter is ignored, supersampling is performed based on the interpolation type.
  331. * @recursion_level: Maximum recursion level used for supersampling (3 is a nice value).
  332. * @clip_result: How to clip results.
  333. *
  334. * Deprecated: Use gimp_item_transform_rotate() instead.
  335. *
  336. * Returns: The rotated drawable.
  337. *
  338. * Since: GIMP 2.2
  339. **/
  340. gint32
  341. gimp_drawable_transform_rotate (gint32 drawable_ID,
  342. gdouble angle,
  343. gboolean auto_center,
  344. gint center_x,
  345. gint center_y,
  346. GimpTransformDirection transform_direction,
  347. GimpInterpolationType interpolation,
  348. gboolean supersample,
  349. gint recursion_level,
  350. GimpTransformResize clip_result)
  351. {
  352. GimpParam *return_vals;
  353. gint nreturn_vals;
  354. gint32 ret_drawable_ID = -1;
  355. return_vals = gimp_run_procedure ("gimp-drawable-transform-rotate",
  356. &nreturn_vals,
  357. GIMP_PDB_DRAWABLE, drawable_ID,
  358. GIMP_PDB_FLOAT, angle,
  359. GIMP_PDB_INT32, auto_center,
  360. GIMP_PDB_INT32, center_x,
  361. GIMP_PDB_INT32, center_y,
  362. GIMP_PDB_INT32, transform_direction,
  363. GIMP_PDB_INT32, interpolation,
  364. GIMP_PDB_INT32, supersample,
  365. GIMP_PDB_INT32, recursion_level,
  366. GIMP_PDB_INT32, clip_result,
  367. GIMP_PDB_END);
  368. if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
  369. ret_drawable_ID = return_vals[1].data.d_drawable;
  370. gimp_destroy_params (return_vals, nreturn_vals);
  371. return ret_drawable_ID;
  372. }
  373. /**
  374. * gimp_drawable_transform_rotate_default:
  375. * @drawable_ID: The affected drawable.
  376. * @angle: The angle of rotation (radians).
  377. * @auto_center: Whether to automatically rotate around the selection center.
  378. * @center_x: The hor. coordinate of the center of rotation.
  379. * @center_y: The vert. coordinate of the center of rotation.
  380. * @interpolate: Whether to use interpolation and supersampling.
  381. * @clip_result: How to clip results.
  382. *
  383. * Deprecated: Use gimp_item_transform_rotate() instead.
  384. *
  385. * Returns: The rotated drawable.
  386. *
  387. * Since: GIMP 2.2
  388. **/
  389. gint32
  390. gimp_drawable_transform_rotate_default (gint32 drawable_ID,
  391. gdouble angle,
  392. gboolean auto_center,
  393. gint center_x,
  394. gint center_y,
  395. gboolean interpolate,
  396. GimpTransformResize clip_result)
  397. {
  398. GimpParam *return_vals;
  399. gint nreturn_vals;
  400. gint32 ret_drawable_ID = -1;
  401. return_vals = gimp_run_procedure ("gimp-drawable-transform-rotate-default",
  402. &nreturn_vals,
  403. GIMP_PDB_DRAWABLE, drawable_ID,
  404. GIMP_PDB_FLOAT, angle,
  405. GIMP_PDB_INT32, auto_center,
  406. GIMP_PDB_INT32, center_x,
  407. GIMP_PDB_INT32, center_y,
  408. GIMP_PDB_INT32, interpolate,
  409. GIMP_PDB_INT32, clip_result,
  410. GIMP_PDB_END);
  411. if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
  412. ret_drawable_ID = return_vals[1].data.d_drawable;
  413. gimp_destroy_params (return_vals, nreturn_vals);
  414. return ret_drawable_ID;
  415. }
  416. /**
  417. * gimp_drawable_transform_scale:
  418. * @drawable_ID: The affected drawable.
  419. * @x0: The new x coordinate of the upper-left corner of the scaled region.
  420. * @y0: The new y coordinate of the upper-left corner of the scaled region.
  421. * @x1: The new x coordinate of the lower-right corner of the scaled region.
  422. * @y1: The new y coordinate of the lower-right corner of the scaled region.
  423. * @transform_direction: Direction of transformation.
  424. * @interpolation: Type of interpolation.
  425. * @supersample: This parameter is ignored, supersampling is performed based on the interpolation type.
  426. * @recursion_level: Maximum recursion level used for supersampling (3 is a nice value).
  427. * @clip_result: How to clip results.
  428. *
  429. * Deprecated: Use gimp_item_transform_scale() instead.
  430. *
  431. * Returns: The scaled drawable.
  432. *
  433. * Since: GIMP 2.2
  434. **/
  435. gint32
  436. gimp_drawable_transform_scale (gint32 drawable_ID,
  437. gdouble x0,
  438. gdouble y0,
  439. gdouble x1,
  440. gdouble y1,
  441. GimpTransformDirection transform_direction,
  442. GimpInterpolationType interpolation,
  443. gboolean supersample,
  444. gint recursion_level,
  445. GimpTransformResize clip_result)
  446. {
  447. GimpParam *return_vals;
  448. gint nreturn_vals;
  449. gint32 ret_drawable_ID = -1;
  450. return_vals = gimp_run_procedure ("gimp-drawable-transform-scale",
  451. &nreturn_vals,
  452. GIMP_PDB_DRAWABLE, drawable_ID,
  453. GIMP_PDB_FLOAT, x0,
  454. GIMP_PDB_FLOAT, y0,
  455. GIMP_PDB_FLOAT, x1,
  456. GIMP_PDB_FLOAT, y1,
  457. GIMP_PDB_INT32, transform_direction,
  458. GIMP_PDB_INT32, interpolation,
  459. GIMP_PDB_INT32, supersample,
  460. GIMP_PDB_INT32, recursion_level,
  461. GIMP_PDB_INT32, clip_result,
  462. GIMP_PDB_END);
  463. if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
  464. ret_drawable_ID = return_vals[1].data.d_drawable;
  465. gimp_destroy_params (return_vals, nreturn_vals);
  466. return ret_drawable_ID;
  467. }
  468. /**
  469. * gimp_drawable_transform_scale_default:
  470. * @drawable_ID: The affected drawable.
  471. * @x0: The new x coordinate of the upper-left corner of the scaled region.
  472. * @y0: The new y coordinate of the upper-left corner of the scaled region.
  473. * @x1: The new x coordinate of the lower-right corner of the scaled region.
  474. * @y1: The new y coordinate of the lower-right corner of the scaled region.
  475. * @interpolate: Whether to use interpolation and supersampling.
  476. * @clip_result: How to clip results.
  477. *
  478. * Deprecated: Use gimp_item_transform_scale() instead.
  479. *
  480. * Returns: The scaled drawable.
  481. *
  482. * Since: GIMP 2.2
  483. **/
  484. gint32
  485. gimp_drawable_transform_scale_default (gint32 drawable_ID,
  486. gdouble x0,
  487. gdouble y0,
  488. gdouble x1,
  489. gdouble y1,
  490. gboolean interpolate,
  491. GimpTransformResize clip_result)
  492. {
  493. GimpParam *return_vals;
  494. gint nreturn_vals;
  495. gint32 ret_drawable_ID = -1;
  496. return_vals = gimp_run_procedure ("gimp-drawable-transform-scale-default",
  497. &nreturn_vals,
  498. GIMP_PDB_DRAWABLE, drawable_ID,
  499. GIMP_PDB_FLOAT, x0,
  500. GIMP_PDB_FLOAT, y0,
  501. GIMP_PDB_FLOAT, x1,
  502. GIMP_PDB_FLOAT, y1,
  503. GIMP_PDB_INT32, interpolate,
  504. GIMP_PDB_INT32, clip_result,
  505. GIMP_PDB_END);
  506. if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
  507. ret_drawable_ID = return_vals[1].data.d_drawable;
  508. gimp_destroy_params (return_vals, nreturn_vals);
  509. return ret_drawable_ID;
  510. }
  511. /**
  512. * gimp_drawable_transform_shear:
  513. * @drawable_ID: The affected drawable.
  514. * @shear_type: Type of shear.
  515. * @magnitude: The magnitude of the shear.
  516. * @transform_direction: Direction of transformation.
  517. * @interpolation: Type of interpolation.
  518. * @supersample: This parameter is ignored, supersampling is performed based on the interpolation type.
  519. * @recursion_level: Maximum recursion level used for supersampling (3 is a nice value).
  520. * @clip_result: How to clip results.
  521. *
  522. * Deprecated: Use gimp_item_transform_shear() instead.
  523. *
  524. * Returns: The sheared drawable.
  525. *
  526. * Since: GIMP 2.2
  527. **/
  528. gint32
  529. gimp_drawable_transform_shear (gint32 drawable_ID,
  530. GimpOrientationType shear_type,
  531. gdouble magnitude,
  532. GimpTransformDirection transform_direction,
  533. GimpInterpolationType interpolation,
  534. gboolean supersample,
  535. gint recursion_level,
  536. GimpTransformResize clip_result)
  537. {
  538. GimpParam *return_vals;
  539. gint nreturn_vals;
  540. gint32 ret_drawable_ID = -1;
  541. return_vals = gimp_run_procedure ("gimp-drawable-transform-shear",
  542. &nreturn_vals,
  543. GIMP_PDB_DRAWABLE, drawable_ID,
  544. GIMP_PDB_INT32, shear_type,
  545. GIMP_PDB_FLOAT, magnitude,
  546. GIMP_PDB_INT32, transform_direction,
  547. GIMP_PDB_INT32, interpolation,
  548. GIMP_PDB_INT32, supersample,
  549. GIMP_PDB_INT32, recursion_level,
  550. GIMP_PDB_INT32, clip_result,
  551. GIMP_PDB_END);
  552. if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
  553. ret_drawable_ID = return_vals[1].data.d_drawable;
  554. gimp_destroy_params (return_vals, nreturn_vals);
  555. return ret_drawable_ID;
  556. }
  557. /**
  558. * gimp_drawable_transform_shear_default:
  559. * @drawable_ID: The affected drawable.
  560. * @shear_type: Type of shear.
  561. * @magnitude: The magnitude of the shear.
  562. * @interpolate: Whether to use interpolation and supersampling.
  563. * @clip_result: How to clip results.
  564. *
  565. * Deprecated: Use gimp_item_transform_shear() instead.
  566. *
  567. * Returns: The sheared drawable.
  568. *
  569. * Since: GIMP 2.2
  570. **/
  571. gint32
  572. gimp_drawable_transform_shear_default (gint32 drawable_ID,
  573. GimpOrientationType shear_type,
  574. gdouble magnitude,
  575. gboolean interpolate,
  576. GimpTransformResize clip_result)
  577. {
  578. GimpParam *return_vals;
  579. gint nreturn_vals;
  580. gint32 ret_drawable_ID = -1;
  581. return_vals = gimp_run_procedure ("gimp-drawable-transform-shear-default",
  582. &nreturn_vals,
  583. GIMP_PDB_DRAWABLE, drawable_ID,
  584. GIMP_PDB_INT32, shear_type,
  585. GIMP_PDB_FLOAT, magnitude,
  586. GIMP_PDB_INT32, interpolate,
  587. GIMP_PDB_INT32, clip_result,
  588. GIMP_PDB_END);
  589. if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
  590. ret_drawable_ID = return_vals[1].data.d_drawable;
  591. gimp_destroy_params (return_vals, nreturn_vals);
  592. return ret_drawable_ID;
  593. }
  594. /**
  595. * gimp_drawable_transform_2d:
  596. * @drawable_ID: The affected drawable.
  597. * @source_x: X coordinate of the transformation center.
  598. * @source_y: Y coordinate of the transformation center.
  599. * @scale_x: Amount to scale in x direction.
  600. * @scale_y: Amount to scale in y direction.
  601. * @angle: The angle of rotation (radians).
  602. * @dest_x: X coordinate of where the center goes.
  603. * @dest_y: Y coordinate of where the center goes.
  604. * @transform_direction: Direction of transformation.
  605. * @interpolation: Type of interpolation.
  606. * @supersample: This parameter is ignored, supersampling is performed based on the interpolation type.
  607. * @recursion_level: Maximum recursion level used for supersampling (3 is a nice value).
  608. * @clip_result: How to clip results.
  609. *
  610. * Deprecated: Use gimp_item_transform_2d() instead.
  611. *
  612. * Returns: The transformed drawable.
  613. *
  614. * Since: GIMP 2.2
  615. **/
  616. gint32
  617. gimp_drawable_transform_2d (gint32 drawable_ID,
  618. gdouble source_x,
  619. gdouble source_y,
  620. gdouble scale_x,
  621. gdouble scale_y,
  622. gdouble angle,
  623. gdouble dest_x,
  624. gdouble dest_y,
  625. GimpTransformDirection transform_direction,
  626. GimpInterpolationType interpolation,
  627. gboolean supersample,
  628. gint recursion_level,
  629. GimpTransformResize clip_result)
  630. {
  631. GimpParam *return_vals;
  632. gint nreturn_vals;
  633. gint32 ret_drawable_ID = -1;
  634. return_vals = gimp_run_procedure ("gimp-drawable-transform-2d",
  635. &nreturn_vals,
  636. GIMP_PDB_DRAWABLE, drawable_ID,
  637. GIMP_PDB_FLOAT, source_x,
  638. GIMP_PDB_FLOAT, source_y,
  639. GIMP_PDB_FLOAT, scale_x,
  640. GIMP_PDB_FLOAT, scale_y,
  641. GIMP_PDB_FLOAT, angle,
  642. GIMP_PDB_FLOAT, dest_x,
  643. GIMP_PDB_FLOAT, dest_y,
  644. GIMP_PDB_INT32, transform_direction,
  645. GIMP_PDB_INT32, interpolation,
  646. GIMP_PDB_INT32, supersample,
  647. GIMP_PDB_INT32, recursion_level,
  648. GIMP_PDB_INT32, clip_result,
  649. GIMP_PDB_END);
  650. if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
  651. ret_drawable_ID = return_vals[1].data.d_drawable;
  652. gimp_destroy_params (return_vals, nreturn_vals);
  653. return ret_drawable_ID;
  654. }
  655. /**
  656. * gimp_drawable_transform_2d_default:
  657. * @drawable_ID: The affected drawable.
  658. * @source_x: X coordinate of the transformation center.
  659. * @source_y: Y coordinate of the transformation center.
  660. * @scale_x: Amount to scale in x direction.
  661. * @scale_y: Amount to scale in y direction.
  662. * @angle: The angle of rotation (radians).
  663. * @dest_x: X coordinate of where the center goes.
  664. * @dest_y: Y coordinate of where the center goes.
  665. * @interpolate: Whether to use interpolation and supersampling.
  666. * @clip_result: How to clip results.
  667. *
  668. * Deprecated: Use gimp_item_transform_2d() instead.
  669. *
  670. * Returns: The transformed drawable.
  671. *
  672. * Since: GIMP 2.2
  673. **/
  674. gint32
  675. gimp_drawable_transform_2d_default (gint32 drawable_ID,
  676. gdouble source_x,
  677. gdouble source_y,
  678. gdouble scale_x,
  679. gdouble scale_y,
  680. gdouble angle,
  681. gdouble dest_x,
  682. gdouble dest_y,
  683. gboolean interpolate,
  684. GimpTransformResize clip_result)
  685. {
  686. GimpParam *return_vals;
  687. gint nreturn_vals;
  688. gint32 ret_drawable_ID = -1;
  689. return_vals = gimp_run_procedure ("gimp-drawable-transform-2d-default",
  690. &nreturn_vals,
  691. GIMP_PDB_DRAWABLE, drawable_ID,
  692. GIMP_PDB_FLOAT, source_x,
  693. GIMP_PDB_FLOAT, source_y,
  694. GIMP_PDB_FLOAT, scale_x,
  695. GIMP_PDB_FLOAT, scale_y,
  696. GIMP_PDB_FLOAT, angle,
  697. GIMP_PDB_FLOAT, dest_x,
  698. GIMP_PDB_FLOAT, dest_y,
  699. GIMP_PDB_INT32, interpolate,
  700. GIMP_PDB_INT32, clip_result,
  701. GIMP_PDB_END);
  702. if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
  703. ret_drawable_ID = return_vals[1].data.d_drawable;
  704. gimp_destroy_params (return_vals, nreturn_vals);
  705. return ret_drawable_ID;
  706. }
  707. /**
  708. * gimp_drawable_transform_matrix:
  709. * @drawable_ID: The affected drawable.
  710. * @coeff_0_0: coefficient (0,0) of the transformation matrix.
  711. * @coeff_0_1: coefficient (0,1) of the transformation matrix.
  712. * @coeff_0_2: coefficient (0,2) of the transformation matrix.
  713. * @coeff_1_0: coefficient (1,0) of the transformation matrix.
  714. * @coeff_1_1: coefficient (1,1) of the transformation matrix.
  715. * @coeff_1_2: coefficient (1,2) of the transformation matrix.
  716. * @coeff_2_0: coefficient (2,0) of the transformation matrix.
  717. * @coeff_2_1: coefficient (2,1) of the transformation matrix.
  718. * @coeff_2_2: coefficient (2,2) of the transformation matrix.
  719. * @transform_direction: Direction of transformation.
  720. * @interpolation: Type of interpolation.
  721. * @supersample: This parameter is ignored, supersampling is performed based on the interpolation type.
  722. * @recursion_level: Maximum recursion level used for supersampling (3 is a nice value).
  723. * @clip_result: How to clip results.
  724. *
  725. * Deprecated: Use gimp_item_transform_matrix() instead.
  726. *
  727. * Returns: The transformed drawable.
  728. *
  729. * Since: GIMP 2.2
  730. **/
  731. gint32
  732. gimp_drawable_transform_matrix (gint32 drawable_ID,
  733. gdouble coeff_0_0,
  734. gdouble coeff_0_1,
  735. gdouble coeff_0_2,
  736. gdouble coeff_1_0,
  737. gdouble coeff_1_1,
  738. gdouble coeff_1_2,
  739. gdouble coeff_2_0,
  740. gdouble coeff_2_1,
  741. gdouble coeff_2_2,
  742. GimpTransformDirection transform_direction,
  743. GimpInterpolationType interpolation,
  744. gboolean supersample,
  745. gint recursion_level,
  746. GimpTransformResize clip_result)
  747. {
  748. GimpParam *return_vals;
  749. gint nreturn_vals;
  750. gint32 ret_drawable_ID = -1;
  751. return_vals = gimp_run_procedure ("gimp-drawable-transform-matrix",
  752. &nreturn_vals,
  753. GIMP_PDB_DRAWABLE, drawable_ID,
  754. GIMP_PDB_FLOAT, coeff_0_0,
  755. GIMP_PDB_FLOAT, coeff_0_1,
  756. GIMP_PDB_FLOAT, coeff_0_2,
  757. GIMP_PDB_FLOAT, coeff_1_0,
  758. GIMP_PDB_FLOAT, coeff_1_1,
  759. GIMP_PDB_FLOAT, coeff_1_2,
  760. GIMP_PDB_FLOAT, coeff_2_0,
  761. GIMP_PDB_FLOAT, coeff_2_1,
  762. GIMP_PDB_FLOAT, coeff_2_2,
  763. GIMP_PDB_INT32, transform_direction,
  764. GIMP_PDB_INT32, interpolation,
  765. GIMP_PDB_INT32, supersample,
  766. GIMP_PDB_INT32, recursion_level,
  767. GIMP_PDB_INT32, clip_result,
  768. GIMP_PDB_END);
  769. if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
  770. ret_drawable_ID = return_vals[1].data.d_drawable;
  771. gimp_destroy_params (return_vals, nreturn_vals);
  772. return ret_drawable_ID;
  773. }
  774. /**
  775. * gimp_drawable_transform_matrix_default:
  776. * @drawable_ID: The affected drawable.
  777. * @coeff_0_0: coefficient (0,0) of the transformation matrix.
  778. * @coeff_0_1: coefficient (0,1) of the transformation matrix.
  779. * @coeff_0_2: coefficient (0,2) of the transformation matrix.
  780. * @coeff_1_0: coefficient (1,0) of the transformation matrix.
  781. * @coeff_1_1: coefficient (1,1) of the transformation matrix.
  782. * @coeff_1_2: coefficient (1,2) of the transformation matrix.
  783. * @coeff_2_0: coefficient (2,0) of the transformation matrix.
  784. * @coeff_2_1: coefficient (2,1) of the transformation matrix.
  785. * @coeff_2_2: coefficient (2,2) of the transformation matrix.
  786. * @interpolate: Whether to use interpolation and supersampling.
  787. * @clip_result: How to clip results.
  788. *
  789. * Deprecated: Use gimp_item_transform_matrix() instead.
  790. *
  791. * Returns: The transformed drawable.
  792. *
  793. * Since: GIMP 2.2
  794. **/
  795. gint32
  796. gimp_drawable_transform_matrix_default (gint32 drawable_ID,
  797. gdouble coeff_0_0,
  798. gdouble coeff_0_1,
  799. gdouble coeff_0_2,
  800. gdouble coeff_1_0,
  801. gdouble coeff_1_1,
  802. gdouble coeff_1_2,
  803. gdouble coeff_2_0,
  804. gdouble coeff_2_1,
  805. gdouble coeff_2_2,
  806. gboolean interpolate,
  807. GimpTransformResize clip_result)
  808. {
  809. GimpParam *return_vals;
  810. gint nreturn_vals;
  811. gint32 ret_drawable_ID = -1;
  812. return_vals = gimp_run_procedure ("gimp-drawable-transform-matrix-default",
  813. &nreturn_vals,
  814. GIMP_PDB_DRAWABLE, drawable_ID,
  815. GIMP_PDB_FLOAT, coeff_0_0,
  816. GIMP_PDB_FLOAT, coeff_0_1,
  817. GIMP_PDB_FLOAT, coeff_0_2,
  818. GIMP_PDB_FLOAT, coeff_1_0,
  819. GIMP_PDB_FLOAT, coeff_1_1,
  820. GIMP_PDB_FLOAT, coeff_1_2,
  821. GIMP_PDB_FLOAT, coeff_2_0,
  822. GIMP_PDB_FLOAT, coeff_2_1,
  823. GIMP_PDB_FLOAT, coeff_2_2,
  824. GIMP_PDB_INT32, interpolate,
  825. GIMP_PDB_INT32, clip_result,
  826. GIMP_PDB_END);
  827. if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
  828. ret_drawable_ID = return_vals[1].data.d_drawable;
  829. gimp_destroy_params (return_vals, nreturn_vals);
  830. return ret_drawable_ID;
  831. }