2011-03-29 13:12:20 +02:00
|
|
|
/* base class for all vips operations
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
Copyright (C) 1991-2005 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.
|
2011-03-29 13:12:20 +02:00
|
|
|
|
2012-09-17 12:52:32 +02:00
|
|
|
This library is distributed in the hope that it will be useful,
|
2011-03-29 13:12:20 +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.
|
2011-03-29 13:12:20 +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
|
2011-03-29 13:12:20 +02:00
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef VIPS_OPERATION_H
|
|
|
|
#define VIPS_OPERATION_H
|
|
|
|
|
2022-02-15 06:02:07 +01:00
|
|
|
#include <glib.h>
|
|
|
|
#include <glib-object.h>
|
|
|
|
#include <vips/object.h>
|
|
|
|
#include <vips/buf.h>
|
|
|
|
#include <vips/basic.h>
|
|
|
|
|
2011-03-29 13:12:20 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif /*__cplusplus*/
|
|
|
|
|
2012-07-10 11:51:40 +02:00
|
|
|
typedef enum /*< flags >*/ {
|
|
|
|
VIPS_OPERATION_NONE = 0,
|
|
|
|
VIPS_OPERATION_SEQUENTIAL = 1,
|
2013-09-29 12:04:11 +02:00
|
|
|
VIPS_OPERATION_SEQUENTIAL_UNBUFFERED = 2,
|
2014-02-03 14:23:58 +01:00
|
|
|
VIPS_OPERATION_NOCACHE = 4,
|
2022-04-11 12:32:32 +02:00
|
|
|
VIPS_OPERATION_DEPRECATED = 8,
|
|
|
|
VIPS_OPERATION_UNTRUSTED = 16,
|
|
|
|
VIPS_OPERATION_BLOCKED = 32
|
2012-07-10 11:51:40 +02:00
|
|
|
} VipsOperationFlags;
|
|
|
|
|
2011-03-29 13:12:20 +02:00
|
|
|
#define VIPS_TYPE_OPERATION (vips_operation_get_type())
|
|
|
|
#define VIPS_OPERATION( obj ) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_CAST( (obj), \
|
|
|
|
VIPS_TYPE_OPERATION, VipsOperation ))
|
|
|
|
#define VIPS_OPERATION_CLASS( klass ) \
|
|
|
|
(G_TYPE_CHECK_CLASS_CAST( (klass), \
|
|
|
|
VIPS_TYPE_OPERATION, VipsOperationClass ))
|
|
|
|
#define VIPS_IS_OPERATION( obj ) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_OPERATION ))
|
|
|
|
#define VIPS_IS_OPERATION_CLASS( klass ) \
|
|
|
|
(G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_OPERATION ))
|
|
|
|
#define VIPS_OPERATION_GET_CLASS( obj ) \
|
|
|
|
(G_TYPE_INSTANCE_GET_CLASS( (obj), \
|
|
|
|
VIPS_TYPE_OPERATION, VipsOperationClass ))
|
|
|
|
|
2014-09-03 15:32:55 +02:00
|
|
|
typedef gboolean (*VipsOperationBuildFn)( VipsObject *object );
|
2011-03-29 13:12:20 +02:00
|
|
|
|
|
|
|
typedef struct _VipsOperation {
|
|
|
|
VipsObject parent_instance;
|
|
|
|
|
2011-09-19 11:18:48 +02:00
|
|
|
/* Keep the hash here.
|
|
|
|
*/
|
|
|
|
guint hash;
|
|
|
|
gboolean found_hash;
|
|
|
|
|
2013-11-26 15:57:56 +01:00
|
|
|
/* Pixels calculated ... handy for measuring over-calculation.
|
2013-11-18 19:31:49 +01:00
|
|
|
*/
|
|
|
|
int pixels;
|
|
|
|
|
2011-03-29 13:12:20 +02:00
|
|
|
} VipsOperation;
|
|
|
|
|
|
|
|
typedef struct _VipsOperationClass {
|
|
|
|
VipsObjectClass parent_class;
|
|
|
|
|
2011-12-02 14:15:05 +01:00
|
|
|
/* Print the usage message.
|
|
|
|
*/
|
2014-09-03 15:32:55 +02:00
|
|
|
void (*usage)( struct _VipsOperationClass *cls, VipsBuf *buf );
|
2012-07-10 11:51:40 +02:00
|
|
|
|
2012-07-18 11:39:29 +02:00
|
|
|
/* Return a set of operation flags.
|
2012-07-10 11:51:40 +02:00
|
|
|
*/
|
2014-09-03 15:32:55 +02:00
|
|
|
VipsOperationFlags (*get_flags)( VipsOperation *operation );
|
2012-07-10 11:51:40 +02:00
|
|
|
VipsOperationFlags flags;
|
2014-06-12 10:22:28 +02:00
|
|
|
|
|
|
|
/* One of our input images has signalled "invalidate". The cache uses
|
|
|
|
* VipsOperation::invalidate to drop dirty ops.
|
|
|
|
*/
|
2014-09-03 15:32:55 +02:00
|
|
|
void (*invalidate)( VipsOperation *operation );
|
2011-03-29 13:12:20 +02:00
|
|
|
} VipsOperationClass;
|
|
|
|
|
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_operation_get_type(void);
|
2011-03-29 13:12:20 +02:00
|
|
|
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2012-07-10 11:51:40 +02:00
|
|
|
VipsOperationFlags vips_operation_get_flags( VipsOperation *operation );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-12-02 14:15:05 +01:00
|
|
|
void vips_operation_class_print_usage( VipsOperationClass *operation_class );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2014-06-12 10:22:28 +02:00
|
|
|
void vips_operation_invalidate( VipsOperation *operation );
|
2011-12-02 14:15:05 +01:00
|
|
|
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-03-29 13:12:20 +02:00
|
|
|
int vips_operation_call_valist( VipsOperation *operation, va_list ap );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-03-29 13:12:20 +02:00
|
|
|
VipsOperation *vips_operation_new( const char *name );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2014-10-21 15:55:38 +02:00
|
|
|
int vips_call_required_optional( VipsOperation **operation,
|
2014-10-27 13:57:28 +01:00
|
|
|
va_list required, va_list optional );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2012-07-09 15:51:37 +02:00
|
|
|
int vips_call( const char *operation_name, ... )
|
|
|
|
__attribute__((sentinel));
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2012-07-09 18:20:58 +02:00
|
|
|
int vips_call_split( const char *operation_name, va_list optional, ... );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2014-04-25 15:50:58 +02:00
|
|
|
int vips_call_split_option_string( const char *operation_name,
|
|
|
|
const char *option_string, va_list optional, ... );
|
2011-03-29 13:12:20 +02:00
|
|
|
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-05-16 18:10:08 +02:00
|
|
|
void vips_call_options( GOptionGroup *group, VipsOperation *operation );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-05-11 15:51:47 +02:00
|
|
|
int vips_call_argv( VipsOperation *operation, int argc, char **argv );
|
|
|
|
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-09-22 15:07:12 +02:00
|
|
|
void vips_cache_drop_all( void );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2015-02-01 18:56:48 +01:00
|
|
|
VipsOperation *vips_cache_operation_lookup( VipsOperation *operation );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2015-02-01 18:56:48 +01:00
|
|
|
void vips_cache_operation_add( VipsOperation *operation );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2012-01-03 17:02:52 +01:00
|
|
|
int vips_cache_operation_buildp( VipsOperation **operation );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2012-01-03 17:02:52 +01:00
|
|
|
VipsOperation *vips_cache_operation_build( VipsOperation *operation );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2012-06-21 14:11:35 +02:00
|
|
|
void vips_cache_print( void );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-09-22 15:07:12 +02:00
|
|
|
void vips_cache_set_max( int max );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2012-01-06 15:56:24 +01:00
|
|
|
void vips_cache_set_max_mem( size_t max_mem );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-09-22 15:07:12 +02:00
|
|
|
int vips_cache_get_max( void );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-09-22 15:07:12 +02:00
|
|
|
int vips_cache_get_size( void );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-09-22 15:07:12 +02:00
|
|
|
size_t vips_cache_get_max_mem( void );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-11-02 15:51:39 +01:00
|
|
|
int vips_cache_get_max_files( void );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2011-11-02 15:51:39 +01:00
|
|
|
void vips_cache_set_max_files( int max_files );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2012-01-06 15:56:24 +01:00
|
|
|
void vips_cache_set_dump( gboolean dump );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2012-01-06 15:56:24 +01:00
|
|
|
void vips_cache_set_trace( gboolean trace );
|
2011-09-19 17:44:51 +02:00
|
|
|
|
2016-09-09 09:52:14 +02:00
|
|
|
/* Part of threadpool, really, but we want these in a header that gets scanned
|
|
|
|
* for our typelib.
|
|
|
|
*/
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2016-09-09 09:52:14 +02:00
|
|
|
void vips_concurrency_set( int concurrency );
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2016-09-09 09:52:14 +02:00
|
|
|
int vips_concurrency_get( void );
|
|
|
|
|
2022-04-16 11:58:55 +02:00
|
|
|
VIPS_API
|
2022-04-11 12:32:32 +02:00
|
|
|
void vips_operation_block_set( const char *name, gboolean state );
|
|
|
|
|
2011-03-29 13:12:20 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif /*__cplusplus*/
|
|
|
|
|
|
|
|
#endif /*VIPS_OPERATION_H*/
|