Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

Vec3Real64 Impala::Core::Array::Element::ColHSI2RGB ( const Vec3Real64 &  v  )  [inline]

Conversion from HSI to RGB.

No formula yet...

Definition at line 272 of file ColConvert.h.

References FIVE_PI_3, FOUR_PI_3, PI, PI_3, TWO_PI_3, Impala::Core::Array::Element::Vec3Real64::X(), Impala::Core::Array::Element::Vec3Real64::Y(), and Impala::Core::Array::Element::Vec3Real64::Z().

Referenced by Impala::Visualization::Plot::Similarity::SelectColor(), Impala::Core::Array::Element::Color::ToCMY(), Impala::Core::Array::Element::Color::ToLab(), Impala::Core::Array::Element::Color::ToLuv(), Impala::Core::Array::Element::Color::ToOOO(), Impala::Core::Array::Element::Color::ToRGB(), and Impala::Core::Array::Element::Color::ToXYZ().

00273 {
00274     double H = v.X();
00275     double S = v.Y();
00276     double I = v.Z();
00277     double Htmp;
00278     double R,B,G;
00279     
00280     if (H == 0.0)
00281         R = G = B = I;
00282     else if (H > 0.0 && H < TWO_PI_3 ) {
00283         Htmp = 1 / sqrt(3.0) * tan(H - PI_3);
00284         B = (1.0 - S) * I;
00285         G = (1.5 + 1.5*Htmp ) * I - ((0.5 + 1.5*Htmp) * B);
00286         R = 3.0 * I - G - B;
00287     }
00288     else if (H >= TWO_PI_3 && H < FOUR_PI_3) {
00289         Htmp = 1 / sqrt(3.0) * tan(H - PI);
00290         R = (1.0 - S) * I;
00291         B = (1.5 + 1.5*Htmp ) * I - ((0.5 + 1.5*Htmp) * R);
00292         G = 3.0 * I - B - R;
00293     }
00294     else { 
00295         Htmp = 1 / sqrt(3.0) * tan(H - FIVE_PI_3);
00296         G = (1.0 - S) * I;
00297         R = (1.5 + 1.5*Htmp ) * I - ((0.5 + 1.5*Htmp) * G);
00298         B = 3.0 * I - R - G;
00299     }
00300     return Vec3Real64(R, G, B);
00301 }

Here is the call graph for this function:


Generated on Fri Mar 19 10:59:59 2010 for ImpalaSrc by  doxygen 1.5.1