Isis 3.0 Developer's Reference (API) |
Home |
00001 #ifndef Pixel_h 00002 #define Pixel_h 00003 00024 #include "SpecialPixel.h" 00025 00026 namespace Isis { 00051 class Pixel { 00052 public: 00053 static unsigned char To8Bit(const double d); 00054 static short int To16Bit(const double d); 00055 static float To32Bit(const double d); 00056 00057 static double ToDouble(const unsigned char t); 00058 static double ToDouble(const short int t); 00059 static double ToDouble(const float t); 00060 00061 static float ToFloat(const unsigned char d); 00062 static float ToFloat(const short int d); 00063 static float ToFloat(const double d); 00064 00065 static std::string ToString(double d); 00066 00075 static inline bool IsSpecial(const double d) { 00076 return(d < VALID_MIN8); 00077 } 00078 00088 static inline bool IsSpecial(const float f) { 00089 return(f < VALID_MIN4); 00090 } 00091 00100 static inline bool IsValid(const double d) { 00101 return(d >= VALID_MIN8); 00102 } 00103 00111 static inline bool IsNull(const double d) { 00112 return(d == NULL8); 00113 } 00114 00122 static inline bool IsHigh(const double d) { 00123 return(d == HIGH_REPR_SAT8) || (d == HIGH_INSTR_SAT8); 00124 } 00125 00133 static inline bool IsLow(const double d) { 00134 return(d == LOW_REPR_SAT8) || (d == LOW_INSTR_SAT8); 00135 } 00136 00144 static inline bool IsHrs(const double d) { 00145 return(d == HIGH_REPR_SAT8); 00146 } 00147 00155 static inline bool IsHis(const double d) { 00156 return(d == HIGH_INSTR_SAT8); 00157 } 00158 00166 static inline bool IsLis(const double d) { 00167 return(d == LOW_INSTR_SAT8); 00168 } 00169 00177 static inline bool IsLrs(const double d) { 00178 return(d == LOW_REPR_SAT8); 00179 } 00180 00181 }; // end of pixel class 00182 } 00183 #endif