Imagick / imagick

🌈 The Imagick PHP extension 🌈
http://pecl.php.net/imagick
Other
546 stars 138 forks source link

haldClutImage needs documenting #367

Open Danack opened 3 years ago

Danack commented 3 years ago

In particular how to generate a 'hald clut' as I just tried to use this function, and have no idea how to do that.

Danack commented 3 years ago

How to generate a hald clut: http://www.quelsolaar.com/technology/clut.html

cube_size = level * level;
image_size = level * level * level;
data = p = malloc((sizeof *data) * image_size * image_size * 3);
for(blue = 0; blue < cube_size; blue++)
{
     for(green = 0; green < cube_size; green++)
     {
         for(red = 0; red < cube_size; red++)
         {
             *p++ = (float)red / (float)(cube_size - 1);
             *p++ = (float)green / (float)(cube_size - 1);
             *p++ = (float)blue / (float)(cube_size - 1);
         }
     }
}
Danack commented 3 years ago

Found the origin of the name Hald clut.

Screen Shot 2021-05-09 at 19 49 21