OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ossimNitfImageBandV2_0 Class Reference

#include <ossimNitfImageBandV2_0.h>

Inheritance diagram for ossimNitfImageBandV2_0:
ossimNitfImageBand ossimObject ossimReferenced ossimNitfImageBandV2_1

Public Member Functions

 ossimNitfImageBandV2_0 ()
 default constructor More...
 
virtual ~ossimNitfImageBandV2_0 ()
 virtual destructory More...
 
virtual void parseStream (ossim::istream &in)
 
virtual void writeStream (ossim::ostream &out)
 
virtual std::ostream & print (std::ostream &out, const std::string &prefix=std::string(), ossim_uint32 band=0) const
 print method that outputs a key/value type format adding prefix to keys. More...
 
virtual ossim_uint32 getNumberOfLuts () const
 
virtual const ossimRefPtr< ossimNitfImageLutgetLut (ossim_uint32 idx) const
 
virtual ossimRefPtr< ossimNitfImageLutgetLut (ossim_uint32 idx)
 
virtual ossimString getBandRepresentation () const
 
virtual void setBandRepresentation (const ossimString &rep)
 Sets the band representation. More...
 
virtual ossimString getBandSignificance () const
 
virtual void setBandSignificance (const ossimString &rep)
 Sets the band significance. More...
 
bool loadState (const ossimKeywordlist &kwl, const char *prefix, ossim_uint32 index=0)
 
- Public Member Functions inherited from ossimNitfImageBand
 ossimNitfImageBand ()
 
virtual ~ossimNitfImageBand ()
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimObjectdup () const
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual ossimString getDescription () const
 
virtual ossimString getClassName () const
 
virtual RTTItypeid getType () const
 
virtual bool canCastTo (ossimObject *obj) const
 
virtual bool canCastTo (const RTTItypeid &id) const
 
virtual bool canCastTo (const ossimString &parentClassName) const
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
virtual std::ostream & print (std::ostream &out) const
 Generic print method. More...
 
virtual bool isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
virtual void accept (ossimVisitor &visitor)
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (const ossimReferenced &)
 
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
int referenceCount () const
 

Protected Member Functions

void clearFields ()
 
void printLookupTables (std::ostream &out) const
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 

Protected Attributes

char theBandRepresentation [3]
 
char theBandSignificance [7]
 
char theBandImageFilterCondition [2]
 
char theBandStandardImageFilterCode [4]
 
char theBandNumberOfLuts [2]
 
char theBandNumberOfLutEntries [6]
 
std::vector< ossimRefPtr< ossimNitfImageLut > > theLookupTables
 

Additional Inherited Members

- Public Attributes inherited from ossimNitfImageBand
 TYPE_DATA
 

Detailed Description

Definition at line 23 of file ossimNitfImageBandV2_0.h.

Constructor & Destructor Documentation

◆ ossimNitfImageBandV2_0()

ossimNitfImageBandV2_0::ossimNitfImageBandV2_0 ( )

default constructor

Definition at line 20 of file ossimNitfImageBandV2_0.cpp.

References clearFields().

21 {
22  clearFields();
23 }

◆ ~ossimNitfImageBandV2_0()

ossimNitfImageBandV2_0::~ossimNitfImageBandV2_0 ( )
virtual

virtual destructory

Definition at line 25 of file ossimNitfImageBandV2_0.cpp.

26 {
27 }

Member Function Documentation

◆ clearFields()

void ossimNitfImageBandV2_0::clearFields ( )
protected

Definition at line 187 of file ossimNitfImageBandV2_0.cpp.

References theBandImageFilterCondition, theBandNumberOfLutEntries, theBandNumberOfLuts, theBandRepresentation, theBandSignificance, theBandStandardImageFilterCode, and theLookupTables.

Referenced by ossimNitfImageBandV2_0().

