/usr/include/vips/dispatch.h is in libvips-dev 8.4.5-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 | /* VIPS function dispatch.
*
* J. Cupitt, 8/4/93.
*/
/*
This file is part of VIPS.
VIPS 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 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
/*
These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
*/
#ifndef IM_DISPATCH_H
#define IM_DISPATCH_H
#ifdef __cplusplus
extern "C" {
#endif /*__cplusplus*/
#include <glib-object.h>
#include <vips/vips.h>
#include <vips/util.h>
/* Type names. You may define your own, but if you use one of these, then
* you should use the built-in VIPS type converters.
*/
#define IM_TYPE_IMAGEVEC "imagevec" /* im_object is ptr to IMAGE[] */
#define IM_TYPE_DOUBLEVEC "doublevec" /* im_object is ptr to double[] */
#define IM_TYPE_INTVEC "intvec" /* im_object is ptr to int[] */
#define IM_TYPE_DOUBLE "double" /* im_object is ptr to double */
#define IM_TYPE_INT "integer" /* 32-bit integer */
#define IM_TYPE_COMPLEX "complex" /* Pair of doubles */
#define IM_TYPE_STRING "string" /* Zero-terminated char array */
#define IM_TYPE_IMASK "intmask" /* Integer mask type */
#define IM_TYPE_DMASK "doublemask" /* Double mask type */
#define IM_TYPE_IMAGE "image" /* IMAGE descriptor */
#define IM_TYPE_DISPLAY "display" /* Display descriptor */
#define IM_TYPE_GVALUE "gvalue" /* GValue wrapper */
#define IM_TYPE_INTERPOLATE "interpolate"/* A subclass of VipsInterpolate */
typedef char *im_arg_type; /* Type of argument id */
/* Internal representation of an argument to an image processing function.
*/
typedef void *im_object;
/* These bits are ored together to make the flags in a type descriptor.
*
* IM_TYPE_OUTPUT: set to indicate output, otherwise input. If the IM_TYPE_RW
* bit is set and IM_TYPE_OUTPUT is not set, both input and output (ie. the
* operation side-effects this argument).
*
* IM_TYPE_ARG: Two ways of making an im_object --- with and without a
* command-line string to help you along. Arguments with a string are thing
* like IMAGE descriptors, which require a filename to initialise.
* Arguments without are things like output numbers, where making the object
* simply involves allocating storage.
*/
typedef enum {
IM_TYPE_NONE = 0, /* No flags */
IM_TYPE_OUTPUT = 0x1, /* Output/input object */
IM_TYPE_ARG = 0x2, /* Uses a str arg in construction */
IM_TYPE_RW = 0x4 /* Read-write */
} im_type_flags;
/* Initialise, destroy and write objects. The "str" argument to the
* init function will not be supplied if this is not an ARG type. The
* write function writes to the GString.
*/
typedef int (*im_init_obj_fn)( im_object *obj, char *str );
typedef int (*im_dest_obj_fn)( im_object obj );
/* Describe a VIPS type.
*/
typedef struct {
im_arg_type type; /* Type of argument */
int size; /* sizeof( im_object repres. ) */
im_type_flags flags; /* Flags */
im_init_obj_fn init; /* Operation functions */
im_dest_obj_fn dest; /* Destroy object */
} im_type_desc;
/* Success on an argument. This is called if the image processing function
* succeeds and should be used to (for example) print output.
*/
typedef int (*im_print_obj_fn)( im_object obj );
/* Describe a VIPS command argument.
*/
typedef struct {
char *name; /* eg. "width" */
im_type_desc *desc; /* Type description */
im_print_obj_fn print; /* Print some output objects */
} im_arg_desc;
/* Type of VIPS dispatch funtion.
*/
typedef int (*im_dispatch_fn)( im_object *argv );
/* Maximum size of arg table.
*/
#define IM_MAX_ARGS (1000)
/* Flags for functions. These are for information only, and more may be
* added.
*/
typedef enum {
IM_FN_NONE = 0, /* No flags set */
IM_FN_PIO = 0x1, /* Is a partial function */
IM_FN_TRANSFORM = 0x2, /* Performs coordinate transformations */
IM_FN_PTOP = 0x4, /* Point-to-point ... can be done with a LUT */
IM_FN_NOCACHE = 0x8 /* Result should not be cached */
} im_fn_flags;
/* Describe a VIPS function.
*/
typedef struct {
char *name; /* eg "im_invert" */
char *desc; /* Description - eg "photographic negative" */
im_fn_flags flags; /* Flags for this function */
im_dispatch_fn disp; /* Dispatch */
int argc; /* Number of args */
im_arg_desc *argv; /* Arg table */
} im_function;
/* A set of VIPS functions forming a package.
*/
typedef struct {
char *name; /* Package name (eg "arithmetic") */
int nfuncs; /* Number of functions in package */
im_function **table; /* Array of function descriptors */
} im_package;
/* Externs for dispatch.
*/
/* Struct for mask IO to a file.
*/
typedef struct {
char *name; /* Command-line name in */
void *mask; /* Mask --- DOUBLE or INT */
} im_mask_object;
/* Struct for doublevec IO
*/
typedef struct {
int n; /* Vector length */
double *vec; /* Vector */
} im_doublevec_object;
/* Struct for intvec IO
*/
typedef struct {
int n; /* Vector length */
int *vec; /* Vector */
} im_intvec_object;
/* Struct for imagevec IO
*/
typedef struct {
int n; /* Vector length */
IMAGE **vec; /* Vector */
} im_imagevec_object;
/* Built-in VIPS types.
*/
extern im_type_desc im__input_int;
extern im_type_desc im__input_intvec;
extern im_type_desc im__input_imask;
extern im_type_desc im__output_int;
extern im_type_desc im__output_intvec;
extern im_type_desc im__output_imask;
extern im_type_desc im__input_double;
extern im_type_desc im__input_doublevec;
extern im_type_desc im__input_dmask;
extern im_type_desc im__output_double;
extern im_type_desc im__output_doublevec;
extern im_type_desc im__output_dmask;
extern im_type_desc im__output_dmask_screen;
extern im_type_desc im__output_complex;
extern im_type_desc im__input_string;
extern im_type_desc im__output_string;
extern im_type_desc im__input_imagevec;
extern im_type_desc im__input_image;
extern im_type_desc im__output_image;
extern im_type_desc im__rw_image;
extern im_type_desc im__input_display;
extern im_type_desc im__output_display;
extern im_type_desc im__input_gvalue;
extern im_type_desc im__output_gvalue;
extern im_type_desc im__input_interpolate;
/* VIPS print functions.
*/
int im__iprint( im_object obj ); /* int */
int im__ivprint( im_object obj ); /* intvec */
int im__dprint( im_object obj ); /* double */
int im__dvprint( im_object obj ); /* doublevec */
int im__dmsprint( im_object obj ); /* DOUBLEMASK as stats */
int im__cprint( im_object obj ); /* complex */
int im__sprint( im_object obj ); /* string */
int im__displayprint( im_object obj ); /* im_col_display */
int im__gprint( im_object obj ); /* GValue */
/* Macros for convenient creation.
*/
#define IM_INPUT_INT( S ) { S, &im__input_int, NULL }
#define IM_INPUT_INTVEC( S ) { S, &im__input_intvec, NULL }
#define IM_INPUT_IMASK( S ) { S, &im__input_imask, NULL }
#define IM_OUTPUT_INT( S ) { S, &im__output_int, im__iprint }
#define IM_OUTPUT_INTVEC( S ) { S, &im__output_intvec, im__ivprint }
#define IM_OUTPUT_IMASK( S ) { S, &im__output_imask, NULL }
#define IM_INPUT_DOUBLE( S ) { S, &im__input_double, NULL }
#define IM_INPUT_DOUBLEVEC( S ) { S, &im__input_doublevec, NULL }
#define IM_INPUT_DMASK( S ) { S, &im__input_dmask, NULL }
#define IM_OUTPUT_DOUBLE( S ) { S, &im__output_double, im__dprint }
#define IM_OUTPUT_DOUBLEVEC( S ) { S, &im__output_doublevec, im__dvprint }
#define IM_OUTPUT_DMASK( S ) { S, &im__output_dmask, NULL }
#define IM_OUTPUT_DMASK_STATS( S ) { S, &im__output_dmask_screen, im__dmsprint }
#define IM_OUTPUT_COMPLEX( S ) { S, &im__output_complex, im__cprint }
#define IM_INPUT_STRING( S ) { S, &im__input_string, NULL }
#define IM_OUTPUT_STRING( S ) { S, &im__output_string, im__sprint }
#define IM_INPUT_IMAGE( S ) { S, &im__input_image, NULL }
#define IM_INPUT_IMAGEVEC( S ) { S, &im__input_imagevec, NULL }
#define IM_OUTPUT_IMAGE( S ) { S, &im__output_image, NULL }
#define IM_RW_IMAGE( S ) { S, &im__rw_image, NULL }
#define IM_INPUT_DISPLAY( S ) { S, &im__input_display, NULL }
#define IM_OUTPUT_DISPLAY( S ) { S, &im__output_display, im__displayprint }
#define IM_INPUT_GVALUE( S ) { S, &im__input_gvalue, NULL }
#define IM_OUTPUT_GVALUE( S ) { S, &im__output_gvalue, im__gprint }
#define IM_INPUT_INTERPOLATE( S ) { S, &im__input_interpolate, NULL }
/* Add a plug-in package.
*/
im_package *im_load_plugin( const char *name );
int im_load_plugins( const char *fmt, ... )
__attribute__((format(printf, 1, 2)));
/* Close all plug-ins.
*/
int im_close_plugins( void );
/* Loop over all loaded packages.
*/
void *im_map_packages( VipsSListMap2Fn fn, void *a );
/* Convenience functions for finding packages, functions, etc.
*/
im_function *im_find_function( const char *name );
im_package *im_find_package( const char *name );
im_package *im_package_of_function( const char *name );
/* Allocate space for, and free im_object argument lists.
*/
int im_free_vargv( im_function *fn, im_object *vargv );
int im_allocate_vargv( im_function *fn, im_object *vargv );
/* Run a VIPS command by name.
*/
int im_run_command( char *name, int argc, char **argv );
int vips__input_interpolate_init( im_object *obj, char *str );
#ifdef __cplusplus
}
#endif /*__cplusplus*/
#endif /*IM_DISPATCH_H*/
|