49 static ossimString monthConversionTable[] = {
" ",
"JAN",
"FEB",
"MAR",
"APR",
"MAY",
"JUN",
"JUL",
"AUG",
"SEP",
"OCT",
"NOV",
"DEC"};
57 theEnableRpcbTagFlag(false),
58 theEnableBlockaTagFlag(
true),
59 theCopyFieldsFlag(false)
136 <<
"ossimNitf20Writer::writeFile ERROR:" 137 <<
" Could not open! Returning..." 167 imageTypeList.push_back(
ossimString(
"nitf20_block_band_separate"));
168 imageTypeList.push_back(
ossimString(
"nitf20_block_band_sequential"));
173 if(!property)
return;
177 if(name ==
"file_header")
181 if(containerProperty)
183 std::vector<ossimRefPtr<ossimProperty> > propertyList;
188 else if(name ==
"image_header")
192 if(containerProperty)
194 std::vector<ossimRefPtr<ossimProperty> > propertyList;
199 else if (name ==
"enable_rpcb_tag")
203 else if (name ==
"enable_blocka_tag")
207 else if(name ==
"copy_fields_flag")
224 if(name ==
"file_header")
227 std::vector<ossimRefPtr<ossimProperty> > propertyList;
234 else if(name ==
"image_header")
237 std::vector<ossimRefPtr<ossimProperty> > propertyList;
244 else if(name ==
"enable_rpcb_tag")
249 result = boolProperty;
251 else if(name ==
"enable_blocka_tag")
256 result = boolProperty;
258 else if(name ==
"copy_fields_flag")
263 result = boolProperty;
277 propertyNames.push_back(
"file_header");
278 propertyNames.push_back(
"image_header");
279 propertyNames.push_back(
"enable_rpcb_tag");
280 propertyNames.push_back(
"enable_blocka_tag");
281 propertyNames.push_back(
"copy_fields_flag");
299 imageInfoRecord.
setImageLength(bands*byteSize*blocksVertical*blockSize.
y*blocksHorizontal*blockSize.
x);
345 for(idx = 0; idx < bands; ++idx)
349 out << std::setfill(
'0')
361 ossim_uint64 imageHeaderSize = imageHeaderEnd - imageHeaderStart;
462 imageInfoRecord.
setImageLength(bands*byteSize*blocksHorizontal*blocksVertical*blockSize.
x*blockSize.
y);
510 for(idx = 0; idx < bands; ++idx)
514 out << std::setfill(
'0')
526 int imageHeaderSize = imageHeaderEnd - imageHeaderStart;
540 ossim_uint64 bandOffsetInBytes = (blockSizeInBytes*blocksHorizontal*blocksVertical);
585 for(idx = 0; idx < bands; ++idx)
589 bandOffsetInBytes*idx,
656 bool nitf21Flag =
false;
662 nitf21Flag = version.
contains(
"2.1");
671 fileHeaderProperties->
setProperty(
"ostaid", value);
676 fileHeaderProperties->
setProperty(
"ftitle", value);
681 fileHeaderProperties->
setProperty(
"fsclas", value);
691 fileHeaderProperties->
setProperty(
"ophone", value);
717 if(mon.toUInt32() < 13)
719 mon = monthConversionTable[mon.toUInt32()];
721 fileHeaderProperties->
setProperty(
"fdt", day+hour+
min+sec+
"Z"+mon+year);
742 imageHeaderProperties->
setProperty(
"tgtid", value);
747 imageHeaderProperties->
setProperty(
"isclas", value);
752 imageHeaderProperties->
setProperty(
"igeolo", value);
761 imageHeaderProperties->
setProperty(
"ititle", value);
768 imageHeaderProperties->
setProperty(
"iscaut", value);
773 imageHeaderProperties->
setProperty(
"iscode", value);
778 imageHeaderProperties->
setProperty(
"isctlh", value);
783 imageHeaderProperties->
setProperty(
"isrel", value);
788 imageHeaderProperties->
setProperty(
"isctln", value);
793 imageHeaderProperties->
setProperty(
"isdevt", value);
798 imageHeaderProperties->
setProperty(
"isorce", value);
812 if(mon.toUInt32() < 13)
814 mon = monthConversionTable[mon.toUInt32()];
816 imageHeaderProperties->
setProperty(
"idatim", day+hour+
min+sec+
"Z"+mon+year);
820 imageHeaderProperties->
setProperty(
"idatim", value);
831 const char* prefix)
const 16 bit unsigned integer (15 bits used)
virtual ossim_uint32 getWidth() const
virtual void slaveProcessTiles()
virtual void setProperty(ossimRefPtr< ossimProperty > property)
Set the properties.
void getPropertyList(std::vector< ossimRefPtr< ossimProperty > > &propertyList) const
void setProperties(std::vector< ossimRefPtr< ossimProperty > > &propertyList)
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
virtual ossim_uint32 getNumberOfBands() const
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Saves the state of the writer to kwl with prefix then calls base class ossimImageFileWriter::saveStat...
virtual ~ossimNitf20Writer()
virtual void getPropertyList(std::vector< ossimRefPtr< ossimProperty > > &children) const
ossimString theOutputImageType
bool needsAborting() const
virtual bool isMaster() const
Represents serializable keyword/value map.
virtual void setToStartOfSequence()
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
bool theEnableRpcbTagFlag
If true user wants to set RPC00B tag.
ossim_int64 getNumberOfTiles() const
ossim_uint32 height() const
bool contains(char aChar) const
virtual ossimRefPtr< ossimImageData > getNextTile(ossim_uint32 resLevel=0)
static ossimString getNitfPixelType(ossimScalarType scalarType)
Get the nitf pixel type string from scalar type.
bool theCopyFieldsFlag
If true this will enable searching the input connnection for another NITF handler and bring the field...
void setSubheaderLength(ossim_uint32 length)
virtual void getImageTypeList(std::vector< ossimString > &imageTypeList) const
void getImageTypeList(std::vector<ossimString>& imageTypeList)const
virtual ossim_uint32 getHeight() const
16 bit unsigned integer (14 bits used)
OSSIM_DLL ossim_uint32 getActualBitsPerPixel(ossimScalarType scalarType)
Get actual bits per pixel for a given scalar type.
16 bit unsigned integer (13 bits used)
unsigned short ossim_uint16
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
virtual ossimScalarType getOutputScalarType() const
This will be used to query the output pixel type of the tile source.
ossimRefPtr< ossimNitfFileHeaderV2_0 > theFileHeader
virtual ossim_uint32 getSizeInBytes() const
Returns the total number of bytes for all bands.
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
Gets a property.
signed short ossim_sint16
std::string::size_type size() const
ossimRefPtr< ossimImageSourceSequencer > theInputConnection
ossimFilename theFilename
std::string::iterator begin()
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
This will return the bounding rect of the source.
unsigned long long ossim_uint64
unsigned int ossim_uint32
32 bit normalized floating point
OSSIM nitf writer base class to hold methods common to all nitf writers.
OSSIM_DLL ossim_uint32 scalarSizeInBytes(ossimScalarType scalarType)
void addRegisteredTag(ossimRefPtr< ossimNitfRegisteredTag > registeredTag)
virtual bool isOpen() const
const ossimNitfImageHeader * getCurrentImageHeader() const
bool theEnableBlockaTagFlag
If true user wants to set BLOCKA tag.
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
ossim_uint32 width() const
ossimByteOrder getSystemEndianType() const
OSSIM_DLL ossim_uint32 getBitsPerPixel(ossimScalarType scalarType)
Get bits per pixel for a given scalar type.
virtual void addChildren(std::vector< ossimRefPtr< ossimProperty > > &propertyList)
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
RTTI_DEF1(ossimNitf20Writer, "ossimNitf20Writer", ossimNitfWriterBase)
const ossimNitfFileHeader * getFileHeader() const
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
ossim_int64 getNumberOfTilesHorizontal() const
virtual void initializeDefaultsFromConfigFile(ossimNitfFileHeaderV2_X *fileHdr, ossimNitfImageHeaderV2_X *imgHdr)
Sets file header and image header defaults from config file if found in preferences.
T * getObjectAs(ossim_uint32 idx=0)
virtual void setProperty(ossimRefPtr< ossimProperty > property)
void writeGeometry(ossimNitfImageHeaderV2_X *hdr, ossimImageSourceSequencer *seq)
Populates tags with geometry info from projection.
virtual void setWriteExternalGeometryFlag(bool flag)
void setImageLength(ossim_uint64 length)
virtual const void * getBuf() const
virtual void setProperty(const ossimString &name, const ossimString &value)
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Initializes the state of the writer from kwl with prefix then calls base class ossimImageFileWriter::...
void setComplexityLevel(std::streamoff, ossimNitfFileHeaderV2_X *hdr)
Sets the complexity level of theFileHeader.
virtual bool writeBlockBandSequential()
Outputs in band sequential format.
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string's contents...
std::ofstream * theOutputStream
virtual void accept(ossimVisitor &visitor)
We will add a visitor interface for all connectable objects.
std::basic_ofstream< char > ofstream
Class for char output file streams.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Initializes the state of the writer from kwl with prefix then calls base class ossimImageFileWriter::...
virtual void setBandRepresentation(const ossimString &rep)
Sets the band representation.
virtual void setPercentComplete(double percentComplete)
virtual void setTileSize(const ossimIpt &tileSize)
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Saves the state of the writer to kwl with prefix then calls base class ossimImageFileWriter::saveStat...
virtual ossimString getPropertyValueAsString(const ossimString &name) const
ossimNitf20Writer(const ossimFilename &filename=ossimFilename(""), ossimImageSource *inputSource=(ossimImageSource *) NULL)
ossimRefPtr< ossimNitfImageHeaderV2_0 > theImageHeader
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossim_int64 getNumberOfTilesVertical() const
virtual bool writeBlockBandSeparate()
write out block band separate
16 bit unsigned integer (12 bits used)