cCmyk
Overview
Types and Definitions
cCmyk
struct cCmyk
{
float cyan;
float magenta;
float yellow;
float key;
};
typedef struct cCmyk cCmyk;
The cCmyk struct can store a color from the CMYK color space.
Functions
overall
cmyk_c_
#define cmyk_c_( Cyan, Magenta, Yellow, Key )
Creates a cCmyk instance.
cmyk_from_cmyk32_c
cCmyk32 cmyk32_from_cmyk_c( cCmyk cmyk );
Converts a cCmyk value to a cCmyk32 value.
Example
#include "clingo/color/cCmyk.h"
#include "clingo/lang/expect.h"
int main( void )
{
init_tap_c_();
cCmyk color = cmyk_from_cmyk32_c( cmyk32_c_( 128, 128, 128, 128 ) );
float f = 0.501960814f;
expect_c_( eq_cmyk_c_( color, cmyk_c_( f, f, f, f ) ) );
return finish_tap_c_();
}
cmyk_from_cmyk32_c
cCmyk cmyk_from_cmyk32_c( cCmyk32 cmyk32 );
eq_cmyk_c
#define eq_cmyk_c_( A, B ) \
eq_cmyk_c( (A), (B), FLT_EPSILON )
bool eq_cmyk_c( cCmyk a, cCmyk b, float epsilon );
Example
#include "clingo/color/cCmyk.h"
#include "clingo/lang/expect.h"
int main( void )
{
init_tap_c_();
cCmyk a = cmyk_c_( 0.25f, 0.46f, 0.75f, 0.83f );
cCmyk b = cmyk_c_( 0.83f, 0.75f, 0.46f, 0.25f );
expect_c_( eq_cmyk_c_( a, a ) );
expect_c_( !eq_cmyk_c_( a, b ) );
return finish_tap_c_();
}