Release 0.3
[liblqr.git] / lqr / lqr_carver_pub.h
blob8d00a74bf3885f200187566b1e940b4b7d6d6870
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_PUB_H__
24 #define __LQR_CARVER_PUB_H__
26 #ifndef __LQR_BASE_H__
27 #error "lqr_base.h must be included prior to lqr_carver_pub.h"
28 #endif /* __LQR_BASE_H__ */
30 #ifndef __LQR_CURSOR_PUB_H__
31 #error "lqr_cursor_pub.h must be included prior to lqr_carver_pub.h"
32 #endif /* __LQR_CURSOR_PUB_H__ */
34 #ifndef __LQR_GRADIENT_PUB_H__
35 #error "lqr_gradient_pub.h must be included prior to lqr_carver_pub.h"
36 #endif /* __LQR_GRADIENT_PUB_H__ */
38 #ifndef __LQR_CARVER_LIST_PUB_H__
39 #error "lqr_carver_list_pub.h must be included prior to lqr_carver_pub.h"
40 #endif /* __LQR_CARVER_LIST_PUB_H__ */
42 #ifndef __LQR_VMAP_LIST_PUB_H__
43 #error "lqr_vmap_list_pub.h must be included prior to lqr_carver_pub.h"
44 #endif /* __LQR_VMAP_LIST_PUB_H__ */
46 #ifndef __LQR_PROGRESS_PUB_H__
47 #error "lqr_progress_pub.h must be included prior to lqr_carver_pub.h"
48 #endif /* __LQR_PROGRESS_PUB_H__ */
51 /* LQR_CARVER CLASS PUBLIC FUNCTIONS */
53 /* constructor & destructor */
54 LqrCarver * lqr_carver_new (guchar * buffer, gint width, gint height, gint channels);
55 LqrCarver * lqr_carver_new_ext (void * buffer, gint width, gint height, gint channels, LqrColDepth colour_depth);
56 void lqr_carver_destroy (LqrCarver * r);
58 /* initialize */
59 LqrRetVal lqr_carver_init (LqrCarver *r, gint delta_x, gfloat rigidity);
61 /* set attributes */
62 void lqr_carver_set_gradient_function (LqrCarver * r, LqrGradFuncType gf_ind);
63 void lqr_carver_set_dump_vmaps (LqrCarver *r);
64 void lqr_carver_set_no_dump_vmaps (LqrCarver *r);
65 void lqr_carver_set_resize_order (LqrCarver *r, LqrResizeOrder resize_order);
66 void lqr_carver_set_side_switch_frequency (LqrCarver *r, guint switch_frequency);
67 LqrRetVal lqr_carver_set_enl_step (LqrCarver *r, gfloat enl_step);
68 LqrRetVal lqr_carver_attach (LqrCarver * r, LqrCarver * aux);
69 void lqr_carver_set_progress (LqrCarver *r, LqrProgress *p);
71 /* image manipulations */
72 LqrRetVal lqr_carver_resize (LqrCarver * r, gint w1, gint h1); /* liquid resize */
73 LqrRetVal lqr_carver_flatten (LqrCarver * r); /* flatten the multisize image */
75 /* readout */
76 void lqr_carver_scan_reset (LqrCarver * r);
77 gboolean lqr_carver_scan (LqrCarver *r, gint *x, gint *y, guchar ** rgb);
78 gboolean lqr_carver_scan_ext (LqrCarver *r, gint *x, gint *y, void ** rgb);
79 gboolean lqr_carver_scan_line (LqrCarver * r, gint * n, guchar ** rgb);
80 gboolean lqr_carver_scan_line_ext (LqrCarver * r, gint * n, void ** rgb);
81 gboolean lqr_carver_scan_by_row (LqrCarver *r);
82 gint lqr_carver_get_bpp (LqrCarver *r);
83 gint lqr_carver_get_channels (LqrCarver *r);
84 gint lqr_carver_get_width (LqrCarver * r);
85 gint lqr_carver_get_height (LqrCarver * r);
86 gint lqr_carver_get_ref_width (LqrCarver * r);
87 gint lqr_carver_get_ref_height (LqrCarver * r);
88 gint lqr_carver_get_orientation (LqrCarver * r);
89 LqrColDepth lqr_carver_get_col_depth (LqrCarver * r);
90 gfloat lqr_carver_get_enl_step (LqrCarver *r);
91 gint lqr_carver_get_depth (LqrCarver *r);
94 #endif /* __LQR_CARVER_PUB_H__ */