2012-01-29 17:39:56 +00:00
|
|
|
#ifndef _PAYSAGES_COLOR_H_
|
|
|
|
#define _PAYSAGES_COLOR_H_
|
|
|
|
|
2012-03-08 15:10:25 +00:00
|
|
|
#include "curve.h"
|
2012-01-29 17:39:56 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2012-05-29 13:32:23 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
double r;
|
|
|
|
double g;
|
|
|
|
double b;
|
|
|
|
double a;
|
|
|
|
} Color;
|
|
|
|
|
|
|
|
extern Color COLOR_TRANSPARENT;
|
|
|
|
extern Color COLOR_BLACK;
|
|
|
|
extern Color COLOR_RED;
|
|
|
|
extern Color COLOR_GREEN;
|
|
|
|
extern Color COLOR_BLUE;
|
|
|
|
extern Color COLOR_WHITE;
|
|
|
|
extern Color COLOR_GREY;
|
|
|
|
|
2012-03-08 15:10:25 +00:00
|
|
|
/* Color */
|
2012-04-22 17:12:39 +00:00
|
|
|
void colorSave(PackStream* stream, Color* col);
|
|
|
|
void colorLoad(PackStream* stream, Color* col);
|
2012-03-08 15:10:25 +00:00
|
|
|
|
2012-01-29 17:39:56 +00:00
|
|
|
unsigned int colorTo32BitRGBA(Color* col);
|
|
|
|
unsigned int colorTo32BitBGRA(Color* col);
|
|
|
|
unsigned int colorTo32BitARGB(Color* col);
|
|
|
|
unsigned int colorTo32BitABGR(Color* col);
|
2012-03-08 15:10:25 +00:00
|
|
|
|
2012-01-29 17:39:56 +00:00
|
|
|
void colorMask(Color* base, Color* mask);
|
|
|
|
double colorNormalize(Color* col);
|
|
|
|
double colorGetValue(Color* col);
|
|
|
|
|
2012-03-08 15:10:25 +00:00
|
|
|
/* ColorGradation */
|
|
|
|
typedef struct ColorGradation ColorGradation;
|
|
|
|
|
|
|
|
ColorGradation* colorGradationCreate();
|
|
|
|
void colorGradationDelete(ColorGradation* gradation);
|
|
|
|
void colorGradationCopy(ColorGradation* source, ColorGradation* destination);
|
|
|
|
|
2012-04-22 17:12:39 +00:00
|
|
|
void colorGradationSave(PackStream* stream, ColorGradation* gradation);
|
|
|
|
void colorGradationLoad(PackStream* stream, ColorGradation* gradation);
|
2012-03-08 15:10:25 +00:00
|
|
|
|
|
|
|
void colorGradationGetRedCurve(ColorGradation* gradation, Curve* curve);
|
|
|
|
void colorGradationGetGreenCurve(ColorGradation* gradation, Curve* curve);
|
|
|
|
void colorGradationGetBlueCurve(ColorGradation* gradation, Curve* curve);
|
|
|
|
|
|
|
|
void colorGradationSetRedCurve(ColorGradation* gradation, Curve* curve);
|
|
|
|
void colorGradationSetGreenCurve(ColorGradation* gradation, Curve* curve);
|
|
|
|
void colorGradationSetBlueCurve(ColorGradation* gradation, Curve* curve);
|
|
|
|
|
2012-02-21 13:41:02 +00:00
|
|
|
void colorGradationQuickAdd(ColorGradation* gradation, double value, Color* col);
|
2012-03-08 15:10:25 +00:00
|
|
|
void colorGradationQuickAddRgb(ColorGradation* gradation, double value, double r, double g, double b);
|
|
|
|
|
2012-01-29 17:39:56 +00:00
|
|
|
Color colorGradationGet(ColorGradation* gradation, double value);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|