Orfeo ToolBox  4.2
Orfeo ToolBox is not a black box
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
otb::JPEG2000ImageIO Class Reference

ImageIO object for reading and writing JPEG2000 format images. More...

#include <otbJPEG2000ImageIO.h>

+ Inheritance diagram for otb::JPEG2000ImageIO:
+ Collaboration diagram for otb::JPEG2000ImageIO:

Public Types

typedef itk::SmartPointer< SelfPointer
 
typedef JPEG2000ImageIO Self
 
typedef otb::ImageIOBase Superclass
 
- Public Types inherited from otb::ImageIOBase
typedef std::vector< std::string > ArrayOfExtensionsType
 
typedef vcl_size_t BufferSizeType
 
enum  ByteOrder {
  BigEndian,
  LittleEndian,
  OrderNotApplicable
}
 
enum  FileType {
  ASCII,
  Binary,
  TypeNotApplicable
}
 
typedef long IndexValueType
 
enum  IOComponentType {
  UNKNOWNCOMPONENTTYPE,
  UCHAR,
  CHAR,
  USHORT,
  SHORT,
  UINT,
  INT,
  ULONG,
  LONG,
  FLOAT,
  DOUBLE,
  CSHORT,
  CINT,
  CFLOAT,
  CDOUBLE
}
 
enum  IOPixelType {
  UNKNOWNPIXELTYPE,
  SCALAR,
  RGB,
  RGBA,
  OFFSET,
  VECTOR,
  POINT,
  COVARIANTVECTOR,
  SYMMETRICSECONDRANKTENSOR,
  DIFFUSIONTENSOR3D,
  COMPLEX,
  FIXEDARRAY,
  MATRIX
}
 
typedef itk::SmartPointer< SelfPointer
 
typedef ImageIOBase Self
 
typedef std::streamoff SizeType
 
typedef unsigned long SizeValueType
 
typedef itk::LightProcessObject Superclass
 

Public Member Functions

virtual bool CanReadFile (const char *)
 
virtual bool CanStreamRead ()
 
virtual bool CanStreamWrite ()
 
virtual bool CanWriteFile (const char *)
 
virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
bool GetAvailableResolutions (std::vector< unsigned int > &res)
 
virtual unsigned int GetCacheSizeInByte ()
 
itk::MultiThreader * GetMultiThreader ()
 
virtual const char * GetNameOfClass () const
 
unsigned int GetNumberOfOverviews ()
 
virtual unsigned int GetResolutionFactor ()
 
bool GetResolutionInfo (std::vector< unsigned int > &res, std::vector< std::string > &desc)
 
virtual void Read (void *buffer)
 
virtual void ReadImageInformation ()
 
virtual void ReadVolume (void *buffer)
 
virtual void SetCacheSizeInByte (unsigned int _arg)
 
virtual void SetResolutionFactor (unsigned int _arg)
 
virtual void Write (const void *buffer)
 
virtual void WriteImageInformation ()
 
- Public Member Functions inherited from otb::ImageIOBase
virtual itk::ImageIORegion GenerateStreamableReadRegionFromRequestedRegion (const itk::ImageIORegion &requested) const
 
virtual unsigned int GetActualNumberOfSplitsForWriting (unsigned int numberOfRequestedSplits, const itk::ImageIORegion &pasteRegion, const itk::ImageIORegion &largestPossibleRegion)
 
virtual ByteOrder GetByteOrder () const
 
std::string GetByteOrderAsString (ByteOrder) const
 
virtual unsigned int GetComponentSize () const
 
virtual IOComponentType GetComponentType () const
 
std::string GetComponentTypeAsString (IOComponentType) const
 
virtual const std::type_info & GetComponentTypeInfo () const
 
virtual std::vector< double > GetDefaultDirection (unsigned int i) const
 
virtual unsigned int GetDimensions (unsigned int i) const
 
virtual std::vector< double > GetDirection (unsigned int i) const
 
virtual const char * GetFileName () const
 
virtual FileType GetFileType () const
 
std::string GetFileTypeAsString (FileType) const
 
SizeType GetImageSizeInBytes () const
 
SizeType GetImageSizeInComponents () const
 
SizeType GetImageSizeInPixels () const
 
virtual const itk::ImageIORegionGetIORegion ()
 
virtual const unsigned int & GetNumberOfComponents ()
 
virtual unsigned int GetNumberOfDimensions () const
 
virtual double GetOrigin (unsigned int i) const
 
virtual SizeType GetPixelStride () const
 
virtual IOPixelType GetPixelType () const
 
