Added deprecated attributes
[liblqr.git] / lqr / lqr_carver_pub.h
blobc436344766f7a1617c28a13b6f811639fc047355
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_ENERGY_PUB_H__
39 #error "lqr_energy_pub.h must be included prior to lqr_carver_pub.h"
40 #endif /* __LQR_ENERGY_PUB_H__ */
42 #ifndef __LQR_CURSOR_PUB_H__
43 #error "lqr_cursor_pub.h must be included prior to lqr_carver_pub.h"
44 #endif /* __LQR_CURSOR_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_H__ */
50 #ifndef __LQR_CARVER_LIST_PUB_H__
51 #error "lqr_carver_list_pub.h must be included prior to lqr_carver_pub.h"
52 #endif /* __LQR_CARVER_LIST_PUB_H__ */
54 #ifndef __LQR_VMAP_LIST_PUB_H__
55 #error "lqr_vmap_list_pub.h must be included prior to lqr_carver_pub.h"
56 #endif /* __LQR_VMAP_LIST_PUB_H__ */
58 #ifndef __LQR_PROGRESS_PUB_H__
59 #error "lqr_progress_pub.h must be included prior to lqr_carver_pub.h"
60 #endif /* __LQR_PROGRESS_PUB_H__ */
62 /* LQR_CARVER CLASS PUBLIC FUNCTIONS */
64 /* constructor & destructor */
65 LQR_PUBLIC LqrCarver *lqr_carver_new(guchar *buffer, gint width, gint height, gint channels);
66 LQR_PUBLIC LqrCarver *lqr_carver_new_ext(void *buffer, gint width, gint height, gint channels,
67 LqrColDepth colour_depth);
68 LQR_PUBLIC void lqr_carver_destroy(LqrCarver *r);
70 /* initialize */
71 LQR_PUBLIC LqrRetVal lqr_carver_init(LqrCarver *r, gint delta_x, gfloat rigidity);
73 /* set attributes */
74 LQR_PUBLIC LqrRetVal lqr_carver_set_image_type(LqrCarver *r, LqrImageType image_type);
75 LQR_PUBLIC LqrRetVal lqr_carver_set_alpha_channel(LqrCarver *r, gint channel_index);
76 LQR_PUBLIC LqrRetVal lqr_carver_set_black_channel(LqrCarver *r, gint channel_index);
77 LQR_PUBLIC void lqr_carver_set_dump_vmaps(LqrCarver *r);
78 LQR_PUBLIC void lqr_carver_set_no_dump_vmaps(LqrCarver *r);
79 LQR_PUBLIC void lqr_carver_set_resize_order(LqrCarver *r, LqrResizeOrder resize_order);
80 LQR_PUBLIC void lqr_carver_set_side_switch_frequency(LqrCarver *r, guint switch_frequency);
81 LQR_PUBLIC LqrRetVal lqr_carver_set_enl_step(LqrCarver *r, gfloat enl_step);
82 LQR_PUBLIC void lqr_carver_set_use_cache(LqrCarver *r, gboolean use_cache);
83 LQR_PUBLIC LqrRetVal lqr_carver_attach(LqrCarver *r, LqrCarver *aux);
84 LQR_PUBLIC void lqr_carver_set_progress(LqrCarver *r, LqrProgress * p);
85 LQR_PUBLIC void lqr_carver_set_preserve_input_image(LqrCarver *r);
86 /* THIS FUNCTION IS ONLY MAINTAINED FOR BACK-COMPATIBILITY PURPOSES */
87 /* lqr_carver_set_energy_function_builtin() should be used instead */
88 G_GNUC_DEPRECATED
89 LQR_PUBLIC void lqr_carver_set_gradient_function(LqrCarver *r, LqrGradFuncType gf_ind);
91 /* image manipulations */
92 LQR_PUBLIC LqrRetVal lqr_carver_resize(LqrCarver *r, gint w1, gint h1); /* liquid resize */
93 LQR_PUBLIC LqrRetVal lqr_carver_flatten(LqrCarver *r); /* flatten the multisize image */
94 LQR_PUBLIC LqrRetVal lqr_carver_cancel(LqrCarver *r); /* cancel the current action from a different thread */
96 /* readout */
97 LQR_PUBLIC void lqr_carver_scan_reset(LqrCarver *r);
98 LQR_PUBLIC gboolean lqr_carver_scan(LqrCarver *r, gint *x, gint *y, guchar **rgb);
99 LQR_PUBLIC gboolean lqr_carver_scan_ext(LqrCarver *r, gint *x, gint *y, void **rgb);
100 LQR_PUBLIC gboolean lqr_carver_scan_line(LqrCarver *r, gint *n, guchar **rgb);
101 LQR_PUBLIC gboolean lqr_carver_scan_line_ext(LqrCarver *r, gint *n, void **rgb);
102 LQR_PUBLIC gboolean lqr_carver_scan_by_row(LqrCarver *r);
103 G_GNUC_DEPRECATED
104 LQR_PUBLIC gint lqr_carver_get_bpp(LqrCarver *r);
105 LQR_PUBLIC gint lqr_carver_get_channels(LqrCarver *r);
106 LQR_PUBLIC gint lqr_carver_get_width(LqrCarver *r);
107 LQR_PUBLIC gint lqr_carver_get_height(LqrCarver *r);
108 LQR_PUBLIC gint lqr_carver_get_ref_width(LqrCarver *r);
109 LQR_PUBLIC gint lqr_carver_get_ref_height(LqrCarver *r);
110 LQR_PUBLIC gint lqr_carver_get_orientation(LqrCarver *r);
111 LQR_PUBLIC LqrColDepth lqr_carver_get_col_depth(LqrCarver *r);
112 LQR_PUBLIC LqrImageType lqr_carver_get_image_type(LqrCarver *r);
113 LQR_PUBLIC gfloat lqr_carver_get_enl_step(LqrCarver *r);
114 LQR_PUBLIC gint lqr_carver_get_depth(LqrCarver *r);
116 #endif /* __LQR_CARVER_PUB_H__ */