SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG

BotDetect - Real-Time Bot Detection API
 
 

MAN page from RedHat Other XITE-3.3-3.i386.rpm

IHS

Section: C Library Functions (3)
Updated: 16 Mar 1998
Index

 

NAME

ihs, rgb2ihs, ihs2rgb, rgb2ihs_byte, ihs2rgb_byte,rgb2ihs_word, ihs2rgb_word - Convert between RGB and IHS

 

SYNTAX


 #include <xite/ihs.h>


 void rgb2ihs( double r, double g, double b,
    double* i, double* h, double* s, int norm );


 void ihs2rgb( double i, double h, double s,
    double* r, double* g, double* b, int norm );


 void rgb2ihs_byte( unsigned char r,
    unsigned char g, unsigned char b,
    unsigned char *i, unsigned char *h,
    unsigned char *s );


 void ihs2rgb_byte( unsigned char i,
    unsigned char h, unsigned char s,
    unsigned char *r, unsigned char *g,
    unsigned char *b );


 void rgb2ihs_word( unsigned short r,
    unsigned short g, unsigned short b,
    unsigned short *i, unsigned short *h,
    unsigned short *s );


 void ihs2rgb_word( unsigned short i,
    unsigned short h, unsigned short s,
    unsigned short *r, unsigned short *g,
    unsigned short *b );

 

DESCRIPTION

rgb2ihsconverts from RGB-space to IHS-space.ihs2rgbconverts from IHS-space to RGB-space.rgb values are normalized
 0.0 <= r <= 1.0, 0.0 <= b <= 1.0, 0.0 <= b <= 1.0,

If norm = TRUE the IHS values are normalized.
 0.0 <= i <= 1.0, 0.0 <= h <= 1.0, 0.0 <= s <= 1.0,

If norm = FALSE:
 0.0 <= i <= 1.0
 0.0 <= h <  1.0
 0.0 <= s <= Smax(I,H)

rgb2ihs_xxxxand ihs2rgb_xxxxnormalize the datain the range 0-255 for xxxx=byte and 0-65535 for xxxx=word

 

RGB2IHS


 i = A11 * r + A12 * g + A13 * b;
 u = A21 * r + A22 * g + A23 * b;
 v = A31 * r + A32 * g + A33 * b;


 h = atan2(v, u) , 0 <= h < 2*pi
 s = sqrt(u*u + v*v)

 

IHS2RGB


 u = s*cos(h)
 v = s*sin(h)


 r =  i + A21 * u + A31 * v;
 g =  i + A22 * u + A32 * v;
 b =  i + A23 * u + A33 * v;

 

VALUES


 A11 = A12 = A13 =  1./3.
 A21 = A22       = -1./sqrt(6.)
 A23             =  2./sqrt(6.)
 A31 = -A32      =  1./sqrt(2.)
 A33             =  0.

 

NORMALIZATION


 i' = i / sqrt(3.0)
 h' = h / 2*pi
 s' = s / (Max s for (i,h))

 

SEE ALSO

ihs2rgb(1), ihs2rgb_img(3), rgb2ihs(1), rgb2ihs_img(3)

 

AUTHOR

Otto Milvang


 

Index

NAME
SYNTAX
DESCRIPTION
RGB2IHS
IHS2RGB
VALUES
NORMALIZATION
SEE ALSO
AUTHOR

This document was created byman2html,using the manual pages.
 
ICM Bot detect detector