util

util

Synopsis

#define             IM_PI
#define             IM_RAD                              ( r )
#define             IM_DEG                              ( a )
#define             IM_MAX                              (A,B)
#define             IM_MIN                              (A,B)
#define             IM_ABS                              (x)
#define             IM_CLIP                             (A,V,B)
#define             IM_NUMBER                           (R)
#define             IM_FREEF                            ( F, S )
#define             IM_FREE                             ( S )
#define             IM_SETSTR                           ( S, V )
#define             IM_UNROLL                           ( N, OPER )
#define             IM_RINT                             ( R )
#define             IM_CLIP_UCHAR                       ( V, SEQ )
#define             IM_CLIP_USHORT                      ( V, SEQ )
#define             IM_CLIP_CHAR                        ( V, SEQ )
#define             IM_CLIP_SHORT                       ( V, SEQ )
#define             IM_CLIP_NONE                        ( V, SEQ )
void *              (*im_construct_fn)                  (void *,
                                                         void *,
                                                         void *);
void *              im_local                            (VipsImage *im,
                                                         im_construct_fn cons,
                                                         im_callback_fn dest,
                                                         void *a,
                                                         void *b,
                                                         void *c);
int                 im_local_array                      (VipsImage *im,
                                                         void **out,
                                                         int n,
                                                         im_construct_fn cons,
                                                         im_callback_fn dest,
                                                         void *a,
                                                         void *b,
                                                         void *c);
char *              im__break_token                     (char *str,
                                                         char *brk);
void *              (*VSListMap2Fn)                     (void *,
                                                         void *,
                                                         void *);
void *              (*VSListMap4Fn)                     (void *,
                                                         void *,
                                                         void *,
                                                         void *,
                                                         void *);
void *              (*VSListFold2Fn)                    (void *,
                                                         void *,
                                                         void *,
                                                         void *);
gboolean            im_slist_equal                      (GSList *l1,
                                                         GSList *l2);
void *              im_slist_map2                       (GSList *list,
                                                         VSListMap2Fn fn,
                                                         void *a,
                                                         void *b);
void *              im_slist_map2_rev                   (GSList *list,
                                                         VSListMap2Fn fn,
                                                         void *a,
                                                         void *b);
void *              im_slist_map4                       (GSList *list,
                                                         VSListMap4Fn fn,
                                                         void *a,
                                                         void *b,
                                                         void *c,
                                                         void *d);
void *              im_slist_fold2                      (GSList *list,
                                                         void *start,
                                                         VSListFold2Fn fn,
                                                         void *a,
                                                         void *b);
GSList *            im_slist_filter                     (GSList *list,
                                                         VSListMap2Fn fn,
                                                         void *a,
                                                         void *b);
void                im_slist_free_all                   (GSList *list);
void *              im_map_equal                        (void *a,
                                                         void *b);
void *              im_hash_table_map                   (GHashTable *hash,
                                                         VSListMap2Fn fn,
                                                         void *a,
                                                         void *b);
void *              (*VipsTypeMap)                      (GType ,
                                                         void *);
void *              (*VipsTypeMap2)                     (GType ,
                                                         void *,
                                                         void *);
void *              (*VipsClassMap)                     (VipsObjectClass *,
                                                         void *);
void *              vips_type_map                       (GType base,
                                                         VipsTypeMap2 fn,
                                                         void *a,
                                                         void *b);
void *              vips_type_map_concrete_all          (GType base,
                                                         VipsTypeMap fn,
                                                         void *a);
void *              vips_class_map_concrete_all         (GType base,
                                                         VipsClassMap fn,
                                                         void *a);
VipsObjectClass *   vips_class_find                     (const char *basename,
                                                         const char *nickname);
GType               vips_type_find                      (const char *basename,
                                                         const char *nickname);
char *              im_strncpy                          (char *dest,
                                                         const char *src,
                                                         int n);
char *              im_strrstr                          (const char *haystack,
                                                         const char *needle);
char *              im_strdup                           (IMAGE *im,
                                                         const char *str);
gboolean            im_ispostfix                        (const char *a,
                                                         const char *b);
gboolean            im_isprefix                         (const char *a,
                                                         const char *b);
int                 im_vsnprintf                        (char *str,
                                                         size_t size,
                                                         const char *format,
                                                         va_list ap);
int                 im_snprintf                         (char *str,
                                                         size_t size,
                                                         const char *format,
                                                         ...);
char *              im_break_token                      (char *str,
                                                         const char *brk);
const char *        im_skip_dir                         (const char *filename);
void                im_filename_split                   (const char *path,
                                                         char *name,
                                                         char *mode);
void                im_filename_suffix                  (const char *path,
                                                         char *suffix);
int                 im_filename_suffix_match            (const char *path,
                                                         const char *suffixes[]);
char *              im_getnextoption                    (char **in);
char *              im_getsuboption                     (const char *buf);
gint64              im_file_length                      (int fd);
int                 im__write                           (int fd,
                                                         const void *buf,
                                                         size_t count);