std::string GetPixelTypeAsString (IOPixelType) const
 
virtual double GetSpacing (unsigned int i) const
 
virtual itk::ImageIORegion GetSplitRegionForWriting (unsigned int ithPiece, unsigned int numberOfActualSplits, const itk::ImageIORegion &pasteRegion, const itk::ImageIORegion &largestPossibleRegion)
 
const ArrayOfExtensionsTypeGetSupportedReadExtensions () const
 
const ArrayOfExtensionsTypeGetSupportedWriteExtensions () const
 
virtual bool GetUseCompression () const
 
virtual bool GetUseStreamedReading () const
 
virtual bool GetUseStreamedWriting () const
 
virtual void SetByteOrder (const ByteOrder _arg)
 
void SetByteOrderToBigEndian ()
 
void SetByteOrderToLittleEndian ()
 
virtual void SetComponentType (const IOComponentType _arg)
 
virtual void SetDimensions (unsigned int i, unsigned int dim)
 
virtual void SetDirection (unsigned int i, std::vector< double > &direction)
 
virtual void SetDirection (unsigned int i, vnl_vector< double > &direction)
 
virtual void SetFileName (const char *_arg)
 
virtual void SetFileType (const FileType _arg)
 
void SetFileTypeToASCII ()
 
void SetFileTypeToBinary ()
 
virtual void SetIORegion (itk::ImageIORegion _arg)
 
virtual void SetNumberOfComponents (unsigned int _arg)
 
void SetNumberOfDimensions (unsigned int)
 
virtual void SetOrigin (unsigned int i, double origin)
 
virtual void SetPixelType (const IOPixelType _arg)
 
virtual bool SetPixelTypeInfo (const std::type_info &ptype)
 
virtual void SetSpacing (unsigned int i, double spacing)
 
virtual void SetUseCompression (bool _arg)
 
virtual void SetUseStreamedReading (bool _arg)
 
virtual void SetUseStreamedWriting (bool _arg)
 
virtual bool SupportsDimension (unsigned long dim)
 
virtual void UseCompressionOff ()
 
virtual void UseCompressionOn ()
 
virtual void UseStreamedReadingOff ()
 
virtual void UseStreamedReadingOn ()
 
virtual void UseStreamedWritingOff ()
 
virtual void UseStreamedWritingOn ()
 

Static Public Member Functions

static Pointer New ()
 

Protected Types

typedef std::vector
< boost::shared_ptr
< JPEG2000InternalReader > > 
ReaderVectorType
 

Protected Member Functions

 JPEG2000ImageIO ()
 
virtual ~JPEG2000ImageIO ()
 
void PrintSelf (std::ostream &os, itk::Indent indent) const
 
- Protected Member Functions inherited from otb::ImageIOBase
 ImageIOBase ()
 
virtual ~ImageIOBase ()
 
void AddSupportedReadExtension (const char *extension)
 
void AddSupportedWriteExtension (const char *extension)
 
void ComputeStrides ()
 
virtual unsigned int GetActualNumberOfSplitsForWritingCanStreamWrite (unsigned int numberOfRequestedSplits, const itk::ImageIORegion &pasteRegion) const
 
SizeType GetComponentStride () const
 
virtual unsigned int GetPixelSize () const
 
SizeType GetRowStride () const
 
SizeType GetSliceStride () const
 
virtual itk::ImageIORegion GetSplitRegionForWritingCanStreamWrite (unsigned int ithPiece, unsigned int numberOfActualSplits, const itk::ImageIORegion &pasteRegion) const
 
void ReadBufferAsASCII (std::istream &os, void *buffer, IOComponentType ctype, SizeType numberOfBytesToBeRead)
 
bool ReadBufferAsBinary (std::istream &os, void *buffer, SizeType numberOfBytesToBeRead)
 
virtual void Reset (const bool freeDynamic=true)
 
void Resize (const unsigned int numDimensions, const unsigned int *dimensions)
 
void WriteBufferAsASCII (std::ostream &os, const void *buffer, IOComponentType ctype, SizeType numberOfBytesToWrite)
 

Protected Attributes

ReaderVectorType m_InternalReaders
 
boost::shared_ptr
< JPEG2000TileCache
m_TileCache
 
- Protected Attributes inherited from otb::ImageIOBase
ByteOrder m_ByteOrder
 
IOComponentType m_ComponentType
 
std::vector< SizeValueTypem_Dimensions
 
std::vector< std::vector
< double > > 
m_Direction
 
std::string m_FileName
 
FileType m_FileType
 
bool m_Initialized
 
