Hid private symbols + updated autodeb machinery for hardy
[liblqr.git] / lqr / lqr_base.h
blobb3864b3c41e3429a114909534872224cf1cd9d66
1 /* LiquidRescaling Library
2 * Copyright (C) 2007 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/>
24 #ifndef __LQR_BASE_H__
25 #define __LQR_BASE_H__
27 #define LQR_MAX_NAME_LENGTH (1024)
29 #define EXPORT __attribute__((visibility("default")))
31 #define TRY_N_N(assign) if ((assign) == NULL) { return NULL; }
32 //#define TRY_N_F(assign) if ((assign) == NULL) { return FALSE; }
33 //#define TRY_F_N(assign) if ((assign) == FALSE) { return NULL; }
34 //#define TRY_F_F(assign) if ((assign) == FALSE) { return FALSE; }
37 #if 0
38 #define __LQR_DEBUG__
39 #endif
41 #if 0
42 #define __LQR_VERBOSE__
43 #endif
45 /**** RETURN VALUES (signals) ****/
46 enum _LqrRetVal
48 LQR_ERROR, /* generic error */
49 LQR_OK, /* ok */
50 LQR_NOMEM, /* not enough memory */
51 LQR_WARNING /* generic warning */
54 typedef enum _LqrRetVal LqrRetVal;
56 /* generic signal processing macros */
57 #define CATCH(expr) G_STMT_START { \
58 LqrRetVal ret_val; \
59 if ((ret_val = (expr)) != LQR_OK) \
60 { \
61 return ret_val; \
62 } \
63 } G_STMT_END
65 /* convert a NULL assignment to an error signal */
66 #define CATCH_MEM(expr) G_STMT_START { \
67 if ((expr) == NULL) \
68 { \
69 return LQR_NOMEM; \
70 } \
71 } G_STMT_END
73 /* convert a boolean value to an error signal */
74 #define CATCH_F(expr) G_STMT_START { \
75 if ((expr) == FALSE) \
76 { \
77 return LQR_ERROR; \
78 } \
79 } G_STMT_END
83 /**** RESIZE ORDER ****/
84 enum _LqrResizeOrder
86 LQR_RES_ORDER_HOR,
87 LQR_RES_ORDER_VERT
90 typedef enum _LqrResizeOrder LqrResizeOrder;
92 /**** CLASSES DECLARATIONS ****/
94 struct _LqrCarver; /* the multisize image carver */
96 typedef struct _LqrCarver LqrCarver;
98 #endif /* __LQR_BASE_H__ */