From eda4ed64f151453d8c253f9fbc7347592ffad1bd Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 7 Jan 2015 14:22:13 +0000 Subject: [PATCH] rename _!PIXEL etc. to help bindings ruby gobject-introspection hates numbers at the start of _ separated names --- ChangeLog | 2 ++ libvips/deprecated/im_vips2dz.c | 2 +- libvips/foreign/dzsave.c | 14 +++++++------- libvips/include/vips/foreign.h | 12 ++++++------ libvips/iofuncs/enumtypes.c | 6 +++--- 5 files changed, 19 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index ab59c1e4..38dc7f85 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,8 @@ - display param default and range in usage - better docs - more tests +- renamed VIPS_FOREIGN_DZ_DEPTH_1 as VIPS_FOREIGN_DZ_DEPTH_ONE etc. to help + bindings 24/12/14 started 7.42.1 - add gobject-2.0 to Requires: in vips and vips-cpp .pc files diff --git a/libvips/deprecated/im_vips2dz.c b/libvips/deprecated/im_vips2dz.c index 19fbe319..3a304991 100644 --- a/libvips/deprecated/im_vips2dz.c +++ b/libvips/deprecated/im_vips2dz.c @@ -59,7 +59,7 @@ im_vips2dz( IMAGE *in, const char *filename ) char *suffix = ".jpeg"; int overlap = 0; int tile_size = 256; - VipsForeignDzDepth depth = VIPS_FOREIGN_DZ_DEPTH_1PIXEL; + VipsForeignDzDepth depth = VIPS_FOREIGN_DZ_DEPTH_ONEPIXEL; gboolean centre = FALSE; VipsAngle angle = VIPS_ANGLE_D0; diff --git a/libvips/foreign/dzsave.c b/libvips/foreign/dzsave.c index 15a60a60..1d110271 100644 --- a/libvips/foreign/dzsave.c +++ b/libvips/foreign/dzsave.c @@ -542,15 +542,15 @@ pyramid_build( VipsForeignSaveDz *dz, Layer *above, } switch( dz->depth ) { - case VIPS_FOREIGN_DZ_DEPTH_1PIXEL: + case VIPS_FOREIGN_DZ_DEPTH_ONEPIXEL: limit = 1; break; - case VIPS_FOREIGN_DZ_DEPTH_1TILE: + case VIPS_FOREIGN_DZ_DEPTH_ONETILE: limit = dz->tile_size; break; - case VIPS_FOREIGN_DZ_DEPTH_1: + case VIPS_FOREIGN_DZ_DEPTH_ONE: limit = VIPS_MAX( width, height ); break; @@ -1603,11 +1603,11 @@ vips_foreign_save_dz_build( VipsObject *object ) */ if( dz->layout == VIPS_FOREIGN_DZ_LAYOUT_DZ ) { if( !vips_object_argument_isset( object, "depth" ) ) - dz->depth = VIPS_FOREIGN_DZ_DEPTH_1PIXEL; + dz->depth = VIPS_FOREIGN_DZ_DEPTH_ONEPIXEL; } else if( !vips_object_argument_isset( object, "depth" ) ) - dz->depth = VIPS_FOREIGN_DZ_DEPTH_1TILE; + dz->depth = VIPS_FOREIGN_DZ_DEPTH_ONETILE; if( VIPS_OBJECT_CLASS( vips_foreign_save_dz_parent_class )-> build( object ) ) @@ -1949,7 +1949,7 @@ vips_foreign_save_dz_class_init( VipsForeignSaveDzClass *class ) VIPS_ARGUMENT_OPTIONAL_INPUT, G_STRUCT_OFFSET( VipsForeignSaveDz, depth ), VIPS_TYPE_FOREIGN_DZ_DEPTH, - VIPS_FOREIGN_DZ_DEPTH_1PIXEL ); + VIPS_FOREIGN_DZ_DEPTH_ONEPIXEL ); VIPS_ARG_BOOL( class, "centre", 13, _( "Center" ), @@ -2021,7 +2021,7 @@ vips_foreign_save_dz_init( VipsForeignSaveDz *dz ) dz->overlap = 1; dz->tile_size = 256; dz->tile_count = 0; - dz->depth = VIPS_FOREIGN_DZ_DEPTH_1PIXEL; + dz->depth = VIPS_FOREIGN_DZ_DEPTH_ONEPIXEL; dz->angle = VIPS_ANGLE_D0; dz->container = VIPS_FOREIGN_DZ_CONTAINER_FS; } diff --git a/libvips/include/vips/foreign.h b/libvips/include/vips/foreign.h index 4a2418d7..a695d4e0 100644 --- a/libvips/include/vips/foreign.h +++ b/libvips/include/vips/foreign.h @@ -496,16 +496,16 @@ typedef enum { /** * VipsForeignDzDepth: - * @VIPS_FOREIGN_DZ_DEPTH_1PIXEL: create layers down to 1x1 pixel - * @VIPS_FOREIGN_DZ_DEPTH_1TILE: create layers down to 1x1 tile - * @VIPS_FOREIGN_DZ_DEPTH_1: only create a single layer + * @VIPS_FOREIGN_DZ_DEPTH_ONEPIXEL: create layers down to 1x1 pixel + * @VIPS_FOREIGN_DZ_DEPTH_ONETILE: create layers down to 1x1 tile + * @VIPS_FOREIGN_DZ_DEPTH_ONE: only create a single layer * * How many pyramid layers to create. */ typedef enum { - VIPS_FOREIGN_DZ_DEPTH_1PIXEL, - VIPS_FOREIGN_DZ_DEPTH_1TILE, - VIPS_FOREIGN_DZ_DEPTH_1, + VIPS_FOREIGN_DZ_DEPTH_ONEPIXEL, + VIPS_FOREIGN_DZ_DEPTH_ONETILE, + VIPS_FOREIGN_DZ_DEPTH_ONE, VIPS_FOREIGN_DZ_DEPTH_LAST } VipsForeignDzDepth; diff --git a/libvips/iofuncs/enumtypes.c b/libvips/iofuncs/enumtypes.c index 540f49c4..a7f8e8e4 100644 --- a/libvips/iofuncs/enumtypes.c +++ b/libvips/iofuncs/enumtypes.c @@ -152,9 +152,9 @@ vips_foreign_dz_depth_get_type( void ) if( etype == 0 ) { static const GEnumValue values[] = { - {VIPS_FOREIGN_DZ_DEPTH_1PIXEL, "VIPS_FOREIGN_DZ_DEPTH_1PIXEL", "1pixel"}, - {VIPS_FOREIGN_DZ_DEPTH_1TILE, "VIPS_FOREIGN_DZ_DEPTH_1TILE", "1tile"}, - {VIPS_FOREIGN_DZ_DEPTH_1, "VIPS_FOREIGN_DZ_DEPTH_1", "1"}, + {VIPS_FOREIGN_DZ_DEPTH_ONEPIXEL, "VIPS_FOREIGN_DZ_DEPTH_ONEPIXEL", "onepixel"}, + {VIPS_FOREIGN_DZ_DEPTH_ONETILE, "VIPS_FOREIGN_DZ_DEPTH_ONETILE", "onetile"}, + {VIPS_FOREIGN_DZ_DEPTH_ONE, "VIPS_FOREIGN_DZ_DEPTH_ONE", "one"}, {VIPS_FOREIGN_DZ_DEPTH_LAST, "VIPS_FOREIGN_DZ_DEPTH_LAST", "last"}, {0, NULL, NULL} };