40 out << bandPtr[bandIdx] <<
" ";
56 theNumberOfEntries(0),
58 theBandScalarType(bandScalarType),
59 theNullPixelIndex(nullPixelIndex)
61 create(numberOfEntries, numberOfBands);
66 theNumberOfEntries(lut.theNumberOfEntries),
67 theNumberOfBands(lut.theNumberOfBands),
68 theBandScalarType(lut.theBandScalarType),
69 theNullPixelIndex(lut.theNullPixelIndex),
70 m_entryLabels(lut.m_entryLabels)
95 if(numberOfEntries&&numberOfBands)
130 for(bandIdx = 0; bandIdx <
size; ++bandIdx)
132 ossim_int64 delta = lutPtr[bandIdx] - bandValues[bandIdx];
133 sumSquare += (delta*delta);
176 if(bandPtr[band] < minValue)
178 minValue = bandPtr[band];
180 if(bandPtr[band] > maxValue)
182 maxValue = bandPtr[band];
279 ostr << lutPtr[bandIdx]
337 if (numberOfBands && numberOfEntries)
365 lutPtr[bandIdx] = lutValue.
toInt32();
378 std::map<ossim_uint32, std::vector<ossimString> >::iterator it =
m_entryLabels.find(band);
383 return std::vector<ossimString>();
std::ostream & operator<<(std::ostream &out, const ossimNBandLutDataObject &lut)
ossim_int32 LUT_ENTRY_TYPE
std::vector< ossimString > getEntryLabels(ossim_uint32 band)
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Represents serializable keyword/value map.
bool addFile(const char *file)
const char * find(const char *key) const
void setEntryLables(ossim_uint32 band, std::vector< ossimString > entryLabels)
static const char * NULL_VALUE_KW
static ossimString toString(bool aValue)
Numeric to string methods.
static const char * NUMBER_ENTRIES_KW
virtual ossimString getClassName() const
void getMinMax(ossim_uint32 band, LUT_ENTRY_TYPE &minValue, LUT_ENTRY_TYPE &maxValue)
Will return the min max value for a given band.
ossimNBandLutDataObject(ossim_uint32 numberOfEntries=0, ossim_uint32 numberOfBands=0, ossimScalarType bandScalarType=OSSIM_UINT8, ossim_int32 nullPixelIndex=-1)
std::map< ossim_uint32, std::vector< ossimString > > m_entryLabels
bool operator==(const ossimNBandLutDataObject &lut) const
Determines if the state of this lut is identical to the passed in lut.
static const char * TYPE_KW
virtual ossim_int32 getEntryNumber(const char *entry_string, bool case_insensitive=true) const
ossim_int32 toInt32() const
void clearLut()
Will do a simple memset to '\0' all.
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
static ossimScalarTypeLut * instance()
Returns the static instance of an ossimScalarTypeLut object.
ossim_uint32 theNumberOfEntries
unsigned int ossim_uint32
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
bool open(const ossimFilename &lutFile)
Reads in an external lut file.
static const char * NUMBER_BANDS_KW
virtual ~ossimNBandLutDataObject()
RTTI_DEF1(ossimNBandLutDataObject, "ossimNBandLutDataObject", ossimObject)
ossim_uint32 theNumberOfBands
const ossimNBandLutDataObject & operator=(const ossimNBandLutDataObject &lut)
does a deep copy from the passed in lut to the object.
static const char * ENTRY_KW
void create(ossim_uint32 numberOfEntries, ossim_uint32 numberOfBands=3)
ossimScalarType theBandScalarType
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string's contents...
static const char * SCALAR_TYPE_KW
class ossimNBandLutDataObject
ossim_uint32 findIndex(ossim_int32 *values) const
This method gives you a way to find an entry index closest to the passed in band values.
ossim_int32 theNullPixelIndex
std::basic_istringstream< char > istringstream
Class for char input memory streams.
float distance(double lat1, double lon1, double lat2, double lon2, int units)
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Loads the state of the object by reading in the keywords listed in the save state.
static const char * FILENAME_KW
ossim_int32 getFirstNullAlphaIndex() const
std::basic_ostream< char > ostream
Base class for char output streams.