1 /* LiquidRescaling Library
2 * Copyright (C) 2007 Carlo Baldassi (the "Author") <carlobaldassi@gmail.com>.
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; }
42 #define __LQR_VERBOSE__
45 /**** RETURN VALUES (signals) ****/
48 LQR_ERROR
, /* generic error */
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 { \
59 if ((ret_val = (expr)) != LQR_OK) \
65 /* convert a NULL assignment to an error signal */
66 #define CATCH_MEM(expr) G_STMT_START { \
73 /* convert a boolean value to an error signal */
74 #define CATCH_F(expr) G_STMT_START { \
75 if ((expr) == FALSE) \
83 /**** RESIZE ORDER ****/
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__ */