rename Colorimetric as ColourSpace
This commit is contained in:
parent
7b665c24df
commit
b030162677
@ -51,10 +51,10 @@
|
|||||||
|
|
||||||
#include "colour.h"
|
#include "colour.h"
|
||||||
|
|
||||||
typedef VipsColorimetric VipsLCh2Lab;
|
typedef VipsColourSpace VipsLCh2Lab;
|
||||||
typedef VipsColorimetricClass VipsLCh2LabClass;
|
typedef VipsColourSpaceClass VipsLCh2LabClass;
|
||||||
|
|
||||||
G_DEFINE_TYPE( VipsLCh2Lab, vips_LCh2Lab, VIPS_TYPE_COLORIMETRIC );
|
G_DEFINE_TYPE( VipsLCh2Lab, vips_LCh2Lab, VIPS_TYPE_COLOUR_SPACE );
|
||||||
|
|
||||||
/* Process a buffer of data.
|
/* Process a buffer of data.
|
||||||
*/
|
*/
|
||||||
|
@ -45,10 +45,10 @@
|
|||||||
|
|
||||||
#include "colour.h"
|
#include "colour.h"
|
||||||
|
|
||||||
typedef VipsColorimetric VipsLCh2UCS;
|
typedef VipsColourSpace VipsLCh2UCS;
|
||||||
typedef VipsColorimetricClass VipsLCh2UCSClass;
|
typedef VipsColourSpaceClass VipsLCh2UCSClass;
|
||||||
|
|
||||||
G_DEFINE_TYPE( VipsLCh2UCS, vips_LCh2UCS, VIPS_TYPE_COLORIMETRIC );
|
G_DEFINE_TYPE( VipsLCh2UCS, vips_LCh2UCS, VIPS_TYPE_COLOUR_SPACE );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* vips_col_L2Lucs:
|
* vips_col_L2Lucs:
|
||||||
|
@ -45,10 +45,10 @@
|
|||||||
|
|
||||||
#include "colour.h"
|
#include "colour.h"
|
||||||
|
|
||||||
typedef VipsColorimetric VipsLab2LCh;
|
typedef VipsColourSpace VipsLab2LCh;
|
||||||
typedef VipsColorimetricClass VipsLab2LChClass;
|
typedef VipsColourSpaceClass VipsLab2LChClass;
|
||||||
|
|
||||||
G_DEFINE_TYPE( VipsLab2LCh, vips_Lab2LCh, VIPS_TYPE_COLORIMETRIC );
|
G_DEFINE_TYPE( VipsLab2LCh, vips_Lab2LCh, VIPS_TYPE_COLOUR_SPACE );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* vips_col_ab2h:
|
* vips_col_ab2h:
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
#include "colour.h"
|
#include "colour.h"
|
||||||
|
|
||||||
typedef struct _VipsLab2XYZ {
|
typedef struct _VipsLab2XYZ {
|
||||||
VipsColorimetric parent_instance;
|
VipsColourSpace parent_instance;
|
||||||
|
|
||||||
/* The colour temperature -- default to D65.
|
/* The colour temperature -- default to D65.
|
||||||
*/
|
*/
|
||||||
@ -75,9 +75,9 @@ typedef struct _VipsLab2XYZ {
|
|||||||
|
|
||||||
} VipsLab2XYZ;
|
} VipsLab2XYZ;
|
||||||
|
|
||||||
typedef VipsColorimetricClass VipsLab2XYZClass;
|
typedef VipsColourSpaceClass VipsLab2XYZClass;
|
||||||
|
|
||||||
G_DEFINE_TYPE( VipsLab2XYZ, vips_Lab2XYZ, VIPS_TYPE_COLORIMETRIC );
|
G_DEFINE_TYPE( VipsLab2XYZ, vips_Lab2XYZ, VIPS_TYPE_COLOUR_SPACE );
|
||||||
|
|
||||||
/* Process a buffer of data.
|
/* Process a buffer of data.
|
||||||
*/
|
*/
|
||||||
|
@ -57,10 +57,10 @@ static float LI[1001];
|
|||||||
static float CI[3001];
|
static float CI[3001];
|
||||||
static float hI[101][361];
|
static float hI[101][361];
|
||||||
|
|
||||||
typedef VipsColorimetric VipsUCS2LCh;
|
typedef VipsColourSpace VipsUCS2LCh;
|
||||||
typedef VipsColorimetricClass VipsUCS2LChClass;
|
typedef VipsColourSpaceClass VipsUCS2LChClass;
|
||||||
|
|
||||||
G_DEFINE_TYPE( VipsUCS2LCh, vips_UCS2LCh, VIPS_TYPE_COLORIMETRIC );
|
G_DEFINE_TYPE( VipsUCS2LCh, vips_UCS2LCh, VIPS_TYPE_COLOUR_SPACE );
|
||||||
|
|
||||||
/* Generate LI (inverse) tables.
|
/* Generate LI (inverse) tables.
|
||||||
*/
|
*/
|
||||||
|
@ -70,7 +70,7 @@
|
|||||||
float cbrt_table[QUANT_ELEMENTS];
|
float cbrt_table[QUANT_ELEMENTS];
|
||||||
|
|
||||||
typedef struct _VipsXYZ2Lab {
|
typedef struct _VipsXYZ2Lab {
|
||||||
VipsColorimetric parent_instance;
|
VipsColourSpace parent_instance;
|
||||||
|
|
||||||
/* The colour temperature -- default to D65.
|
/* The colour temperature -- default to D65.
|
||||||
*/
|
*/
|
||||||
@ -84,9 +84,9 @@ typedef struct _VipsXYZ2Lab {
|
|||||||
|
|
||||||
} VipsXYZ2Lab;
|
} VipsXYZ2Lab;
|
||||||
|
|
||||||
typedef VipsColorimetricClass VipsXYZ2LabClass;
|
typedef VipsColourSpaceClass VipsXYZ2LabClass;
|
||||||
|
|
||||||
G_DEFINE_TYPE( VipsXYZ2Lab, vips_XYZ2Lab, VIPS_TYPE_COLORIMETRIC );
|
G_DEFINE_TYPE( VipsXYZ2Lab, vips_XYZ2Lab, VIPS_TYPE_COLOUR_SPACE );
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
table_init( void *client )
|
table_init( void *client )
|
||||||
|
@ -46,10 +46,10 @@
|
|||||||
|
|
||||||
#include "colour.h"
|
#include "colour.h"
|
||||||
|
|
||||||
typedef VipsColorimetric VipsXYZ2Yxy;
|
typedef VipsColourSpace VipsXYZ2Yxy;
|
||||||
typedef VipsColorimetricClass VipsXYZ2YxyClass;
|
typedef VipsColourSpaceClass VipsXYZ2YxyClass;
|
||||||
|
|
||||||
G_DEFINE_TYPE( VipsXYZ2Yxy, vips_XYZ2Yxy, VIPS_TYPE_COLORIMETRIC );
|
G_DEFINE_TYPE( VipsXYZ2Yxy, vips_XYZ2Yxy, VIPS_TYPE_COLOUR_SPACE );
|
||||||
|
|
||||||
static void
|
static void
|
||||||
vips_XYZ2Yxy_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width )
|
vips_XYZ2Yxy_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width )
|
||||||
|
@ -46,10 +46,10 @@
|
|||||||
|
|
||||||
#include "colour.h"
|
#include "colour.h"
|
||||||
|
|
||||||
typedef VipsColorimetric VipsYxy2XYZ;
|
typedef VipsColourSpace VipsYxy2XYZ;
|
||||||
typedef VipsColorimetricClass VipsYxy2XYZClass;
|
typedef VipsColourSpaceClass VipsYxy2XYZClass;
|
||||||
|
|
||||||
G_DEFINE_TYPE( VipsYxy2XYZ, vips_Yxy2XYZ, VIPS_TYPE_COLORIMETRIC );
|
G_DEFINE_TYPE( VipsYxy2XYZ, vips_Yxy2XYZ, VIPS_TYPE_COLOUR_SPACE );
|
||||||
|
|
||||||
void
|
void
|
||||||
vips_Yxy2XYZ_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width )
|
vips_Yxy2XYZ_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width )
|
||||||
|
@ -156,13 +156,13 @@ vips_colour_init( VipsColour *colour )
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
G_DEFINE_ABSTRACT_TYPE( VipsColorimetric, vips_colorimetric, VIPS_TYPE_COLOUR );
|
G_DEFINE_ABSTRACT_TYPE( VipsColourSpace, vips_space, VIPS_TYPE_COLOUR );
|
||||||
|
|
||||||
static int
|
static int
|
||||||
vips_colorimetric_build( VipsObject *object )
|
vips_space_build( VipsObject *object )
|
||||||
{
|
{
|
||||||
VipsColour *colour = VIPS_COLOUR( object );
|
VipsColour *colour = VIPS_COLOUR( object );
|
||||||
VipsColorimetric *colorimetric = VIPS_COLORIMETRIC( object );
|
VipsColourSpace *space = VIPS_COLOUR_SPACE( object );
|
||||||
|
|
||||||
VipsImage **t;
|
VipsImage **t;
|
||||||
|
|
||||||
@ -173,7 +173,7 @@ vips_colorimetric_build( VipsObject *object )
|
|||||||
|
|
||||||
/* We only process float.
|
/* We only process float.
|
||||||
*/
|
*/
|
||||||
if( vips_cast_float( colorimetric->in, &t[0], NULL ) )
|
if( vips_cast_float( space->in, &t[0], NULL ) )
|
||||||
return( -1 );
|
return( -1 );
|
||||||
colour->in[0] = t[0];
|
colour->in[0] = t[0];
|
||||||
|
|
||||||
@ -192,7 +192,7 @@ vips_colorimetric_build( VipsObject *object )
|
|||||||
if( colour->in[0] )
|
if( colour->in[0] )
|
||||||
g_object_ref( colour->in[0] );
|
g_object_ref( colour->in[0] );
|
||||||
|
|
||||||
if( VIPS_OBJECT_CLASS( vips_colorimetric_parent_class )->
|
if( VIPS_OBJECT_CLASS( vips_space_parent_class )->
|
||||||
build( object ) )
|
build( object ) )
|
||||||
return( -1 );
|
return( -1 );
|
||||||
|
|
||||||
@ -213,7 +213,7 @@ vips_colorimetric_build( VipsObject *object )
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
vips_colorimetric_class_init( VipsColorimetricClass *class )
|
vips_space_class_init( VipsColourSpaceClass *class )
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class = G_OBJECT_CLASS( class );
|
GObjectClass *gobject_class = G_OBJECT_CLASS( class );
|
||||||
VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class );
|
VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class );
|
||||||
@ -221,19 +221,19 @@ vips_colorimetric_class_init( VipsColorimetricClass *class )
|
|||||||
gobject_class->set_property = vips_object_set_property;
|
gobject_class->set_property = vips_object_set_property;
|
||||||
gobject_class->get_property = vips_object_get_property;
|
gobject_class->get_property = vips_object_get_property;
|
||||||
|
|
||||||
vobject_class->nickname = "colorimetric";
|
vobject_class->nickname = "space";
|
||||||
vobject_class->description = _( "colorimetric operations" );
|
vobject_class->description = _( "colour space transformations" );
|
||||||
vobject_class->build = vips_colorimetric_build;
|
vobject_class->build = vips_space_build;
|
||||||
|
|
||||||
VIPS_ARG_IMAGE( class, "in", 1,
|
VIPS_ARG_IMAGE( class, "in", 1,
|
||||||
_( "Input" ),
|
_( "Input" ),
|
||||||
_( "Input image" ),
|
_( "Input image" ),
|
||||||
VIPS_ARGUMENT_REQUIRED_INPUT,
|
VIPS_ARGUMENT_REQUIRED_INPUT,
|
||||||
G_STRUCT_OFFSET( VipsColorimetric, in ) );
|
G_STRUCT_OFFSET( VipsColourSpace, in ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
vips_colorimetric_init( VipsColorimetric *colorimetric )
|
vips_space_init( VipsColourSpace *space )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,34 +88,34 @@ GType vips_colour_get_type( void );
|
|||||||
/* A three float bands in, three float bands out colourspace transformation.
|
/* A three float bands in, three float bands out colourspace transformation.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define VIPS_TYPE_COLORIMETRIC (vips_colorimetric_get_type())
|
#define VIPS_TYPE_COLOUR_SPACE (vips_space_get_type())
|
||||||
#define VIPS_COLORIMETRIC( obj ) \
|
#define VIPS_COLOUR_SPACE( obj ) \
|
||||||
(G_TYPE_CHECK_INSTANCE_CAST( (obj), \
|
(G_TYPE_CHECK_INSTANCE_CAST( (obj), \
|
||||||
VIPS_TYPE_COLORIMETRIC, VipsColorimetric ))
|
VIPS_TYPE_COLOUR_SPACE, VipsColourSpace ))
|
||||||
#define VIPS_COLORIMETRIC_CLASS( klass ) \
|
#define VIPS_COLOUR_SPACE_CLASS( klass ) \
|
||||||
(G_TYPE_CHECK_CLASS_CAST( (klass), \
|
(G_TYPE_CHECK_CLASS_CAST( (klass), \
|
||||||
VIPS_TYPE_COLORIMETRIC, VipsColorimetricClass))
|
VIPS_TYPE_COLOUR_SPACE, VipsColourSpaceClass))
|
||||||
#define VIPS_IS_COLORIMETRIC( obj ) \
|
#define VIPS_IS_COLOUR_SPACE( obj ) \
|
||||||
(G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_COLORIMETRIC ))
|
(G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_COLOUR_SPACE ))
|
||||||
#define VIPS_IS_COLORIMETRIC_CLASS( klass ) \
|
#define VIPS_IS_COLOUR_SPACE_CLASS( klass ) \
|
||||||
(G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_COLORIMETRIC ))
|
(G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_COLOUR_SPACE ))
|
||||||
#define VIPS_COLORIMETRIC_GET_CLASS( obj ) \
|
#define VIPS_COLOUR_SPACE_GET_CLASS( obj ) \
|
||||||
(G_TYPE_INSTANCE_GET_CLASS( (obj), \
|
(G_TYPE_INSTANCE_GET_CLASS( (obj), \
|
||||||
VIPS_TYPE_COLORIMETRIC, VipsColorimetricClass ))
|
VIPS_TYPE_COLOUR_SPACE, VipsColourSpaceClass ))
|
||||||
|
|
||||||
typedef struct _VipsColorimetric {
|
typedef struct _VipsColourSpace {
|
||||||
VipsColour parent_instance;
|
VipsColour parent_instance;
|
||||||
|
|
||||||
VipsImage *in;
|
VipsImage *in;
|
||||||
|
|
||||||
} VipsColorimetric;
|
} VipsColourSpace;
|
||||||
|
|
||||||
typedef struct _VipsColorimetricClass {
|
typedef struct _VipsColourSpaceClass {
|
||||||
VipsColourClass parent_class;
|
VipsColourClass parent_class;
|
||||||
|
|
||||||
} VipsColorimetricClass;
|
} VipsColourSpaceClass;
|
||||||
|
|
||||||
GType vips_colorimetric_get_type( void );
|
GType vips_space_get_type( void );
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user