COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
jcapistd.cpp File Reference
#include "jinclude.h"
#include "jpeglib.h"
Include dependency graph for jcapistd.cpp:

Macros

#define JPEG_INTERNALS
 

Functions

void jpeg_start_compress (j_compress_ptr cinfo, boolean write_all_tables)
 
JDIMENSION jpeg_write_scanlines (j_compress_ptr cinfo, JSAMPARRAY scanlines, JDIMENSION num_lines)
 
JDIMENSION jpeg_write_raw_data (j_compress_ptr cinfo, JSAMPIMAGE data, JDIMENSION num_lines)
 

Macro Definition Documentation

#define JPEG_INTERNALS

Function Documentation

void jpeg_start_compress ( j_compress_ptr  cinfo,
boolean  write_all_tables 
)
39 {
40  if (cinfo->global_state != CSTATE_START)
41  ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
42 
43  if (write_all_tables)
44  jpeg_suppress_tables(cinfo, FALSE); /* mark all tables to be written */
45 
46  /* (Re)initialize error mgr and destination modules */
47  (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);
48  (*cinfo->dest->init_destination) (cinfo);
49  /* Perform master selection of active modules */
50  jinit_compress_master(cinfo);
51  /* Set up for the first pass */
52  (*cinfo->master->prepare_for_pass) (cinfo);
53  /* Ready for application to drive first pass through jpeg_write_scanlines
54  * or jpeg_write_raw_data.
55  */
56  cinfo->next_scanline = 0;
58 }
#define CSTATE_START
Definition: jpegint.h:25
Definition: jpeglib.h:258
Definition: jerror.h:65
#define CSTATE_RAW_OK
Definition: jpegint.h:27
#define CSTATE_SCANNING
Definition: jpegint.h:26
JDIMENSION next_scanline
Definition: jpeglib.h:359
#define FALSE
Definition: jpleph.cpp:69
struct jpeg_error_mgr * err
Definition: jpeglib.h:274
void(* init_destination)()
Definition: jpeglib.h:722
void jinit_compress_master(j_compress_ptr cinfo)
Definition: jcinit.cpp:30
struct jpeg_destination_mgr * dest
Definition: jpeglib.h:277
void(* reset_error_mgr)()
Definition: jpeglib.h:659
#define ERREXIT1(cinfo, code, p1)
Definition: jerror.h:208
void jpeg_suppress_tables(j_compress_ptr cinfo, boolean suppress)
Definition: jcapimin.cpp:119
int global_state
Definition: jpeglib.h:274
boolean raw_data_in
Definition: jpeglib.h:325
struct jpeg_comp_master * master
Definition: jpeglib.h:400
JDIMENSION jpeg_write_scanlines ( j_compress_ptr  cinfo,
JSAMPARRAY  scanlines,
JDIMENSION  num_lines 
)
79 {
80  JDIMENSION row_ctr, rows_left;
81 
82  if (cinfo->global_state != CSTATE_SCANNING)
83  ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
84  if (cinfo->next_scanline >= cinfo->image_height)
85  WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
86 
87  /* Call progress monitor hook if present */
88  if (cinfo->progress != NULL) {
89  cinfo->progress->pass_counter = (long) cinfo->next_scanline;
90  cinfo->progress->pass_limit = (long) cinfo->image_height;
91  (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
92  }
93 
94  /* Give master control module another chance if this is first call to
95  * jpeg_write_scanlines. This lets output of the frame/scan headers be
96  * delayed so that application can write COM, etc, markers between
97  * jpeg_start_compress and jpeg_write_scanlines.
98  */
99  if (cinfo->master->call_pass_startup)
100  (*cinfo->master->pass_startup) (cinfo);
101 
102  /* Ignore any extra scanlines at bottom of image. */
103  rows_left = cinfo->image_height - cinfo->next_scanline;
104  if (num_lines > rows_left)
105  num_lines = rows_left;
106 
107  row_ctr = 0;
108  (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, num_lines);
109  cinfo->next_scanline += row_ctr;
110  return row_ctr;
111 }
void(* progress_monitor)()
Definition: jpeglib.h:707
long pass_limit
Definition: jpeglib.h:710
JDIMENSION image_height
Definition: jpeglib.h:285
Definition: jpeglib.h:258
Definition: jerror.h:65
struct jpeg_progress_mgr * progress
Definition: jpeglib.h:274
#define CSTATE_SCANNING
Definition: jpegint.h:26
boolean call_pass_startup
Definition: jpegint.h:51
long pass_counter
Definition: jpeglib.h:709
JDIMENSION next_scanline
Definition: jpeglib.h:359
Definition: jerror.h:184
struct jpeg_c_main_controller * main
Definition: jpeglib.h:401
#define WARNMS(cinfo, code)
Definition: jerror.h:238
#define ERREXIT1(cinfo, code, p1)
Definition: jerror.h:208
int global_state
Definition: jpeglib.h:274
unsigned int JDIMENSION
Definition: jmorecfg.h:171
struct jpeg_comp_master * master
Definition: jpeglib.h:400
JDIMENSION jpeg_write_raw_data ( j_compress_ptr  cinfo,
JSAMPIMAGE  data,
JDIMENSION  num_lines 
)
122 {
123  JDIMENSION lines_per_iMCU_row;
124 
125  if (cinfo->global_state != CSTATE_RAW_OK)
126  ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
127  if (cinfo->next_scanline >= cinfo->image_height) {
128  WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
129  return 0;
130  }
131 
132  /* Call progress monitor hook if present */
133  if (cinfo->progress != NULL) {
134  cinfo->progress->pass_counter = (long) cinfo->next_scanline;
135  cinfo->progress->pass_limit = (long) cinfo->image_height;
136  (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
137  }
138 
139  /* Give master control module another chance if this is first call to
140  * jpeg_write_raw_data. This lets output of the frame/scan headers be
141  * delayed so that application can write COM, etc, markers between
142  * jpeg_start_compress and jpeg_write_raw_data.
143  */
144  if (cinfo->master->call_pass_startup)
145  (*cinfo->master->pass_startup) (cinfo);
146 
147  /* Verify that at least one iMCU row has been passed. */
148  lines_per_iMCU_row = cinfo->max_v_samp_factor * DCTSIZE;
149  if (num_lines < lines_per_iMCU_row)
150  ERREXIT(cinfo, JERR_BUFFER_SIZE);
151 
152  /* Directly compress the row. */
153  if (! (*cinfo->coef->compress_data) (cinfo, data)) {
154  /* If compressor did not consume the whole row, suspend processing. */
155  return 0;
156  }
157 
158  /* OK, we processed one iMCU row. */
159  cinfo->next_scanline += lines_per_iMCU_row;
160  return lines_per_iMCU_row;
161 }
void(* progress_monitor)()
Definition: jpeglib.h:707
long pass_limit
Definition: jpeglib.h:710
JDIMENSION image_height
Definition: jpeglib.h:285
#define ERREXIT(cinfo, code)
Definition: jerror.h:205
Definition: jpeglib.h:258
Definition: jerror.h:65
#define CSTATE_RAW_OK
Definition: jpegint.h:27
struct jpeg_progress_mgr * progress
Definition: jpeglib.h:274
boolean call_pass_startup
Definition: jpegint.h:51
long pass_counter
Definition: jpeglib.h:709
JDIMENSION next_scanline
Definition: jpeglib.h:359
Definition: jerror.h:184
Definition: jerror.h:69
struct jpeg_c_coef_controller * coef
Definition: jpeglib.h:403
int max_v_samp_factor
Definition: jpeglib.h:370
#define WARNMS(cinfo, code)
Definition: jerror.h:238
#define ERREXIT1(cinfo, code, p1)
Definition: jerror.h:208
int global_state
Definition: jpeglib.h:274
#define DCTSIZE
Definition: jpeglib.h:46
unsigned int JDIMENSION
Definition: jmorecfg.h:171
struct jpeg_comp_master * master
Definition: jpeglib.h:400