im_colorhsi.h
Go to the documentation of this file.00001 /** \file
00002 * \brief HSI Color Manipulation
00003 *
00004 * See Copyright Notice in im_lib.h
00005 */
00006
00007 #ifndef __IM_COLORHSI_H
00008 #define __IM_COLORHSI_H
00009
00010 #if defined(__cplusplus)
00011 extern "C" {
00012 #endif
00013
00014
00015 /** \defgroup hsi HSI Color Coordinate System Conversions
00016 *
00017 * \par
00018 * HSI is just the RGB color space written in a different coordinate system.
00019 * \par
00020 * "I" is defined along the cube diagonal. It ranges from 0 (black) to 1 (white). \n
00021 * HS are the polar coordinates of a plane normal to "I". \n
00022 * "S" is the normal distance from the diagonal of the RGB cube. It ranges from 0 to Smax. \n
00023 * "H" is the angle starting from the red vector, given in degrees.
00024 * \par
00025 * This is not a new color space, this is exactly the same gammut as RGB. \n
00026 * Since it is still a cube, Smax depends on H.
00027 * \par
00028 * See \ref im_colorhsi.h
00029 * \ingroup color */
00030
00031
00032 /** Returns the maximum S for H (here in radians) and I.
00033 * \ingroup hsi */
00034 float imColorHSI_Smax(float h, double cosh, double sinh, float i);
00035
00036 /** Returns I where S is maximum given H (here in radians).
00037 * \ingroup hsi */
00038 float imColorHSI_ImaxS(float h, double cosh, double sinh);
00039
00040 /** Converts from RGB to HSI.
00041 * \ingroup hsi */
00042 void imColorRGB2HSI(float r, float g, float b, float *h, float *s, float *i);
00043
00044 /** Converts from RGB (byte) to HSI.
00045 * \ingroup hsi */
00046 void imColorRGB2HSIbyte(unsigned char r, unsigned char g, unsigned char b, float *h, float *s, float *i);
00047
00048 /** Converts from HSI to RGB.
00049 * \ingroup hsi */
00050 void imColorHSI2RGB(float h, float s, float i, float *r, float *g, float *b);
00051
00052 /** Converts from HSI to RGB (byte).
00053 * \ingroup hsi */
00054 void imColorHSI2RGBbyte(float h, float s, float i, unsigned char *r, unsigned char *g, unsigned char *b);
00055
00056
00057 #if defined(__cplusplus)
00058 }
00059 #endif
00060
00061 #endif