14 # include <vcl_msvc_warnings.h> 26 #define SIZEOF(object) ((std::size_t) sizeof(object)) 31 #define vil_jpeg_OUTPUT_BUF_SIZE 4096 // choose an efficiently fwrite'able size 44 dest->buffer = (JOCTET *)
45 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo,
49 dest->base.next_output_byte = dest->buffer;
80 ERREXIT(cinfo, JERR_FILE_WRITE);
82 dest->base.next_output_byte = dest->buffer;
102 if (dest->stream->write(dest->buffer, datacount) != (
vil_streampos)datacount)
103 ERREXIT(cinfo, JERR_FILE_WRITE);
120 assert(! cinfo->dest);
124 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo,
127 cinfo->dest = reinterpret_cast<jpeg_destination_mgr *>(dest);
142 assert(dst !=
nullptr);
143 assert(dst->stream == vs);
146 cinfo->dest->next_output_byte = dst->buffer;
Stream interface for VIL image loaders.
void vil_jpeg_stream_dst_rewind(j_compress_ptr cinfo, vil_stream *vs)
jpeg_boolean vil_jpeg_empty_output_buffer(j_compress_ptr cinfo)
Empty the output buffer — called whenever buffer fills up.
void vil_jpeg_term_destination(j_compress_ptr cinfo)
Terminate destination — called by jpeg_finish_compress after all data has been written....
#define vil_jpeg_OUTPUT_BUF_SIZE
virtual void seek(vil_streampos position)=0
Goto file pointer.
vil_jpeg_stream_destination_mgr * vil_jpeg_dstptr
STATIC void vil_jpeg_init_destination(j_compress_ptr cinfo)
void vil_jpeg_stream_dst_set(j_compress_ptr cinfo, vil_stream *vs)
Prepare for output to a vil_stream.
Stream interface for VIL image loaders.
this is the data source structure which allows JPEG to write to a vil_stream.