47 #define NCBI_USE_ERRCODE_X Util_Image
98 istr.seekg(-istr.gcount(), ios::cur);
105 if (memcmp(magic,
i->m_Signature,
i->m_Length) == 0) {
146 string::size_type pos = fname.find_last_of(
".");
147 if (pos == string::npos) {
151 string ext(fname.substr(pos + 1, fname.length() - pos - 1));
156 if (ext ==
i->m_Ext) {
165 size_t* width,
size_t* height,
size_t*
depth,
174 size_t* width,
size_t* height,
size_t*
depth,
188 size_t pos = istr.tellg();
189 bool res =
handler->ReadImageInfo(istr, width, height,
depth);
190 istr.seekg(pos, ios::beg);
219 return handler->ReadImage(istr);
234 size_t x,
size_t y,
size_t w,
size_t h,
243 size_t x,
size_t y,
size_t w,
size_t h,
251 return handler->ReadImage(istr, x, y, w, h);
309 size_t x,
size_t y,
size_t w,
size_t h,
333 size_t x,
size_t y,
size_t w,
size_t h,
360 "Image format not supported");
class CImageIOHandler This is the base class for all image I/O handlers, and defines the standard int...
static EType GetTypeFromMagic(CNcbiIstream &istr)
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 ReadImageInfo(const string &file, size_t *width, size_t *height, size_t *depth, EType *type)
read just the image information
static CImage * ReadSubImage(CNcbiIstream &istr, size_t x, size_t y, size_t w, size_t h, EType type=CImageIO::eUnknown)
static CImageIOHandler * x_GetHandler(EType type)
static bool WriteImage(const CImage &image, CNcbiOstream &ostr, EType type, ECompress compress=eCompress_Default)
static EType GetTypeFromFileName(const string &file)
static CImage * ReadImage(const string &file, EType type=CImageIO::eUnknown)
void(*)(CSeq_entry_Handle seh, IWorkbench *wb, const CSerialObject &obj) handler
static unsigned char depth[2 *(256+1+29)+1]
std::ofstream out("events_result.xml")
main entry point for tests
#define ERR_POST_X(err_subcode, message)
Error posting with default error code and given error subcode.
void Error(CExceptionArgs_Base &args)
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ofstream CNcbiOfstream
Portable alias for ofstream.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
static string & ToLower(string &str)
Convert string to lower case – string& version.
static const SExtMagicInfo kExtensionMagicTable[]
static const int kMaxMagic
static const struct SMagicInfo kMagicTable[]
Definition of all error codes used in util (xutil.lib).
std::istream & in(std::istream &in_, double &x_)
unsigned char m_Signature[kMaxMagic]