188 {
189  memset(theBandRepresentation, ' ', 2);
190  memset(theBandSignificance, ' ', 6);
191  memset(theBandImageFilterCondition, 'N', 1);
192  memset(theBandStandardImageFilterCode, ' ', 3);
193  memset(theBandNumberOfLutEntries, ' ', 5);
194 
195  theLookupTables.clear();
196  theBandRepresentation[2] = '\0';
197  theBandSignificance[6] = '\0';
198  theBandImageFilterCondition[1] = '\0';
200  theBandNumberOfLuts[0] = 0x30;
201  theBandNumberOfLuts[1] = '\0';
202  theBandNumberOfLutEntries[5] = '\0';
203 }
std::vector< ossimRefPtr< ossimNitfImageLut > > theLookupTables

◆ getBandRepresentation()

ossimString ossimNitfImageBandV2_0::getBandRepresentation ( ) const
virtual
Returns
The band representation as an ossimString.

Implements ossimNitfImageBand.

Definition at line 154 of file ossimNitfImageBandV2_0.cpp.

References theBandRepresentation.

◆ getBandSignificance()

ossimString ossimNitfImageBandV2_0::getBandSignificance ( ) const
virtual
Returns
The band significance as an ossimString.

Definition at line 171 of file ossimNitfImageBandV2_0.cpp.

References theBandSignificance.

◆ getLut() [1/2]

const ossimRefPtr< ossimNitfImageLut > ossimNitfImageBandV2_0::getLut ( ossim_uint32  idx) const
virtual

Implements ossimNitfImageBand.

Definition at line 134 of file ossimNitfImageBandV2_0.cpp.

References getNumberOfLuts(), and theLookupTables.

135 {
136  if(idx < getNumberOfLuts())
137  {
138  return theLookupTables[idx];
139  }
140 
141  return NULL;
142 }
virtual ossim_uint32 getNumberOfLuts() const
std::vector< ossimRefPtr< ossimNitfImageLut > > theLookupTables

◆ getLut() [2/2]

ossimRefPtr< ossimNitfImageLut > ossimNitfImageBandV2_0::getLut ( ossim_uint32  idx)
virtual

Implements ossimNitfImageBand.

Definition at line 144 of file ossimNitfImageBandV2_0.cpp.

References getNumberOfLuts(), and theLookupTables.

145 {
146  if(idx < getNumberOfLuts())
147  {
148  return theLookupTables[idx];
149  }
150 
151  return NULL;
152 }
virtual ossim_uint32 getNumberOfLuts() const
std::vector< ossimRefPtr< ossimNitfImageLut > > theLookupTables

◆ getNumberOfLuts()

ossim_uint32 ossimNitfImageBandV2_0::getNumberOfLuts ( ) const
virtual

Implements ossimNitfImageBand.

Definition at line 129 of file ossimNitfImageBandV2_0.cpp.

References theLookupTables.

Referenced by getLut().

130 {
131  return static_cast<ossim_uint32>(theLookupTables.size());
132 }
std::vector< ossimRefPtr< ossimNitfImageLut > > theLookupTables
unsigned int ossim_uint32

◆ loadState()

bool ossimNitfImageBandV2_0::loadState ( const ossimKeywordlist kwl,
const char *  prefix,
ossim_uint32  index = 0 
)

◆ parseStream()

void ossimNitfImageBandV2_0::parseStream ( ossim::istream in)
virtual

Implements ossimNitfImageBand.

Definition at line 29 of file ossimNitfImageBandV2_0.cpp.

References theBandImageFilterCondition, theBandNumberOfLutEntries, theBandNumberOfLuts, theBandRepresentation, theBandSignificance, theBandStandardImageFilterCode, theLookupTables, and ossimString::toLong().

