NCBI C++ ToolKit
Public Types | Static Public Member Functions | Static Private Member Functions | List of all members
CImageIO Class Reference

Search Toolkit Book for CImageIO

#include <util/image/image_io.hpp>

Public Types

enum  EType {
  eUnknown , eBmp , eGif , eJpeg ,
  ePng , eSgi , eTiff , eXpm ,
  eRaw
}
 
enum  ECompress {
  eCompress_None , eCompress_Low , eCompress_Medium , eCompress_High ,
  eCompress_Min = eCompress_None , eCompress_Max = eCompress_High , eCompress_Default = eCompress_Medium
}
 

Static Public Member Functions

static EType GetTypeFromMagic (CNcbiIstream &istr)
 
static EType GetTypeFromMagic (const string &file)
 
static EType GetTypeFromFileName (const string &file)
 
static CImageReadImage (const string &file, EType type=CImageIO::eUnknown)
 
static CImageReadImage (CNcbiIstream &istr, EType type=CImageIO::eUnknown)
 
static bool ReadImageInfo (const string &file, size_t *width, size_t *height, size_t *depth, EType *type)
 read just the image information More...
 
static bool ReadImageInfo (CNcbiIstream &istr, size_t *width, size_t *height, size_t *depth, EType *type)
 
static CImageReadSubImage (CNcbiIstream &istr, size_t x, size_t y, size_t w, size_t h, EType type=CImageIO::eUnknown)
 
static CImageReadSubImage (const string &file, size_t x, size_t y, size_t w, size_t h, EType type=CImageIO::eUnknown)
 
static bool WriteImage (const CImage &image, CNcbiOstream &ostr, EType type, ECompress compress=eCompress_Default)
 
static bool WriteImage (const CImage &image, const string &file, EType type=eUnknown, ECompress compress=eCompress_Default)
 
static bool WriteSubImage (const CImage &image, CNcbiOstream &ostr, size_t x, size_t y, size_t w, size_t h, EType type, ECompress compress=eCompress_Default)
 
static bool WriteSubImage (const CImage &image, const string &file, size_t x, size_t y, size_t w, size_t h, EType type=eUnknown, ECompress compress=eCompress_Default)
 

Static Private Member Functions

static CImageIOHandlerx_GetHandler (EType type)
 

Detailed Description

Definition at line 55 of file image_io.hpp.

Member Enumeration Documentation

◆ ECompress

Enumerator
eCompress_None 
eCompress_Low 
eCompress_Medium 
eCompress_High 
eCompress_Min 
eCompress_Max 
eCompress_Default 

Definition at line 73 of file image_io.hpp.

◆ EType

enum CImageIO::EType ( void  )
Enumerator
eUnknown 
eBmp 
eGif 
eJpeg 
ePng 
eSgi 
eTiff 
eXpm 
eRaw 

Definition at line 60 of file image_io.hpp.

Member Function Documentation

◆ GetTypeFromFileName()

CImageIO::EType CImageIO::GetTypeFromFileName ( const string file)
static

◆ GetTypeFromMagic() [1/2]

CImageIO::EType CImageIO::GetTypeFromMagic ( CNcbiIstream istr)
static

Definition at line 91 of file image_io.cpp.

References eUnknown, i, kMagicTable, kMaxMagic, and type.

Referenced by GetTypeFromMagic(), ReadImage(), ReadImageInfo(), and ReadSubImage().

◆ GetTypeFromMagic() [2/2]

CImageIO::EType CImageIO::GetTypeFromMagic ( const string file)
static

Definition at line 81 of file image_io.cpp.

References eUnknown, file, and GetTypeFromMagic().

◆ ReadImage() [1/2]

CImage * CImageIO::ReadImage ( CNcbiIstream istr,
EType  type = CImageIO::eUnknown 
)
static

Definition at line 212 of file image_io.cpp.

References ERR_POST_X, Error(), eUnknown, GetTypeFromMagic(), NULL, and x_GetHandler().

◆ ReadImage() [2/2]

CImage * CImageIO::ReadImage ( const string file,
EType  type = CImageIO::eUnknown 
)
static

Definition at line 205 of file image_io.cpp.

References file, and in().

Referenced by CGlTexture::CGlTexture(), and CConvImageApp::Run().

◆ ReadImageInfo() [1/2]

bool CImageIO::ReadImageInfo ( CNcbiIstream istr,
size_t *  width,
size_t *  height,
size_t *  depth,
EType type 
)
static

Definition at line 173 of file image_io.cpp.

References depth, ERR_POST_X, Error(), GetTypeFromMagic(), and x_GetHandler().

◆ ReadImageInfo() [2/2]

bool CImageIO::ReadImageInfo ( const string file,
size_t *  width,
size_t *  height,
size_t *  depth,
EType type 
)
static

read just the image information

Definition at line 164 of file image_io.cpp.

References depth, file, and in().

Referenced by CImageDemoApp::Run().

◆ ReadSubImage() [1/2]

CImage * CImageIO::ReadSubImage ( CNcbiIstream istr,
size_t  x,
size_t  y,
size_t  w,
size_t  h,
EType  type = CImageIO::eUnknown 
)
static

Definition at line 242 of file image_io.cpp.

References ERR_POST_X, Error(), eUnknown, GetTypeFromMagic(), NULL, and x_GetHandler().

Referenced by ReadSubImage(), and CSubImageApp::Run().

◆ ReadSubImage() [2/2]

CImage * CImageIO::ReadSubImage ( const string file,
size_t  x,
size_t  y,
size_t  w,
size_t  h,
EType  type = CImageIO::eUnknown 
)
static

Definition at line 233 of file image_io.cpp.

References file, in(), and ReadSubImage().

◆ WriteImage() [1/2]

bool CImageIO::WriteImage ( const CImage image,
CNcbiOstream ostr,
EType  type,
ECompress  compress = eCompress_Default 
)
static

◆ WriteImage() [2/2]

bool CImageIO::WriteImage ( const CImage image,
const string file,
EType  type = eUnknown,
ECompress  compress = eCompress_Default 
)
static

Definition at line 265 of file image_io.cpp.

References compress, ERR_POST_X, Error(), eUnknown, file, GetTypeFromFileName(), out(), and WriteImage().

◆ WriteSubImage() [1/2]

bool CImageIO::WriteSubImage ( const CImage image,
CNcbiOstream ostr,
size_t  x,
size_t  y,
size_t  w,
size_t  h,
EType  type,
ECompress  compress = eCompress_Default 
)
static

Definition at line 331 of file image_io.cpp.

References compress, ERR_POST_X, Error(), and x_GetHandler().

Referenced by WriteSubImage().

◆ WriteSubImage() [2/2]

bool CImageIO::WriteSubImage ( const CImage image,
const string file,
size_t  x,
size_t  y,
size_t  w,
size_t  h,
EType  type = eUnknown,
ECompress  compress = eCompress_Default 
)
static

Definition at line 307 of file image_io.cpp.

References compress, ERR_POST_X, Error(), eUnknown, file, GetTypeFromFileName(), out(), and WriteSubImage().

◆ x_GetHandler()

CImageIOHandler * CImageIO::x_GetHandler ( EType  type)
staticprivate

Definition at line 354 of file image_io.cpp.

References eBmp, eGif, eJpeg, ePng, eRaw, eSgi, eTiff, eUnknown, and NCBI_THROW.

Referenced by ReadImage(), ReadImageInfo(), ReadSubImage(), WriteImage(), and WriteSubImage().


The documentation for this class was generated from the following files:
Modified on Sun Jul 21 04:12:52 2024 by modify_doxy.py rev. 669887