31 NUMBER_LINES(
"number_lines",
32 "Number of lines in the raster image.");
35 NUMBER_SAMPLES(
"number_samples",
36 "Number of samples in the raster image.");
39 VALID_START_LINE(
"valid_start_line",
40 "First valid line of raster image(zero based).");
43 VALID_STOP_LINE(
"valid_stop_line",
44 "Last valid line of raster image(zero based).");
47 VALID_START_SAMPLE(
"valid_start_sample",
48 "First valid sample of raster image(zero based).");
51 VALID_STOP_SAMPLE(
"valid_stop_sample",
52 "Last valid sample of raster image(zero based).");
55 SUB_IMAGE_OFFSET_LINE(
56 "sub_image_offset_line",
57 "Pixel line offset of sub-image in the full-image pixel space.");
60 SUB_IMAGE_OFFSET_SAMP(
61 "sub_image_offset_samp",
62 "Pixel sample offset of sub-image in the full-image pixel space.");
65 HEADER_SIZE(
"header_size",
66 "Header size in bytes.");
69 SET_NULLS(
"set_fill_to_nulls_mode",
70 "0 = do nothing to pixels,\n1 = all zeroes to min values,\ 71 \n2 = zeroes to null on edges only.");
74 PIXELS_TO_CHOP(
"pixels_to_chop",
75 "Ammount of pixels to chop from edge.");
79 static ossimTrace traceDebug(
"ossimGeneralRasterInfo:debug");
89 theSubImageOffset(0,0),
91 theSetNullsMode(NONE),
110 theMetaData(pixelType, numberOfBands),
111 theImageFileList(imageFileList),
112 theInterleaveType(il_type),
113 theRawImageRect(0,0,0,0),
114 theValidImageRect(0,0,0,0),
115 theImageRect(0,0,0,0),
116 theSubImageOffset(0,0),
117 theHeaderSize(headerSize),
118 theSetNullsMode(nullsMode),
119 thePixelsToChop(pixelsToChop),
133 theRawImageRect(0,0,0,0),
134 theValidImageRect(0,0,0,0),
135 theImageRect(0,0,0,0),
136 theSubImageOffset(0,0),
138 theSetNullsMode(NONE),
151 theMetaData ( obj.theMetaData ),
152 theImageFileList ( obj.theImageFileList ),
153 theInterleaveType ( obj.theInterleaveType ),
154 theRawImageRect ( obj.theRawImageRect ),
155 theValidImageRect ( obj.theValidImageRect ),
156 theImageRect ( obj.theImageRect ),
157 theSubImageOffset ( obj.theSubImageOffset ),
158 theHeaderSize ( obj.theHeaderSize ),
159 theSetNullsMode ( obj.theSetNullsMode ),
160 thePixelsToChop ( obj.thePixelsToChop ),
161 theImageDataByteOrder ( obj.theImageDataByteOrder )
243 out << kwl << std::endl;
249 static const char MODULE[] =
"ossimGeneralRasterInfo::setFillToNullMode";
257 << MODULE <<
" ERROR:" 258 <<
"\nmode out of bounds(0 - 2): " << mode << std::endl
259 <<
"\nmode has not been changed." << std::endl;
330 const char* prefix)
const 353 SUB_IMAGE_OFFSET_LINE,
357 SUB_IMAGE_OFFSET_SAMP,
406 static const char MODULE[] =
"ossimGeneralRasterInfo::loadState";
409 CLOG <<
"DEBUG: entered..." 410 <<
"\nprefix: " << (prefix ? prefix :
"")
411 <<
"\nInput keyword list:\n" 430 << MODULE <<
" ERROR:\n" 431 <<
"Detected an error in the keywordlist: " << kwl
454 <<
"Required number of lines is 0!" << std::endl;
465 <<
"Required keyword not found: " << key << std::endl;
471 key = NUMBER_SAMPLES;
482 <<
"Required number of samples is 0!" << std::endl;
493 <<
"Required keyword not found: " << key << std::endl;
504 <<
" Error loading meta data!\n" << std::endl;
558 <<
"Required keyword not found: " 614 <<
"Required keyword not found: " 616 <<
"\nInterleave type is multi file; however," 617 <<
" not enough were pick up!" << std::endl;
623 key = VALID_START_LINE;
630 key = VALID_STOP_LINE;
641 <<
"\nValid stop line < start line." 644 <<
"\nError status has been set. Returning." << std::endl;
648 key = VALID_START_SAMPLE;
655 key = VALID_STOP_SAMPLE;
666 <<
"\nValid stop samp < start samp." 669 <<
"\nError status has been set. Returning." << std::endl;
678 key = SUB_IMAGE_OFFSET_LINE;
685 key = SUB_IMAGE_OFFSET_SAMP;
705 if ((tmp < 3) && (tmp > -1))
714 <<
"\nset_fill_to_nulls_mode value out of range." 715 <<
"\nDefaulted to 2" << std::endl;
719 key = PIXELS_TO_CHOP;
758 << MODULE <<
" Exit status: " << (result?
"true":
"false") << std::endl;
767 static const char MODULE[] =
"ossimGeneralRasterInfo::open";
771 << MODULE <<
" entered..." <<
"\nimageFile: " << imageFile << std::endl;
780 if ( !imageFile.
exists() )
782 copyFile = imageFile.
expand();
826 else if ( ext ==
"xml" )
876 << MODULE <<
" Exit status: " << (result?
"true":
"false") << std::endl;
888 char delimeter =
' ';
1014 std::string pixelType =
"N";
1018 pixelType = value.
string();
1041 if (pixelType ==
"S")
1053 if( pixelType ==
"S")
1057 else if( pixelType ==
"F")
1069 if( (nbits < 8) && (nbits >= 1 ) )
1089 bool result =
false;
1091 if( hdr.
open( headerFile ) )
1100 bool result =
false;
1183 bool result =
false;
1186 if (file.
open( headerFile ))
1252 file.
getPath(
"/metadata/eainfo/detailed/enttyp/enttypd", eainfo);
1256 if( numBytes > 0 && numBytes != 3 )
1258 numBits = numBytes*8;
1264 else if( numBits == 32 )
1294 result = ( fileSize / rectSize.
x / rectSize.
y /
numberOfBands() ) * 8;
void set_uly(ossim_int32 y)
static const char * BYTE_ORDER_KW
ossim_int32 bytesPerPixel() const
Bytes per pixel.
ossim_int32 theHeaderSize
Size of header in bytes.
ossimIrect theValidImageRect
The rectangle representing where the valid part of the image lies within "theRawImageRect".
ossim_int32 headerSize() const
Returns the size of header in bytes.
ossim_int32 thePixelsToChop
Amount of pixels to chop for each line edge.
void setImageFileList(const std::vector< ossimFilename > &list)
const ossimIrect & validImageRect() const
Returns the rectangle of where the image is within the raster file.
Represents serializable keyword/value map.
bool addFile(const char *file)
const std::string & findKey(const std::string &key) const
Find methods that take std::string(s).
ossimByteOrder theImageDataByteOrder
The byte order the image data is stored in.
ossimInterleaveType interleaveType() const
Enumerated in InterleaveTypeLUT.
ossim_int64 fileSize() const
ossimFilename expand() const
Method to do file name expansion.
virtual ossimString getEntryString(ossim_int32 entry_number) const
ossim_uint32 getNumberOfBands()
Get Bands.
ossimKeywordlist & downcaseKeywords()
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
bool contains(char aChar) const
ossimImageMetaData theMetaData
static ossimString toString(bool aValue)
Numeric to string methods.
bool getPath(const ossimString &path, ossimString &s) const
Gets path from doc and initializes string.
std::vector< ossimFilename > theImageFileList
const ossimIpt & ul() const
void change_delimiter(char del)
OSSIM_DLL ossimByteOrder byteOrder()
static const ossimErrorCode OSSIM_ERROR
ossim_uint32 toUInt32() const
bool initializeFromHdr(const ossimFilename &imageFile, const ossimFilename &headerFile)
Initialize from header file.
ossimByteOrder getImageDataByteOrder() const
void clear()
Clears data members.
virtual std::ostream & print(std::ostream &out) const
Generic print method.
virtual ossim_int32 getEntryNumber(const char *entry_string, bool case_insensitive=true) const
ossim_int32 toInt32() const
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
const std::vector< ossimFilename > & getImageFileList() const
const ossimIrect & rawImageRect() const
Zero based rectangle of the raw image.
const ossimIpt & subImageOffset() const
Returns the offset of this image's origin to a full-image's origin, in the case where this image is a...
bool open(const ossimFilename &imageFile)
Takes image file and attempts to derive/find header file to parse for general raster data...
void setSubImageOffset(const ossimIpt &d)
ossimInterleaveType theInterleaveType
std::string::size_type size() const
void setRawImageRect(const ossimIrect &imageRect)
void setFillToNullsMode(ossim_uint32 mode)
Sets theSetNullsMode.
unsigned int ossim_uint32
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
ossim_int32 rawLines() const
Returns the number of lines within "theRawImageRect".
Class for FGDC XML doc parsing.
ossimFillMode theSetNullsMode
Mode of how to handle pixels on import.
ossim_int32 rawSamples() const
Returns the number of samples within "theRawImageRect".
void setImageFile(const ossimFilename &file)
Sets the image file list to file.
ossim_int32 getBitsPerPixel(const ossimFilename &imageFile) const
Private method to get bits per pixel from file size, lines, samples and bands.
bool getImageSize(ossimIpt &size) const
const ossimIpt & lr() const
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
void setValidImageRect(const ossimIrect &imageRect)
static ossimString downcase(const ossimString &aString)
bool initializeFromXml(const ossimFilename &imageFile, const ossimFilename &headerFile)
Initialize from omd file.
const ossimGeneralRasterInfo & operator=(const ossimGeneralRasterInfo &rhs)
Assignment operator=.
const ossimIpt & ur() const
ossimIrect theImageRect
The valid image rectangle normalized to be zero based.
void set_lrx(ossim_int32 x)
ossimIpt theSubImageOffset
The offset from the full-image origin to this image's origin.
void setInterleaveType(ossimInterleaveType il_type)
static const char * INTERLEAVE_TYPE_KW
virtual ossimErrorCode getErrorStatus() const
void set_lry(ossim_int32 y)
bool initializeFromEnviHdr(const ossimEnviHeader &enviHdr)
Initialize from envi header file.
ossimIrect theRawImageRect
The zero based rectangle of the entire image not including any header.
ossim_uint32 fillToNullsMode() const
Returns the fill mode.
virtual ~ossimGeneralRasterInfo()
ossim_int32 pixelsToChop() const
Returns the number of pixels from the edge of a line to set to the fill value.
const ossimIrect & imageRect() const
Zero based rectangle of the valid image.
bool open(const ossimFilename &xmlFileName)
Open method.
void setImageDataByteOrder(ossimByteOrder byteOrder)
static const char * IMAGE_FILE_KW
ossimFilename & setExtension(const ossimString &e)
Sets the extension of a file name.
void setHeaderSize(ossim_int32 headerSize)
static const char * FILENAME_KW
ossim_int32 numberOfBands() const
Number of bands.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
std::basic_ostream< char > ostream
Base class for char output streams.
void set_ulx(ossim_int32 x)
const std::string & string() const
void setImageRect(const ossimIrect &imageRect)