42 static const ossimIpt DEFAULT_TILE_SIZE(1024, 1024);
57 static const char OSSIM_ID[] =
"$Id: ossimKakaduNitfWriter.cpp 22111 2013-01-12 18:44:25Z dburken $";
64 m_ownsStreamFlag(false)
69 <<
"ossimKakaduNitfWriter::ossimKakaduNitfWriter entered" 109 return ossimString(
"ossim kakadu nitf j2k writer");
159 static const char MODULE[] =
"ossimKakaduNitfWriter::writeStream";
164 << MODULE <<
" entered..." << endl;
204 std::streampos endOfFileHdrPos;
205 std::streampos endOfImgHdrPos;
206 std::streampos endOfFilePos;
267 out << std::setfill(
'0')
291 j2klraTag->setBandsO( BANDS );
303 << MODULE <<
" DEBUG:" 304 <<
"\noutputTilesWide: " << outputTilesWide
305 <<
"\noutputTilesHigh: " << outputTilesHigh
306 <<
"\nnumberOfTiles: " << TILES
326 << MODULE <<
" ERROR:" 327 <<
"Error returned writing tile: " 336 << MODULE <<
" ERROR:" 337 <<
"Error returned writing tile: " <<
tileNumber 379 std::streamoff length = endOfFilePos;
383 length = endOfFileHdrPos;
386 length = endOfImgHdrPos - endOfFileHdrPos;
391 length = endOfFilePos - endOfImgHdrPos;
392 imageInfoRecord.
setImageLength(static_cast<ossim_uint64>(length));
417 << MODULE <<
" exit status = " << (result?
"true":
"false\n")
425 const char* prefix)
const 472 <<
"ossimKakaduNitfWriter::open()\n" 473 <<
"File " <<
theFilename << (result ?
" opened" :
" not opened")
514 (imageType ==
"image/ntf") )
523 if ( property.
valid() )
547 std::vector<ossimString>& propertyNames)
const virtual void setProperty(ossimRefPtr< ossimProperty > property)
Set the properties.
std::ostream * m_outputStream
virtual void slaveProcessTiles()
virtual void setOutputImageType(ossim_int32 type)
virtual void create(ossim::ostream *os, ossimScalarType scalar, ossim_uint32 bands, const ossimIrect &imageRect, const ossimIpt &tileSize, ossim_uint32 tilesToWrite, bool jp2)
Create method.
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
ossimKakaduCompressor * m_compressor
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
bool needsAborting() const
virtual bool isMaster() const
Represents serializable keyword/value map.
ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
void initialize(ossimNitfJ2klraTag *j2klraTag, ossim_uint32 actualBitsPerPixel) const
Initializes the tag.
virtual void setToStartOfSequence()
static const ossimErrorCode OSSIM_OK
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
virtual void finish()
Finish method.
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
Pushes this's names onto the list of property names.
ossim_int64 getNumberOfTiles() const
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
void setSubheaderLength(ossim_uint32 length)
virtual ossimString getLongName() const
ossim_uint32 height() const
virtual ossimRefPtr< ossimImageData > getNextTile(ossim_uint32 resLevel=0)
static ossimString getNitfPixelType(ossimScalarType scalarType)
Get the nitf pixel type string from scalar type.
virtual bool writeStream()
Method to write the image to a stream.
virtual ossimDataObjectStatus getDataObjectStatus() const
OSSIM_DLL ossim_uint32 getActualBitsPerPixel(ossimScalarType scalarType)
Get actual bits per pixel for a given scalar type.
void getPropertyNames(std::vector< ossimString > &propertyNames) const
Pushes this's names onto the list of property names.
static ossimString getCompressionRate(const ossimIrect &rect, ossim_uint32 bands, ossimScalarType scalar, ossim_uint64 lengthInBytes)
Get compression rate (COMRAT) which is bits perpixel per band.
bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
saves the state of the object.
virtual ossimScalarType getOutputScalarType() const
This will be used to query the output pixel type of the tile source.
virtual const char * what() const
Returns the error message.
std::string::size_type size() const
ossimRefPtr< ossimImageSourceSequencer > theInputConnection
ossimFilename theFilename
unsigned long long ossim_uint64
void setImageLength(ossim_uint64 length)
unsigned int ossim_uint32
virtual bool getOutputHasInternalOverviews(void) const
Examples of writers that always generate internal overviews are ossim_kakadu_jp2 and ossim_kakadu_nit...
virtual ossimString getClassName() const
OSSIM nitf writer base class to hold methods common to all nitf writers.
virtual ossimString getExtension() const
Returns a 3-letter extension from the image type descriptor (theOutputImageType) that can be used for...
bool getAlphaChannelFlag() const
Retrieve the writer's setting for whether or not to add an alpha channel to the output png image...
virtual bool writeFile()
Writes the file to disk or a stream.
virtual void getImageTypeList(std::vector< ossimString > &imageTypeList) const
Appends this writer image types to list "imageTypeList".
virtual void setAlphaChannelFlag(bool flag)
Set the writer to add an alpha channel to the output.
ossim_uint32 width() const
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
saves the state of the object.
OSSIM_DLL ossim_uint32 getBitsPerPixel(ossimScalarType scalarType)
Get bits per pixel for a given scalar type.
virtual bool setProperty(ossimRefPtr< ossimProperty > property)
Will set the property whose name matches the argument "property->getName()".
virtual ~ossimKakaduNitfWriter()
virtual bool writeTile(ossimImageData &srcTile)
Write tile method.
virtual bool isOpen() const
ossim_int64 getNumberOfTilesHorizontal() const
virtual void setProperty(ossimRefPtr< ossimProperty > property)
Will set the property whose name matches the argument "property->getName()".
virtual ossimErrorCode getErrorStatus() const
void writeGeometry(ossimNitfImageHeaderV2_X *hdr, ossimImageSourceSequencer *seq)
Populates tags with geometry info from projection.
virtual void setWriteExternalGeometryFlag(bool flag)
bool hasImageType(const ossimString &imageType) const
bool hasImageType(const ossimString& imageType) const
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
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.
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string's contents...
const ossimIrect & getAreaOfInterest() const
std::basic_ofstream< char > ofstream
Class for char output file streams.
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
Gets a property.
#define RTTI_DEF1(cls, name, b1)
virtual void setBandRepresentation(const ossimString &rep)
Sets the band representation.
virtual void setPercentComplete(double percentComplete)
bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
virtual bool setOutputStream(std::ostream &stream)
Sets the output stream to write to.
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...
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossim_int64 getNumberOfTilesVertical() const
ossimKakaduNitfWriter()
default constructor
std::basic_ostream< char > ostream
Base class for char output streams.
virtual ossimString getShortName() const