Go to the SVN repository for this file.
48istr.read(
reinterpret_cast<char*
>(&header), 4);
55istr.read(
reinterpret_cast<char*
>(&width),
sizeof(
size_t));
56istr.read(
reinterpret_cast<char*
>(&height),
sizeof(
size_t));
57istr.read(
reinterpret_cast<char*
>(&
depth),
sizeof(
size_t));
62 "CImageIORaw::ReadImage(): failed to allocate image");
65istr.read(
reinterpret_cast<char*
>(image->
SetData()),
66width * height *
depth);
72 size_tx,
size_ty,
size_tw,
size_th)
76istr.read(
reinterpret_cast<char*
>(&header), 4);
83istr.read(
reinterpret_cast<char*
>(&width),
sizeof(
size_t));
84istr.read(
reinterpret_cast<char*
>(&height),
sizeof(
size_t));
85istr.read(
reinterpret_cast<char*
>(&
depth),
sizeof(
size_t));
91 "CImageIORaw::ReadImage(): failed to allocate image");
95 const size_tinput_bpl = width *
depth;
96 const size_toutput_bpl = w *
depth;
100istr.seekg(input_bpl * y + x *
depth, ios::beg);
101 for(
size_t i= 0;
i< h; ++
i,
data+= output_bpl) {
102istr.read(
reinterpret_cast<char*
>(
data), output_bpl);
103istr.seekg(input_bpl - output_bpl, ios::cur);
110 size_t*,
size_t*,
size_t*)
113 "CImageIORaw::ReadImageInfo(): RAW format inspection " 122ostr.write(
reinterpret_cast<const char*
>(
sc_Header), 4);
129ostr.write(
reinterpret_cast<const char*
>(&width),
sizeof(
size_t));
130ostr.write(
reinterpret_cast<const char*
>(&height),
sizeof(
size_t));
131ostr.write(
reinterpret_cast<const char*
>(&
depth),
sizeof(
size_t));
134ostr.write(
reinterpret_cast<const char*
>(image.
GetData()),
135width * height *
depth);
141 size_twidth,
size_theight,
145ostr.write(
reinterpret_cast<const char*
>(
sc_Header), 4);
150ostr.write(
reinterpret_cast<const char*
>(&width),
sizeof(
size_t));
151ostr.write(
reinterpret_cast<const char*
>(&height),
sizeof(
size_t));
152ostr.write(
reinterpret_cast<const char*
>(&
depth),
sizeof(
size_t));
156 const size_toutput_bpl = width *
depth;
160 data+= input_bpl * y;
161 for(
size_t i= 0;
i< height; ++
i,
data+= input_bpl) {
162ostr.write(
reinterpret_cast<const char*
>(
data), output_bpl);
bool ReadImageInfo(CNcbiIstream &istr, size_t *width, size_t *height, size_t *depth)
Read a portion of an image from a stream, returning a pointer to the image.
CImage * ReadImage(CNcbiIstream &istr)
Read an entire image from a stream, returning a pointer to the image.
void WriteImage(const CImage &image, CNcbiOstream &ostr, CImageIO::ECompress compress)
write images to file in HANDLER format
size_t GetDepth(void) const
const unsigned char * GetData(void) const
size_t GetWidth(void) const
size_t GetHeight(void) const
unsigned char * SetData(void)
static unsigned char depth[2 *(256+1+29)+1]
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
TObjectType * Release(void)
Release a reference to the object and return a pointer to the object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
static const char * sc_Header
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4