Defines | Typedefs | Functions
core/vil/file_formats/vil_jpeg_destination_mgr.cxx File Reference
#include "vil_jpeg_destination_mgr.h"
#include <vcl_cassert.h>
#include <vcl_cstddef.h>
#include <vil/vil_stream.h>

Go to the source code of this file.

Defines

#define STATIC
#define SIZEOF(object)   ((vcl_size_t) sizeof(object))
#define vil_jpeg_OUTPUT_BUF_SIZE   4096

Typedefs

typedef
vil_jpeg_stream_destination_mgr
vil_jpeg_dstptr

Functions

STATIC void vil_jpeg_init_destination (j_compress_ptr cinfo)
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. Usually needs to flush buffer.
void vil_jpeg_stream_dst_set (j_compress_ptr cinfo, vil_stream *vs)
 Prepare for output to a vil_stream.
void vil_jpeg_stream_dst_rewind (j_compress_ptr cinfo, vil_stream *vs)

Detailed Description

Author:
fsm
    Modifications
       11 Oct 2002 Ian Scott - converted to vil
  

Definition in file vil_jpeg_destination_mgr.cxx.


Define Documentation

#define SIZEOF (   object)    ((vcl_size_t) sizeof(object))

Definition at line 26 of file vil_jpeg_destination_mgr.cxx.

#define STATIC

Definition at line 18 of file vil_jpeg_destination_mgr.cxx.

#define vil_jpeg_OUTPUT_BUF_SIZE   4096

Definition at line 31 of file vil_jpeg_destination_mgr.cxx.


Typedef Documentation

Definition at line 32 of file vil_jpeg_destination_mgr.cxx.


Function Documentation

jpeg_boolean vil_jpeg_empty_output_buffer ( j_compress_ptr  cinfo)

Empty the output buffer --- called whenever buffer fills up.

In typical applications, this should write the entire output buffer (ignoring the current state of next_output_byte & free_in_buffer), reset the pointer & count to the start of the buffer, and return TRUE indicating that the buffer has been dumped.

In applications that need to be able to suspend compression due to output overrun, a FALSE return indicates that the buffer cannot be emptied now. In this situation, the compressor will return to its caller (possibly with an indication that it has not accepted all the supplied scanlines). The application should resume compression after it has made more room in the output buffer. Note that there are substantial restrictions on the use of suspension --- see the documentation.

When suspending, the compressor will back up to a convenient restart point (typically the start of the current MCU). next_output_byte & free_in_buffer indicate where the restart point will be if the current call returns FALSE. Data beyond this point will be regenerated after resumption, so do not write it out when emptying the buffer externally.

Definition at line 75 of file vil_jpeg_destination_mgr.cxx.

STATIC void vil_jpeg_init_destination ( j_compress_ptr  cinfo)

Definition at line 39 of file vil_jpeg_destination_mgr.cxx.

void vil_jpeg_stream_dst_rewind ( j_compress_ptr  cinfo,
vil_stream vs 
)

Definition at line 138 of file vil_jpeg_destination_mgr.cxx.

void vil_jpeg_stream_dst_set ( j_compress_ptr  cinfo,
vil_stream vs 
)

Prepare for output to a vil_stream.

The caller must have already opened the stream, and is responsible for closing it after finishing compression.

Definition at line 112 of file vil_jpeg_destination_mgr.cxx.

void vil_jpeg_term_destination ( j_compress_ptr  cinfo)

Terminate destination --- called by jpeg_finish_compress after all data has been written. Usually needs to flush buffer.

Note:
not called by jpeg_abort or jpeg_destroy; surrounding application must deal with any cleanup that should happen even for error exit.

Definition at line 95 of file vil_jpeg_destination_mgr.cxx.