Improved update_mmap macros
[liblqr.git] / lqr / lqr_carver_priv.h
blob7ca1aa754255b78a506dd037193981a42e9b1953
1 /* LiquidRescaling Library
2 * Copyright (C) 2007-2009 Carlo Baldassi (the "Author") <carlobaldassi@gmail.com>.
3 * All Rights Reserved.
5 * This library implements the algorithm described in the paper
6 * "Seam Carving for Content-Aware Image Resizing"
7 * by Shai Avidan and Ariel Shamir
8 * which can be found at http://www.faculty.idc.ac.il/arik/imret.pdf
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Lesser General Public License as published by
12 * the Free Software Foundation; version 3 dated June, 2007.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, see <http://www.gnu.org/licenses/>
23 #ifndef __LQR_CARVER_PRIV_H__
24 #define __LQR_CARVER_PRIV_H__
26 #ifndef __LQR_BASE_H__
27 #error "lqr_base.h must be included prior to lqr_carver.h"
28 #endif /* __LQR_BASE_H__ */
30 #ifndef __LQR_GRADIENT_H__
31 #error "lqr_gradient.h must be included prior to lqr_carver_priv.h"
32 #endif /* __LQR_GRADIENT_H__ */
34 #ifndef __LQR_READER_WINDOW_PUB_H__
35 #error "lqr_rwindow_pub.h must be included prior to lqr_carver_priv.h"
36 #endif /* __LQR_READER_WINDOW_PUB_H__ */
38 #ifndef __LQR_ENERGY_H__
39 #error "lqr_energy.h must be included prior to lqr_carver_priv.h"
40 #endif /* __LQR_ENERGY_H__ */
42 #ifndef __LQR_CARVER_LIST_H__
43 #error "lqr_carver_list.h must be included prior to lqr_carver_priv.h"
44 #endif /* __LQR_CARVER_LIST_H__ */
46 #ifndef __LQR_VMAP_H__
47 #error "lqr_vmap_priv.h must be included prior to lqr_carver_priv.h"
48 #endif /* __LQR_VMAP_H__ */
50 #ifndef __LQR_VMAP_LIST_H__
51 #error "lqr_vmap_list.h must be included prior to lqr_carver_priv.h"
52 #endif /* __LQR_VMAP_LIST_H__ */
54 /* Macros for internal use */
56 #define AS_8I(x) ((lqr_t_8i*)x)
57 #define AS_16I(x) ((lqr_t_16i*)x)
58 #define AS_32F(x) ((lqr_t_32f*)x)
59 #define AS_64F(x) ((lqr_t_64f*)x)
61 #define AS2_8I(x) ((lqr_t_8i**)x)
62 #define AS2_16I(x) ((lqr_t_16i**)x)
63 #define AS2_32F(x) ((lqr_t_32f**)x)
64 #define AS2_64F(x) ((lqr_t_64f**)x)
66 #define PXL_COPY(dest, dest_ind, src, src_ind, col_depth) G_STMT_START { \
67 switch (col_depth) \
68 { \
69 case LQR_COLDEPTH_8I: \
70 AS_8I(dest)[dest_ind] = AS_8I(src)[src_ind]; \
71 break; \
72 case LQR_COLDEPTH_16I: \
73 AS_16I(dest)[dest_ind] = AS_16I(src)[src_ind]; \
74 break; \
75 case LQR_COLDEPTH_32F: \
76 AS_32F(dest)[dest_ind] = AS_32F(src)[src_ind]; \
77 break; \
78 case LQR_COLDEPTH_64F: \
79 AS_64F(dest)[dest_ind] = AS_64F(src)[src_ind]; \
80 break; \
81 } \
82 } G_STMT_END
84 #define BUF_POINTER_COPY(dest, src, col_depth) G_STMT_START { \
85 switch (col_depth) \
86 { \
87 case LQR_COLDEPTH_8I: \
88 *AS2_8I(dest) = AS_8I(src); \
89 break; \
90 case LQR_COLDEPTH_16I: \
91 *AS2_16I(dest) = AS_16I(src); \
92 break; \
93 case LQR_COLDEPTH_32F: \
94 *AS2_32F(dest) = AS_32F(src); \
95 break; \
96 case LQR_COLDEPTH_64F: \
97 *AS2_64F(dest) = AS_64F(src); \
98 break; \
99 } \
100 } G_STMT_END
102 #define BUF_TRY_NEW_RET_POINTER(dest, size, col_depth) G_STMT_START { \
103 switch (col_depth) \
105 case LQR_COLDEPTH_8I: \
106 TRY_N_N (dest = g_try_new (lqr_t_8i, size)); \
107 break; \
108 case LQR_COLDEPTH_16I: \
109 TRY_N_N (dest = g_try_new (lqr_t_16i, size)); \
110 break; \
111 case LQR_COLDEPTH_32F: \
112 TRY_N_N (dest = g_try_new (lqr_t_32f, size)); \
113 break; \
114 case LQR_COLDEPTH_64F: \
115 TRY_N_N (dest = g_try_new (lqr_t_64f, size)); \
116 break; \
118 } G_STMT_END
120 #define BUF_TRY_NEW0_RET_POINTER(dest, size, col_depth) G_STMT_START { \
121 switch (col_depth) \
123 case LQR_COLDEPTH_8I: \
124 TRY_N_N (dest = g_try_new0 (lqr_t_8i, size)); \
125 break; \
126 case LQR_COLDEPTH_16I: \
127 TRY_N_N (dest = g_try_new0 (lqr_t_16i, size)); \
128 break; \
129 case LQR_COLDEPTH_32F: \
130 TRY_N_N (dest = g_try_new0 (lqr_t_32f, size)); \
131 break; \
132 case LQR_COLDEPTH_64F: \
133 TRY_N_N (dest = g_try_new0 (lqr_t_64f, size)); \
134 break; \
136 } G_STMT_END
138 #define BUF_TRY_NEW0_RET_LQR(dest, size, col_depth) G_STMT_START { \
139 switch (col_depth) \
141 case LQR_COLDEPTH_8I: \
142 LQR_CATCH_MEM (dest = g_try_new0 (lqr_t_8i, size)); \
143 break; \
144 case LQR_COLDEPTH_16I: \
145 LQR_CATCH_MEM (dest = g_try_new0 (lqr_t_16i, size)); \
146 break; \
147 case LQR_COLDEPTH_32F: \
148 LQR_CATCH_MEM (dest = g_try_new0 (lqr_t_32f, size)); \
149 break; \
150 case LQR_COLDEPTH_64F: \
151 LQR_CATCH_MEM (dest = g_try_new0 (lqr_t_64f, size)); \
152 break; \
154 } G_STMT_END
156 #define LQR_CATCH_CANC(carver) G_STMT_START { \
157 if (g_atomic_int_get(&carver->state) == LQR_CARVER_STATE_CANCELLED) \
159 return LQR_USRCANCEL; \
161 } G_STMT_END
163 #define LQR_CATCH_CANC_N(carver) G_STMT_START { \
164 if (g_atomic_int_get(&carver->state) == LQR_CARVER_STATE_CANCELLED) \
166 return NULL; \
168 } G_STMT_END
170 /* Macros for update_mmap speedup : without rigidity */
172 #define DATADOWN(y, x) (r->raw[(y) - 1][(x)])
173 #define MDOWN(y, x) (r->m[DATADOWN((y), (x))])
175 #define MMIN1G(y, x1) (least = DATADOWN((y), (x1)), MDOWN((y), (x1)))
176 #define MMINTESTL(y, x1, x2) (MDOWN((y), (x1)) <= MDOWN((y), (x2)))
177 #define MMINTESTR(y, x1, x2) (MDOWN((y), (x1)) < MDOWN((y), (x2)))
179 #define MMINLGG1(y, n, x1, x2) (MMINTESTL((y), (x1), (x2)) ? MMINL ## n ## G((y), (x1)) : MMINL ## n ## G((y), (x2)))
180 #define MMINLGG2(y, n, x1, x2, ...) (MMINTESTL((y), (x1), (x2)) ? MMINL ## n ## G((y), (x1), __VA_ARGS__ ) : MMINL ## n ## G((y), (x2), __VA_ARGS__ ))
181 #define MMINLGG3(y, n, x1, x2, ...) (MMINTESTL((y), (x1), (x2)) ? MMINL ## n ## G((y), (x1), __VA_ARGS__ ) : MMINL ## n ## G((y), (x2), __VA_ARGS__ ))
182 #define MMINLGG4(y, n, x1, x2, ...) (MMINTESTL((y), (x1), (x2)) ? MMINL ## n ## G((y), (x1), __VA_ARGS__ ) : MMINL ## n ## G((y), (x2), __VA_ARGS__ ))
184 #define MMINRGG1(y, n, x1, x2) (MMINTESTR((y), (x1), (x2)) ? MMINR ## n ## G((y), (x1)) : MMINR ## n ## G((y), (x2)))
185 #define MMINRGG2(y, n, x1, x2, ...) (MMINTESTR((y), (x1), (x2)) ? MMINR ## n ## G((y), (x1), __VA_ARGS__ ) : MMINR ## n ## G((y), (x2), __VA_ARGS__ ))
186 #define MMINRGG3(y, n, x1, x2, ...) (MMINTESTR((y), (x1), (x2)) ? MMINR ## n ## G((y), (x1), __VA_ARGS__ ) : MMINR ## n ## G((y), (x2), __VA_ARGS__ ))
187 #define MMINRGG4(y, n, x1, x2, ...) (MMINTESTR((y), (x1), (x2)) ? MMINR ## n ## G((y), (x1), __VA_ARGS__ ) : MMINR ## n ## G((y), (x2), __VA_ARGS__ ))
189 #define MMINL1G(y, x1) MMIN1G((y), (x1))
190 #define MMINL2G(y, x1, x2) MMINLGG1(y, 1, (x1), (x2))
191 #define MMINL3G(y, x1, x2, x3) MMINLGG2(y, 2, (x1), (x2), (x3))
192 #define MMINL4G(y, x1, x2, x3, x4) MMINLGG3(y, 3, (x1), (x2), (x3), (x4))
193 #define MMINL5G(y, x1, x2, x3, x4, x5) MMINLGG4(y, 4, (x1), (x2), (x3), (x4), (x5))
195 #define MMINR1G(y, x1) MMIN1G((y), (x1))
196 #define MMINR2G(y, x1, x2) MMINRGG1(y, 1, (x1), (x2))
197 #define MMINR3G(y, x1, x2, x3) MMINRGG2(y, 2, (x1), (x2), (x3))
198 #define MMINR4G(y, x1, x2, x3, x4) MMINRGG3(y, 3, (x1), (x2), (x3), (x4))
199 #define MMINR5G(y, x1, x2, x3, x4, x5) MMINRGG4(y, 4, (x1), (x2), (x3), (x4), (x5))
201 #define MMINL1(y, x) MMINL1G((y), (x))
202 #define MMINL2(y, x) MMINL2G((y), (x), (x) + 1)
203 #define MMINL3(y, x) MMINL3G((y), (x), (x) + 1, (x) + 2)
204 #define MMINL4(y, x) MMINL4G((y), (x), (x) + 1, (x) + 2, (x) + 3)
205 #define MMINL5(y, x) MMINL5G((y), (x), (x) + 1, (x) + 2, (x) + 3, (x) + 4)
207 #define MMINR1(y, x) MMINR1G((y), (x))
208 #define MMINR2(y, x) MMINR2G((y), (x), (x) + 1)
209 #define MMINR3(y, x) MMINR3G((y), (x), (x) + 1, (x) + 2)
210 #define MMINR4(y, x) MMINR4G((y), (x), (x) + 1, (x) + 2, (x) + 3)
211 #define MMINR5(y, x) MMINR5G((y), (x), (x) + 1, (x) + 2, (x) + 3, (x) + 4)
213 /* Macros for update_mmap speedup : with rigidity */
215 #define MRDOWN(y, x, dx) (r->m[DATADOWN((y), (x))] + r_fact * r->rigidity_map[(dx)])
217 #define MRSET1(y, x, dx) (mc[(dx)] = MRDOWN((y), (x), (dx)))
218 #define MRSET2(y, x, dx) (MRSET1((y), (x), (dx)), MRSET1((y), (x) + 1, (dx) + 1))
219 #define MRSET3(y, x, dx) (MRSET2((y), (x), (dx)), MRSET1((y), (x) + 2, (dx) + 2))
220 #define MRSET4(y, x, dx) (MRSET3((y), (x), (dx)), MRSET1((y), (x) + 3, (dx) + 3))
221 #define MRSET5(y, x, dx) (MRSET4((y), (x), (dx)), MRSET1((y), (x) + 4, (dx) + 4))
223 #define MRMIN1G(y, x1, dx1) (least = DATADOWN((y), (x1)), mc[(dx1)])
224 #define MRMINTESTL(dx1, dx2) (mc[(dx1)] <= mc[(dx2)])
225 #define MRMINTESTR(dx1, dx2) (mc[(dx1)] < mc[(dx2)])
227 #define MRMINLGG1(y, n, x1, dx1, x2, dx2) (MRMINTESTL((dx1), (dx2)) ? MRMINL ## n ## G((y), (x1), (dx1)) : MRMINL ## n ## G((y), (x2), (dx2)))
228 #define MRMINLGG2(y, n, x1, dx1, x2, dx2, ...) (MRMINTESTL((dx1), (dx2)) ? MRMINL ## n ## G((y), (x1), (dx1), __VA_ARGS__ ) : MRMINL ## n ## G((y), (x2), (dx2), __VA_ARGS__ ))
229 #define MRMINLGG3(y, n, x1, dx1, x2, dx2, ...) (MRMINTESTL((dx1), (dx2)) ? MRMINL ## n ## G((y), (x1), (dx1), __VA_ARGS__ ) : MRMINL ## n ## G((y), (x2), (dx2), __VA_ARGS__ ))
230 #define MRMINLGG4(y, n, x1, dx1, x2, dx2, ...) (MRMINTESTL((dx1), (dx2)) ? MRMINL ## n ## G((y), (x1), (dx1), __VA_ARGS__ ) : MRMINL ## n ## G((y), (x2), (dx2), __VA_ARGS__ ))
232 #define MRMINRGG1(y, n, x1, dx1, x2, dx2) (MRMINTESTR((dx1), (dx2)) ? MRMINR ## n ## G((y), (x1), (dx1)) : MRMINR ## n ## G((y), (x2), (dx2)))
233 #define MRMINRGG2(y, n, x1, dx1, x2, dx2, ...) (MRMINTESTR((dx1), (dx2)) ? MRMINR ## n ## G((y), (x1), (dx1), __VA_ARGS__ ) : MRMINR ## n ## G((y), (x2), (dx2), __VA_ARGS__ ))
234 #define MRMINRGG3(y, n, x1, dx1, x2, dx2, ...) (MRMINTESTR((dx1), (dx2)) ? MRMINR ## n ## G((y), (x1), (dx1), __VA_ARGS__ ) : MRMINR ## n ## G((y), (x2), (dx2), __VA_ARGS__ ))
235 #define MRMINRGG4(y, n, x1, dx1, x2, dx2, ...) (MRMINTESTR((dx1), (dx2)) ? MRMINR ## n ## G((y), (x1), (dx1), __VA_ARGS__ ) : MRMINR ## n ## G((y), (x2), (dx2), __VA_ARGS__ ))
237 #define MRMINL1G(y, x1, dx1) MRMIN1G((y), (x1), (dx1))
238 #define MRMINL2G(y, x1, dx1, x2, dx2) MRMINLGG1(y, 1, (x1), (dx1), (x2), (dx2))
239 #define MRMINL3G(y, x1, dx1, x2, dx2, x3, dx3) MRMINLGG2(y, 2, (x1), (dx1), (x2), (dx2), (x3), (dx3))
240 #define MRMINL4G(y, x1, dx1, x2, dx2, x3, dx3, x4, dx4) MRMINLGG3(y, 3, (x1), (dx1), (x2), (dx2), (x3), (dx3), (x4), (dx4))
241 #define MRMINL5G(y, x1, dx1, x2, dx2, x3, dx3, x4, dx4, x5, dx5) MRMINLGG4(y, 4, (x1), (dx1), (x2), (dx2), (x3), (dx3), (x4), (dx4), (x5), (dx5))
243 #define MRMINR1G(y, x1, dx1) MRMIN1G((y), (x1), (dx1))
244 #define MRMINR2G(y, x1, dx1, x2, dx2) MRMINRGG1(y, 1, (x1), (dx1), (x2), (dx2))
245 #define MRMINR3G(y, x1, dx1, x2, dx2, x3, dx3) MRMINRGG2(y, 2, (x1), (dx1), (x2), (dx2), (x3), (dx3))
246 #define MRMINR4G(y, x1, dx1, x2, dx2, x3, dx3, x4, dx4) MRMINRGG3(y, 3, (x1), (dx1), (x2), (dx2), (x3), (dx3), (x4), (dx4))
247 #define MRMINR5G(y, x1, dx1, x2, dx2, x3, dx3, x4, dx4, x5, dx5) MRMINRGG4(y, 4, (x1), (dx1), (x2), (dx2), (x3), (dx3), (x4), (dx4), (x5), (dx5))
249 #define MRMINL1(y, x, dx) MRMINL1G((y), (x), (dx))
250 #define MRMINL2(y, x, dx) MRMINL2G((y), (x), (dx), (x) + 1, (dx) + 1)
251 #define MRMINL3(y, x, dx) MRMINL3G((y), (x), (dx), (x) + 1, (dx) + 1, (x) + 2, (dx) + 2)
252 #define MRMINL4(y, x, dx) MRMINL4G((y), (x), (dx), (x) + 1, (dx) + 1, (x) + 2, (dx) + 2, (x) + 3, (dx) + 3)
253 #define MRMINL5(y, x, dx) MRMINL5G((y), (x), (dx), (x) + 1, (dx) + 1, (x) + 2, (dx) + 2, (x) + 3, (dx) + 3, (x) + 4, (dx) + 4)
255 #define MRMINR1(y, x, dx) MRMINR1G((y), (x), (dx))
256 #define MRMINR2(y, x, dx) MRMINR2G((y), (x), (dx), (x) + 1, (dx) + 1)
257 #define MRMINR3(y, x, dx) MRMINR3G((y), (x), (dx), (x) + 1, (dx) + 1, (x) + 2, (dx) + 2)
258 #define MRMINR4(y, x, dx) MRMINR4G((y), (x), (dx), (x) + 1, (dx) + 1, (x) + 2, (dx) + 2, (x) + 3, (dx) + 3)
259 #define MRMINR5(y, x, dx) MRMINR5G((y), (x), (dx), (x) + 1, (dx) + 1, (x) + 2, (dx) + 2, (x) + 3, (dx) + 3, (x) + 4, (dx) + 4)
261 /* Tolerance for update_mmap */
262 #define UPDATE_TOLERANCE (1e-5)
264 /* Carver states */
266 enum _LqrCarverState {
267 LQR_CARVER_STATE_STD,
268 LQR_CARVER_STATE_RESIZING,
269 LQR_CARVER_STATE_INFLATING,
270 LQR_CARVER_STATE_TRANSPOSING,
271 LQR_CARVER_STATE_FLATTENING,
272 LQR_CARVER_STATE_CANCELLED
275 typedef enum _LqrCarverState LqrCarverState;
278 /**** LQR_CARVER CLASS DEFINITION ****/
280 /* This is the representation of the multisize image */
281 struct _LqrCarver
283 gint w_start, h_start; /* original width & height */
284 gint w, h; /* current width & height */
285 gint w0, h0; /* map array width & height */
287 gint level; /* (in)visibility level (1 = full visibility) */
288 gint max_level; /* max level computed so far
289 * it is not: level <= max_level
290 * but rather: level <= 2 * max_level - 1
291 * since levels are shifted upon inflation
294 LqrImageType image_type; /* image type */
295 gint channels; /* number of colour channels of the image */
296 gint alpha_channel; /* opacity channel index (-1 if absent) */
297 gint black_channel; /* black channel index (-1 if absent) */
298 LqrColDepth col_depth; /* image colour depth */
300 gint transposed; /* flag to set transposed state */
301 gboolean active; /* flag to set if carver is active */
302 gboolean nrg_active; /* flag to set if carver energy is active */
303 LqrCarver* root; /* pointer to the root carver */
305 gboolean resize_aux_layers; /* flag to determine whether the auxiliary layers are resized */
306 gboolean dump_vmaps; /* flag to determine whether to output the seam map */
307 LqrResizeOrder resize_order; /* resize order */
309 LqrCarverList *attached_list; /* list of attached carvers */
311 gfloat rigidity; /* rigidity value (can straighten seams) */
312 gfloat *rigidity_map; /* the rigidity function */
313 gfloat *rigidity_mask; /* the rigidity mask */
314 gint delta_x; /* max displacement of seams (currently is only meaningful if 0 or 1 */
316 void *rgb; /* array of rgb points */
317 gint *vs; /* array of visibility levels */
318 gfloat *en; /* array of energy levels */
319 gfloat *bias; /* bias mask */
320 gfloat *m; /* array of auxiliary energy values */
321 gint *least; /* array of pointers */
322 gint *_raw; /* array of array-coordinates, for seam computation */
323 gint **raw; /* array of array-coordinates, for seam computation */
325 LqrCursor *c; /* cursor to be used as image reader */
326 void *rgb_ro_buffer; /* readout buffer */
328 gint *vpath; /* array of array-coordinates representing a vertical seam */
329 gint *vpath_x; /* array of abscisses representing a vertical seam */
331 gint leftright; /* whether to favor left or right seams */
332 gint lr_switch_frequency; /* interval between leftright switches */
333 gfloat enl_step; /* maximum enlargement ratio in a single step */
335 LqrProgress * progress; /* pointer to progress update functions */
336 gint session_update_step; /* update step for the rescaling session */
337 gint session_rescale_total; /* total amount of rescaling for the session */
338 gint session_rescale_current; /* current amount of rescaling for the session */
340 LqrEnergyFunc nrg; /* pointer to a general energy function */
341 gint nrg_radius; /* energy function radius */
342 LqrEnergyReaderType nrg_read_t; /* energy function reader type */
343 gpointer nrg_extra_data; /* extra data to pass on to the energy function */
344 LqrReadingWindow * rwindow; /* reading window for energy computation */
346 gint *nrg_xmin; /* auxiliary vector for energy update */
347 gint *nrg_xmax; /* auxiliary vector for energy update */
349 gboolean nrg_uptodate; /* flag set if energy map is up to date */
351 gdouble * rcache; /* array of brightness (or luma or else) levels for energy computation */
352 gboolean use_rcache; /* wheter to cache brightness, luma etc. */
354 LqrVMapList * flushed_vs; /* linked list of pointers to flushed visibility maps buffers */
356 gboolean preserve_in_buffer; /* whether to preserve the buffer given to lqr_carver_new */
358 volatile gint state; /* current state of the carver (actually a LqrCarverState enum)*/
359 volatile gint state_lock; /* lock for state changing routines */
360 volatile gint state_lock_queue; /* lock queue for state changing routines */
364 /* LQR_CARVER CLASS PRIVATE FUNCTIONS */
366 /* constructor base */
367 LqrCarver * lqr_carver_new_common (gint width, gint height, gint channels);
369 /* Init energy related structures only */
370 LqrRetVal lqr_carver_init_energy_related (LqrCarver *r);
372 /* build maps */
373 LqrRetVal lqr_carver_build_maps (LqrCarver * r, gint depth); /* build all */
374 LqrRetVal lqr_carver_build_emap (LqrCarver * r); /* energy */
375 LqrRetVal lqr_carver_build_mmap (LqrCarver * r); /* minpath */
376 LqrRetVal lqr_carver_build_vsmap (LqrCarver * r, gint depth); /* visibility */
378 /* internal functions for maps computation */
379 LqrRetVal lqr_carver_compute_e (LqrCarver * r, gint x, gint y); /* compute energy of point at c */
380 LqrRetVal lqr_carver_update_emap (LqrCarver * r); /* update energy map after seam removal */
381 LqrRetVal lqr_carver_update_mmap (LqrCarver * r); /* minpath */
382 void lqr_carver_build_vpath (LqrCarver * r); /* compute seam path */
383 void lqr_carver_carve (LqrCarver * r); /* updates the "raw" buffer */
384 void lqr_carver_update_vsmap (LqrCarver * r, gint l); /* update visibility map after seam removal */
385 void lqr_carver_finish_vsmap (LqrCarver * r); /* complete visibility map (last seam) */
386 LqrRetVal lqr_carver_inflate (LqrCarver * r, gint l); /* adds enlargment info to map */
387 LqrRetVal lqr_carver_propagate_vsmap (LqrCarver * r); /* propagates vsmap on attached carvers */
389 /* image manipulations */
390 LqrRetVal lqr_carver_resize_width (LqrCarver * r, gint w1); /* liquid resize width */
391 LqrRetVal lqr_carver_resize_height (LqrCarver * r, gint h1); /* liquid resize height */
392 void lqr_carver_set_width (LqrCarver * r, gint w1);
393 LqrRetVal lqr_carver_transpose (LqrCarver * r);
394 void lqr_carver_scan_reset_all (LqrCarver * r);
396 /* auxiliary */
397 LqrRetVal lqr_carver_scan_reset_attached (LqrCarver * r, LqrDataTok data);
398 LqrRetVal lqr_carver_set_width_attached (LqrCarver * r, LqrDataTok data);
399 LqrRetVal lqr_carver_inflate_attached (LqrCarver * r, LqrDataTok data);
400 LqrRetVal lqr_carver_flatten_attached (LqrCarver * r, LqrDataTok data);
401 LqrRetVal lqr_carver_transpose_attached (LqrCarver * r, LqrDataTok data);
402 LqrRetVal lqr_carver_propagate_vsmap_attached (LqrCarver * r, LqrDataTok data);
403 LqrRetVal lqr_carver_set_state (LqrCarver * r, LqrCarverState state, gboolean skip_canceled);
404 LqrRetVal lqr_carver_set_state_attached (LqrCarver * r, LqrDataTok data);
406 #ifdef __LQR_DEBUG__
407 /* debug */
408 void lqr_carver_debug_check_rows(LqrCarver * r);
409 #endif /* __LQR_DEBUG__ */
411 #endif /* __LQR_CARVER_PRIV_H__ */