more hacking on gio warnings
all the serious ones seem to be fixed now
This commit is contained in:
parent
d0ec401a12
commit
7ae919e4f4
25
TODO
25
TODO
@ -1,26 +1,13 @@
|
|||||||
- remaining warnings
|
- remaining warnings
|
||||||
|
|
||||||
include/vips/type.h:99: Warning: Vips: vips_value_get_area: return value: Missing (transfer) annotation
|
include/vips/type.h:156: Warning: Vips: vips_value_get_array_object: return
|
||||||
include/vips/type.h:98: Warning: Vips: vips_value_set_area: argument free_fn: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
|
value: Missing (transfer) annotation
|
||||||
include/vips/type.h:137: Warning: Vips: vips_value_get_array: return value: Missing (transfer) annotation
|
include/vips/operation.h:81: Warning: Vips: vips_operation_class_print_usage:
|
||||||
include/vips/type.h:156: Warning: Vips: vips_value_get_array_object: return value: Missing (transfer) annotation
|
argument operation_class: Unresolved type: 'VipsOperationClass*'
|
||||||
include/vips/type.h:86: Warning: Vips: vips_area_new: argument free_fn: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
|
foreign/foreign.c:383: Warning: Vips: vips_foreign_map: argument fn:
|
||||||
include/vips/type.h:87: Warning: Vips: vips_area_new_blob: argument free_fn: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
|
Unresolved type: 'VipsSListMap2Fn'
|
||||||
|
|
||||||
iofuncs/type.c:518: Warning: Vips: vips_value_get_blob: return value: Missing (transfer) annotation
|
|
||||||
iofuncs/type.c:471: Warning: Vips: vips_value_set_blob: argument free_fn: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
|
|
||||||
|
|
||||||
iofuncs/header.c:921: Warning: Vips: vips_image_set_area: argument free_fn: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
|
|
||||||
iofuncs/header.c:993: Warning: Vips: vips_image_set_blob: argument free_fn: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
|
|
||||||
|
|
||||||
include/vips/object.h:273: Warning: Vips: vips__argument_table_lookup: return value: Unresolved type: 'VipsArgument*'
|
|
||||||
|
|
||||||
include/vips/operation.h:81: Warning: Vips: vips_operation_class_print_usage: argument operation_class: Unresolved type: 'VipsOperationClass*'
|
|
||||||
|
|
||||||
foreign/foreign.c:383: Warning: Vips: vips_foreign_map: argument fn: Unresolved type: 'VipsSListMap2Fn'
|
|
||||||
foreign/foreign.c:399: Warning: Vips: vips_foreign_map: return value: Missing (transfer) annotation
|
|
||||||
|
|
||||||
conversion/im_system_image.c:129: Warning: Vips: im_system_image: return value: Missing (transfer) annotation
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -55,8 +55,7 @@ vips_introspection_sources="$introspection_sources2"
|
|||||||
|
|
||||||
# add headers that form the public vips8 API .. don't do a find and exclude,
|
# add headers that form the public vips8 API .. don't do a find and exclude,
|
||||||
# we end up excluding almost everything argh
|
# we end up excluding almost everything argh
|
||||||
headers="vips.h object.h image.h error.h foreign.h interpolate.h header.h
|
headers="basic.h vips.h object.h image.h error.h foreign.h interpolate.h header.h operation.h enumtypes.h arithmetic.h conversion.h type.h"
|
||||||
operation.h enumtypes.h arithmetic.h conversion.h type.h"
|
|
||||||
for name in $headers; do
|
for name in $headers; do
|
||||||
vips_introspection_sources="$vips_introspection_sources include/vips/$name"
|
vips_introspection_sources="$vips_introspection_sources include/vips/$name"
|
||||||
done
|
done
|
||||||
|
@ -126,7 +126,7 @@ system_image( IMAGE *im,
|
|||||||
*
|
*
|
||||||
* See also: im_system().
|
* See also: im_system().
|
||||||
*
|
*
|
||||||
* Returns: an image on success, NULL on error
|
* Returns: (transfer full): an image on success, NULL on error
|
||||||
*/
|
*/
|
||||||
IMAGE *
|
IMAGE *
|
||||||
im_system_image( IMAGE *im,
|
im_system_image( IMAGE *im,
|
||||||
|
@ -383,7 +383,7 @@ file_compare( VipsForeignClass *a, VipsForeignClass *b )
|
|||||||
/**
|
/**
|
||||||
* vips_foreign_map:
|
* vips_foreign_map:
|
||||||
* @base: base class to search below (eg. "VipsForeignLoad")
|
* @base: base class to search below (eg. "VipsForeignLoad")
|
||||||
* @fn: function to apply to each #VipsForeignClass
|
* @fn: (scope call): function to apply to each #VipsForeignClass
|
||||||
* @a: user data
|
* @a: user data
|
||||||
* @b: user data
|
* @b: user data
|
||||||
*
|
*
|
||||||
@ -396,7 +396,7 @@ file_compare( VipsForeignClass *a, VipsForeignClass *b )
|
|||||||
*
|
*
|
||||||
* See also: vips_slist_map().
|
* See also: vips_slist_map().
|
||||||
*
|
*
|
||||||
* Returns: the result of iteration
|
* Returns: (transfer none): the result of iteration
|
||||||
*/
|
*/
|
||||||
void *
|
void *
|
||||||
vips_foreign_map( const char *base, VipsSListMap2Fn fn, void *a, void *b )
|
vips_foreign_map( const char *base, VipsSListMap2Fn fn, void *a, void *b )
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
pkginclude_HEADERS = \
|
pkginclude_HEADERS = \
|
||||||
|
basic.h \
|
||||||
type.h \
|
type.h \
|
||||||
almostdeprecated.h \
|
almostdeprecated.h \
|
||||||
deprecated.h \
|
deprecated.h \
|
||||||
|
63
libvips/include/vips/basic.h
Normal file
63
libvips/include/vips/basic.h
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
/* A few basic types needed everywhere.
|
||||||
|
*
|
||||||
|
* 27/10/11
|
||||||
|
* - from type.h
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef VIPS_BASIC_H
|
||||||
|
#define VIPS_BASIC_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif /*__cplusplus*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* VipsPel:
|
||||||
|
*
|
||||||
|
* A picture element. Cast this to whatever the associated VipsBandFormat says
|
||||||
|
* to get the value.
|
||||||
|
*/
|
||||||
|
typedef unsigned char VipsPel;
|
||||||
|
|
||||||
|
/* Also used for eg. vips_local() and friends.
|
||||||
|
*/
|
||||||
|
typedef int (*VipsCallbackFn)( void *a, void *b );
|
||||||
|
|
||||||
|
/* Like GFunc, but return a value.
|
||||||
|
*/
|
||||||
|
typedef void *(*VipsSListMap2Fn)( void *, void *, void * );
|
||||||
|
typedef void *(*VipsSListMap4Fn)( void *, void *, void *, void *, void * );
|
||||||
|
typedef void *(*VipsSListFold2Fn)( void *, void *, void *, void * );
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif /*__cplusplus*/
|
||||||
|
|
||||||
|
#endif /*VIPS_BASIC_H*/
|
@ -1,4 +1,4 @@
|
|||||||
/* area.h
|
/* the GTypes we define
|
||||||
*
|
*
|
||||||
* 27/10/11
|
* 27/10/11
|
||||||
* - from header.h
|
* - from header.h
|
||||||
@ -30,25 +30,13 @@
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef VIPS_AREA_H
|
#ifndef VIPS_TYPE_H
|
||||||
#define VIPS_AREA_H
|
#define VIPS_TYPE_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif /*__cplusplus*/
|
#endif /*__cplusplus*/
|
||||||
|
|
||||||
/**
|
|
||||||
* VipsPel:
|
|
||||||
*
|
|
||||||
* A picture element. Cast this to whatever the associated VipsBandFormat says
|
|
||||||
* to get the value.
|
|
||||||
*/
|
|
||||||
typedef unsigned char VipsPel;
|
|
||||||
|
|
||||||
/* Also used for eg. vips_local() and friends.
|
|
||||||
*/
|
|
||||||
typedef int (*VipsCallbackFn)( void *a, void *b );
|
|
||||||
|
|
||||||
/* A ref-counted area of memory. Can hold arrays of things as well.
|
/* A ref-counted area of memory. Can hold arrays of things as well.
|
||||||
*/
|
*/
|
||||||
typedef struct _VipsArea {
|
typedef struct _VipsArea {
|
||||||
@ -95,7 +83,7 @@ VipsArea *vips_area_new_array_object( int n );
|
|||||||
* The #GType for a #vips_area.
|
* The #GType for a #vips_area.
|
||||||
*/
|
*/
|
||||||
#define VIPS_TYPE_AREA (vips_area_get_type())
|
#define VIPS_TYPE_AREA (vips_area_get_type())
|
||||||
int vips_value_set_area( GValue *value, VipsCallbackFn free_fn, void *data );
|
void vips_value_set_area( GValue *value, VipsCallbackFn free_fn, void *data );
|
||||||
void *vips_value_get_area( const GValue *value, size_t *length );
|
void *vips_value_get_area( const GValue *value, size_t *length );
|
||||||
GType vips_area_get_type( void );
|
GType vips_area_get_type( void );
|
||||||
|
|
||||||
@ -128,12 +116,12 @@ GType vips_ref_string_get_type( void );
|
|||||||
*/
|
*/
|
||||||
#define VIPS_TYPE_BLOB (vips_blob_get_type())
|
#define VIPS_TYPE_BLOB (vips_blob_get_type())
|
||||||
void *vips_value_get_blob( const GValue *value, size_t *length );
|
void *vips_value_get_blob( const GValue *value, size_t *length );
|
||||||
int vips_value_set_blob( GValue *value,
|
void vips_value_set_blob( GValue *value,
|
||||||
VipsCallbackFn free_fn, void *data, size_t length );
|
VipsCallbackFn free_fn, void *data, size_t length );
|
||||||
GType vips_blob_get_type( void );
|
GType vips_blob_get_type( void );
|
||||||
|
|
||||||
int vips_value_set_array( GValue *value,
|
void vips_value_set_array( GValue *value,
|
||||||
GType type, size_t sizeof_type, int n );
|
int n, GType type, size_t sizeof_type );
|
||||||
void *vips_value_get_array( const GValue *value,
|
void *vips_value_get_array( const GValue *value,
|
||||||
int *n, GType *type, size_t *sizeof_type );
|
int *n, GType *type, size_t *sizeof_type );
|
||||||
|
|
||||||
@ -163,4 +151,4 @@ void vips__meta_init_types( void );
|
|||||||
}
|
}
|
||||||
#endif /*__cplusplus*/
|
#endif /*__cplusplus*/
|
||||||
|
|
||||||
#endif /*VIPS_AREA_H*/
|
#endif /*VIPS_TYPE_H*/
|
||||||
|
@ -155,12 +155,6 @@ G_STMT_START { \
|
|||||||
#define VIPS_ENUM_NICK( ENUM, VALUE ) \
|
#define VIPS_ENUM_NICK( ENUM, VALUE ) \
|
||||||
(g_enum_get_value( g_type_class_ref( ENUM ), VALUE )->value_nick)
|
(g_enum_get_value( g_type_class_ref( ENUM ), VALUE )->value_nick)
|
||||||
|
|
||||||
/* Like GFunc, but return a value.
|
|
||||||
*/
|
|
||||||
typedef void *(*VipsSListMap2Fn)( void *, void *, void * );
|
|
||||||
typedef void *(*VipsSListMap4Fn)( void *, void *, void *, void *, void * );
|
|
||||||
typedef void *(*VipsSListFold2Fn)( void *, void *, void *, void * );
|
|
||||||
|
|
||||||
gboolean vips_slist_equal( GSList *l1, GSList *l2 );
|
gboolean vips_slist_equal( GSList *l1, GSList *l2 );
|
||||||
void *vips_slist_map2( GSList *list, VipsSListMap2Fn fn, void *a, void *b );
|
void *vips_slist_map2( GSList *list, VipsSListMap2Fn fn, void *a, void *b );
|
||||||
void *vips_slist_map2_rev( GSList *list, VipsSListMap2Fn fn, void *a, void *b );
|
void *vips_slist_map2_rev( GSList *list, VipsSListMap2Fn fn, void *a, void *b );
|
||||||
|
@ -94,6 +94,8 @@ extern "C" {
|
|||||||
# endif
|
# endif
|
||||||
#endif /*SWIG*/
|
#endif /*SWIG*/
|
||||||
|
|
||||||
|
#include <vips/basic.h>
|
||||||
|
|
||||||
#include <vips/buf.h>
|
#include <vips/buf.h>
|
||||||
#include <vips/util.h>
|
#include <vips/util.h>
|
||||||
#include <vips/object.h>
|
#include <vips/object.h>
|
||||||
|
@ -922,7 +922,7 @@ vips_image_map( VipsImage *image, VipsImageMapFn fn, void *a )
|
|||||||
* vips_image_set_area:
|
* vips_image_set_area:
|
||||||
* @image: image to attach the metadata to
|
* @image: image to attach the metadata to
|
||||||
* @field: metadata name
|
* @field: metadata name
|
||||||
* @free_fn: free function for @data
|
* @free_fn: (scope async): free function for @data
|
||||||
* @data: pointer to area of memory
|
* @data: pointer to area of memory
|
||||||
*
|
*
|
||||||
* Attaches @data as a metadata item on @image under the name @field. When
|
* Attaches @data as a metadata item on @image under the name @field. When
|
||||||
@ -994,7 +994,7 @@ vips_image_get_area( VipsImage *image, const char *field, void **data )
|
|||||||
* vips_image_set_blob:
|
* vips_image_set_blob:
|
||||||
* @image: image to attach the metadata to
|
* @image: image to attach the metadata to
|
||||||
* @field: metadata name
|
* @field: metadata name
|
||||||
* @free_fn: free function for @data
|
* @free_fn: (scope async): free function for @data
|
||||||
* @data: pointer to area of memory
|
* @data: pointer to area of memory
|
||||||
* @length: length of memory area
|
* @length: length of memory area
|
||||||
*
|
*
|
||||||
|
@ -287,6 +287,10 @@ vips_argument_instance_free( VipsArgumentInstance *argument_instance )
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* vips__argument_table_lookup: (skip)
|
* vips__argument_table_lookup: (skip)
|
||||||
|
* @table: table to search
|
||||||
|
* @pspec: spec to search for
|
||||||
|
*
|
||||||
|
* Find the #VipsArgument for a @pspec.
|
||||||
*/
|
*/
|
||||||
VipsArgument *
|
VipsArgument *
|
||||||
vips__argument_table_lookup( VipsArgumentTable *table, GParamSpec *pspec )
|
vips__argument_table_lookup( VipsArgumentTable *table, GParamSpec *pspec )
|
||||||
|
@ -209,6 +209,12 @@ vips_operation_init( VipsOperation *operation )
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* vips_operation_class_print_usage: (skip)
|
||||||
|
* @operation_class: class to print usage for
|
||||||
|
*
|
||||||
|
* Print a usage message for the operation to stdout.
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
vips_operation_class_print_usage( VipsOperationClass *operation_class )
|
vips_operation_class_print_usage( VipsOperationClass *operation_class )
|
||||||
{
|
{
|
||||||
|
@ -112,7 +112,10 @@ vips_area_unref( VipsArea *area )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* An area of mem with a free func. (eg. \0-terminated string, or a struct).
|
/**
|
||||||
|
* vips_area_new: (skip)
|
||||||
|
*
|
||||||
|
* An area of mem with a free func. (eg. \0-terminated string, or a struct).
|
||||||
* Inital count == 1, so _unref() after attaching somewhere.
|
* Inital count == 1, so _unref() after attaching somewhere.
|
||||||
*/
|
*/
|
||||||
VipsArea *
|
VipsArea *
|
||||||
@ -137,7 +140,10 @@ vips_area_new( VipsCallbackFn free_fn, void *data )
|
|||||||
return( area );
|
return( area );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* An area of mem with a free func and a length (some sort of binary object,
|
/**
|
||||||
|
* vips_area_new_blob: (skip)
|
||||||
|
*
|
||||||
|
* An area of mem with a free func and a length (some sort of binary object,
|
||||||
* like an ICC profile).
|
* like an ICC profile).
|
||||||
*/
|
*/
|
||||||
VipsArea *
|
VipsArea *
|
||||||
@ -200,9 +206,15 @@ vips_area_new_array_object( int n )
|
|||||||
return( area );
|
return( area );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set value to be a ref-counted area of memory with a free function.
|
/**
|
||||||
|
* vips_value_set_area:
|
||||||
|
* @value: set this value
|
||||||
|
* @free_fn: (scope async): data will be freed with this function
|
||||||
|
* @data: set @value to track this pointer
|
||||||
|
*
|
||||||
|
* Set value to be a ref-counted area of memory with a free function.
|
||||||
*/
|
*/
|
||||||
int
|
void
|
||||||
vips_value_set_area( GValue *value, VipsCallbackFn free_fn, void *data )
|
vips_value_set_area( GValue *value, VipsCallbackFn free_fn, void *data )
|
||||||
{
|
{
|
||||||
VipsArea *area;
|
VipsArea *area;
|
||||||
@ -211,11 +223,16 @@ vips_value_set_area( GValue *value, VipsCallbackFn free_fn, void *data )
|
|||||||
g_value_init( value, VIPS_TYPE_AREA );
|
g_value_init( value, VIPS_TYPE_AREA );
|
||||||
g_value_set_boxed( value, area );
|
g_value_set_boxed( value, area );
|
||||||
vips_area_unref( area );
|
vips_area_unref( area );
|
||||||
|
|
||||||
return( 0 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Don't touch count (area is static).
|
/**
|
||||||
|
* vips_value_get_area:
|
||||||
|
* @value: get from this value
|
||||||
|
* @length: (allow-none): optionally return length here
|
||||||
|
*
|
||||||
|
* Get the pointer from an area. Don't touch count (area is static).
|
||||||
|
*
|
||||||
|
* Returns: (transfer none): The pointer held by @value.
|
||||||
*/
|
*/
|
||||||
void *
|
void *
|
||||||
vips_value_get_area( const GValue *value, size_t *length )
|
vips_value_get_area( const GValue *value, size_t *length )
|
||||||
@ -265,7 +282,7 @@ vips_area_get_type( void )
|
|||||||
*
|
*
|
||||||
* Get the C string held internally by the GValue.
|
* Get the C string held internally by the GValue.
|
||||||
*
|
*
|
||||||
* Returns: The C string held by @value. This must not be freed.
|
* Returns: (transfer none): The C string held by @value.
|
||||||
*/
|
*/
|
||||||
const char *
|
const char *
|
||||||
vips_value_get_save_string( const GValue *value )
|
vips_value_get_save_string( const GValue *value )
|
||||||
@ -367,12 +384,12 @@ vips_save_string_get_type( void )
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* vips_value_get_ref_string:
|
* vips_value_get_ref_string:
|
||||||
* @value: #GValue to get from
|
* @value: %GValue to get from
|
||||||
* @length: return length here, optionally
|
* @length: (allow-none): return length here, optionally
|
||||||
*
|
*
|
||||||
* Get the C string held internally by the GValue.
|
* Get the C string held internally by the GValue.
|
||||||
*
|
*
|
||||||
* Returns: (transfer none): the C string held by @value.
|
* Returns: (transfer none): The C string held by @value.
|
||||||
*/
|
*/
|
||||||
const char *
|
const char *
|
||||||
vips_value_get_ref_string( const GValue *value, size_t *length )
|
vips_value_get_ref_string( const GValue *value, size_t *length )
|
||||||
@ -471,7 +488,7 @@ vips_ref_string_get_type( void )
|
|||||||
/**
|
/**
|
||||||
* vips_value_set_blob:
|
* vips_value_set_blob:
|
||||||
* @value: GValue to set
|
* @value: GValue to set
|
||||||
* @free_fn: free function for @data
|
* @free_fn: (scope async): free function for @data
|
||||||
* @data: pointer to area of memory
|
* @data: pointer to area of memory
|
||||||
* @length: length of memory area
|
* @length: length of memory area
|
||||||
*
|
*
|
||||||
@ -484,10 +501,8 @@ vips_ref_string_get_type( void )
|
|||||||
* copied by copying reference-counted pointers.
|
* copied by copying reference-counted pointers.
|
||||||
*
|
*
|
||||||
* See also: vips_value_get_blob()
|
* See also: vips_value_get_blob()
|
||||||
*
|
|
||||||
* Returns: 0 on success, -1 otherwise.
|
|
||||||
*/
|
*/
|
||||||
int
|
void
|
||||||
vips_value_set_blob( GValue *value,
|
vips_value_set_blob( GValue *value,
|
||||||
VipsCallbackFn free_fn, void *data, size_t length )
|
VipsCallbackFn free_fn, void *data, size_t length )
|
||||||
{
|
{
|
||||||
@ -498,14 +513,12 @@ vips_value_set_blob( GValue *value,
|
|||||||
area = vips_area_new_blob( free_fn, data, length );
|
area = vips_area_new_blob( free_fn, data, length );
|
||||||
g_value_set_boxed( value, area );
|
g_value_set_boxed( value, area );
|
||||||
vips_area_unref( area );
|
vips_area_unref( area );
|
||||||
|
|
||||||
return( 0 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* vips_value_get_blob:
|
* vips_value_get_blob:
|
||||||
* @value: GValue to set
|
* @value: GValue to set
|
||||||
* @length: (out): optionally return length of memory area
|
* @length: (allow-none): optionally return length of memory area
|
||||||
*
|
*
|
||||||
* Returns the data pointer from a blob. Optionally returns the length too.
|
* Returns the data pointer from a blob. Optionally returns the length too.
|
||||||
*
|
*
|
||||||
@ -515,7 +528,7 @@ vips_value_set_blob( GValue *value,
|
|||||||
*
|
*
|
||||||
* See also: vips_value_set_blob()
|
* See also: vips_value_set_blob()
|
||||||
*
|
*
|
||||||
* Returns: (transfer none): a pointer to the area
|
* Returns: (transfer none): The pointer held by @value.
|
||||||
*/
|
*/
|
||||||
void *
|
void *
|
||||||
vips_value_get_blob( const GValue *value, size_t *length )
|
vips_value_get_blob( const GValue *value, size_t *length )
|
||||||
@ -587,21 +600,43 @@ vips_blob_get_type( void )
|
|||||||
return( type );
|
return( type );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set value to be an array of things. Don't initialise the contents: get the
|
/**
|
||||||
* pointer and write instead.
|
* vips_value_set_array:
|
||||||
|
* @value: %GValue to set
|
||||||
|
* @n: number of elements
|
||||||
|
* @type: the type of each element
|
||||||
|
* @sizeof_type: the sizeof each element
|
||||||
|
*
|
||||||
|
* Set @value to be an array of things.
|
||||||
|
*
|
||||||
|
* This allocates memory but does not
|
||||||
|
* initialise the contents: get the pointer and write instead.
|
||||||
*/
|
*/
|
||||||
int
|
void
|
||||||
vips_value_set_array( GValue *value, GType type, size_t sizeof_type, int n )
|
vips_value_set_array( GValue *value, int n, GType type, size_t sizeof_type )
|
||||||
{
|
{
|
||||||
VipsArea *area;
|
VipsArea *area;
|
||||||
|
|
||||||
area = vips_area_new_array( type, sizeof_type, n );
|
area = vips_area_new_array( type, sizeof_type, n );
|
||||||
g_value_set_boxed( value, area );
|
g_value_set_boxed( value, area );
|
||||||
vips_area_unref( area );
|
vips_area_unref( area );
|
||||||
|
|
||||||
return( 0 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* vips_value_get_array:
|
||||||
|
* @value: %GValue to get from
|
||||||
|
* @n: (allow-none): return the number of elements here, optionally
|
||||||
|
* @type: (allow-none): return the type of each element here, optionally
|
||||||
|
* @sizeof_type: (allow-none): return the sizeof each element here, optionally
|
||||||
|
*
|
||||||
|
* Return the pointer to the array held by @value.
|
||||||
|
* Optionally return the other properties of the array in @n, @type,
|
||||||
|
* @sizeof_type.
|
||||||
|
*
|
||||||
|
* See also: vips_value_set_array().
|
||||||
|
*
|
||||||
|
* Returns: (transfer none): The array address.
|
||||||
|
*/
|
||||||
void *
|
void *
|
||||||
vips_value_get_array( const GValue *value,
|
vips_value_get_array( const GValue *value,
|
||||||
int *n, GType *type, size_t *sizeof_type )
|
int *n, GType *type, size_t *sizeof_type )
|
||||||
@ -625,8 +660,8 @@ vips_value_get_array( const GValue *value,
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* vips_value_get_array_double:
|
* vips_value_get_array_double:
|
||||||
* @value: #GValue to get from
|
* @value: %GValue to get from
|
||||||
* @n: return the number of elements here, optionally
|
* @n: (allow-none): return the number of elements here, optionally
|
||||||
*
|
*
|
||||||
* Return the start of the array of doubles held by @value.
|
* Return the start of the array of doubles held by @value.
|
||||||
* optionally return the number of elements in @n.
|
* optionally return the number of elements in @n.
|
||||||
@ -643,7 +678,7 @@ vips_value_get_array_double( const GValue *value, int *n )
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* vips_value_set_array_double:
|
* vips_value_set_array_double:
|
||||||
* @value: #GValue to get from
|
* @value: %GValue to get from
|
||||||
* @array: array of doubles
|
* @array: array of doubles
|
||||||
* @n: the number of elements
|
* @n: the number of elements
|
||||||
*
|
*
|
||||||
@ -659,7 +694,7 @@ vips_value_set_array_double( GValue *value, const double *array, int n )
|
|||||||
double *array_copy;
|
double *array_copy;
|
||||||
|
|
||||||
g_value_init( value, VIPS_TYPE_ARRAY_DOUBLE );
|
g_value_init( value, VIPS_TYPE_ARRAY_DOUBLE );
|
||||||
vips_value_set_array( value, G_TYPE_DOUBLE, sizeof( double ), n );
|
vips_value_set_array( value, n, G_TYPE_DOUBLE, sizeof( double ) );
|
||||||
array_copy = vips_value_get_array_double( value, NULL );
|
array_copy = vips_value_get_array_double( value, NULL );
|
||||||
memcpy( array_copy, array, n * sizeof( double ) );
|
memcpy( array_copy, array, n * sizeof( double ) );
|
||||||
|
|
||||||
@ -710,7 +745,7 @@ transform_g_string_array_double( const GValue *src_value, GValue *dest_value )
|
|||||||
n += 1;
|
n += 1;
|
||||||
g_free( str );
|
g_free( str );
|
||||||
|
|
||||||
vips_value_set_array( dest_value, G_TYPE_DOUBLE, sizeof( double ), n );
|
vips_value_set_array( dest_value, n, G_TYPE_DOUBLE, sizeof( double ) );
|
||||||
array = (double *) vips_value_get_array( dest_value, NULL, NULL, NULL );
|
array = (double *) vips_value_get_array( dest_value, NULL, NULL, NULL );
|
||||||
|
|
||||||
str = g_value_dup_string( src_value );
|
str = g_value_dup_string( src_value );
|
||||||
@ -739,11 +774,11 @@ vips_array_double_get_type( void )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* vips_array_object_get:
|
* vips_array_object_get: (skip)
|
||||||
* @value: #GValue to get from
|
* @value: %GValue to get from
|
||||||
* @n: return the number of elements here, optionally
|
* @n: (allow-none): return the number of elements here, optionally
|
||||||
*
|
*
|
||||||
* Return the start of the array of #GObject held by @value.
|
* Return the start of the array of %GObject held by @value.
|
||||||
* optionally return the number of elements in @n.
|
* optionally return the number of elements in @n.
|
||||||
*
|
*
|
||||||
* See also: vips_array_object_set().
|
* See also: vips_array_object_set().
|
||||||
@ -758,7 +793,7 @@ vips_value_get_array_object( const GValue *value, int *n )
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* vips_array_object_set:
|
* vips_array_object_set:
|
||||||
* @value: #GValue to set
|
* @value: %GValue to set
|
||||||
* @n: the number of elements
|
* @n: the number of elements
|
||||||
*
|
*
|
||||||
* Set @value to hold an array of GObject. Pass in the array length in @n.
|
* Set @value to hold an array of GObject. Pass in the array length in @n.
|
||||||
|
Loading…
Reference in New Issue
Block a user