itk::ImageIORegion m_IORegion
 
unsigned int m_NumberOfComponents
 
unsigned int m_NumberOfDimensions
 
std::vector< double > m_Origin
 
IOPixelType m_PixelType
 
std::vector< double > m_Spacing
 
std::vector< SizeTypem_Strides
 
bool m_UseCompression
 
bool m_UseStreamedReading
 
bool m_UseStreamedWriting
 

Private Member Functions

 JPEG2000ImageIO (const Self &)
 
std::vector< unsigned int > ComputeTileList ()
 
void ConfigureCache ()
 
void LoadTileData (void *buffer, void *tile)
 
void operator= (const Self &)
 

Static Private Member Functions

static ITK_THREAD_RETURN_TYPE ThreaderCallback (void *arg)
 

Private Attributes

unsigned int m_BytePerPixel
 
unsigned int m_CacheSizeInByte
 
unsigned int m_NumberOfOverviews
 
int m_NumberOfThreads
 
unsigned int m_ResolutionFactor
 
itk::MultiThreader::Pointer m_Threader
 

Detailed Description

ImageIO object for reading and writing JPEG2000 format images.

The streaming (read and write) is implemented.

Definition at line 41 of file otbJPEG2000ImageIO.h.

Member Typedef Documentation

Definition at line 48 of file otbJPEG2000ImageIO.h.

typedef std::vector<boost::shared_ptr<JPEG2000InternalReader> > otb::JPEG2000ImageIO::ReaderVectorType
protected

Definition at line 128 of file otbJPEG2000ImageIO.h.

Standard class typedefs.

Definition at line 46 of file otbJPEG2000ImageIO.h.

Definition at line 47 of file otbJPEG2000ImageIO.h.

Constructor & Destructor Documentation

otb::JPEG2000ImageIO::JPEG2000ImageIO ( )
protected
otb::JPEG2000ImageIO::~JPEG2000ImageIO ( )
protectedvirtual

Destructor.

Definition at line 774 of file otbJPEG2000ImageIO.cxx.

otb::JPEG2000ImageIO::JPEG2000ImageIO ( const Self )
private

Member Function Documentation

bool otb::JPEG2000ImageIO::CanReadFile ( const char *  filename)
virtual

Determine the file type. Returns true if this ImageIO can read the file specified.

Implements otb::ImageIOBase.

Definition at line 777 of file otbJPEG2000ImageIO.cxx.

References m_InternalReaders, m_ResolutionFactor, and NULL.

Referenced by Read(), and ReadImageInformation().

virtual bool otb::JPEG2000ImageIO::CanStreamRead ( )
inlinevirtual

Determine the file type. Returns true if the ImageIO can stream read the specified file

Reimplemented from otb::ImageIOBase.

Definition at line 63 of file otbJPEG2000ImageIO.h.

virtual bool otb::JPEG2000ImageIO::CanStreamWrite ( void  )
inlinevirtual

Determine the file type. Returns true if the ImageIO can stream write the specified file

Reimplemented from otb::ImageIOBase.

Definition at line 96 of file otbJPEG2000ImageIO.h.

bool otb::JPEG2000ImageIO::CanWriteFile ( const char *  )
virtual

Determine the file type. Returns true if this ImageIO can read the file specified.

Implements otb::ImageIOBase.

Definition at line 1726 of file otbJPEG2000ImageIO.cxx.

Referenced by WriteImageInformation().

std::vector< unsigned int > otb::JPEG2000ImageIO::ComputeTileList ( )
private
void otb::JPEG2000ImageIO::ConfigureCache ( )
private
virtual::itk::LightObject::Pointer otb::JPEG2000ImageIO::CreateAnother ( void  ) const
bool otb::JPEG2000ImageIO::GetAvailableResolutions ( std::vector< unsigned int > &  res)

Get all resolution in jpeg2000 file from res = 0 which is the full resolution to nbReslution-1 which is most degraded

Definition at line 865 of file otbJPEG2000ImageIO.cxx.

References m_InternalReaders.

virtual unsigned int otb::JPEG2000ImageIO::GetCacheSizeInByte ( )
virtual
itk::MultiThreader* otb::JPEG2000ImageIO::GetMultiThreader ( )
inline

Return the multithreader used by this class.

Definition at line 111 of file otbJPEG2000ImageIO.h.

Referenced by Read().

virtual const char* otb::JPEG2000ImageIO::GetNameOfClass ( ) const
virtual

Run-time type information (and related methods).

Reimplemented from otb::ImageIOBase.

unsigned int otb::JPEG2000ImageIO::GetNumberOfOverviews ( )

