From 02d8f0925f6bb623e3e2f2394842ebb00064ed2d Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Thu, 20 Oct 2011 14:56:13 +0100 Subject: [PATCH] sybnc --- ChangeLog | 1 + TODO | 19 ++++++++++++++++++- libvips/conversion/insert.c | 4 ++-- libvips/include/vips/object.h | 13 +++++++++++++ 4 files changed, 34 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index c2045eb2..2b6ed744 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,7 @@ - added --vips-leak flag - more VipsImage props - added vips_image_write(), old one becomes vips_image_write_to_file() +- added vips_region_paint_pel() 12/10/11 started 7.26.6 - NOCACHE was not being set correctly on OS X causing performance diff --git a/TODO b/TODO index 16bd475e..9ea50806 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,16 @@ +- we have VIPS_ARG_ARRAY, but really we need to say it's an array of double + + can we derive from G_TYPE_ARRAY and make G_TYPE_ARRAY_DOUBLE? + + no, we have to make a fresh boxed type + + maybe make a boxed type which is a GArray plus a GType for array members? + then we could have array of double + + add to header.c + + + - we have this is many places: if( vips_image_copy_fieldsv( conversion->output, @@ -6,7 +19,9 @@ vips_demand_hint( conversion->output, VIPS_DEMAND_STYLE_THINSTRIP, insert->main, insert->sub, NULL ); - can we combine these into a single API call? + why not combine these into a single API call? + + use array version in several places @@ -17,6 +32,8 @@ *join needs insert too + insert* needs clip, lintra_vec + diff --git a/libvips/conversion/insert.c b/libvips/conversion/insert.c index a6dbdd5d..1e9edf90 100644 --- a/libvips/conversion/insert.c +++ b/libvips/conversion/insert.c @@ -120,7 +120,7 @@ typedef struct _VipsInsert { int x; int y; gboolean expand; - double *background; + GArray *background; /* Pixel we paint calculated from background. */ @@ -418,7 +418,7 @@ vips_insert_class_init( VipsInsertClass *class ) G_STRUCT_OFFSET( VipsInsert, expand ), FALSE ); - VIPS_ARG_DOUBLEVEC( class, "background", 5, + VIPS_ARG_ARRAY( class, "background", 5, _( "Background" ), _( "Colour for new pixels" ), VIPS_ARGUMENT_OPTIONAL_INPUT, diff --git a/libvips/include/vips/object.h b/libvips/include/vips/object.h index 0ccae099..f7d6d862 100644 --- a/libvips/include/vips/object.h +++ b/libvips/include/vips/object.h @@ -146,6 +146,19 @@ extern int _vips__argument_id; pspec, (FLAGS), (PRIORITY), (OFFSET) ); \ } +#define VIPS_ARG_ARRAY( CLASS, NAME, PRIORITY, LONG, DESC, FLAGS, OFFSET, \ + MIN, MAX, VALUE ) { \ + GParamSpec *pspec; \ + \ + pspec = g_param_spec_boxed( (NAME), (LONG), (DESC), \ + G_TYPE_ARRAY, \ + G_PARAM_READWRITE );\ + g_object_class_install_property( G_OBJECT_CLASS( CLASS ), \ + _vips__argument_id++, pspec ); \ + vips_object_class_install_argument( VIPS_OBJECT_CLASS( CLASS ), \ + pspec, (FLAGS), (PRIORITY), (OFFSET) ); \ +} + #define VIPS_ARG_INT( CLASS, NAME, PRIORITY, LONG, DESC, FLAGS, OFFSET, \ MIN, MAX, VALUE ) { \ GParamSpec *pspec; \