FILE *              im__file_open_read                  (const char *filename);
FILE *              im__file_open_write                 (const char *filename);
char *              im__file_read                       (FILE *fp,
                                                         const char *name,
                                                         unsigned int *length_out);
char *              im__file_read_name                  (const char *name,
                                                         unsigned int *length_out);
int                 im__file_write                      (void *data,
                                                         size_t size,
                                                         size_t nmemb,
                                                         FILE *stream);
enum                VipsToken;
const char *        vips__token_get                     (const char *buffer,
                                                         VipsToken *token,
                                                         char *string,
                                                         int size);
const char *        vips__token_must                    (const char *buffer,
                                                         VipsToken *token,
                                                         char *string,
                                                         int size);
const char *        vips__token_need                    (const char *buffer,
                                                         VipsToken need_token,
                                                         char *string,
                                                         int size);
int                 im_existsf                          (const char *name,
                                                         ...);
int                 im_ispoweroftwo                     (int p);
int                 im_isvips                           (const char *filename);
int                 im_amiMSBfirst                      (void);
IMAGE *             im__open_temp                       (void);
int                 im_bits_of_fmt                      (VipsBandFmt fmt);

Description

Details

IM_PI

#define IM_PI (3.14159265358979323846)

IM_RAD()

#define IM_RAD( r ) (((r) / 360.0) * 2.0 * IM_PI)

IM_DEG()

#define IM_DEG( a ) (((a) / (2.0 * IM_PI)) * 360.0)

IM_MAX()

#define IM_MAX(A,B) ((A)>(B)?(A):(B))

IM_MIN()

#define IM_MIN(A,B) ((A)<(B)?(A):(B))

IM_ABS()

#define IM_ABS(x) (((x) >= 0) ? (x) : -(x))

IM_CLIP()

#define IM_CLIP(A,V,B) IM_MAX( (A), IM_MIN( (B), (V) ) )

IM_NUMBER()

#define IM_NUMBER(R) ((int)(sizeof(R)/sizeof(R[0])))

IM_FREEF()

#define             IM_FREEF( F, S )

IM_FREE()

#define             IM_FREE( S )

IM_SETSTR()

#define             IM_SETSTR( S, V )

IM_UNROLL()

#define             IM_UNROLL( N, OPER )

IM_RINT()

#define IM_RINT( R ) ((int)((R)>0?((R)+0.5):((R)-0.5)))

IM_CLIP_UCHAR()

#define             IM_CLIP_UCHAR( V, SEQ )

IM_CLIP_USHORT()

#define             IM_CLIP_USHORT( V, SEQ )

IM_CLIP_CHAR()

#define             IM_CLIP_CHAR( V, SEQ )

IM_CLIP_SHORT()

#define             IM_CLIP_SHORT( V, SEQ )

IM_CLIP_NONE()

#define IM_CLIP_NONE( V, SEQ ) {}

im_construct_fn ()

void *              (*im_construct_fn)                  (void *,
                                                         void *,
                                                         void *);

im_local ()

void *              im_local                            (VipsImage *im,
                                                         im_construct_fn cons,
                                                         im_callback_fn dest,
                                                         void *a,
                                                         void *b,
                                                         void *c);

im_local_array ()

int                 im_local_array                      (VipsImage *im,
                                                         void **out,
                                                         int n,
                                                         im_construct_fn cons,
                                                         im_callback_fn dest,
                                                         void *a,
                                                         void *b,
                                                         void *c);

im__break_token ()

char *              im__break_token                     (char *str,
                                                         char *brk);

VSListMap2Fn ()

void *              (*VSListMap2Fn)                     (void *,
                                                         void *,
                                                         void *);

VSListMap4Fn ()

void *              (*VSListMap4Fn)                     (void *,
                                                         void *,
                                                         void *,
                                                         void *,
                                                         void *);

VSListFold2Fn ()

void *              (*VSListFold2Fn)                    (void *,
                                                         void *,
                                                         void *,
                                                         void *);

im_slist_equal ()

gboolean            im_slist_equal                      (GSList *l1,
                                                         GSList *l2);

im_slist_map2 ()

void *              im_slist_map2                       (GSList *list,
                                                         VSListMap2Fn fn,
                                                         void *a,
                                                         void *b);

im_slist_map2_rev ()

void *              im_slist_map2_rev                   (GSList *list,
                                                         VSListMap2Fn fn,
                                                         void *a,
                                                         void *b);

im_slist_map4 ()

void *              im_slist_map4                       (GSList *list,
                                                         VSListMap4Fn fn,
                                                         void *a,
                                                         void *b,
                                                         void *c,
                                                         void *d);

im_slist_fold2 ()

void *              im_slist_fold2                      (GSList *list,
                                                         void *start,
                                                         VSListFold2Fn fn,
                                                         void *a,
                                                         void *b);

im_slist_filter ()

