OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimOpjCommon.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: Place for common code used by both encoders and decoders
8 // using the openjpeg library.
9 //
10 // This code is namespaced with "ossim".
11 //
12 //----------------------------------------------------------------------------
13 // $Id$
14 
15 #ifndef ossimOpjCommon_HEADER
16 #define ossimOpjCommon_HEADER 1
17 
19 #include <iosfwd>
20 #include <string>
21 
22 // Forward declarations:
23 class ossimImageData;
24 class ossimIrect;
25 struct opj_codestream_info;
26 struct opj_cparameters;
27 struct opj_dparameters;
28 struct opj_image;
29 struct opj_image_comp;
30 
31 namespace ossim
32 {
34  void opj_error_callback(const char* msg, void* /* client_data */);
35 
37  void opj_warning_callback(const char* msg, void* /* client_data */ );
38 
40  void opj_info_callback(const char* msg, void* /* client_data */);
41 
42  bool opj_decode( std::ifstream* in,
43  const ossimIrect& rect,
44  ossim_uint32 resLevel,
45  ossim_int32 format, // OPJ_CODEC_FORMAT
46  std::streamoff fileOffset, // for nitf
47  ossimImageData* tile
48  );
49 
50  bool copyOpjImage( opj_image* image, ossimImageData* tile );
51 
52  template <class T> bool copyOpjSrgbImage( T dummy,
53  opj_image* image,
54  ossimImageData* tile );
55 
61 
67  std::ostream& print(std::ostream& out, const opj_codestream_info& info);
68 
74  std::ostream& print(std::ostream& out, const opj_cparameters& param);
75 
81  std::ostream& print(std::ostream& out, const opj_dparameters& param);
82 
88  std::ostream& print(std::ostream& out, const opj_image& image);
89 
95  std::ostream& print(std::ostream& out, const opj_image_comp& comp);
96 
97  std::string getProgressionOrderString( ossim_int32 prog_order );
98 
99 } // End of namespace ossim
100 
101 #endif /* ossimOpjCommon_HEADER */
std::basic_ifstream< char > ifstream
Class for char input file streams.
Definition: ossimIosFwd.h:44
This code was derived from https://gist.github.com/mshockwave.
Definition: Barrier.h:8
void opj_warning_callback(const char *msg, void *)
Callback method for warnings.
std::ostream & print(std::ostream &out, kdu_core::kdu_codestream &cs)
Convenience print method for kdu_codestream.
unsigned int ossim_uint32
void opj_info_callback(const char *msg, void *)
Callback method for info.
bool copyOpjSrgbImage(T dummy, opj_image *image, ossimImageData *tile)
bool opj_decode(std::ifstream *in, const ossimIrect &rect, ossim_uint32 resLevel, ossim_int32 format, std::streamoff fileOffset, ossimImageData *tile)
std::string getProgressionOrderString(ossim_int32 prog_order)
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
void opj_error_callback(const char *msg, void *)
Callback method for errors.
ossim_int32 getCodecFormat(std::istream *str)
Gets codec format from magic number.
bool copyOpjImage(opj_image *image, ossimImageData *tile)
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
int ossim_int32