IM: im_colorhsi.h Source File

IM - Imaging Libray

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: 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 the cube diagonal. HS is a polar coordinates of a plane normal to "I". 
00022  * "S" is the distance from the diagonal. "H" is the angle from red vector.
00023  * \par
00024  * This is not a new color space, this is exactly the same gammut as RGB. \n
00025  * Since it is still a cube, Smax depends on H. 
00026  * \par
00027  * See \ref im_colorhsi.h
00028  * \ingroup color */
00029 
00030 
00031 /** Returns the maximum S for H (in radians) and I.
00032  * \ingroup hsi */
00033 float imColorHSI_Smax(float h, double cosh, double sinh, float i);
00034 
00035 /** Returns I where S is maximum given H (in radians).
00036  * \ingroup hsi */
00037 float imColorHSI_ImaxS(float h, double cosh, double sinh);
00038 
00039 /** Converts from RGB to HSI.
00040  * \ingroup hsi */
00041 void imColorRGB2HSI(float r, float g, float b, float *h, float *s, float *i);
00042 
00043 /** Converts from RGB (byte) to HSI.
00044  * \ingroup hsi */
00045 void imColorRGB2HSIbyte(unsigned char r, unsigned char g, unsigned char b, float *h, float *s, float *i);
00046 
00047 /** Converts from HSI to RGB.
00048  * \ingroup hsi */
00049 void imColorHSI2RGB(float h, float s, float i, float *r, float *g, float *b);
00050 
00051 /** Converts from HSI to RGB (byte).
00052  * \ingroup hsi */
00053 void imColorHSI2RGBbyte(float h, float s, float i, unsigned char *r, unsigned char *g, unsigned char *b);
00054 
00055 
00056 #if defined(__cplusplus)
00057 }
00058 #endif
00059 
00060 #endif