rename VipsColourSpace as VipsColourTransform
to avoid confusion with VipsColourspace an internal class, no API change
This commit is contained in:
parent
ad6f42c869
commit
fd1db58189
@ -52,10 +52,10 @@
|
||||
|
||||
#include "pcolour.h"
|
||||
|
||||
typedef VipsColourSpace VipsLCh2Lab;
|
||||
typedef VipsColourSpaceClass VipsLCh2LabClass;
|
||||
typedef VipsColourTransform VipsLCh2Lab;
|
||||
typedef VipsColourTransformClass VipsLCh2LabClass;
|
||||
|
||||
G_DEFINE_TYPE( VipsLCh2Lab, vips_LCh2Lab, VIPS_TYPE_COLOUR_SPACE );
|
||||
G_DEFINE_TYPE( VipsLCh2Lab, vips_LCh2Lab, VIPS_TYPE_COLOUR_TRANSFORM );
|
||||
|
||||
/* Process a buffer of data.
|
||||
*/
|
||||
|
@ -48,10 +48,10 @@
|
||||
|
||||
#include "pcolour.h"
|
||||
|
||||
typedef VipsColourSpace VipsLCh2CMC;
|
||||
typedef VipsColourSpaceClass VipsLCh2CMCClass;
|
||||
typedef VipsColourTransform VipsLCh2CMC;
|
||||
typedef VipsColourTransformClass VipsLCh2CMCClass;
|
||||
|
||||
G_DEFINE_TYPE( VipsLCh2CMC, vips_LCh2CMC, VIPS_TYPE_COLOUR_SPACE );
|
||||
G_DEFINE_TYPE( VipsLCh2CMC, vips_LCh2CMC, VIPS_TYPE_COLOUR_TRANSFORM );
|
||||
|
||||
/* I ordered this paper from the library and it took ages. For reference, the
|
||||
* recommended short formula are:
|
||||
|
@ -46,10 +46,10 @@
|
||||
|
||||
#include "pcolour.h"
|
||||
|
||||
typedef VipsColourSpace VipsLab2LCh;
|
||||
typedef VipsColourSpaceClass VipsLab2LChClass;
|
||||
typedef VipsColourTransform VipsLab2LCh;
|
||||
typedef VipsColourTransformClass VipsLab2LChClass;
|
||||
|
||||
G_DEFINE_TYPE( VipsLab2LCh, vips_Lab2LCh, VIPS_TYPE_COLOUR_SPACE );
|
||||
G_DEFINE_TYPE( VipsLab2LCh, vips_Lab2LCh, VIPS_TYPE_COLOUR_TRANSFORM );
|
||||
|
||||
/**
|
||||
* vips_col_ab2h:
|
||||
|
@ -62,7 +62,7 @@
|
||||
#include "pcolour.h"
|
||||
|
||||
typedef struct _VipsLab2XYZ {
|
||||
VipsColourSpace parent_instance;
|
||||
VipsColourTransform parent_instance;
|
||||
|
||||
/* The colour temperature -- default to D65.
|
||||
*/
|
||||
@ -76,9 +76,9 @@ typedef struct _VipsLab2XYZ {
|
||||
|
||||
} VipsLab2XYZ;
|
||||
|
||||
typedef VipsColourSpaceClass VipsLab2XYZClass;
|
||||
typedef VipsColourTransformClass VipsLab2XYZClass;
|
||||
|
||||
G_DEFINE_TYPE( VipsLab2XYZ, vips_Lab2XYZ, VIPS_TYPE_COLOUR_SPACE );
|
||||
G_DEFINE_TYPE( VipsLab2XYZ, vips_Lab2XYZ, VIPS_TYPE_COLOUR_TRANSFORM );
|
||||
|
||||
/* Process a buffer of data.
|
||||
*/
|
||||
|
@ -58,10 +58,10 @@ static float LI[1001];
|
||||
static float CI[3001];
|
||||
static float hI[101][361];
|
||||
|
||||
typedef VipsColourSpace VipsCMC2LCh;
|
||||
typedef VipsColourSpaceClass VipsCMC2LChClass;
|
||||
typedef VipsColourTransform VipsCMC2LCh;
|
||||
typedef VipsColourTransformClass VipsCMC2LChClass;
|
||||
|
||||
G_DEFINE_TYPE( VipsCMC2LCh, vips_CMC2LCh, VIPS_TYPE_COLOUR_SPACE );
|
||||
G_DEFINE_TYPE( VipsCMC2LCh, vips_CMC2LCh, VIPS_TYPE_COLOUR_TRANSFORM );
|
||||
|
||||
/* Generate LI (inverse) tables.
|
||||
*/
|
||||
|
@ -72,7 +72,7 @@
|
||||
float cbrt_table[QUANT_ELEMENTS];
|
||||
|
||||
typedef struct _VipsXYZ2Lab {
|
||||
VipsColourSpace parent_instance;
|
||||
VipsColourTransform parent_instance;
|
||||
|
||||
/* The colour temperature -- default to D65.
|
||||
*/
|
||||
@ -86,9 +86,9 @@ typedef struct _VipsXYZ2Lab {
|
||||
|
||||
} VipsXYZ2Lab;
|
||||
|
||||
typedef VipsColourSpaceClass VipsXYZ2LabClass;
|
||||
typedef VipsColourTransformClass VipsXYZ2LabClass;
|
||||
|
||||
G_DEFINE_TYPE( VipsXYZ2Lab, vips_XYZ2Lab, VIPS_TYPE_COLOUR_SPACE );
|
||||
G_DEFINE_TYPE( VipsXYZ2Lab, vips_XYZ2Lab, VIPS_TYPE_COLOUR_TRANSFORM );
|
||||
|
||||
static void *
|
||||
table_init( void *client )
|
||||
|
@ -49,10 +49,10 @@
|
||||
|
||||
#include "pcolour.h"
|
||||
|
||||
typedef VipsColourSpace VipsXYZ2Yxy;
|
||||
typedef VipsColourSpaceClass VipsXYZ2YxyClass;
|
||||
typedef VipsColourTransform VipsXYZ2Yxy;
|
||||
typedef VipsColourTransformClass VipsXYZ2YxyClass;
|
||||
|
||||
G_DEFINE_TYPE( VipsXYZ2Yxy, vips_XYZ2Yxy, VIPS_TYPE_COLOUR_SPACE );
|
||||
G_DEFINE_TYPE( VipsXYZ2Yxy, vips_XYZ2Yxy, VIPS_TYPE_COLOUR_TRANSFORM );
|
||||
|
||||
static void
|
||||
vips_XYZ2Yxy_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width )
|
||||
|
@ -47,10 +47,10 @@
|
||||
|
||||
#include "pcolour.h"
|
||||
|
||||
typedef VipsColourSpace VipsXYZ2scRGB;
|
||||
typedef VipsColourSpaceClass VipsXYZ2scRGBClass;
|
||||
typedef VipsColourTransform VipsXYZ2scRGB;
|
||||
typedef VipsColourTransformClass VipsXYZ2scRGBClass;
|
||||
|
||||
G_DEFINE_TYPE( VipsXYZ2scRGB, vips_XYZ2scRGB, VIPS_TYPE_COLOUR_SPACE );
|
||||
G_DEFINE_TYPE( VipsXYZ2scRGB, vips_XYZ2scRGB, VIPS_TYPE_COLOUR_TRANSFORM );
|
||||
|
||||
/* We used to have the comment:
|
||||
|
||||
|
@ -49,10 +49,10 @@
|
||||
|
||||
#include "pcolour.h"
|
||||
|
||||
typedef VipsColourSpace VipsYxy2XYZ;
|
||||
typedef VipsColourSpaceClass VipsYxy2XYZClass;
|
||||
typedef VipsColourTransform VipsYxy2XYZ;
|
||||
typedef VipsColourTransformClass VipsYxy2XYZClass;
|
||||
|
||||
G_DEFINE_TYPE( VipsYxy2XYZ, vips_Yxy2XYZ, VIPS_TYPE_COLOUR_SPACE );
|
||||
G_DEFINE_TYPE( VipsYxy2XYZ, vips_Yxy2XYZ, VIPS_TYPE_COLOUR_TRANSFORM );
|
||||
|
||||
void
|
||||
vips_Yxy2XYZ_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width )
|
||||
|
@ -458,18 +458,19 @@ vips_colour_init( VipsColour *colour )
|
||||
colour->input_bands = -1;
|
||||
}
|
||||
|
||||
G_DEFINE_ABSTRACT_TYPE( VipsColourSpace, vips_colour_space, VIPS_TYPE_COLOUR );
|
||||
G_DEFINE_ABSTRACT_TYPE( VipsColourTransform, vips_colour_transform,
|
||||
VIPS_TYPE_COLOUR );
|
||||
|
||||
static int
|
||||
vips_colour_space_build( VipsObject *object )
|
||||
vips_colour_transform_build( VipsObject *object )
|
||||
{
|
||||
VipsColour *colour = VIPS_COLOUR( object );
|
||||
VipsColourSpace *space = VIPS_COLOUR_SPACE( object );
|
||||
VipsColourTransform *transform = VIPS_COLOUR_TRANSFORM( object );
|
||||
VipsImage **t = (VipsImage **) vips_object_local_array( object, 1 );
|
||||
|
||||
/* We only process float.
|
||||
*/
|
||||
if( vips_cast_float( space->in, &t[0], NULL ) )
|
||||
if( vips_cast_float( transform->in, &t[0], NULL ) )
|
||||
return( -1 );
|
||||
|
||||
/* We always do 3 bands -> 3 bands.
|
||||
@ -479,7 +480,7 @@ vips_colour_space_build( VipsObject *object )
|
||||
colour->n = 1;
|
||||
colour->in = t;
|
||||
|
||||
if( VIPS_OBJECT_CLASS( vips_colour_space_parent_class )->
|
||||
if( VIPS_OBJECT_CLASS( vips_colour_transform_parent_class )->
|
||||
build( object ) )
|
||||
return( -1 );
|
||||
|
||||
@ -487,7 +488,7 @@ vips_colour_space_build( VipsObject *object )
|
||||
}
|
||||
|
||||
static void
|
||||
vips_colour_space_class_init( VipsColourSpaceClass *class )
|
||||
vips_colour_transform_class_init( VipsColourTransformClass *class )
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS( class );
|
||||
VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class );
|
||||
@ -497,17 +498,17 @@ vips_colour_space_class_init( VipsColourSpaceClass *class )
|
||||
|
||||
vobject_class->nickname = "space";
|
||||
vobject_class->description = _( "colour space transformations" );
|
||||
vobject_class->build = vips_colour_space_build;
|
||||
vobject_class->build = vips_colour_transform_build;
|
||||
|
||||
VIPS_ARG_IMAGE( class, "in", 1,
|
||||
_( "Input" ),
|
||||
_( "Input image" ),
|
||||
VIPS_ARGUMENT_REQUIRED_INPUT,
|
||||
G_STRUCT_OFFSET( VipsColourSpace, in ) );
|
||||
G_STRUCT_OFFSET( VipsColourTransform, in ) );
|
||||
}
|
||||
|
||||
static void
|
||||
vips_colour_space_init( VipsColourSpace *space )
|
||||
vips_colour_transform_init( VipsColourTransform *space )
|
||||
{
|
||||
VipsColour *colour = (VipsColour *) space;
|
||||
|
||||
|
@ -49,7 +49,7 @@ typedef struct _VipsdE00 {
|
||||
|
||||
} VipsdE00;
|
||||
|
||||
typedef VipsColourSpaceClass VipsdE00Class;
|
||||
typedef VipsColourDifferenceClass VipsdE00Class;
|
||||
|
||||
G_DEFINE_TYPE( VipsdE00, vips_dE00, VIPS_TYPE_COLOUR_DIFFERENCE );
|
||||
|
||||
|
@ -54,7 +54,7 @@ typedef struct _VipsdE76 {
|
||||
|
||||
} VipsdE76;
|
||||
|
||||
typedef VipsColourSpaceClass VipsdE76Class;
|
||||
typedef VipsColourDifferenceClass VipsdE76Class;
|
||||
|
||||
G_DEFINE_TYPE( VipsdE76, vips_dE76, VIPS_TYPE_COLOUR_DIFFERENCE );
|
||||
|
||||
|
@ -47,7 +47,7 @@ typedef struct _VipsdECMC {
|
||||
|
||||
} VipsdECMC;
|
||||
|
||||
typedef VipsColourSpaceClass VipsdECMCClass;
|
||||
typedef VipsColourDifferenceClass VipsdECMCClass;
|
||||
|
||||
G_DEFINE_TYPE( VipsdECMC, vips_dECMC, VIPS_TYPE_COLOUR_DIFFERENCE );
|
||||
|
||||
|
@ -98,34 +98,34 @@ GType vips_colour_get_type( void );
|
||||
/* A float in, float out colourspace transformation.
|
||||
*/
|
||||
|
||||
#define VIPS_TYPE_COLOUR_SPACE (vips_colour_space_get_type())
|
||||
#define VIPS_COLOUR_SPACE( obj ) \
|
||||
#define VIPS_TYPE_COLOUR_TRANSFORM (vips_colour_transform_get_type())
|
||||
#define VIPS_COLOUR_TRANSFORM( obj ) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST( (obj), \
|
||||
VIPS_TYPE_COLOUR_SPACE, VipsColourSpace ))
|
||||
#define VIPS_COLOUR_SPACE_CLASS( klass ) \
|
||||
VIPS_TYPE_COLOUR_TRANSFORM, VipsColourTransform ))
|
||||
#define VIPS_COLOUR_TRANSFORM_CLASS( klass ) \
|
||||
(G_TYPE_CHECK_CLASS_CAST( (klass), \
|
||||
VIPS_TYPE_COLOUR_SPACE, VipsColourSpaceClass))
|
||||
#define VIPS_IS_COLOUR_SPACE( obj ) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_COLOUR_SPACE ))
|
||||
#define VIPS_IS_COLOUR_SPACE_CLASS( klass ) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_COLOUR_SPACE ))
|
||||
#define VIPS_COLOUR_SPACE_GET_CLASS( obj ) \
|
||||
VIPS_TYPE_COLOUR_TRANSFORM, VipsColourTransformClass))
|
||||
#define VIPS_IS_COLOUR_TRANSFORM( obj ) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_COLOUR_TRANSFORM ))
|
||||
#define VIPS_IS_COLOUR_TRANSFORM_CLASS( klass ) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_COLOUR_TRANSFORM ))
|
||||
#define VIPS_COLOUR_TRANSFORM_GET_CLASS( obj ) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS( (obj), \
|
||||
VIPS_TYPE_COLOUR_SPACE, VipsColourSpaceClass ))
|
||||
VIPS_TYPE_COLOUR_TRANSFORM, VipsColourTransformClass ))
|
||||
|
||||
typedef struct _VipsColourSpace {
|
||||
typedef struct _VipsColourTransform {
|
||||
VipsColour parent_instance;
|
||||
|
||||
VipsImage *in;
|
||||
|
||||
} VipsColourSpace;
|
||||
} VipsColourTransform;
|
||||
|
||||
typedef struct _VipsColourSpaceClass {
|
||||
typedef struct _VipsColourTransformClass {
|
||||
VipsColourClass parent_class;
|
||||
|
||||
} VipsColourSpaceClass;
|
||||
} VipsColourTransformClass;
|
||||
|
||||
GType vips_colour_space_get_type( void );
|
||||
GType vips_colour_transform_get_type( void );
|
||||
|
||||
/* Change colour encoding ... either in or out is not three-band float.
|
||||
*/
|
||||
|
@ -49,10 +49,10 @@
|
||||
|
||||
#include "pcolour.h"
|
||||
|
||||
typedef VipsColourSpace VipsscRGB2XYZ;
|
||||
typedef VipsColourSpaceClass VipsscRGB2XYZClass;
|
||||
typedef VipsColourTransform VipsscRGB2XYZ;
|
||||
typedef VipsColourTransformClass VipsscRGB2XYZClass;
|
||||
|
||||
G_DEFINE_TYPE( VipsscRGB2XYZ, vips_scRGB2XYZ, VIPS_TYPE_COLOUR_SPACE );
|
||||
G_DEFINE_TYPE( VipsscRGB2XYZ, vips_scRGB2XYZ, VIPS_TYPE_COLOUR_TRANSFORM );
|
||||
|
||||
void
|
||||
vips_scRGB2XYZ_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width )
|
||||
|
Loading…
Reference in New Issue
Block a user