OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimHsiVector.h
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: See top level LICENSE.txt file.
4 //
5 // Author: Garrett Potts
6 // Description:
7 //
8 //*************************************************************************
9 // $Id: ossimHsiVector.h 9968 2006-11-29 14:01:53Z gpotts $
10 #ifndef ossimHsiVector_HEADER
11 #define ossimHsiVector_HEADER
12 #include <iostream>
14 
15 class ossimRgbVector;
16 class ossimNormRgbVector;
17 
19 {
20 public:
22  {
23  out << "<" << data.theBuf[0] << ", "
24  << data.theBuf[1] << ", "
25  << data.theBuf[2] << ">";
26 
27  return out;
28  }
29  // assumed normalized ossim_float64s
30  //
31  //
33  {
34  theBuf[0] = h;
35  theBuf[1] = s;
36  theBuf[2] = i;
37  }
38  ossimHsiVector(const ossimRgbVector& rgb);
40 
41  ossimHsiVector& operator =(const ossimRgbVector& rgb);
42  ossimHsiVector& operator =(const ossimNormRgbVector& rgb);
43 
44  void setFromRgb(ossim_float64 r, ossim_float64 g, ossim_float64 b);
45 
46  ossim_float64 getH()const { return theBuf[0]; }
47  ossim_float64 getS()const { return theBuf[1]; }
48  ossim_float64 getI()const { return theBuf[2]; }
49  void setH(ossim_float64 H) { theBuf[0] = H; }
50  void setS(ossim_float64 S) { theBuf[1] = S; }
51  void setI(ossim_float64 I) { theBuf[2] = I; }
52 
54  {
55  colorValue = colorValue > max? max:colorValue;
56  colorValue = colorValue < min? min:colorValue;
57 
58  return colorValue;
59  }
60 
61 protected:
67  ossim_float64 theBuf[3];
68 };
69 
70 #endif
ossim_float64 clamp(ossim_float64 colorValue, ossim_float64 min=0, ossim_float64 max=1) const
ossim_float64 getS() const
#define OSSIMDLLEXPORT
ossim_float64 getH() const
ossim_float64 theBuf[3]
ossimHsiVector(ossim_float64 h=0, ossim_float64 s=0, ossim_float64 i=0)
double ossim_float64
ostream & operator<<(ostream &out, const ossimAxes &axes)
Definition: ossimAxes.h:88
void setI(ossim_float64 I)
void setH(ossim_float64 H)
ossim_float64 getI() const
#define max(a, b)
Definition: auxiliary.h:76
void setS(ossim_float64 S)
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
#define min(a, b)
Definition: auxiliary.h:75