Problems with HSLTransform?
Posted: 2008-02-19T07:29:33-07:00
Ok making progress, here is the latest.
The following code exists in the MagicNet MagikColor.cpp file
ColorHSL::ColorHSL(double hue, double saturation, double luminosity) : Color() {
MagickLib::HSLTransform(hue, saturation, luminosity, &pixel->red, &pixel->green, &pixel->blue);
pixel->opacity = Opaque;
}
double ColorHSL::Hue::get(void) {
double h, s, l;
MagickLib::TransformHSL(pixel->red, pixel->green, pixel->blue, &h, &s, &l);
return h;
}
void ColorHSL::Hue::set(double hue) {
double h, s, l;
MagickLib::TransformHSL(pixel->red, pixel->green, pixel->blue, &h, &s, &l);
MagickLib::HSLTransform(hue, s, l, &pixel->red, &pixel->green, &pixel->blue);
}
double ColorHSL::Saturation::get(void) {
double h, s, l;
MagickLib::TransformHSL(pixel->red, pixel->green, pixel->blue, &h, &s, &l);
return s;
}
void ColorHSL::Saturation::set(double saturation) {
double h, s, l;
MagickLib::TransformHSL(pixel->red, pixel->green, pixel->blue, &h, &s, &l);
MagickLib::HSLTransform(h, saturation, l, &pixel->red, &pixel->green, &pixel->blue);
}
double ColorHSL::Luminosity::get(void) {
double h, s, l;
MagickLib::TransformHSL(pixel->red, pixel->green, pixel->blue, &h, &s, &l);
return l;
}
void ColorHSL::Luminosity::set(double luminosity) {
double h, s, l;
MagickLib::TransformHSL(pixel->red, pixel->green, pixel->blue, &h, &s, &l);
MagickLib::HSLTransform(h, s, luminosity, &pixel->red, &pixel->green, &pixel->blue);
}
There are frequent references to a TransformHSL and HSLTransform method, these do not exists in the MagickLib as far as I can tell.
Anyone know whether this is needed or can be fixed.... there is already a ColorHSL class in the core library I think.
Cheers
The following code exists in the MagicNet MagikColor.cpp file
ColorHSL::ColorHSL(double hue, double saturation, double luminosity) : Color() {
MagickLib::HSLTransform(hue, saturation, luminosity, &pixel->red, &pixel->green, &pixel->blue);
pixel->opacity = Opaque;
}
double ColorHSL::Hue::get(void) {
double h, s, l;
MagickLib::TransformHSL(pixel->red, pixel->green, pixel->blue, &h, &s, &l);
return h;
}
void ColorHSL::Hue::set(double hue) {
double h, s, l;
MagickLib::TransformHSL(pixel->red, pixel->green, pixel->blue, &h, &s, &l);
MagickLib::HSLTransform(hue, s, l, &pixel->red, &pixel->green, &pixel->blue);
}
double ColorHSL::Saturation::get(void) {
double h, s, l;
MagickLib::TransformHSL(pixel->red, pixel->green, pixel->blue, &h, &s, &l);
return s;
}
void ColorHSL::Saturation::set(double saturation) {
double h, s, l;
MagickLib::TransformHSL(pixel->red, pixel->green, pixel->blue, &h, &s, &l);
MagickLib::HSLTransform(h, saturation, l, &pixel->red, &pixel->green, &pixel->blue);
}
double ColorHSL::Luminosity::get(void) {
double h, s, l;
MagickLib::TransformHSL(pixel->red, pixel->green, pixel->blue, &h, &s, &l);
return l;
}
void ColorHSL::Luminosity::set(double luminosity) {
double h, s, l;
MagickLib::TransformHSL(pixel->red, pixel->green, pixel->blue, &h, &s, &l);
MagickLib::HSLTransform(h, s, luminosity, &pixel->red, &pixel->green, &pixel->blue);
}
There are frequent references to a TransformHSL and HSLTransform method, these do not exists in the MagickLib as far as I can tell.
Anyone know whether this is needed or can be fixed.... there is already a ColorHSL class in the core library I think.
Cheers