/** * Copyright (c) 2003 Billy Biggs * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Last updated Mon Jun 16 13:12:17 ADT 2003 by vektor * - Initial release. */ #ifndef HUEROTATE_H_INCLUDED #define HUEROTATE_H_INCLUDED #ifdef __cplusplus extern "C" { #endif /** * This rotates the hue of a given scanline of sRGB pixels using the hue * angle from the CIELAB colourspace. This can be used to shift the * colours of an image in a reasonably perceptually uniform colourspace. * * The input should conform to the sRGB standard, http://www.srgb.com/ * * Take care in that the conversion is lossy due to quantization to 8 * bits per channel. */ /** * Rotates the hue of a 24bit per pixel scanline, RGB component ordering * (in memory, src[ 0 ] == R). * * Angle is in radians between 0 and (2.0 * M_PI). */ void hue_rotate_scanline_rgb24( uint8_t *dst, uint8_t *src, int width, double angle ); /** * Rotates the hue of a 32bit per pixel scanline, RGBA component * ordering (in memory, src[ 0 ] == R, src[ 3 ] == A). We assume that * the colour is non-premultiplied, and take note that for premultiplied * alpha this would get more complicated, since you can end up with a * brighter colour after the rotation. We only touch colour, the alpha * channel is simply copied from source to destination. * * Angle is in radians between 0 and (2.0 * M_PI). */ void hue_rotate_scanline_rgba32( uint8_t *dst, uint8_t *src, int width, double angle ); #ifdef __cplusplus }; #endif #endif /* HUEROTATE_H_INCLUDED */