2009-08-16 17:00:08 +02:00
|
|
|
/* abstract base class for all vips objects
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
Copyright (C) 1991-2003 The National Gallery
|
|
|
|
|
2012-09-17 12:52:32 +02:00
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
2009-08-16 17:00:08 +02:00
|
|
|
|
2012-09-17 12:52:32 +02:00
|
|
|
This library is distributed in the hope that it will be useful,
|
2009-08-16 17:00:08 +02:00
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2012-09-17 12:52:32 +02:00
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
2009-08-16 17:00:08 +02:00
|
|
|
|
2012-09-17 12:52:32 +02:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
License along with this library; if not, write to the Free Software
|
2013-03-07 06:40:19 +01:00
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
|
|
02110-1301 USA
|
2009-08-16 17:00:08 +02:00
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef VIPS_OBJECT_H
|
|
|
|
#define VIPS_OBJECT_H
|
|
|
|
|
2022-02-15 06:02:07 +01:00
|
|
|
#include <glib.h>
|
|
|
|
#include <glib-object.h>
|
|
|
|
#include <vips/buf.h>
|
|
|
|
#include <vips/basic.h>
|
|
|
|
|
2009-08-16 17:00:08 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif /*__cplusplus*/
|
|
|
|
|
2011-02-15 23:49:22 +01:00
|
|
|
/* Handy!
|
|
|
|
*/
|
2013-07-15 11:49:49 +02:00
|
|
|
#ifdef VIPS_DEBUG
|
|
|
|
#define VIPS_UNREF( X ) G_STMT_START { \
|
|
|
|
if( X ) { \
|
|
|
|
g_assert( G_OBJECT( X )->ref_count > 0 ); \
|
|
|
|
g_object_unref( X ); \
|
|
|
|
(X) = 0; \
|
|
|
|
} \
|
|
|
|
} G_STMT_END
|
|
|
|
#else /*!VIPS_DEBUG*/
|
2011-07-15 15:37:20 +02:00
|
|
|
#define VIPS_UNREF( X ) VIPS_FREEF( g_object_unref, (X) )
|
2013-07-15 11:49:49 +02:00
|
|
|
#endif /*VIPS_DEBUG*/
|
2011-02-15 23:49:22 +01:00
|
|
|
|
2009-08-16 17:00:08 +02:00
|
|
|
typedef struct _VipsObject VipsObject;
|
|
|
|
typedef struct _VipsObjectClass VipsObjectClass;
|
|
|
|
|
|
|
|
/* Track extra stuff for arguments to objects
|
|
|
|
*/
|
|
|
|
|
2012-02-20 22:02:37 +01:00
|
|
|
typedef enum /*< flags >*/ {
|
2009-08-16 17:00:08 +02:00
|
|
|
VIPS_ARGUMENT_NONE = 0,
|
|
|
|
VIPS_ARGUMENT_REQUIRED = 1,
|
|
|
|
VIPS_ARGUMENT_CONSTRUCT = 2,
|
|
|
|
VIPS_ARGUMENT_SET_ONCE = 4,
|
2012-01-02 12:06:04 +01:00
|
|
|
VIPS_ARGUMENT_SET_ALWAYS = 8,
|
|
|
|
VIPS_ARGUMENT_INPUT = 16,
|
2012-08-07 13:52:50 +02:00
|
|
|
VIPS_ARGUMENT_OUTPUT = 32,
|
2014-09-15 15:47:34 +02:00
|
|
|
VIPS_ARGUMENT_DEPRECATED = 64,
|
|
|
|
VIPS_ARGUMENT_MODIFY = 128
|
2011-02-16 15:40:31 +01:00
|
|
|
} VipsArgumentFlags;
|
2009-08-16 17:00:08 +02:00
|
|
|
|
|
|
|
/* Useful flag combinations. User-visible ones are:
|
|
|
|
|
2011-03-03 15:49:12 +01:00
|
|
|
VIPS_ARGUMENT_REQUIRED_INPUT Eg. the "left" argument for an add operation
|
2009-08-16 17:00:08 +02:00
|
|
|
|
|
|
|
VIPS_ARGUMENT_OPTIONAL_INPUT Eg. the "caption" for an object
|
|
|
|
|
2011-08-30 17:33:25 +02:00
|
|
|
VIPS_ARGUMENT_REQUIRED_OUTPUT Eg. the "result" of an add operation
|
|
|
|
|
|
|
|
VIPS_ARGUMENT_OPTIONAL_OUTPUT Eg. the x pos of the image minimum
|
2009-08-16 17:00:08 +02:00
|
|
|
|
|
|
|
Other combinations are used internally, eg. supplying the cast-table for an
|
|
|
|
arithmetic operation
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define VIPS_ARGUMENT_REQUIRED_INPUT \
|
|
|
|
(VIPS_ARGUMENT_INPUT | \
|
2011-05-13 15:47:23 +02:00
|
|
|
VIPS_ARGUMENT_REQUIRED | \
|
2011-11-01 14:31:08 +01:00
|
|
|
VIPS_ARGUMENT_CONSTRUCT)
|
2009-08-16 17:00:08 +02:00
|
|
|
|
2011-05-13 15:47:23 +02:00
|
|
|
#define VIPS_ARGUMENT_OPTIONAL_INPUT \
|
|
|
|
(VIPS_ARGUMENT_INPUT | \
|
2011-11-01 14:31:08 +01:00
|
|
|
VIPS_ARGUMENT_CONSTRUCT)
|
2009-08-16 17:00:08 +02:00
|
|
|
|
2011-05-19 10:22:48 +02:00
|
|
|
#define VIPS_ARGUMENT_REQUIRED_OUTPUT \
|
2009-08-16 17:00:08 +02:00
|
|
|
(VIPS_ARGUMENT_OUTPUT | \
|
2011-05-19 10:22:48 +02:00
|
|
|
VIPS_ARGUMENT_REQUIRED | \
|
2011-11-01 14:31:08 +01:00
|
|
|
VIPS_ARGUMENT_CONSTRUCT)
|
2009-08-16 17:00:08 +02:00
|
|
|
|
2011-08-30 17:33:25 +02:00
|
|
|
#define VIPS_ARGUMENT_OPTIONAL_OUTPUT \
|
|
|
|
(VIPS_ARGUMENT_OUTPUT | \
|
2011-11-01 14:31:08 +01:00
|
|
|
VIPS_ARGUMENT_CONSTRUCT)
|
2011-08-30 17:33:25 +02:00
|
|
|
|
2011-10-16 15:48:47 +02:00
|
|
|
#define VIPS_ARG_IMAGE( CLASS, NAME, PRIORITY, LONG, DESC, FLAGS, OFFSET ) { \
|
|
|
|
GParamSpec *pspec; \
|
|
|
|
\
|
|
|
|
pspec = g_param_spec_object( (NAME), (LONG), (DESC), \
|
|
|
|
VIPS_TYPE_IMAGE, \
|
2014-10-06 15:37:44 +02:00
|
|
|
(GParamFlags) (G_PARAM_READWRITE) ); \
|
2011-10-16 15:48:47 +02:00
|
|
|
g_object_class_install_property( G_OBJECT_CLASS( CLASS ), \
|
2018-05-29 17:49:20 +02:00
|
|
|
vips_argument_get_id(), pspec ); \
|
2011-10-16 15:48:47 +02:00
|
|
|
vips_object_class_install_argument( VIPS_OBJECT_CLASS( CLASS ), \
|
2014-10-06 15:37:44 +02:00
|
|
|
pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET) ); \
|
2011-10-16 15:48:47 +02:00
|
|
|
}
|
|
|
|
|
2019-10-10 23:02:39 +02:00
|
|
|
#define VIPS_ARG_OBJECT( CLASS, NAME, PRIORITY, LONG, DESC, FLAGS, OFFSET, TYPE ) { \
|
2012-11-08 14:34:37 +01:00
|
|
|
GParamSpec *pspec; \
|
|
|
|
\
|
|
|
|
pspec = g_param_spec_object( (NAME), (LONG), (DESC), \
|
2019-10-10 23:02:39 +02:00
|
|
|
TYPE, \
|
2014-10-06 15:37:44 +02:00
|
|
|
(GParamFlags) (G_PARAM_READWRITE) ); \
|
2012-11-08 14:34:37 +01:00
|
|
|
g_object_class_install_property( G_OBJECT_CLASS( CLASS ), \
|
2018-05-29 17:49:20 +02:00
|
|
|
vips_argument_get_id(), pspec ); \
|
2012-11-08 14:34:37 +01:00
|
|
|
vips_object_class_install_argument( VIPS_OBJECT_CLASS( CLASS ), \
|
2014-10-06 15:37:44 +02:00
|
|
|
pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET) ); \
|
2012-11-08 14:34:37 +01:00
|
|
|
}
|
|
|
|
|
2019-10-10 23:02:39 +02:00
|
|
|
#define VIPS_ARG_INTERPOLATE( CLASS, NAME, PRIORITY, LONG, DESC, FLAGS, OFFSET ) \
|
|
|
|
VIPS_ARG_OBJECT( CLASS, NAME, PRIORITY, LONG, DESC, FLAGS, OFFSET, VIPS_TYPE_INTERPOLATE )
|
|
|
|
|
2011-10-21 15:50:34 +02:00
|
|
|
#define VIPS_ARG_BOOL( CLASS, NAME, PRIORITY, LONG, DESC, \
|
|
|
|
FLAGS, OFFSET, VALUE ) { \
|
2011-10-16 15:48:47 +02:00
|
|
|
GParamSpec *pspec; \
|
|
|
|
\
|
|
|
|
pspec = g_param_spec_boolean( (NAME), (LONG), (DESC), \
|
|
|
|
(VALUE), \
|
2014-10-06 15:37:44 +02:00
|
|
|
(GParamFlags) (G_PARAM_READWRITE) ); \
|
2011-10-16 15:48:47 +02:00
|
|
|
g_object_class_install_property( G_OBJECT_CLASS( CLASS ), \
|
2018-05-29 17:49:20 +02:00
|
|
|
vips_argument_get_id(), pspec ); \
|
2011-10-16 15:48:47 +02:00
|
|
|
vips_object_class_install_argument( VIPS_OBJECT_CLASS( CLASS ), \
|
2014-10-06 15:37:44 +02:00
|
|
|
pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET) ); \
|
2011-10-16 15:48:47 +02:00
|
|
|
}
|
|
|
|
|
2011-10-21 15:50:34 +02:00
|
|
|
#define VIPS_ARG_DOUBLE( CLASS, NAME, PRIORITY, LONG, DESC, \
|
|
|
|
FLAGS, OFFSET, MIN, MAX, VALUE ) { \
|
2011-10-16 15:48:47 +02:00
|
|
|
GParamSpec *pspec; \
|
|
|
|
\
|
|
|
|
pspec = g_param_spec_double( (NAME), (LONG), (DESC), \
|
|
|
|
(MIN), (MAX), (VALUE), \
|
2014-10-06 15:37:44 +02:00
|
|
|
(GParamFlags) (G_PARAM_READWRITE) );\
|
2011-10-16 15:48:47 +02:00
|
|
|
g_object_class_install_property( G_OBJECT_CLASS( CLASS ), \
|
2018-05-29 17:49:20 +02:00
|
|
|
vips_argument_get_id(), pspec ); \
|
2011-10-16 15:48:47 +02:00
|
|
|
vips_object_class_install_argument( VIPS_OBJECT_CLASS( CLASS ), \
|
2014-10-06 15:37:44 +02:00
|
|
|
pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET) ); \
|
2011-10-16 15:48:47 +02:00
|
|
|
}
|
|
|
|
|
2011-10-21 15:50:34 +02:00
|
|
|
#define VIPS_ARG_BOXED( CLASS, NAME, PRIORITY, LONG, DESC, \
|
2011-10-22 14:10:47 +02:00
|
|
|
FLAGS, OFFSET, TYPE ) { \
|
2011-10-20 15:56:13 +02:00
|
|
|
GParamSpec *pspec; \
|
|
|
|
\
|
|
|
|
pspec = g_param_spec_boxed( (NAME), (LONG), (DESC), \
|
2011-10-21 15:50:34 +02:00
|
|
|
(TYPE), \
|
2014-10-06 15:37:44 +02:00
|
|
|
(GParamFlags) (G_PARAM_READWRITE) );\
|
2011-10-20 15:56:13 +02:00
|
|
|
g_object_class_install_property( G_OBJECT_CLASS( CLASS ), \
|
2018-05-29 17:49:20 +02:00
|
|
|
vips_argument_get_id(), pspec ); \
|
2011-10-20 15:56:13 +02:00
|
|
|
vips_object_class_install_argument( VIPS_OBJECT_CLASS( CLASS ), \
|
2014-10-06 15:37:44 +02:00
|
|
|
pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET) ); \
|
2011-10-20 15:56:13 +02:00
|
|
|
}
|
|
|
|
|
2011-10-21 15:50:34 +02:00
|
|
|
#define VIPS_ARG_INT( CLASS, NAME, PRIORITY, LONG, DESC, \
|
|
|
|
FLAGS, OFFSET, MIN, MAX, VALUE ) { \
|
2011-10-16 15:48:47 +02:00
|
|
|
GParamSpec *pspec; \
|
|
|
|
\
|
|
|
|
pspec = g_param_spec_int( (NAME), (LONG), (DESC), \
|
|
|
|
(MIN), (MAX), (VALUE), \
|
2014-10-06 15:37:44 +02:00
|
|
|
(GParamFlags) (G_PARAM_READWRITE) );\
|
2011-10-16 15:48:47 +02:00
|
|
|
g_object_class_install_property( G_OBJECT_CLASS( CLASS ), \
|
2018-05-29 17:49:20 +02:00
|
|
|
vips_argument_get_id(), pspec ); \
|
2011-10-16 15:48:47 +02:00
|
|
|
vips_object_class_install_argument( VIPS_OBJECT_CLASS( CLASS ), \
|
2014-10-06 15:37:44 +02:00
|
|
|
pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET) ); \
|
2011-10-16 15:48:47 +02:00
|
|
|
}
|
|
|
|
|
2011-12-09 10:42:39 +01:00
|
|
|
#define VIPS_ARG_UINT64( CLASS, NAME, PRIORITY, LONG, DESC, \
|
|
|
|
FLAGS, OFFSET, MIN, MAX, VALUE ) { \
|
|
|
|
GParamSpec *pspec; \
|
|
|
|
\
|
|
|
|
pspec = g_param_spec_uint64( (NAME), (LONG), (DESC), \
|
|
|
|
(MIN), (MAX), (VALUE), \
|
2014-10-06 15:37:44 +02:00
|
|
|
(GParamFlags) (G_PARAM_READWRITE) );\
|
2011-12-09 10:42:39 +01:00
|
|
|
g_object_class_install_property( G_OBJECT_CLASS( CLASS ), \
|
2018-05-29 17:49:20 +02:00
|
|
|
vips_argument_get_id(), pspec ); \
|
2011-12-09 10:42:39 +01:00
|
|
|
vips_object_class_install_argument( VIPS_OBJECT_CLASS( CLASS ), \
|
2014-10-06 15:37:44 +02:00
|
|
|
pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET) ); \
|
2011-12-09 10:42:39 +01:00
|
|
|
}
|
|
|
|
|
2011-10-21 15:50:34 +02:00
|
|
|
#define VIPS_ARG_ENUM( CLASS, NAME, PRIORITY, LONG, DESC, \
|
|
|
|
FLAGS, OFFSET, TYPE, VALUE ) { \
|
2011-10-16 15:48:47 +02:00
|
|
|
GParamSpec *pspec; \
|
|
|
|
\
|
|
|
|
pspec = g_param_spec_enum( (NAME), (LONG), (DESC), \
|
|
|
|
(TYPE), (VALUE), \
|
2014-10-06 15:37:44 +02:00
|
|
|
(GParamFlags) (G_PARAM_READWRITE) );\
|
2011-10-16 15:48:47 +02:00
|
|
|
g_object_class_install_property( G_OBJECT_CLASS( CLASS ), \
|
2018-05-29 17:49:20 +02:00
|
|
|
vips_argument_get_id(), pspec ); \
|
2011-10-16 15:48:47 +02:00
|
|
|
vips_object_class_install_argument( VIPS_OBJECT_CLASS( CLASS ), \
|
2014-10-06 15:37:44 +02:00
|
|
|
pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET) ); \
|
2011-10-16 15:48:47 +02:00
|
|
|
}
|
|
|
|
|
2012-02-20 22:02:37 +01:00
|
|
|
#define VIPS_ARG_FLAGS( CLASS, NAME, PRIORITY, LONG, DESC, \
|
|
|
|
FLAGS, OFFSET, TYPE, VALUE ) { \
|
|
|
|
GParamSpec *pspec; \
|
|
|
|
\
|
|
|
|
pspec = g_param_spec_flags( (NAME), (LONG), (DESC), \
|
|
|
|
(TYPE), (VALUE), \
|
2014-10-06 15:37:44 +02:00
|
|
|
(GParamFlags) (G_PARAM_READWRITE) );\
|
2012-02-20 22:02:37 +01:00
|
|
|
g_object_class_install_property( G_OBJECT_CLASS( CLASS ), \
|
2018-05-29 17:49:20 +02:00
|
|
|
vips_argument_get_id(), pspec ); \
|
2012-02-20 22:02:37 +01:00
|
|
|
vips_object_class_install_argument( VIPS_OBJECT_CLASS( CLASS ), \
|
2014-10-06 15:37:44 +02:00
|
|
|
pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET) ); \
|
2012-02-20 22:02:37 +01:00
|
|
|
}
|
|
|
|
|
2011-10-16 15:48:47 +02:00
|
|
|
#define VIPS_ARG_STRING( CLASS, NAME, PRIORITY, LONG, DESC, FLAGS, OFFSET, \
|
|
|
|
VALUE ) { \
|
|
|
|
GParamSpec *pspec; \
|
|
|
|
\
|
|
|
|
pspec = g_param_spec_string( (NAME), (LONG), (DESC), \
|
|
|
|
(VALUE), \
|
2014-10-06 15:37:44 +02:00
|
|
|
(GParamFlags) (G_PARAM_READWRITE) ); \
|
2011-10-16 15:48:47 +02:00
|
|
|
g_object_class_install_property( G_OBJECT_CLASS( CLASS ), \
|
2018-05-29 17:49:20 +02:00
|
|
|
vips_argument_get_id(), pspec ); \
|
2011-10-16 15:48:47 +02:00
|
|
|
vips_object_class_install_argument( VIPS_OBJECT_CLASS( CLASS ), \
|
2014-10-06 15:37:44 +02:00
|
|
|
pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET) ); \
|
2011-10-16 15:48:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#define VIPS_ARG_POINTER( CLASS, NAME, PRIORITY, LONG, DESC, FLAGS, OFFSET ) { \
|
|
|
|
GParamSpec *pspec; \
|
|
|
|
\
|
|
|
|
pspec = g_param_spec_pointer( (NAME), (LONG), (DESC), \
|
2014-10-06 15:37:44 +02:00
|
|
|
(GParamFlags) (G_PARAM_READWRITE) ); \
|
2018-12-20 17:44:52 +01:00
|
|
|
g_object_class_install_property( G_OBJECT_CLASS( CLASS ), \
|
2018-05-29 17:49:20 +02:00
|
|
|
vips_argument_get_id(), pspec ); \
|
2011-10-16 15:48:47 +02:00
|
|
|
vips_object_class_install_argument( VIPS_OBJECT_CLASS( CLASS ), \
|
2014-10-06 15:37:44 +02:00
|
|
|
pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET) ); \
|
2011-10-16 15:48:47 +02:00
|
|
|
}
|
|
|
|
|
2009-08-16 17:00:08 +02:00
|
|
|
/* Keep one of these for every argument.
|
|
|
|
*/
|
|
|
|
typedef struct _VipsArgument {
|
|
|
|
GParamSpec *pspec; /* pspec for this argument */
|
|
|
|
|
|
|
|
/* More stuff, see below */
|
|
|
|
} VipsArgument;
|
|
|
|
|
|
|
|
/* Keep one of these in the class struct for every argument.
|
|
|
|
*/
|
|
|
|
typedef struct _VipsArgumentClass {
|
|
|
|
VipsArgument parent;
|
|
|
|
|
|
|
|
/* The class of the object we are an arg for.
|
|
|
|
*/
|
|
|
|
VipsObjectClass *object_class;
|
|
|
|
|
2011-02-16 15:40:31 +01:00
|
|
|
VipsArgumentFlags flags;
|
2011-10-16 15:48:47 +02:00
|
|
|
int priority; /* Order args by this */
|
2009-08-16 17:00:08 +02:00
|
|
|
guint offset; /* G_STRUCT_OFFSET of member in object */
|
|
|
|
} VipsArgumentClass;
|
|
|
|
|
|
|
|
/* Keep one of these in the object struct for every argument instance.
|
|
|
|
*/
|
|
|
|
typedef struct _VipsArgumentInstance {
|
|
|
|
VipsArgument parent;
|
|
|
|
|
2011-09-04 11:10:39 +02:00
|
|
|
/* The class we are part of.
|
|
|
|
*/
|
|
|
|
VipsArgumentClass *argument_class;
|
|
|
|
|
2009-08-16 17:00:08 +02:00
|
|
|
/* The object we are attached to.
|
|
|
|
*/
|
|
|
|
VipsObject *object;
|
|
|
|
|
|
|
|
/* Has been set.
|
|
|
|
*/
|
|
|
|
gboolean assigned;
|
|
|
|
|
2011-04-04 16:46:57 +02:00
|
|
|
/* If this is an output argument, keep the id of our "close" handler
|
2009-08-16 17:00:08 +02:00
|
|
|
* here.
|
|
|
|
*/
|
2011-04-04 16:46:57 +02:00
|
|
|
gulong close_id;
|
2014-06-12 10:22:28 +02:00
|
|
|
|
|
|
|
/* We need to listen for "invalidate" on input images and send our own
|
|
|
|
* "invalidate" out. If we go, we need to disconnect.
|
|
|
|
*/
|
|
|
|
gulong invalidate_id;
|
2009-08-16 17:00:08 +02:00
|
|
|
} VipsArgumentInstance;
|
|
|
|
|
|
|
|
/* Need to look up our VipsArgument structs from a pspec. Just hash the
|
|
|
|
* pointer (ie. we assume pspecs are never shared, is this correct?)
|
|
|
|
*/
|
|
|
|
typedef GHashTable VipsArgumentTable;
|
|
|
|
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2018-05-29 17:49:20 +02:00
|
|
|
int vips_argument_get_id( void );
|
2011-07-17 15:36:57 +02:00
|
|
|
void vips__object_set_member( VipsObject *object, GParamSpec *pspec,
|
|
|
|
GObject **member, GObject *argument );
|
2014-09-03 15:32:55 +02:00
|
|
|
typedef void *(*VipsArgumentMapFn)( VipsObject *object, GParamSpec *pspec,
|
|
|
|
VipsArgumentClass *argument_class,
|
|
|
|
VipsArgumentInstance *argument_instance, void *a, void *b );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2009-08-16 17:00:08 +02:00
|
|
|
void *vips_argument_map( VipsObject *object,
|
|
|
|
VipsArgumentMapFn fn, void *a, void *b );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2018-08-20 09:45:46 +02:00
|
|
|
int vips_object_get_args( VipsObject *object,
|
2018-08-19 22:42:26 +02:00
|
|
|
const char ***names, int **flags, int *n_args );
|
2014-09-03 15:32:55 +02:00
|
|
|
typedef void *(*VipsArgumentClassMapFn)( VipsObjectClass *object_class,
|
|
|
|
GParamSpec *pspec,
|
|
|
|
VipsArgumentClass *argument_class, void *a, void *b );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-12-02 14:15:05 +01:00
|
|
|
void *vips_argument_class_map( VipsObjectClass *object_class,
|
|
|
|
VipsArgumentClassMapFn fn, void *a, void *b );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2014-02-20 20:52:36 +01:00
|
|
|
gboolean vips_argument_class_needsstring( VipsArgumentClass *argument_class );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-09-30 00:26:10 +02:00
|
|
|
int vips_object_get_argument( VipsObject *object, const char *name,
|
|
|
|
GParamSpec **pspec,
|
|
|
|
VipsArgumentClass **argument_class,
|
|
|
|
VipsArgumentInstance **argument_instance );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2012-11-09 14:08:59 +01:00
|
|
|
gboolean vips_object_argument_isset( VipsObject *object, const char *name );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2012-01-05 14:26:25 +01:00
|
|
|
VipsArgumentFlags vips_object_get_argument_flags( VipsObject *object,
|
|
|
|
const char *name );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2012-01-05 14:26:25 +01:00
|
|
|
int vips_object_get_argument_priority( VipsObject *object, const char *name );
|
2011-05-16 18:10:08 +02:00
|
|
|
|
2011-05-22 18:32:57 +02:00
|
|
|
/* We have to loop over an objects args in several places, and we can't always
|
|
|
|
* use vips_argument_map(), the preferred looper. Have the loop code as a
|
|
|
|
* macro as well for these odd cases.
|
|
|
|
*/
|
|
|
|
#define VIPS_ARGUMENT_FOR_ALL( OBJECT, PSPEC, ARG_CLASS, ARG_INSTANCE ) { \
|
|
|
|
VipsObjectClass *object_class = VIPS_OBJECT_GET_CLASS( OBJECT ); \
|
|
|
|
GSList *p; \
|
|
|
|
\
|
|
|
|
for( p = object_class->argument_table_traverse; p; p = p->next ) { \
|
|
|
|
VipsArgumentClass *ARG_CLASS = \
|
|
|
|
(VipsArgumentClass *) p->data; \
|
|
|
|
VipsArgument *argument = (VipsArgument *) argument_class; \
|
|
|
|
GParamSpec *PSPEC = argument->pspec; \
|
2022-09-23 15:37:35 +02:00
|
|
|
VipsArgumentInstance *ARG_INSTANCE G_GNUC_UNUSED = \
|
2011-05-22 18:32:57 +02:00
|
|
|
vips__argument_get_instance( argument_class, \
|
|
|
|
VIPS_OBJECT( OBJECT ) ); \
|
|
|
|
|
2012-06-01 15:20:20 +02:00
|
|
|
#define VIPS_ARGUMENT_FOR_ALL_END } }
|
2011-05-22 18:32:57 +02:00
|
|
|
|
2012-02-23 11:05:13 +01:00
|
|
|
/* And some macros to collect args from a va list.
|
2012-11-02 22:45:13 +01:00
|
|
|
*
|
|
|
|
* Use something like this:
|
|
|
|
|
|
|
|
GParamSpec *pspec;
|
|
|
|
VipsArgumentClass *argument_class;
|
|
|
|
VipsArgumentInstance *argument_instance;
|
|
|
|
|
|
|
|
if( vips_object_get_argument( VIPS_OBJECT( operation ), name,
|
|
|
|
&pspec, &argument_class, &argument_instance ) )
|
|
|
|
return( -1 );
|
|
|
|
|
|
|
|
VIPS_ARGUMENT_COLLECT_SET( pspec, argument_class, ap );
|
|
|
|
|
|
|
|
GValue value holds the value of an input argument, do
|
|
|
|
something with it
|
|
|
|
|
|
|
|
VIPS_ARGUMENT_COLLECT_GET( pspec, argument_class, ap );
|
|
|
|
|
|
|
|
void **arg points to where to write an output argument
|
|
|
|
|
|
|
|
VIPS_ARGUMENT_COLLECT_END
|
|
|
|
|
2012-02-23 11:05:13 +01:00
|
|
|
*/
|
2020-10-10 19:48:52 +02:00
|
|
|
#define VIPS_ARGUMENT_COLLECT_SET( PSPEC, ARG_CLASS, AP ) \
|
|
|
|
if( (ARG_CLASS->flags & VIPS_ARGUMENT_INPUT) ) { \
|
|
|
|
GValue value = { 0, }; \
|
|
|
|
gchar *error = NULL; \
|
|
|
|
\
|
|
|
|
/* Input args are given inline, eg. ("factor", 12.0) \
|
|
|
|
* and must be collected. \
|
|
|
|
*/ \
|
|
|
|
G_VALUE_COLLECT_INIT( &value, \
|
|
|
|
G_PARAM_SPEC_VALUE_TYPE( PSPEC ), AP, 0, &error ); \
|
|
|
|
\
|
|
|
|
/* Don't bother with the error message. \
|
|
|
|
*/ \
|
|
|
|
if( error ) { \
|
|
|
|
VIPS_DEBUG_MSG( "VIPS_OBJECT_COLLECT_SET: err\n" ); \
|
|
|
|
g_free( error ); \
|
|
|
|
}
|
2012-02-23 11:05:13 +01:00
|
|
|
|
|
|
|
#define VIPS_ARGUMENT_COLLECT_GET( PSPEC, ARG_CLASS, AP ) \
|
|
|
|
g_value_unset( &value ); \
|
|
|
|
} \
|
|
|
|
else if( (ARG_CLASS->flags & VIPS_ARGUMENT_OUTPUT) ) { \
|
2022-09-23 15:37:35 +02:00
|
|
|
void **arg G_GNUC_UNUSED; \
|
2012-02-23 11:05:13 +01:00
|
|
|
\
|
|
|
|
/* Output args are a pointer to where to send the \
|
|
|
|
* result. \
|
|
|
|
*/ \
|
|
|
|
arg = va_arg( AP, void ** );
|
|
|
|
|
|
|
|
#define VIPS_ARGUMENT_COLLECT_END \
|
|
|
|
}
|
|
|
|
|
2009-08-16 17:00:08 +02:00
|
|
|
#define VIPS_TYPE_OBJECT (vips_object_get_type())
|
|
|
|
#define VIPS_OBJECT( obj ) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_CAST( (obj), VIPS_TYPE_OBJECT, VipsObject ))
|
|
|
|
#define VIPS_OBJECT_CLASS( klass ) \
|
|
|
|
(G_TYPE_CHECK_CLASS_CAST( (klass), VIPS_TYPE_OBJECT, VipsObjectClass))
|
|
|
|
#define VIPS_IS_OBJECT( obj ) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_OBJECT ))
|
|
|
|
#define VIPS_IS_OBJECT_CLASS( klass ) \
|
|
|
|
(G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_OBJECT ))
|
|
|
|
#define VIPS_OBJECT_GET_CLASS( obj ) \
|
|
|
|
(G_TYPE_INSTANCE_GET_CLASS( (obj), VIPS_TYPE_OBJECT, VipsObjectClass ))
|
|
|
|
|
|
|
|
struct _VipsObject {
|
2016-07-13 23:39:16 +02:00
|
|
|
GObject parent_instance;
|
2009-08-16 17:00:08 +02:00
|
|
|
|
2011-11-14 12:51:15 +01:00
|
|
|
/* Set after ->build() has run succesfully: construct is fully done
|
|
|
|
* and checked.
|
|
|
|
*/
|
|
|
|
gboolean constructed;
|
|
|
|
|
|
|
|
/* Set for static objects which are allocated at startup and never
|
|
|
|
* freed. These objects are ommitted from leak reports.
|
|
|
|
*/
|
|
|
|
gboolean static_object;
|
2009-08-16 17:00:08 +02:00
|
|
|
|
|
|
|
/* Table of argument instances for this class and any derived classes.
|
|
|
|
*/
|
|
|
|
VipsArgumentTable *argument_table;
|
|
|
|
|
|
|
|
/* Class properties (see below), duplicated in the instance so we can
|
|
|
|
* get at them easily via the property system.
|
|
|
|
*/
|
|
|
|
char *nickname;
|
|
|
|
char *description;
|
2011-02-16 15:40:31 +01:00
|
|
|
|
|
|
|
/* The pre/post/close callbacks are all fire-once.
|
|
|
|
*/
|
|
|
|
gboolean preclose;
|
|
|
|
gboolean close;
|
|
|
|
gboolean postclose;
|
2013-10-02 22:20:41 +02:00
|
|
|
|
|
|
|
/* Total memory allocated relative to this object, handy for
|
|
|
|
* profiling.
|
|
|
|
*/
|
|
|
|
size_t local_memory;
|
2014-02-03 14:23:58 +01:00
|
|
|
|
2009-08-16 17:00:08 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _VipsObjectClass {
|
2011-06-02 13:23:56 +02:00
|
|
|
GObjectClass parent_class;
|
2009-08-16 17:00:08 +02:00
|
|
|
|
|
|
|
/* Build the object ... all argument properties have been set,
|
|
|
|
* now build the thing.
|
|
|
|
*/
|
|
|
|
int (*build)( VipsObject *object );
|
|
|
|
|
2014-04-09 12:42:03 +02:00
|
|
|
/* Just after build ... the object is fully ready for work.
|
|
|
|
*/
|
2020-06-30 12:10:30 +02:00
|
|
|
int (*postbuild)( VipsObject *object, void *data );
|
2014-04-09 12:42:03 +02:00
|
|
|
|
2009-08-16 17:00:08 +02:00
|
|
|
/* Try to print something about the class, handy for help displays.
|
2011-12-02 14:15:05 +01:00
|
|
|
* Keep to one line.
|
2009-08-16 17:00:08 +02:00
|
|
|
*/
|
2014-09-03 15:32:55 +02:00
|
|
|
void (*summary_class)( struct _VipsObjectClass *cls, VipsBuf *buf );
|
2009-08-16 17:00:08 +02:00
|
|
|
|
2013-02-26 14:32:40 +01:00
|
|
|
/* Try to print a one-line summary for the object, the user can see
|
|
|
|
* this output via things like "header fred.tif", --vips-cache-trace,
|
|
|
|
* etc.
|
2009-08-16 17:00:08 +02:00
|
|
|
*/
|
2014-09-03 15:32:55 +02:00
|
|
|
void (*summary)( VipsObject *object, VipsBuf *buf );
|
2009-08-16 17:00:08 +02:00
|
|
|
|
2012-01-16 15:54:29 +01:00
|
|
|
/* Try to print everything about the object, handy for debugging.
|
2011-12-14 15:03:30 +01:00
|
|
|
*/
|
2014-09-03 15:32:55 +02:00
|
|
|
void (*dump)( VipsObject *object, VipsBuf *buf );
|
2011-12-14 15:03:30 +01:00
|
|
|
|
2011-03-10 15:17:02 +01:00
|
|
|
/* Sanity-check the object. Print messages and stuff.
|
|
|
|
* Handy for debugging.
|
|
|
|
*/
|
2014-09-03 15:32:55 +02:00
|
|
|
void (*sanity)( VipsObject *object, VipsBuf *buf );
|
2011-03-10 15:17:02 +01:00
|
|
|
|
2011-03-11 00:44:38 +01:00
|
|
|
/* Rewind. Save and restore any stuff that needs to survive a
|
|
|
|
* dispose().
|
|
|
|
*/
|
2014-09-03 15:32:55 +02:00
|
|
|
void (*rewind)( VipsObject *object );
|
2011-03-11 00:44:38 +01:00
|
|
|
|
2011-02-16 15:40:31 +01:00
|
|
|
/* Just before close, everything is still alive.
|
|
|
|
*/
|
2014-09-03 15:32:55 +02:00
|
|
|
void (*preclose)( VipsObject *object );
|
2011-02-16 15:40:31 +01:00
|
|
|
|
|
|
|
/* Close, time to free stuff.
|
|
|
|
*/
|
2014-09-03 15:32:55 +02:00
|
|
|
void (*close)( VipsObject *object );
|
2011-02-16 15:40:31 +01:00
|
|
|
|
|
|
|
/* Post-close, everything is dead, except the VipsObject pointer.
|
|
|
|
* Useful for eg. deleting the file associated with a temp image.
|
|
|
|
*/
|
2014-09-03 15:32:55 +02:00
|
|
|
void (*postclose)( VipsObject *object );
|
2011-02-16 15:40:31 +01:00
|
|
|
|
2011-05-25 13:24:01 +02:00
|
|
|
/* The CLI interface. Implement these four to get CLI input and output
|
2011-05-24 15:44:23 +02:00
|
|
|
* for your object.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Given a command-line arg (eg. a filename), make an instance of the
|
2011-05-25 14:25:18 +02:00
|
|
|
* object. Just do the g_object_new(), don't call _build().
|
|
|
|
*
|
|
|
|
* Don't call this directly, see vips_object_new_from_string().
|
2011-05-24 15:44:23 +02:00
|
|
|
*/
|
|
|
|
VipsObject *(*new_from_string)( const char *string );
|
|
|
|
|
2011-05-25 13:24:01 +02:00
|
|
|
/* The inverse of ^^. Given an object, output what ->new_from_string()
|
|
|
|
* would have been given to make that object.
|
|
|
|
*/
|
2014-09-03 15:32:55 +02:00
|
|
|
void (*to_string)( VipsObject *object, VipsBuf *buf );
|
2011-05-25 13:24:01 +02:00
|
|
|
|
2011-05-24 15:44:23 +02:00
|
|
|
/* 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
|
2011-05-25 13:24:01 +02:00
|
|
|
* error, setting vips_error(). string is NULL if output_needs_arg()
|
2011-05-24 15:44:23 +02:00
|
|
|
* was FALSE.
|
|
|
|
*/
|
|
|
|
int (*output_to_arg)( VipsObject *object, const char *string );
|
|
|
|
|
2009-08-16 17:00:08 +02:00
|
|
|
/* 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;
|
|
|
|
|
2012-06-01 15:20:20 +02:00
|
|
|
/* Hash from pspec to VipsArgumentClass.
|
|
|
|
*
|
|
|
|
* This records the VipsArgumentClass for every pspec used in
|
|
|
|
* VipsObject and any subclass (ie. everywhere), so it's huge. Don't
|
|
|
|
* loop over this hash! Fine for lookups though.
|
2009-08-16 17:00:08 +02:00
|
|
|
*/
|
|
|
|
VipsArgumentTable *argument_table;
|
2012-06-01 15:20:20 +02:00
|
|
|
|
|
|
|
/* A sorted (by priority) list of the VipsArgumentClass for this class
|
|
|
|
* and any superclasses. This is small and specific to this class.
|
|
|
|
*
|
|
|
|
* Use the stored GType to work out when to restart the list for a
|
|
|
|
* subclass.
|
|
|
|
*/
|
2009-08-16 17:00:08 +02:00
|
|
|
GSList *argument_table_traverse;
|
2012-06-01 15:20:20 +02:00
|
|
|
GType argument_table_traverse_gtype;
|
2014-02-03 14:23:58 +01:00
|
|
|
|
2014-06-10 15:43:46 +02:00
|
|
|
/* This class is deprecated and therefore hidden from various UI bits.
|
|
|
|
*
|
|
|
|
* VipsOperation has a deprecated flag, use that in preference to this
|
|
|
|
* if you can.
|
|
|
|
*/
|
|
|
|
gboolean deprecated;
|
|
|
|
|
2014-02-03 14:23:58 +01:00
|
|
|
/* Reserved for future expansion.
|
|
|
|
*/
|
|
|
|
void (*_vips_reserved1)( void );
|
|
|
|
void (*_vips_reserved2)( void );
|
|
|
|
void (*_vips_reserved3)( void );
|
|
|
|
void (*_vips_reserved4)( void );
|
2009-08-16 17:00:08 +02:00
|
|
|
};
|
|
|
|
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-09-09 18:01:29 +02:00
|
|
|
gboolean vips_value_is_null( GParamSpec *psoec, const GValue *value );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2009-08-16 17:00:08 +02:00
|
|
|
void vips_object_set_property( GObject *gobject,
|
|
|
|
guint property_id, const GValue *value, GParamSpec *pspec );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2009-08-16 17:00:08 +02:00
|
|
|
void vips_object_get_property( GObject *gobject,
|
|
|
|
guint property_id, GValue *value, GParamSpec *pspec );
|
|
|
|
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-03-07 16:52:53 +01:00
|
|
|
void vips_object_preclose( VipsObject *object );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2009-08-16 17:00:08 +02:00
|
|
|
int vips_object_build( VipsObject *object );
|
2012-01-16 15:54:29 +01:00
|
|
|
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2012-01-16 15:54:29 +01:00
|
|
|
void vips_object_summary_class( VipsObjectClass *klass, VipsBuf *buf );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2012-01-16 15:54:29 +01:00
|
|
|
void vips_object_summary( VipsObject *object, VipsBuf *buf );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2012-01-16 15:54:29 +01:00
|
|
|
void vips_object_dump( VipsObject *object, VipsBuf *buf );
|
|
|
|
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2012-01-16 15:54:29 +01:00
|
|
|
void vips_object_print_summary_class( VipsObjectClass *klass );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-12-14 15:03:30 +01:00
|
|
|
void vips_object_print_summary( VipsObject *object );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2012-01-16 15:54:29 +01:00
|
|
|
void vips_object_print_dump( VipsObject *object );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-05-16 09:31:55 +02:00
|
|
|
void vips_object_print_name( VipsObject *object );
|
2012-01-16 15:54:29 +01:00
|
|
|
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-03-10 15:17:02 +01:00
|
|
|
gboolean vips_object_sanity( VipsObject *object );
|
2009-08-16 17:00:08 +02:00
|
|
|
|
2016-07-13 23:39:16 +02:00
|
|
|
/* Don't put spaces around void here, it breaks gtk-doc.
|
|
|
|
*/
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2016-07-13 23:39:16 +02:00
|
|
|
GType vips_object_get_type(void);
|
2009-08-16 17:00:08 +02:00
|
|
|
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2014-09-03 15:32:55 +02:00
|
|
|
void vips_object_class_install_argument( VipsObjectClass *cls,
|
|
|
|
GParamSpec *pspec, VipsArgumentFlags flags,
|
|
|
|
int priority, guint offset );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-05-13 11:08:53 +02:00
|
|
|
int vips_object_set_argument_from_string( VipsObject *object,
|
|
|
|
const char *name, const char *value );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2012-11-09 14:08:59 +01:00
|
|
|
gboolean vips_object_argument_needsstring( VipsObject *object,
|
2011-05-23 18:12:09 +02:00
|
|
|
const char *name );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-05-23 18:12:09 +02:00
|
|
|
int vips_object_get_argument_to_string( VipsObject *object,
|
|
|
|
const char *name, const char *arg );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-05-22 18:32:57 +02:00
|
|
|
int vips_object_set_required( VipsObject *object, const char *value );
|
2009-08-16 17:00:08 +02:00
|
|
|
|
2014-09-03 15:32:55 +02:00
|
|
|
typedef void *(*VipsObjectSetArguments)( VipsObject *object, void *a, void *b );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2009-08-16 17:00:08 +02:00
|
|
|
VipsObject *vips_object_new( GType type,
|
|
|
|
VipsObjectSetArguments set, void *a, void *b );
|
|
|
|
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2014-10-27 13:57:28 +01:00
|
|
|
int vips_object_set_valist( VipsObject *object, va_list ap );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2012-07-09 15:51:37 +02:00
|
|
|
int vips_object_set( VipsObject *object, ... )
|
2022-09-23 15:37:35 +02:00
|
|
|
G_GNUC_NULL_TERMINATED;
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2014-04-23 13:57:49 +02:00
|
|
|
int vips_object_set_from_string( VipsObject *object, const char *string );
|
2012-07-09 15:51:37 +02:00
|
|
|
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-05-25 13:24:01 +02:00
|
|
|
VipsObject *vips_object_new_from_string( VipsObjectClass *object_class,
|
|
|
|
const char *p );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2009-08-16 17:00:08 +02:00
|
|
|
void vips_object_to_string( VipsObject *object, VipsBuf *buf );
|
|
|
|
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-03-28 17:03:31 +02:00
|
|
|
void *vips_object_map( VipsSListMap2Fn fn, void *a, void *b );
|
2011-02-15 15:41:46 +01:00
|
|
|
|
2014-09-03 15:32:55 +02:00
|
|
|
typedef void *(*VipsTypeMapFn)( GType type, void *a );
|
|
|
|
typedef void *(*VipsTypeMap2Fn)( GType type, void *a, void *b );
|
|
|
|
typedef void *(*VipsClassMapFn)( VipsObjectClass *cls, void *a );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-11-19 13:51:13 +01:00
|
|
|
void *vips_type_map( GType base, VipsTypeMap2Fn fn, void *a, void *b );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-11-19 13:51:13 +01:00
|
|
|
void *vips_type_map_all( GType base, VipsTypeMapFn fn, void *a );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-11-19 13:51:13 +01:00
|
|
|
int vips_type_depth( GType type );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-02-16 15:40:31 +01:00
|
|
|
GType vips_type_find( const char *basename, const char *nickname );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2014-09-08 15:53:37 +02:00
|
|
|
const char *vips_nickname_find( GType type );
|
2011-02-16 15:40:31 +01:00
|
|
|
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2014-11-17 11:32:40 +01:00
|
|
|
void *vips_class_map_all( GType type, VipsClassMapFn fn, void *a );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2016-07-13 18:07:26 +02:00
|
|
|
const VipsObjectClass *vips_class_find( const char *basename,
|
|
|
|
const char *nickname );
|
2011-11-19 13:51:13 +01:00
|
|
|
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-10-27 18:40:39 +02:00
|
|
|
VipsObject **vips_object_local_array( VipsObject *parent, int n );
|
|
|
|
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-02-24 13:51:52 +01:00
|
|
|
void vips_object_local_cb( VipsObject *vobject, GObject *gobject );
|
|
|
|
#define vips_object_local( V, G ) \
|
2015-04-25 18:39:16 +02:00
|
|
|
(g_signal_connect( V, "close", G_CALLBACK( vips_object_local_cb ), G ))
|
2011-02-24 13:51:52 +01:00
|
|
|
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-11-14 12:51:15 +01:00
|
|
|
void vips_object_set_static( VipsObject *object, gboolean static_object );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-03-10 15:17:02 +01:00
|
|
|
void vips_object_print_all( void );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-03-10 15:17:02 +01:00
|
|
|
void vips_object_sanity_all( void );
|
|
|
|
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-03-10 15:44:38 +01:00
|
|
|
void vips_object_rewind( VipsObject *object );
|
|
|
|
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-11-30 23:06:52 +01:00
|
|
|
void vips_object_unref_outputs( VipsObject *object );
|
|
|
|
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2014-11-13 15:37:59 +01:00
|
|
|
const char *vips_object_get_description( VipsObject *object );
|
|
|
|
|
2009-08-16 17:00:08 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif /*__cplusplus*/
|
|
|
|
|
|
|
|
#endif /*VIPS_OBJECT_H*/
|
|
|
|
|
|
|
|
|