reformat in vips style
This commit is contained in:
parent
d3c73b4d39
commit
a67f92b8d9
@ -129,7 +129,7 @@ vips_CMYK2XYZ_init( VipsCMYK2XYZ *CMYK2XYZ )
|
||||
{
|
||||
}
|
||||
|
||||
#else
|
||||
#else /*!HAVE_LCMS2*/
|
||||
|
||||
typedef VipsColourCode VipsCMYK2XYZ;
|
||||
typedef VipsColourCodeClass VipsCMYK2XYZClass;
|
||||
@ -144,7 +144,7 @@ vips_CMYK2XYZ_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width )
|
||||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < width; i++) {
|
||||
for( i = 0; i < width; i++ ) {
|
||||
float c = p[0] / 255.0;
|
||||
float m = p[1] / 255.0;
|
||||
float y = p[2] / 255.0;
|
||||
|
@ -128,7 +128,7 @@ vips_XYZ2CMYK_init( VipsXYZ2CMYK *XYZ2CMYK )
|
||||
{
|
||||
}
|
||||
|
||||
#else
|
||||
#else /*!HAVE_LCMS2*/
|
||||
|
||||
typedef VipsColourCode VipsXYZ2CMYK;
|
||||
typedef VipsColourCodeClass VipsXYZ2CMYKClass;
|
||||
@ -145,17 +145,17 @@ vips_XYZ2CMYK_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width )
|
||||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < width; i++) {
|
||||
float c, m, y, k;
|
||||
for( i = 0; i < width; i++ ) {
|
||||
float r = p[0] / VIPS_D65_X0;
|
||||
float g = p[1] / VIPS_D65_Y0;
|
||||
float b = p[2] / VIPS_D65_Z0;
|
||||
|
||||
float c, m, y, k;
|
||||
|
||||
c = 255.0 - r;
|
||||
m = 255.0 - g;
|
||||
y = 255.0 - b;
|
||||
k = c;
|
||||
k = VIPS_MIN(k, VIPS_MIN(m, y));
|
||||
k = VIPS_MIN( c, VIPS_MIN( m, y ) );
|
||||
|
||||
c = (c - k) / (255.0 - k) * 255.0;
|
||||
m = (m - k) / (255.0 - k) * 255.0;
|
||||
@ -164,10 +164,12 @@ vips_XYZ2CMYK_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width )
|
||||
q[0] = (unsigned char) VIPS_CLIP(0, c, 255.0);
|
||||
q[1] = (unsigned char) VIPS_CLIP(0, m, 255.0);
|
||||
q[2] = (unsigned char) VIPS_CLIP(0, y, 255.0);
|
||||
if (r < epsilon && g < epsilon && b < epsilon)
|
||||
if( r < epsilon &&
|
||||
g < epsilon &&
|
||||
b < epsilon )
|
||||
q[3] = 255.0;
|
||||
else
|
||||
q[3] = (unsigned char) VIPS_CLIP(0, k, 255.0);
|
||||
q[3] = VIPS_CLIP( 0, k, 255 );
|
||||
|
||||
p += 3;
|
||||
q += 4;
|
||||
|
Loading…
Reference in New Issue
Block a user