Synopsis
#define IM_TYPE_NAME_DOUBLE
#define IM_TYPE_NAME_INT
#define IM_TYPE_NAME_COMPLEX
#define IM_TYPE_NAME_STRING
#define IM_TYPE_NAME_IMASK
#define IM_TYPE_NAME_DMASK
#define IM_TYPE_NAME_IMAGE
#define IM_TYPE_NAME_DISPLAY
#define IM_TYPE_NAME_GVALUE
#define IM_TYPE_NAME_ARRAY
#define IM_TYPE_IM
#define IM_TYPE_AR (OF)
im_type_t;
typedef im_value_t;
im_value_mask_t;
im_value_array_t;
enum im_argument_flags;
im_argument_t;
enum im_operation_flags;
int (*im_operation_dispatch_fn) (im_value_t **argv
);
im_operation_t;
im_type_t * im_type_register (const char *name
,
im_type_t *type_param
,
size_t size
);
void * im_type_map (VSListMap2Fn fn
,
void *a
,
void *b
);
im_type_t * im_type_lookup (const char *name
,
im_type_t *type_param
);
im_operation_t * im_operation_register (const char *name
,
const char *desc
,
im_operation_flags flags
,
im_operation_dispatch_fn disp
,
int argc
);
im_operation_t * im_operation_registerv (const char *name
,
const char *desc
,
im_operation_flags flags
,
im_operation_dispatch_fn disp
,
...
);
void * im_operation_map (VSListMap2Fn fn
,
void *a
,
void *b
);
im_operation_t * im_operation_lookup (const char *name
);
im_argument_t * im_argument_new (const char *name
,
im_type_t *type
,
im_argument_flags flags
);
Details
IM_TYPE_NAME_DOUBLE
#define IM_TYPE_NAME_DOUBLE "double" /* im_value_t is ptr to double */
IM_TYPE_NAME_INT
#define IM_TYPE_NAME_INT "integer" /* 32-bit integer */
IM_TYPE_NAME_COMPLEX
#define IM_TYPE_NAME_COMPLEX "complex" /* Pair of doubles */
IM_TYPE_NAME_STRING
#define IM_TYPE_NAME_STRING "string" /* Zero-terminated char array */
IM_TYPE_NAME_IMASK
#define IM_TYPE_NAME_IMASK "intmask" /* Integer mask type */
IM_TYPE_NAME_DMASK
#define IM_TYPE_NAME_DMASK "doublemask" /* Double mask type */
IM_TYPE_NAME_IMAGE
#define IM_TYPE_NAME_IMAGE "image" /* IMAGE descriptor */
IM_TYPE_NAME_DISPLAY
#define IM_TYPE_NAME_DISPLAY "display" /* Display descriptor */
IM_TYPE_NAME_GVALUE
#define IM_TYPE_NAME_GVALUE "gvalue" /* GValue wrapper */
IM_TYPE_NAME_ARRAY
#define IM_TYPE_NAME_ARRAY "array" /* Array of other values of some type */
IM_TYPE_IM
#define IM_TYPE_IM (im_type_lookup( IM_TYPE_NAME_IMAGE, NULL ))
IM_TYPE_AR()
#define IM_TYPE_AR( OF ) (im_type_lookup( IM_TYPE_NAME_ARRAY, OF ))
im_type_t
typedef struct {
const char *name; /* Name of type, eg. "double" */
struct im__type_t *type_param; /* What this is an array of */
size_t size; /* sizeof( im_value_t ) repres. ) */
} im_type_t;
im_value_t
typedef void im_value_t;
im_value_mask_t
typedef struct {
char *name; /* Command-line name in */
void *mask; /* Mask --- DOUBLE or INT */
} im_value_mask_t;
im_value_array_t
typedef struct {
int n; /* Array length */
im_value_t **array; /* Array */
} im_value_array_t;
enum im_argument_flags
typedef enum {
IM_ARGUMENT_NONE = 0, /* No flags set */
IM_ARGUMENT_OUTPUT = 0x1 /* Is an output arg */
} im_argument_flags;
im_argument_t
typedef struct {
const char *name; /* Eg. "in2" */
im_type_t *type; /* Argument type */
im_argument_flags flags; /* Output/input etc. */
} im_argument_t;
enum im_operation_flags
typedef enum {
IM_OPERATION_NONE = 0, /* No flags set */
IM_OPERATION_PIO = 0x1, /* Is a partial function */
IM_OPERATION_TRANSFORM = 0x2, /* Performs coord transformations */
IM_OPERATION_PTOP = 0x4, /* Point-to-point ... can be LUTted */
IM_OPERATION_NOCACHE = 0x8 /* Result should not be cached */
} im_operation_flags;
im_operation_dispatch_fn ()
int (*im_operation_dispatch_fn) (im_value_t **argv
);
im_operation_t
typedef struct {
const char *name; /* eg "im_invert" */
const char *desc; /* One line description */
im_operation_flags flags; /* Flags for this function */
im_operation_dispatch_fn disp; /* Dispatch */
int argc; /* Number of args */
im_argument_t **argv; /* Arg list */
} im_operation_t;
im_type_register ()
im_type_t * im_type_register (const char *name
,
im_type_t *type_param
,
size_t size
);
im_type_map ()
void * im_type_map (VSListMap2Fn fn
,
void *a
,
void *b
);
im_operation_map ()
void * im_operation_map (VSListMap2Fn fn
,
void *a
,
void *b
);
im_operation_lookup ()
im_operation_t * im_operation_lookup (const char *name
);