GSList *            im_slist_filter                     (GSList *list,
                                                         VSListMap2Fn fn,
                                                         void *a,
                                                         void *b);

im_slist_free_all ()

void                im_slist_free_all                   (GSList *list);

im_map_equal ()

void *              im_map_equal                        (void *a,
                                                         void *b);

im_hash_table_map ()

void *              im_hash_table_map                   (GHashTable *hash,
                                                         VSListMap2Fn fn,
                                                         void *a,
                                                         void *b);

VipsTypeMap ()

void *              (*VipsTypeMap)                      (GType ,
                                                         void *);

VipsTypeMap2 ()

void *              (*VipsTypeMap2)                     (GType ,
                                                         void *,
                                                         void *);

VipsClassMap ()

void *              (*VipsClassMap)                     (VipsObjectClass *,
                                                         void *);

vips_type_map ()

void *              vips_type_map                       (GType base,
                                                         VipsTypeMap2 fn,
                                                         void *a,
                                                         void *b);

vips_type_map_concrete_all ()

void *              vips_type_map_concrete_all          (GType base,
                                                         VipsTypeMap fn,
                                                         void *a);

vips_class_map_concrete_all ()

void *              vips_class_map_concrete_all         (GType base,
                                                         VipsClassMap fn,
                                                         void *a);

vips_class_find ()

VipsObjectClass *   vips_class_find                     (const char *basename,
                                                         const char *nickname);

vips_type_find ()

GType               vips_type_find                      (const char *basename,
                                                         const char *nickname);

im_strncpy ()

char *              im_strncpy                          (char *dest,
                                                         const char *src,
                                                         int n);

im_strrstr ()

char *              im_strrstr                          (const char *haystack,
                                                         const char *needle);

im_strdup ()

char *              im_strdup                           (IMAGE *im,
                                                         const char *str);

im_ispostfix ()

gboolean            im_ispostfix                        (const char *a,
                                                         const char *b);

im_isprefix ()

gboolean            im_isprefix                         (const char *a,
                                                         const char *b);

im_vsnprintf ()

int                 im_vsnprintf                        (char *str,
                                                         size_t size,
                                                         const char *format,
                                                         va_list ap);

im_snprintf ()

int                 im_snprintf                         (char *str,
                                                         size_t size,
                                                         const char *format,
                                                         ...);

im_break_token ()

char *              im_break_token                      (char *str,
                                                         const char *brk);

im_skip_dir ()

const char *        im_skip_dir                         (const char *filename);

im_filename_split ()

void                im_filename_split                   (const char *path,
                                                         char *name,
                                                         char *mode);

im_filename_suffix ()

void                im_filename_suffix                  (const char *path,
                                                         char *suffix);

im_filename_suffix_match ()

int                 im_filename_suffix_match            (const char *path,
                                                         const char *suffixes[]);

im_getnextoption ()

char *              im_getnextoption                    (char **in);

im_getsuboption ()

char *              im_getsuboption                     (const char *buf);

im_file_length ()

gint64              im_file_length                      (int fd);

im__write ()

int                 im__write                           (int fd,
                                                         const void *buf,
                                                         size_t count);

im__file_open_read ()

FILE *              im__file_open_read                  (const char *filename);

im__file_open_write ()

FILE *              im__file_open_write                 (const char *filename);

im__file_read ()

char *              im__file_read                       (FILE *fp,
                                                         const char *name,
                                                         unsigned int *length_out);

im__file_read_name ()

char *              im__file_read_name                  (const char *name,
                                                         unsigned int *length_out);

im__file_write ()

int                 im__file_write                      (void *data,
                                                         size_t size,
                                                         size_t nmemb,
                                                         FILE *stream);

enum VipsToken

typedef enum {
 	VIPS_TOKEN_LEFT = 1,	/* ({[ */
	VIPS_TOKEN_RIGHT,	/* ]}) */
	VIPS_TOKEN_STRING,	/* string or "str\"ing" */
	VIPS_TOKEN_EQUALS,	/* = */
	VIPS_TOKEN_COMMA	/* , */
} VipsToken;

vips__token_get ()

const char *        vips__token_get                     (const char *buffer,
                                                         VipsToken *token,
                                                         char *string,
                                                         int size);

vips__token_must ()

const char *        vips__token_must                    (const char *buffer,
                                                         VipsToken *token,
                                                         char *string,
                                                         int size);

vips__token_need ()

const char *        vips__token_need                    (const char *buffer,
                                                         VipsToken need_token,
                                                         char *string,
                                                         int size);

im_existsf ()

int                 im_existsf                          (const char *name,
                                                         ...);

im_ispoweroftwo ()

int                 im_ispoweroftwo                     (int p);

im_isvips ()

int                 im_isvips                           (const char *filename);

im_amiMSBfirst ()

int                 im_amiMSBfirst                      (void);

im__open_temp ()

IMAGE *             im__open_temp                       (void);

im_bits_of_fmt ()

int                 im_bits_of_fmt                      (VipsBandFmt fmt);