30 {
31  theLookupTables.clear();
32  if(in)
33  {
34  theLookupTables.clear();
35  in.read(theBandRepresentation, 2);
36  in.read(theBandSignificance, 6);
37  in.read(theBandImageFilterCondition, 1);
39  in.read(theBandNumberOfLuts, 1);
40 
41  long numberOfLuts = ossimString(theBandNumberOfLuts).toLong();
42 
43  if(numberOfLuts > 0)
44  {
45  theLookupTables.resize(numberOfLuts);
46  in.read(theBandNumberOfLutEntries, 5);
47 
48  ossim_uint32 numberOfLutsIndex = numberOfLuts;
50  ossim_uint32 idx = 0;
51 
52  while(idx < numberOfLutsIndex)
53  {
55  theLookupTables[idx]->setNumberOfEntries(numberOfLutEntries);
56  theLookupTables[idx]->parseStream(in);
57 
58  ++idx;
59  }
60  }
61  }
62 }
std::vector< ossimRefPtr< ossimNitfImageLut > > theLookupTables
unsigned int ossim_uint32
long toLong() const
toLong&#39;s deprecated, please use the toInts...

◆ print()

std::ostream & ossimNitfImageBandV2_0::print ( std::ostream &  out,
const std::string &  prefix = std::string(),
ossim_uint32  band = 0 
) const
virtual

print method that outputs a key/value type format adding prefix to keys.

Parameters
outStream to output to.
prefixLike "image0."
bandzero based band.

Implements ossimNitfImageBand.

Definition at line 78 of file ossimNitfImageBandV2_0.cpp.

References theBandImageFilterCondition, theBandNumberOfLutEntries, theBandNumberOfLuts, theBandRepresentation, theBandSignificance, theBandStandardImageFilterCode, and theLookupTables.

81 {
83  os << std::setw(3) << std::setfill('0') << (band+1) << ":";
84 
85  ossimString tmpStr = "IREPBAND";
86  tmpStr += os.str();
87 
88  out << prefix << std::setw(24)
89  << tmpStr << theBandRepresentation << "\n";
90 
91  tmpStr = "ISUBCAT";
92  tmpStr += os.str();
93 
94  out << prefix << std::setw(24)
95  << tmpStr << theBandSignificance << "\n";
96 
97  tmpStr = "IFC";
98  tmpStr += os.str();
99 
100  out << prefix << std::setw(24)
101  << tmpStr << theBandImageFilterCondition << "\n";
102 
103  tmpStr = "IMFLT";
104  tmpStr += os.str();
105 
106  out << prefix << std::setw(24)
107  << tmpStr << theBandStandardImageFilterCode << "\n";
108 
109  tmpStr = "NLUTS";
110  tmpStr += os.str();
111 
112  out << prefix << std::setw(24)
113  << tmpStr << theBandNumberOfLuts << "\n";
114 
115  tmpStr = "NELUTS";
116  tmpStr += os.str();
117 
118  out << prefix << std::setw(24)
119  << tmpStr << theBandNumberOfLutEntries << "\n";
120 
121  for(ossim_uint32 idx = 0; idx < theLookupTables.size(); ++idx)
122  {
123  out << *theLookupTables[idx] << std::endl;
124  }
125 
126  return out;
127 }
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35
std::vector< ossimRefPtr< ossimNitfImageLut > > theLookupTables
unsigned int ossim_uint32

◆ printLookupTables()

void ossimNitfImageBandV2_0::printLookupTables ( std::ostream &  out) const
protected

Definition at line 205 of file ossimNitfImageBandV2_0.cpp.

References theLookupTables.

206 {
207  std::vector<ossimRefPtr<ossimNitfImageLut> >::const_iterator tables;
208 
209  tables = theLookupTables.begin();
210  while(tables != theLookupTables.end())
211  {
212  if((*tables).valid())
213  {
214  out << *((*tables).get());
215  }
216  ++tables;
217  if(tables != theLookupTables.end())
218  {
219  out << std::endl;
220  }
221  }
222 }
std::vector< ossimRefPtr< ossimNitfImageLut > > theLookupTables

◆ setBandRepresentation()

void ossimNitfImageBandV2_0::setBandRepresentation ( const ossimString rep)
virtual

Sets the band representation.

Parameters
repThe band representation.

Definition at line 159 of file ossimNitfImageBandV2_0.cpp.

References ossimString::c_str(), and theBandRepresentation.

Referenced by ossimNitf20Writer::writeBlockBandSeparate(), ossimNitfWriter::writeBlockBandSeparate(), ossimNitf20Writer::writeBlockBandSequential(), and ossimNitfWriter::writeBlockBandSequential().

