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 1. \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 * \par 00027 * See \ref im_colorhsi.h 00028 * \ingroup color */ 00029 00030 00031 /** Returns I where S is maximum given H (here in radians). 00032 * \ingroup hsi */ 00033 float imColorHSI_ImaxS(float h, double cosh, double sinh); 00034 00035 /** Converts from RGB to HSI. 00036 * \ingroup hsi */ 00037 void imColorRGB2HSI(float r, float g, float b, float *h, float *s, float *i); 00038 00039 /** Converts from RGB (byte) to HSI. 00040 * \ingroup hsi */ 00041 void imColorRGB2HSIbyte(unsigned char r, unsigned char g, unsigned char b, float *h, float *s, float *i); 00042 00043 /** Converts from HSI to RGB. 00044 * \ingroup hsi */ 00045 void imColorHSI2RGB(float h, float s, float i, float *r, float *g, float *b); 00046 00047 /** Converts from HSI to RGB (byte). 00048 * \ingroup hsi */ 00049 void imColorHSI2RGBbyte(float h, float s, float i, unsigned char *r, unsigned char *g, unsigned char *b); 00050 00051 00052 #if defined(__cplusplus) 00053 } 00054 #endif 00055 00056 #endif