OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimOpjJp2Writer.h
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 //
3 // License: See top level LICENSE.txt file
4 //
5 // Author: David Burken
6 //
7 // Description: OSSIM Open JPEG (j2k) writer.
8 //
9 //----------------------------------------------------------------------------
10 // $Id: ossimOpjJp2Writer.h 11652 2007-08-24 17:14:15Z dburken $
11 #ifndef ossimOpjJp2Writer_HEADER
12 #define ossimOpjJp2Writer_HEADER 1
13 
14 #include <ossim/base/ossimRtti.h>
18 #include <ossim/base/ossimRefPtr.h>
21 
22 class ossimOpjCompressor;
23 
25 {
26 public:
27 
28  /* default constructor */
30 
31  /*
32  * constructor with typeName
33  * if typeName=="ossim_opj_geojp2", only write geotiff header
34  * if typeName=="ossim_opj_gmljp2", only write gmljp2 header
35  * else, write both headers
36  */
37  ossimOpjJp2Writer( const ossimString& typeName );
38 
39  /* virtual destructor */
40  virtual ~ossimOpjJp2Writer();
41 
43  virtual ossimString getShortName() const;
44 
46  virtual ossimString getLongName() const;
47 
49  virtual ossimString getClassName() const;
50 
60  virtual void getImageTypeList(std::vector<ossimString>& imageTypeList)const;
61 
62  virtual bool isOpen()const;
63 
64  virtual bool open();
65 
66  virtual void close();
67 
71  virtual bool saveState(ossimKeywordlist& kwl,
72  const char* prefix=0)const;
73 
78  virtual bool loadState(const ossimKeywordlist& kwl,
79  const char* prefix=0);
80 
87  virtual void setProperty(ossimRefPtr<ossimProperty> property);
88 
94  virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
95 
101  virtual void getPropertyNames(std::vector<ossimString>& propertyNames) const;
102 
111  virtual ossimString getExtension() const;
112 
120  virtual bool getOutputHasInternalOverviews( void ) const;
121 
128  bool hasImageType(const ossimString& imageType) const;
129 
135  virtual bool writeStream();
136 
144  virtual bool setOutputStream(std::ostream& stream);
145 
146 private:
147 
148  bool writeGeotiffBox(std::ostream* stream, ossimOpjCompressor* compressor);
149  bool writeGmlBox(std::ostream* stream, ossimOpjCompressor* compressor);
150 
155  void copyData( const std::streamoff& pos,
157  std::vector<ossim_uint8>& data ) const;
158 
163  virtual bool writeFile();
164 
171 
172  TYPE_DATA
173 
174 };
175 
176 #endif /* #ifndef ossimOpjVoid Writer_HEADER */
virtual void close()
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
Represents serializable keyword/value map.
virtual bool isOpen() const
virtual bool writeFile()
Writes the file to disk or a stream.
bool writeGmlBox(std::ostream *stream, ossimOpjCompressor *compressor)
Pure virtual base class for image file writers.
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
Pushes this&#39;s names onto the list of property names.
virtual ossimString getClassName() const
virtual ossimString getExtension() const
Returns a 3-letter extension from the image type descriptor (theOutputImageType) that can be used for...
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
yy_size_t size
virtual bool getOutputHasInternalOverviews(void) const
Examples of writers that always generate internal overviews are ossim_kakadu_jp2 and ossim_kakadu_nit...
virtual ossimString getShortName() const
#define TYPE_DATA
Definition: ossimRtti.h:339
unsigned int ossim_uint32
virtual ~ossimOpjJp2Writer()
bool hasImageType(const ossimString &imageType) const
virtual bool writeStream()
Method to write the image to a stream.
virtual void setProperty(ossimRefPtr< ossimProperty > property)
Will set the property whose name matches the argument "property->getName()".
virtual ossimString getLongName() const
void copyData(const std::streamoff &pos, ossim_uint32 size, std::vector< ossim_uint8 > &data) const
Hack to copy bytes to vector so we can re-write them.
ossimOpjCompressor * m_compressor
bool writeGeotiffBox(std::ostream *stream, ossimOpjCompressor *compressor)
std::ostream * m_outputStream
virtual bool open()
virtual bool setOutputStream(std::ostream &stream)
Sets the output stream to write to.
virtual void getImageTypeList(std::vector< ossimString > &imageTypeList) const
void getImageTypeList(std::vector<ossimString>& imageTypeList)const
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
saves the state of the object.
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23