work on wrapvips7

This commit is contained in:
John Cupitt 2011-10-17 14:48:20 +01:00
parent 2766b83004
commit 932bc3585a
3 changed files with 45 additions and 22 deletions

17
TODO
View File

@ -1,21 +1,18 @@
- try
$ vips max
im_max (max), maximum value of image, from package "arithmetic"
max in
where:
in :: VipsImage (input)
from package "arithmetic"
flags: (PIO function) (no coordinate transformation) (area
operation) (result can be cached)
$ vips max poop.jpg --vips-leak
no output arg?
need to implement output double args in wrapvips7.c
- try
$ vips im_fliphor firegirl.jpg x.v
vips_value_hash: no case for ((VipsDirection) VIPS_DIRECTION_HORIZONTAL)
type 6850208, VipsDirection
generic 2, VipsDirection
how strange, generic is wrong
lots of errors

View File

@ -479,10 +479,11 @@ vips_wrap7_build_output( VipsObject *object,
{
VipsWrap7 *wrap7 = VIPS_WRAP7( object );
VipsWrap7Class *class = VIPS_WRAP7_GET_CLASS( wrap7 );
int i = argument_class->offset;
im_arg_desc *arg = &class->fn->argv[i];
im_type_desc *type = arg->desc;
im_arg_type vt = type->type;
int i;
im_arg_desc *arg;
im_type_desc *type;
im_arg_type vt;
/* We want required, construct-time, unassigned output args.
*/
@ -492,6 +493,14 @@ vips_wrap7_build_output( VipsObject *object,
!(argument_class->flags & VIPS_ARGUMENT_OUTPUT) )
return( NULL );
/* argument_class->offset is only the argv slot for true params. We
* can't do this before we've tested the arg class.
*/
i = argument_class->offset;
arg = &class->fn->argv[i];
type = arg->desc;
vt = type->type;
/* Provide output objects for the operation to write to.
*/
switch( vips_wrap7_lookup_type( vt ) ) {
@ -543,8 +552,9 @@ vips_wrap7_build( VipsObject *object )
}
if( class->not_supported ) {
vips_error( "wrap7", _( "unable to call vips7 operation "
"%s from vips8" ), oclass->nickname );
vips_error( "wrap7",
_( "vips7 operation %s not supported by vips8" ),
oclass->nickname );
return( -1 );
}
@ -751,7 +761,6 @@ vips_wrap7_subclass_class_init( VipsWrap7Class *class )
case VIPS_WRAP7_INTVEC:
case VIPS_WRAP7_GVALUE:
case VIPS_WRAP7_INTERPOLATE:
case VIPS_WRAP7_DOUBLE:
case VIPS_WRAP7_INT:
case VIPS_WRAP7_COMPLEX:
case VIPS_WRAP7_STRING:
@ -760,6 +769,15 @@ vips_wrap7_subclass_class_init( VipsWrap7Class *class )
* set a flag to block _build().
*/
class->not_supported = TRUE;
pspec = NULL;
break;
case VIPS_WRAP7_DOUBLE:
pspec = g_param_spec_double( arg->name,
arg->name,
arg->name,
-G_MAXDOUBLE, G_MAXDOUBLE, 0.0,
G_PARAM_READWRITE );
break;
case VIPS_WRAP7_IMAGE:
@ -768,6 +786,13 @@ vips_wrap7_subclass_class_init( VipsWrap7Class *class )
arg->name,
VIPS_TYPE_IMAGE,
G_PARAM_READWRITE );
break;
default:
g_assert( 0 );
}
if( pspec ) {
g_object_class_install_property( gobject_class,
i + 1, pspec );
vips_object_class_install_argument( vobject_class,
@ -776,10 +801,6 @@ vips_wrap7_subclass_class_init( VipsWrap7Class *class )
VIPS_ARGUMENT_REQUIRED_OUTPUT :
VIPS_ARGUMENT_REQUIRED_INPUT,
i, i );
break;
default:
g_assert( 0 );
}
}
}

View File

@ -114,8 +114,13 @@ vips_value_hash( GType generic, GValue *value )
return( (unsigned int) g_value_get_enum( value ) );
case G_TYPE_FLAGS:
return( (unsigned int) g_value_get_flags( value ) );
case G_TYPE_UINT64:
return( (unsigned int) g_value_get_uint64( value ) );
{
guint64 i = g_value_get_uint64( value );
return( g_int64_hash( (gint64 *) &i ) );
}
case G_TYPE_INT64:
{