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