OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Functions
ossimJpegMemDest.h File Reference
#include <ossim/base/ossimConstants.h>
#include <iosfwd>

Go to the source code of this file.

Functions

OSSIM_DLL void jpeg_cpp_stream_dest (jpeg_compress_struct *cinfo, std::ostream &stream)
 Method which uses memory instead of a FILE* to write to. More...
 

Function Documentation

◆ jpeg_cpp_stream_dest()

OSSIM_DLL void jpeg_cpp_stream_dest ( jpeg_compress_struct *  cinfo,
std::ostream &  stream 
)

Method which uses memory instead of a FILE* to write to.

Note
Used in place of "jpeg_stdio_dest(&cinfo, outfile)".

Definition at line 69 of file ossimJpegMemDest.cpp.

References empty_output_buffer(), init_destination(), cpp_dest_mgr::pub, cpp_dest_mgr::stream, and term_destination().

Referenced by ossimJpegCodec::encode(), and ossimPdfWriter::writeJpegTile().

70 {
71  cpp_dest_mgr* dest;
72 
73  /* first time for this JPEG object? */
74  if (cinfo->dest == NULL)
75  cinfo->dest = (struct jpeg_destination_mgr *) malloc (sizeof(cpp_dest_mgr));
76 
77  dest = (cpp_dest_mgr*) cinfo->dest;
78  dest->pub.init_destination = init_destination;
79  dest->pub.empty_output_buffer = empty_output_buffer;
80  dest->pub.term_destination = term_destination;
81  dest->stream = &stream;
82 }
void init_destination(j_compress_ptr cinfo)
struct jpeg_destination_mgr pub
boolean empty_output_buffer(j_compress_ptr cinfo)
void term_destination(j_compress_ptr cinfo)
for jmp_buf
std::ostream * stream