160 {
161  std::ostringstream out;
162 
163  out << std::setw(2)
164  << std::setfill(' ')
165  << std::setiosflags(std::ios::left)
166  << rep.c_str();
167 
168  memcpy(theBandRepresentation, out.str().c_str(), 2);
169 }
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396

◆ setBandSignificance()

void ossimNitfImageBandV2_0::setBandSignificance ( const ossimString rep)
virtual

Sets the band significance.

Parameters
repThe band significance.

Definition at line 176 of file ossimNitfImageBandV2_0.cpp.

References ossimString::c_str(), and theBandSignificance.

177 {
178  std::ostringstream out;
179 
180  out << std::setw(6)
181  << std::setfill(' ')
182  << rep.c_str();
183 
184  memcpy(theBandSignificance, out.str().c_str(), 6);
185 }
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396

◆ writeStream()

void ossimNitfImageBandV2_0::writeStream ( ossim::ostream out)
virtual

Implements ossimNitfImageBand.

Definition at line 64 of file ossimNitfImageBandV2_0.cpp.

References theBandImageFilterCondition, theBandNumberOfLuts, theBandRepresentation, theBandSignificance, and theBandStandardImageFilterCode.

65 {
66  out.write(theBandRepresentation, 2);
67  out.write(theBandSignificance, 6);
68  out.write(theBandImageFilterCondition, 1);
69  out.write(theBandStandardImageFilterCode, 3);
70  out.write(theBandNumberOfLuts, 1);
71 
72  if(ossimString(theBandNumberOfLuts).toUInt32() > 0)
73  {
74  // lut output not supported currently
75  }
76 }

Member Data Documentation

◆ theBandImageFilterCondition

char ossimNitfImageBandV2_0::theBandImageFilterCondition[2]
protected

FIELD: IFCnn Is an required 1 byte field. Will be N

Definition at line 93 of file ossimNitfImageBandV2_0.h.

Referenced by clearFields(), parseStream(), print(), and writeStream().

◆ theBandNumberOfLutEntries

char ossimNitfImageBandV2_0::theBandNumberOfLutEntries[6]
protected

NELUTnn This is a conditional field.

Definition at line 111 of file ossimNitfImageBandV2_0.h.

Referenced by clearFields(), parseStream(), and print().

◆ theBandNumberOfLuts

char ossimNitfImageBandV2_0::theBandNumberOfLuts[2]
protected

FIELD: NLUTSnn This is a required 1 byte field. Has value 0-4

Definition at line 105 of file ossimNitfImageBandV2_0.h.

Referenced by clearFields(), parseStream(), print(), and writeStream().

◆ theBandRepresentation

char ossimNitfImageBandV2_0::theBandRepresentation[3]
protected

FIELD: IREPBAND,, Is a required 2 byte field. When theNumberOfBands is 1 this field will contain all spaces.

Definition at line 81 of file ossimNitfImageBandV2_0.h.

Referenced by clearFields(), getBandRepresentation(), parseStream(), print(), setBandRepresentation(), and writeStream().

◆ theBandSignificance

char ossimNitfImageBandV2_0::theBandSignificance[7]
protected

FIELD: ISUBCATnn Is a required 6 byte field.

Definition at line 87 of file ossimNitfImageBandV2_0.h.

Referenced by clearFields(), getBandSignificance(), parseStream(), print(), setBandSignificance(), and writeStream().

◆ theBandStandardImageFilterCode

char ossimNitfImageBandV2_0::theBandStandardImageFilterCode[4]
protected

FIELD: IMFLTnn is a required 3 byte field. This is a reserved field

Definition at line 99 of file ossimNitfImageBandV2_0.h.

Referenced by clearFields(), parseStream(), print(), and writeStream().

◆ theLookupTables

std::vector<ossimRefPtr<ossimNitfImageLut> > ossimNitfImageBandV2_0::theLookupTables
protected

The documentation for this class was generated from the following files: