OLD | NEW |
1 /* | 1 /* |
2 * The copyright in this software is being made available under the 2-clauses | 2 * The copyright in this software is being made available under the 2-clauses |
3 * BSD License, included below. This software may be subject to other third | 3 * BSD License, included below. This software may be subject to other third |
4 * party and contributor rights, including patent rights, and no such rights | 4 * party and contributor rights, including patent rights, and no such rights |
5 * are granted under this license. | 5 * are granted under this license. |
6 * | 6 * |
7 * Copyright (c) 2005, Herve Drolon, FreeImage Team | 7 * Copyright (c) 2005, Herve Drolon, FreeImage Team |
8 * Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR | 8 * Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR |
9 * Copyright (c) 2012, CS Systemes d'Information, France | 9 * Copyright (c) 2012, CS Systemes d'Information, France |
10 * All rights reserved. | 10 * All rights reserved. |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 | 517 |
518 return OPJ_FALSE; | 518 return OPJ_FALSE; |
519 } | 519 } |
520 | 520 |
521 OPJ_BOOL OPJ_CALLCONV opj_set_decoded_resolution_factor(opj_codec_t *p_codec, | 521 OPJ_BOOL OPJ_CALLCONV opj_set_decoded_resolution_factor(opj_codec_t *p_codec, |
522
OPJ_UINT32 res_factor ) | 522
OPJ_UINT32 res_factor ) |
523 { | 523 { |
524 opj_codec_private_t * l_codec = (opj_codec_private_t *) p_codec; | 524 opj_codec_private_t * l_codec = (opj_codec_private_t *) p_codec; |
525 | 525 |
526 if ( !l_codec ){ | 526 if ( !l_codec ){ |
527 fprintf(stderr, "[ERROR] Input parameters of the setup_decoder f
unction are incorrect.\n"); | |
528 return OPJ_FALSE; | 527 return OPJ_FALSE; |
529 } | 528 } |
530 | 529 |
531 » l_codec->m_codec_data.m_decompression.opj_set_decoded_resolution_factor(
l_codec->m_codec, | 530 » return l_codec->m_codec_data.m_decompression.opj_set_decoded_resolution_
factor(l_codec->m_codec, |
532
res_fact
or, | 531
res_fact
or, |
533
&(l_code
c->m_event_mgr) ); | 532
&(l_code
c->m_event_mgr) ); |
534 return OPJ_TRUE; | |
535 } | 533 } |
536 | 534 |
537 /* ---------------------------------------------------------------------- */ | 535 /* ---------------------------------------------------------------------- */ |
538 /* COMPRESSION FUNCTIONS*/ | 536 /* COMPRESSION FUNCTIONS*/ |
539 | 537 |
540 opj_codec_t* OPJ_CALLCONV opj_create_compress(OPJ_CODEC_FORMAT p_format) | 538 opj_codec_t* OPJ_CALLCONV opj_create_compress(OPJ_CODEC_FORMAT p_format) |
541 { | 539 { |
542 opj_codec_private_t *l_codec = 00; | 540 opj_codec_private_t *l_codec = 00; |
543 | 541 |
544 l_codec = (opj_codec_private_t*)opj_calloc(1, sizeof(opj_codec_private_t
)); | 542 l_codec = (opj_codec_private_t*)opj_calloc(1, sizeof(opj_codec_private_t
)); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 } | 691 } |
694 | 692 |
695 OPJ_BOOL OPJ_CALLCONV opj_setup_encoder(opj_codec_t *p_codec, | 693 OPJ_BOOL OPJ_CALLCONV opj_setup_encoder(opj_codec_t *p_codec, |
696
opj_cparameters_t *parameters, | 694
opj_cparameters_t *parameters, |
697
opj_image_t *p_image) | 695
opj_image_t *p_image) |
698 { | 696 { |
699 if (p_codec && parameters && p_image) { | 697 if (p_codec && parameters && p_image) { |
700 opj_codec_private_t * l_codec = (opj_codec_private_t *) p_codec; | 698 opj_codec_private_t * l_codec = (opj_codec_private_t *) p_codec; |
701 | 699 |
702 if (! l_codec->is_decompressor) { | 700 if (! l_codec->is_decompressor) { |
703 » » » l_codec->m_codec_data.m_compression.opj_setup_encoder(»
l_codec->m_codec, | 701 » » » return l_codec->m_codec_data.m_compression.opj_setup_enc
oder(» l_codec->m_codec, |
704
parameters, | 702
parameters, |
705
p_image, | 703
p_image, |
706
&(l_codec->m_event_mgr)
); | 704
&(l_codec->m_event_mgr)
); |
707 return OPJ_TRUE; | |
708 } | 705 } |
709 } | 706 } |
710 | 707 |
711 return OPJ_FALSE; | 708 return OPJ_FALSE; |
712 } | 709 } |
713 | 710 |
714 OPJ_BOOL OPJ_CALLCONV opj_start_compress ( opj_codec_t *p_codec, | 711 OPJ_BOOL OPJ_CALLCONV opj_start_compress ( opj_codec_t *p_codec, |
715
opj_image_t * p_image, | 712
opj_image_t * p_image, |
716
opj_stream_t *p_stream) | 713
opj_stream_t *p_stream) |
717 { | 714 { |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
862 OPJ_INT3
2 info_flag, | 859 OPJ_INT3
2 info_flag, |
863 FILE* ou
tput_stream) | 860 FILE* ou
tput_stream) |
864 { | 861 { |
865 if (p_codec) { | 862 if (p_codec) { |
866 opj_codec_private_t* l_codec = (opj_codec_private_t*) p_codec; | 863 opj_codec_private_t* l_codec = (opj_codec_private_t*) p_codec; |
867 | 864 |
868 l_codec->opj_dump_codec(l_codec->m_codec, info_flag, output_stre
am); | 865 l_codec->opj_dump_codec(l_codec->m_codec, info_flag, output_stre
am); |
869 return; | 866 return; |
870 } | 867 } |
871 | 868 |
872 » fprintf(stderr, "[ERROR] Input parameter of the dump_codec function are
incorrect.\n"); | 869 » /* TODO return error */ |
| 870 » /* fprintf(stderr, "[ERROR] Input parameter of the dump_codec function a
re incorrect.\n"); */ |
873 return; | 871 return; |
874 } | 872 } |
875 | 873 |
876 opj_codestream_info_v2_t* OPJ_CALLCONV opj_get_cstr_info(opj_codec_t *p_codec) | 874 opj_codestream_info_v2_t* OPJ_CALLCONV opj_get_cstr_info(opj_codec_t *p_codec) |
877 { | 875 { |
878 if (p_codec) { | 876 if (p_codec) { |
879 opj_codec_private_t* l_codec = (opj_codec_private_t*) p_codec; | 877 opj_codec_private_t* l_codec = (opj_codec_private_t*) p_codec; |
880 | 878 |
881 return l_codec->opj_get_codec_info(l_codec->m_codec); | 879 return l_codec->opj_get_codec_info(l_codec->m_codec); |
882 } | 880 } |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
953 | 951 |
954 opj_stream_set_user_data(l_stream, p_file, (opj_stream_free_user_data_fn) fc
lose); | 952 opj_stream_set_user_data(l_stream, p_file, (opj_stream_free_user_data_fn) fc
lose); |
955 opj_stream_set_user_data_length(l_stream, opj_get_data_length_from_file(p_fi
le)); | 953 opj_stream_set_user_data_length(l_stream, opj_get_data_length_from_file(p_fi
le)); |
956 opj_stream_set_read_function(l_stream, (opj_stream_read_fn) opj_read_from_fi
le); | 954 opj_stream_set_read_function(l_stream, (opj_stream_read_fn) opj_read_from_fi
le); |
957 opj_stream_set_write_function(l_stream, (opj_stream_write_fn) opj_write_from
_file); | 955 opj_stream_set_write_function(l_stream, (opj_stream_write_fn) opj_write_from
_file); |
958 opj_stream_set_skip_function(l_stream, (opj_stream_skip_fn) opj_skip_from_fi
le); | 956 opj_stream_set_skip_function(l_stream, (opj_stream_skip_fn) opj_skip_from_fi
le); |
959 opj_stream_set_seek_function(l_stream, (opj_stream_seek_fn) opj_seek_from_fi
le); | 957 opj_stream_set_seek_function(l_stream, (opj_stream_seek_fn) opj_seek_from_fi
le); |
960 | 958 |
961 return l_stream; | 959 return l_stream; |
962 } | 960 } |
OLD | NEW |