![]() |
![]() |
![]() |
VIPS Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
#define VIPS_UNREF (X) enum VipsArgumentFlags; #define VIPS_ARGUMENT_REQUIRED_INPUT #define VIPS_ARGUMENT_OPTIONAL_INPUT #define VIPS_ARGUMENT_REQUIRED_OUTPUT VipsArgument; VipsArgumentClass; VipsArgumentInstance; typedef VipsArgumentTable; VipsArgumentInstance * vips__argument_get_instance (VipsArgumentClass *Param1
,VipsObject *Param2
); VipsArgument * vips__argument_table_lookup (VipsArgumentTable *Param1
,GParamSpec *Param2
); void vips__object_set_member (VipsObject *object
,GParamSpec *pspec
,GObject **member
,GObject *argument
); void * (*VipsArgumentMapFn) (VipsObject *Param1
,GParamSpec *Param2
,VipsArgumentClass *Param3
,VipsArgumentInstance *Param4
,void *a
,void *b
); void * vips_argument_map (VipsObject *object
,VipsArgumentMapFn fn
,void *a
,void *b
); void vips_argument_dispose_all (VipsObject *object
); #define VIPS_ARGUMENT_FOR_ALL (OBJECT, PSPEC, ARG_CLASS, ARG_INSTANCE) #define VIPS_ARGUMENT_FOR_ALL_END struct VipsObject; struct VipsObjectClass; gboolean vips_pspec_value_is_null (GParamSpec *pspec
,const GValue *value
); void vips_object_set_property (GObject *gobject
,guint property_id
,const GValue *value
,GParamSpec *pspec
); void vips_object_get_property (GObject *gobject
,guint property_id
,GValue *value
,GParamSpec *pspec
); void vips_object_preclose (VipsObject *object
); int vips_object_build (VipsObject *object
); void vips_object_print_class (VipsObjectClass *klass
); void vips_object_print (VipsObject *object
); void vips_object_print_name (VipsObject *object
); gboolean vips_object_sanity (VipsObject *object
); void vips_object_class_install_argument (VipsObjectClass *Param1
,GParamSpec *pspec
,VipsArgumentFlags flags
,guint offset
); int vips_object_set_argument_from_string (VipsObject *object
,const char *name
,const char *value
); gboolean vips_object_get_argument_needs_string (VipsObject *object
,const char *name
); int vips_object_get_argument_to_string (VipsObject *object
,const char *name
,const char *arg
); int vips_object_set_required (VipsObject *object
,const char *value
); void * (*VipsObjectSetArguments) (VipsObject *Param1
,void *Param2
,void *Param3
); VipsObject * vips_object_new (GType type
,VipsObjectSetArguments set
,void *a
,void *b
); VipsObject * vips_object_new_from_string (VipsObjectClass *object_class
,const char *p
); void vips_object_to_string (VipsObject *object
,VipsBuf *buf
); void * vips_object_map (VipsSListMap2Fn fn
,void *a
,void *b
); void * (*VipsTypeMap) (GType Param1
,void *Param2
); void * (*VipsTypeMap2) (GType Param1
,void *Param2
,void *Param3
); void * (*VipsClassMap) (VipsObjectClass *Param1
,void *Param2
); void * vips_type_map (GType base
,VipsTypeMap2 fn
,void *a
,void *b
); void * vips_type_map_all (GType base
,VipsTypeMap fn
,void *a
); void * vips_class_map_all (GType base
,VipsClassMap fn
,void *a
); int vips_class_depth (VipsObjectClass *klass
); VipsObjectClass * vips_class_find (const char *basename
,const char *nickname
); GType vips_type_find (const char *basename
,const char *nickname
); void vips_object_local_cb (VipsObject *vobject
,GObject *gobject
); #define vips_object_local (V, G) void vips_object_print_all (void
); void vips_object_sanity_all (void
); void vips_object_rewind (VipsObject *object
);
GEnum +----VipsArgumentFlags
GObject +----VipsObject +----VipsOperation +----VipsFormat +----VipsImage +----VipsInterpolate +----VipsPool +----VipsRegion +----VipsThreadState
typedef enum { VIPS_ARGUMENT_NONE = 0, VIPS_ARGUMENT_REQUIRED = 1, VIPS_ARGUMENT_CONSTRUCT = 2, VIPS_ARGUMENT_SET_ONCE = 4, VIPS_ARGUMENT_INPUT = 8, VIPS_ARGUMENT_OUTPUT = 16 } VipsArgumentFlags;
Flags we associate with each object argument.
Have separate input & output flags. Both set is an error; neither set is OK.
Input gobjects are automatically reffed, output gobjects automatically ref us. We also automatically watch for "destroy" and unlink.
no flags | |
must be set in the constructor | |
can only be set in the constructor | |
can only be set once | |
is an input argument (one we depend on) | |
is an output argument (depends on us) |
typedef struct { GParamSpec *pspec; /* pspec for this argument */ /* More stuff, see below */ } VipsArgument;
typedef struct { VipsArgument parent; /* The class of the object we are an arg for. */ VipsObjectClass *object_class; VipsArgumentFlags flags; guint offset; /* G_STRUCT_OFFSET of member in object */ } VipsArgumentClass;
typedef struct { VipsArgument parent; /* The object we are attached to. */ VipsObject *object; /* Has been set. */ gboolean assigned; /* If this is an output argument, keep the id of our "close" handler * here. */ gulong close_id; } VipsArgumentInstance;
VipsArgumentInstance * vips__argument_get_instance (VipsArgumentClass *Param1
,VipsObject *Param2
);
VipsArgument * vips__argument_table_lookup (VipsArgumentTable *Param1
,GParamSpec *Param2
);
void vips__object_set_member (VipsObject *object
,GParamSpec *pspec
,GObject **member
,GObject *argument
);
void * (*VipsArgumentMapFn) (VipsObject *Param1
,GParamSpec *Param2
,VipsArgumentClass *Param3
,VipsArgumentInstance *Param4
,void *a
,void *b
);
void * vips_argument_map (VipsObject *object
,VipsArgumentMapFn fn
,void *a
,void *b
);
struct VipsObjectClass { GObjectClass parent_class; /* Build the object ... all argument properties have been set, * now build the thing. */ int (*build)( VipsObject *object ); /* Try to print something about the class, handy for help displays. */ void (*print_class)( struct _VipsObjectClass *, VipsBuf * ); /* Try to print something about the object, handy for debugging. */ void (*print)( VipsObject *, VipsBuf * ); /* Sanity-check the object. Print messages and stuff. * Handy for debugging. */ void (*sanity)( VipsObject *, VipsBuf * ); /* Rewind. Save and restore any stuff that needs to survive a * dispose(). */ void (*rewind)( VipsObject * ); /* Just before close, everything is still alive. */ void (*preclose)( VipsObject * ); /* Close, time to free stuff. */ void (*close)( VipsObject * ); /* Post-close, everything is dead, except the VipsObject pointer. * Useful for eg. deleting the file associated with a temp image. */ void (*postclose)( VipsObject * ); /* The CLI interface. Implement these four to get CLI input and output * for your object. */ /* Given a command-line arg (eg. a filename), make an instance of the * object. Just do the g_object_new(), don't call _build(). * * Don't call this directly, see vips_object_new_from_string(). */ VipsObject *(*new_from_string)( const char *string ); /* The inverse of ^^. Given an object, output what ->new_from_string() * would have been given to make that object. */ void (*to_string)( VipsObject *, VipsBuf * ); /* Does this output arg need an arg from the command line? Image * output, for example, needs a filename to write to. */ gboolean output_needs_arg; /* Write the object to the string. Return 0 for success, or -1 on * error, setting vips_error(). string is NULL if output_needs_arg() * was FALSE. */ int (*output_to_arg)( VipsObject *object, const char *string ); /* Class nickname, eg. "VipsInterpolateBicubic" has "bicubic" as a * nickname. Not internationalised. */ const char *nickname; /* Class description. Used for help messages, so internationalised. */ const char *description; /* Table of arguments for this class and any derived classes. Order * is important, so keep a traverse list too. We can't rely on the * ordering given by g_object_class_list_properties() since it comes * from a hash :-( */ VipsArgumentTable *argument_table; GSList *argument_table_traverse; };
gboolean vips_pspec_value_is_null (GParamSpec *pspec
,const GValue *value
);
void vips_object_set_property (GObject *gobject
,guint property_id
,const GValue *value
,GParamSpec *pspec
);
void vips_object_get_property (GObject *gobject
,guint property_id
,GValue *value
,GParamSpec *pspec
);
void vips_object_class_install_argument (VipsObjectClass *Param1
,GParamSpec *pspec
,VipsArgumentFlags flags
,guint offset
);
int vips_object_set_argument_from_string (VipsObject *object
,const char *name
,const char *value
);
gboolean vips_object_get_argument_needs_string (VipsObject *object
,const char *name
);
int vips_object_get_argument_to_string (VipsObject *object
,const char *name
,const char *arg
);
void * (*VipsObjectSetArguments) (VipsObject *Param1
,void *Param2
,void *Param3
);
VipsObject * vips_object_new (GType type
,VipsObjectSetArguments set
,void *a
,void *b
);
VipsObject * vips_object_new_from_string (VipsObjectClass *object_class
,const char *p
);