Get number of available overviews in the jpeg2000 file ( if return = 0 => no overviews available because only one resolution is encoded in the file)

Definition at line 875 of file otbJPEG2000ImageIO.cxx.

References m_InternalReaders.

virtual unsigned int otb::JPEG2000ImageIO::GetResolutionFactor ( )
virtual
bool otb::JPEG2000ImageIO::GetResolutionInfo ( std::vector< unsigned int > &  res,
std::vector< std::string > &  desc 
)

Get Info about all resolution in jpeg2000 file

Definition at line 835 of file otbJPEG2000ImageIO.cxx.

References int_ceildivpow2(), and m_InternalReaders.

void otb::JPEG2000ImageIO::LoadTileData ( void *  buffer,
void *  tile 
)
private
static Pointer otb::JPEG2000ImageIO::New ( )
static

Method for creation through the object factory.

void otb::JPEG2000ImageIO::operator= ( const Self )
private
void otb::JPEG2000ImageIO::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
protectedvirtual

Reimplemented from otb::ImageIOBase.

Definition at line 812 of file otbJPEG2000ImageIO.cxx.

References m_ResolutionFactor, and otb::ImageIOBase::PrintSelf().

void otb::JPEG2000ImageIO::Read ( void *  buffer)
virtual
void otb::JPEG2000ImageIO::ReadImageInformation ( )
virtual
void otb::JPEG2000ImageIO::ReadVolume ( void *  buffer)
virtual

Reads 3D data from multiple files assuming one slice per file.

Definition at line 819 of file otbJPEG2000ImageIO.cxx.

virtual void otb::JPEG2000ImageIO::SetCacheSizeInByte ( unsigned int  _arg)
virtual
virtual void otb::JPEG2000ImageIO::SetResolutionFactor ( unsigned int  _arg)
virtual
ITK_THREAD_RETURN_TYPE otb::JPEG2000ImageIO::ThreaderCallback ( void *  arg)
staticprivate

Static function used as a "callback" by the MultiThreader. The threading library will call this routine for each thread, which will delegate the control to ThreadedGenerateData().

Definition at line 1125 of file otbJPEG2000ImageIO.cxx.

References otb::ThreadStruct::Buffer, otb::ThreadStruct::Cache, otb::ThreadStruct::IO, ITK_THREAD_RETURN_TYPE, ITK_THREAD_RETURN_VALUE, otbMsgDevMacro, otb::ThreadStruct::Readers, and otb::ThreadStruct::Tiles.

Referenced by Read().

void otb::JPEG2000ImageIO::Write ( const void *  buffer)
virtual

Writes the data to disk from the memory buffer provided. Make sure that the IORegion has been set properly.

Implements otb::ImageIOBase.

Definition at line 1732 of file otbJPEG2000ImageIO.cxx.

void otb::JPEG2000ImageIO::WriteImageInformation ( void  )
virtual

Member Data Documentation

unsigned int otb::JPEG2000ImageIO::m_BytePerPixel
private

pixel nb of octets

Definition at line 141 of file otbJPEG2000ImageIO.h.

Referenced by ConfigureCache(), JPEG2000ImageIO(), and ReadImageInformation().

unsigned int otb::JPEG2000ImageIO::m_CacheSizeInByte
private

Size of the cache used to reduce number of decoding operations

Definition at line 150 of file otbJPEG2000ImageIO.h.

Referenced by ConfigureCache(), and JPEG2000ImageIO().

ReaderVectorType otb::JPEG2000ImageIO::m_InternalReaders
protected
unsigned int otb::JPEG2000ImageIO::m_NumberOfOverviews
private

Definition at line 147 of file otbJPEG2000ImageIO.h.

int otb::JPEG2000ImageIO::m_NumberOfThreads
private

Definition at line 159 of file otbJPEG2000ImageIO.h.

Referenced by JPEG2000ImageIO().

unsigned int otb::JPEG2000ImageIO::m_ResolutionFactor
private
itk::MultiThreader::Pointer otb::JPEG2000ImageIO::m_Threader
private

Support processing data in multiple threads. Used by subclasses (e.g., ImageSource).

Definition at line 158 of file otbJPEG2000ImageIO.h.

Referenced by JPEG2000ImageIO().

boost::shared_ptr<JPEG2000TileCache> otb::JPEG2000ImageIO::m_TileCache
protected

Definition at line 131 of file otbJPEG2000ImageIO.h.

Referenced by ConfigureCache(), JPEG2000ImageIO(), and Read().


The documentation for this class was generated from the following files: