adding jp2_encode_v2 from v2 branches; using the right return value for opj_stream_flush

This commit is contained in:
Mickael Savinaud 2012-05-14 11:04:59 +00:00
parent 202d5ab754
commit 6965e3e03c
3 changed files with 20 additions and 1 deletions

View File

@ -6040,7 +6040,7 @@ opj_bool j2k_write_eoc_v2( opj_j2k_v2_t *p_j2k,
return OPJ_FALSE; return OPJ_FALSE;
} }
if ( opj_stream_flush(p_stream,p_manager) == EXIT_FAILURE) { if ( ! opj_stream_flush(p_stream,p_manager) ) {
return OPJ_FALSE; return OPJ_FALSE;
} }

View File

@ -2388,6 +2388,14 @@ void jp2_setup_encoder( opj_jp2_v2_t *jp2,
// jp2->jpip_on = parameters->jpip_on; // jp2->jpip_on = parameters->jpip_on;
} }
opj_bool opj_jp2_encode_v2( opj_jp2_v2_t *jp2,
opj_stream_private_t *stream,
opj_event_mgr_t * p_manager)
{
return j2k_encode_v2(jp2->j2k, stream, p_manager);
}
opj_bool opj_jp2_encode(opj_jp2_t *jp2, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info) { opj_bool opj_jp2_encode(opj_jp2_t *jp2, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info) {
int pos_iptr, pos_cidx, pos_jp2c, len_jp2c, len_cidx, end_pos, pos_fidx, len_fidx; int pos_iptr, pos_cidx, pos_jp2c, len_jp2c, len_cidx, end_pos, pos_fidx, len_fidx;

View File

@ -358,6 +358,17 @@ Encode an image into a JPEG-2000 file stream
*/ */
opj_bool opj_jp2_encode(opj_jp2_t *jp2, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info); opj_bool opj_jp2_encode(opj_jp2_t *jp2, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info);
/**
Encode an image into a JPEG-2000 file stream
@param jp2 JP2 compressor handle
@param stream Output buffer stream
@param p_manager event manager
@return Returns true if successful, returns false otherwise
*/
opj_bool opj_jp2_encode_v2( opj_jp2_v2_t *jp2,
opj_stream_private_t *stream,
opj_event_mgr_t * p_manager);
/** /**
* Starts a compression scheme, i.e. validates the codec parameters, writes the header. * Starts a compression scheme, i.e. validates the codec parameters, writes the header.