Problems with HSLTransform?

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
JHam

Problems with HSLTransform?

Post by JHam »

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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Problems with HSLTransform?

Post by magick »

The problem with C is it is not easy to identify private and public API calls. We define public API calls as those defined here: http://www.imagemagick.org/script/magick-core.php. Public API interfaces do not change, however, private interfaces are subject to change. HSLTransform is a private interface and is now called ConvertHSLToRGB(). However, we will add a deprecated method to ImageMagick-6.3.8-10 and release it within a few days to fix the undefined method problem you reported. If you identify any other problems, let us know.
Post Reply