#ifndef SEEN_SP_COLOR_H
#define SEEN_SP_COLOR_H
/*
* Author:
* Lauris Kaplinski <lauris@kaplinski.com>
* bulia byak <buliabyak@users.sf.net>
* Jon A. Cruz <jon@joncruz.org>
*
* Copyright (C) 2001-2002 Lauris Kaplinski
* Copyright (C) 2001 Ximian, Inc.
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include <string>
/* Useful composition macros */
#define SP_RGBA32_U_COMPOSE(r,g,b,a) ((((r) & 0xff) << 24) | (((g) & 0xff) << 16) | (((b) & 0xff) << 8) | ((a) & 0xff))
#define SP_RGBA32_F_COMPOSE(r,g,b,a) SP_RGBA32_U_COMPOSE (SP_COLOR_F_TO_U (r), SP_COLOR_F_TO_U (g), SP_COLOR_F_TO_U (b), SP_COLOR_F_TO_U (a))
struct SVGICCColor;
/**
* An RGB color with optional icc-color part
*/
struct SPColor {
SPColor();
SPColor( float r, float g, float b );
void set( float r, float g, float b );
union {
float c[3];
} v;
};
/* Plain mode helpers */
void sp_color_rgb_to_hsv_floatv (float *hsv, float r, float g, float b);
void sp_color_hsv_to_rgb_floatv (float *rgb, float h, float s, float v);
void sp_color_rgb_to_hsl_floatv (float *hsl, float r, float g, float b);
void sp_color_hsl_to_rgb_floatv (float *rgb, float h, float s, float l);
void sp_color_rgb_to_cmyk_floatv (float *cmyk, float r, float g, float b);
void sp_color_cmyk_to_rgb_floatv (float *rgb, float c, float m, float y, float k);
#endif // SEEN_SP_COLOR_H