2012-01-29 17:39:56 +00:00
|
|
|
#ifndef _PAYSAGES_COLOR_H_
|
|
|
|
#define _PAYSAGES_COLOR_H_
|
|
|
|
|
|
|
|
#include "shared/types.h"
|
2012-02-12 17:26:17 +00:00
|
|
|
#include "shared/constants.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-03-08 15:10:25 +00:00
|
|
|
/* Color */
|
2012-01-29 17:39:56 +00:00
|
|
|
void colorSave(FILE* f, Color* col);
|
|
|
|
void colorLoad(FILE* f, 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-01-29 17:39:56 +00:00
|
|
|
void colorGradationSave(FILE* f, ColorGradation* gradation);
|
|
|
|
void colorGradationLoad(FILE* f, 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
|