diff --git a/libvips/colour/Lab2LCh.c b/libvips/colour/Lab2LCh.c index d9bb77e2..0d86492a 100644 --- a/libvips/colour/Lab2LCh.c +++ b/libvips/colour/Lab2LCh.c @@ -135,6 +135,7 @@ vips_Lab2LCh_class_init( VipsLab2LChClass *class ) object_class->description = _( "transform Lab to LCh" ); colour_class->process_line = vips_Lab2LCh_line; + colour_class->interpretation = VIPS_INTERPRETATION_LCH; } static void diff --git a/libvips/colour/Lab2XYZ.c b/libvips/colour/Lab2XYZ.c index 48df050c..d6f6e4e8 100644 --- a/libvips/colour/Lab2XYZ.c +++ b/libvips/colour/Lab2XYZ.c @@ -168,6 +168,7 @@ vips_Lab2XYZ_class_init( VipsLab2XYZClass *class ) object_class->build = vips_Lab2XYZ_build; colour_class->process_line = vips_Lab2XYZ_line; + colour_class->interpretation = VIPS_INTERPRETATION_XYZ; VIPS_ARG_BOXED( class, "temp", 110, _( "Temperature" ), diff --git a/libvips/colour/colour.c b/libvips/colour/colour.c index 26ec1184..1b56ab85 100644 --- a/libvips/colour/colour.c +++ b/libvips/colour/colour.c @@ -87,6 +87,8 @@ static int vips_colour_build( VipsObject *object ) { VipsColour *colour = VIPS_COLOUR( object ); + VipsColourClass *class = VIPS_COLOUR_GET_CLASS( colour ); + int i; #ifdef DEBUG @@ -114,6 +116,7 @@ vips_colour_build( VipsObject *object ) return( -1 ); vips_demand_hint_array( colour->out, VIPS_DEMAND_STYLE_THINSTRIP, colour->in ); + out->Type = class->interpretation; if( vips_image_generate( colour->out, vips_start_many, vips_colour_gen, vips_stop_many, @@ -139,6 +142,8 @@ vips_colour_class_init( VipsColourClass *class ) operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + class->interpretation = VIPS_INTERPRETATION_sRGB; + VIPS_ARG_IMAGE( class, "out", 100, _( "Output" ), _( "Output image" ), diff --git a/libvips/colour/colour.h b/libvips/colour/colour.h index 976100d6..355bf37a 100644 --- a/libvips/colour/colour.h +++ b/libvips/colour/colour.h @@ -77,6 +77,10 @@ typedef struct _VipsColourClass { /* The buffer processor. */ VipsColourProcessFn process_line; + + /* What to set Type to for this subclass. + */ + VipsInterpretation interpretation; } VipsColourClass; GType vips_colour_get_type( void );