Compare commits

..

1635 Commits

Author SHA1 Message Date
Antonin Descampe
7113c4e3bb Update THANKS.md 2016-10-03 23:47:10 +02:00
Antonin Descampe
b8197de716 Update CHANGELOG.md 2016-10-03 23:45:44 +02:00
Antonin Descampe
b079198838 fix abi-check and limit upload to website for master 2016-09-29 22:06:23 +02:00
Antonin Descampe
110d31891b fix abi-check 2016-09-29 21:44:38 +02:00
Antonin Descampe
cc0c71c30b fix abi-check 2016-09-29 20:23:01 +02:00
Antonin Descampe
5695ac15ff Update abi-check scripts for v2.1.2 2016-09-28 20:59:10 +02:00
Antonin Descampe
df5e8628f2 Update NEWS.md for v2.1.2 2016-09-28 20:58:55 +02:00
Antonin Descampe
b0c0f0ff04 Update Changelog for v2.1.2 2016-09-28 20:58:34 +02:00
Antonin Descampe
9afc1699f0 Update version number for future release 2.2.0 2016-09-28 18:55:02 +02:00
Mathieu Malaterre
34dae137a9 OPENJPEG_NAMESPACE is configurable by user 2016-09-26 12:01:31 +02:00
Mathieu Malaterre
4d5c5e7c48 Remove typos from comments and man pages 2016-09-26 11:26:55 +02:00
Matthieu Darbois
fac916f72a Fix PNM file reading (#847)
Malformed PNM file could cause a crash in opj_compress.
Checks were added to prevent this.

Fixes #843
Updates #440
2016-09-22 00:30:34 +02:00
Stefan Weil
8715ce2749 Fix some issues reported by Coverity Scan (#846)
* test_tile_decoder: Fix potential buffer overflow (coverity)

CID 1190155 (#1 of 1): Unbounded source buffer (STRING_SIZE)

Using a pointer instead of buffer of fixed size avoids the limit
for the length of the input file name.

Signed-off-by: Stefan Weil <sw@weilnetz.de>

* test_tile_encoder: Fix potential buffer overflow (coverity)

CID 1190154 (#1 of 1): Unbounded source buffer (STRING_SIZE)

Using a pointer instead of buffer of fixed size avoids the limit
for the length of the output file name. This implies that the length
can exceed 255, so the data type for variable len had to be fixed, too.

Signed-off-by: Stefan Weil <sw@weilnetz.de>

* openjpip: Initialize data before returning it

This fixes an error reported by Coverity:

CID 1190143 (#1 of 1): Uninitialized scalar variable (UNINIT)

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-09-21 21:15:25 +02:00
Stefan Weil
045aa4d9f2 Fix potential out-of-bounds read (coverity) (#844)
* query_parser: Fix potential out-of-bounds read (coverity)

CID 1190207 (#1 of 1): Out-of-bounds read (OVERRUN)

Variable i must be checked before testing query_param.box_type.

Signed-off-by: Stefan Weil <sw@weilnetz.de>

* jpip_parser: Fix potential out-of-bounds read (coverity)

CID 1190206 (#1 of 1): Out-of-bounds read (OVERRUN)

Variable i must be checked before testing query_param.box_type.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-09-21 13:17:09 +02:00
Antonin Descampe
da94042481 Merge pull request #834 from trylab/issue833
Fix issue 833.
2016-09-20 18:59:30 +02:00
Antonin Descampe
31d44f0280 Disable automatic compilation of t1_generate_luts
Fix #831
2016-09-20 18:48:06 +02:00
Antonin Descampe
3aaeea7ce8 renamed USE_THREAD to OPJ_USE_THREAD
renaming to be consistent with previous OPJ CMake options
2016-09-16 17:54:12 +02:00
Matthieu Darbois
6e7616c83c Remove TODO for overflow check (#842)
The check was already done. It’s been simplified.
Reformat to get consistent style throughout the functions.
2016-09-15 23:51:34 +02:00
Matthieu Darbois
9a07ccb3d0 Add overflow checks for opj_aligned_malloc (#841)
See
https://pdfium.googlesource.com/pdfium/+/b20ab6c7acb3be1393461eb650ca8fa4660c937e/third_party/libopenjpeg20/0020-opj_aligned_malloc.patch
2016-09-15 01:57:53 +02:00
Matthieu Darbois
f88c9974e2 Flags in T1 shall be unsigned (#840)
This will remove some conversion warnings
2016-09-14 23:46:46 +02:00
Matthieu Darbois
0954bc11e3 Fix some warnings (#838)
Fix warnings introduced by uclouvain/openjpeg#786
2016-09-14 00:12:43 +02:00
Antonin Descampe
1e69940955 Merge branch 'smuehlst-bit-fields-type' 2016-09-13 21:21:56 +02:00
Antonin Descampe
f66e120452 Merge branch 'bit-fields-type' of https://github.com/smuehlst/openjpeg into smuehlst-bit-fields-type 2016-09-13 21:21:11 +02:00
Antonin Descampe
d6d0f070e1 Merge pull request #786 from rouault/tier1_optimizations_multithreading
T1 & DWT multithreading decoding optimizations
2016-09-13 16:39:26 +02:00
Antonin Descampe
f1f7c53308 remove ops 1.4 and 1.2 from abi-check to avoid symlinks in gh-pages 2016-09-13 16:21:38 +02:00
trylab
893143c8e1 Fix issue 833.
Add some overflow check operations.
2016-09-13 17:43:30 +08:00
Matthieu Darbois
805972f4c8 Add test for issue 820 (#829)
Update uclouvain/openjpeg#820
2016-09-11 19:47:32 +02:00
Matthieu Darbois
45ed017b1b Add test for issue 826 (#827)
Update uclouvain/openjpeg#826

Also correct names for data of issue uclouvain/openjpeg#823
2016-09-08 23:56:06 +02:00
Matthieu Darbois
b21a8317e5 Fix coverity 113065 (CWE-484) (#824) 2016-09-08 22:14:19 +02:00
Antonin Descampe
5fb81d986e Update THANKS.md 2016-09-08 11:28:58 +02:00
Even Rouault
48c16b2c19 Merge branch 'master' of https://github.com/uclouvain/openjpeg into tier1_optimizations_multithreading_2
Conflicts:
	src/lib/openjp2/t1.c
2016-09-08 10:30:09 +02:00
Even Rouault
ab22c5bad5 opj_thread_pool: fix potential deadlock at thread pool destruction 2016-09-08 09:43:36 +02:00
Matthieu Darbois
ef01f18dfc Cast to size_t before multiplication
Need to cast to size_t before multiplication otherwise overflow check is useless.
2016-09-08 07:34:46 +02:00
Matthieu Darbois
e078172b1c Add sanity check for tile coordinates (#823)
Coordinates are casted from OPJ_UINT32 to OPJ_INT32
Add sanity check for negative values and upper bound becoming lower
than lower bound.
See also
https://pdfium.googlesource.com/pdfium/+/b6befb2ed2485a3805cddea86dc7574510178ea9
2016-09-08 00:24:15 +02:00
Stephan Mühlstrasser
8750e183c6 Moved type OPJ_BITFIELD from openjpeg.h to opj_includes.h
OPJ_BITFIELD is used only in internal headers and must not
appear in the public openjpeg.h header.
2016-09-07 08:41:01 +02:00
Stephan Mühlstrasser
6c83f1468c Merge branch 'master' into bit-fields-type 2016-09-07 08:35:19 +02:00
Matthieu Darbois
acfb307df4 Add test for PR 818 (#822)
update uclouvain/openjpeg#818
2016-09-07 00:00:21 +02:00
Matthieu Darbois
275aad4df8 Update to libpng 1.6.25 (#821) 2016-09-06 22:33:45 +02:00
Matthieu Darbois
734d57d5f7 fix incrementing of "l_tcp->m_nb_mcc_records" in opj_j2k_read_mcc (#820) 2016-09-06 22:33:26 +02:00
trylab
c16bc057ba Fix an integer overflow issue (#809)
Prevent an integer overflow issue in function opj_pi_create_decode of
pi.c.
2016-09-06 07:55:49 +02:00
Matthieu Darbois
ea320dab8b Add overflow check in opj_tcd_init_tile (#819) 2016-09-06 07:54:29 +02:00
Matthieu Darbois
d7e6b7de8a Fix leak & invalid behavior of opj_jp2_read_ihdr (#818)
In case multiple ihdr box are present, only the first one shall be
taken into account.
2016-09-06 01:31:15 +02:00
Matthieu Darbois
ccd9ced49e Add overflow check in opj_j2k_update_image_data (#817) 2016-09-06 00:50:44 +02:00
Matthieu Darbois
9f24b078c7 Change 'restrict' define to 'OPJ_RESTRICT' (#816)
Visual Studio 2015 does not pass regression tests with `__restrict` so kept disabled for MSVC.
Need to check proper usage of OPJ_RESTRICT (if correct then there’s
probably a bug  in vc14)

Closes #661
2016-09-06 00:49:53 +02:00
Stefan Weil
51155950eb Add .gitignore (#787)
Ignore all files and directories which are generated by `cmake . && make`.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-09-05 22:07:50 +02:00
Matthieu Darbois
23cee22286 Switch to clang 3.8 (#814)
clang 3.9 is currently unavailable for precise through apt
2016-09-02 23:58:12 +02:00
Even Rouault
4f9abb9a45 [Win32] Use _beginthreadex instead of CreateThread() 2016-08-11 21:59:28 +02:00
Matthieu Darbois
4a2a8693e5 Update to lcms 2.8 (#808) 2016-08-06 13:04:56 +02:00
Matthieu Darbois
1509ccc51f Update to libpng 1.6.24 (#807) 2016-08-06 12:51:40 +02:00
Matthieu Darbois
5bb919a30e Reenable clang-3.9 build on travis (#806)
clang-3.9 is now available with apt add-on in travis-ci
2016-08-06 12:26:46 +02:00
Stephan Mühlstrasser
54874194a8 Unified bit-field declaration, removed tabs. 2016-07-27 10:09:54 +02:00
Stephan Mühlstrasser
d2d35bf6c2 Create separate type for bit-fields.
The definition of bit-fields with type OPJ_UINT32 caused complilation errors
on IBM iSeries, because OPJ_UINT32 is defined as uint32_t, and
uint32_t is defined as unsigned long in <stdint.h>. The definition of
bit-fields with an integer type of  a specific size doesn't make sense
anyway.
2016-07-25 20:46:11 +02:00
Matthieu Darbois
b8bd1b0e07 Add compilation test for standalone inclusion of openjpeg.h (#798)
This ensures all openjpeg.h dependencies are met.
Fix #673
2016-07-14 11:06:26 +02:00
Stefan Weil
e40c28c2e8 jpwl: Remove non-portable data type u_int16_t (fix issue #796) (#797)
The type casts which used this data type can be removed by changing
the signature of function swap16. As this function is called with
unsigned variables, this change is reasonable.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-07-14 10:49:17 +02:00
Stefan Weil
18da6155b2 Fix dependency for pkg-config (issue #594) (#795)
openjpeg provides libopenjp2.pc, so the require statements must refer to
libopenjp2 instead of openjp2.
Fixes #594 

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-07-12 00:45:51 +02:00
mayeut
b3c422654f Update ABI tracker script
Disable previous version.
2016-07-06 00:26:37 +02:00
mayeut
9db62b2011 Update ABI tracker from 2.1 to 2.1.1 2016-07-05 23:53:31 +02:00
Antonin Descampe
7948d83340 update api/abi tracker 2016-07-05 23:33:00 +02:00
mayeut
132c4a248b Add version 2.1.1 to ABI tracker 2016-07-05 22:12:11 +02:00
Antonin Descampe
ed294598ea Trigger API/ABI update on website 2016-07-05 18:10:35 +02:00
Antonin Descampe
fef144283f Update INSTALL.md 2016-07-05 16:49:10 +02:00
Antonin Descampe
4c5a1cc825 Update AUTHORS.md 2016-07-05 16:40:27 +02:00
Antonin Descampe
bd96ed8353 Update AUTHORS file 2016-07-05 16:07:16 +02:00
Antonin Descampe
f4a708ba0f Update INSTALL, README and THANKS file 2016-07-05 16:04:29 +02:00
Antonin Descampe
2372cb78a0 Upload changelog and convert some files to mardown 2016-07-05 15:29:02 +02:00
Antonin Descampe
9d5002f8fd Remove useless diff command in abi-check.sh 2016-06-26 20:00:37 +02:00
Matthieu Darbois
e4c74f5364 Correct abi-check.sh for PR (#791) 2016-06-25 01:09:42 +02:00
maddin200
cb72c08472 Update tcd.c (#790)
cppcheck unitialized variable
2016-06-21 22:13:57 +02:00
Matthieu Darbois
898ca6f522 Remove clang-3.9 build
c.f. travis-ci/travis-ci#6120
2016-06-21 22:09:08 +02:00
Antonin Descampe
86698be6e9 Automatic upload of ABI report (end) 2016-06-21 17:41:29 +02:00
Antonin Descampe
cdcb77e796 Automatic upload of ABI report (ctd) 2016-06-21 17:21:08 +02:00
Antonin Descampe
954dad66de Automatic upload of ABI report (ctd) 2016-06-21 16:46:38 +02:00
Antonin Descampe
48744a1342 setup automatic upload of ABI reports 2016-06-21 16:19:06 +02:00
Even Rouault
7d3c7a345f Be robust to failed allocations of job structures 2016-05-26 23:51:32 +02:00
Even Rouault
69497d35c0 opj_decompress: use clock_gettime() instead of getrusage() so as to get the time spent, and not to the total CPU time 2016-05-25 21:59:43 +02:00
Even Rouault
d67cd2220a opj_decompress: add a -threads <num_threads> option 2016-05-25 21:02:07 +02:00
Even Rouault
e3eb0a206d .travis.yml: add a conf with OPJ_NUM_THREADS=2 2016-05-25 21:02:07 +02:00
Even Rouault
57b216bb58 Use thread pool for DWT decoding 2016-05-25 21:02:07 +02:00
Even Rouault
5fbb8b2645 Use thread-pool for T1 decoding 2016-05-25 21:02:07 +02:00
Even Rouault
d4b7f03cfa Add opj_codec_set_threads() in public API and propagate resulting thread pool to tcd level
By default, only the main thread is used. If opj_codec_set_threads() is not used,
but the OPJ_NUM_THREADS environment variable is set, its value will be
used to initialize the number of threads. The value can be either an integer
number, or "ALL_CPUS". If OPJ_NUM_THREADS is set and this function is called,
this function will override the behaviour of the environment variable.
2016-05-25 21:02:07 +02:00
Even Rouault
54179fe1d5 Add threading and thread pool API 2016-05-25 21:02:07 +02:00
Even Rouault
7092f7ea11 Fix MSVC210 build issue (use of C99 declaration after statement) introduced in ba1edf6cd41415594729bc90ad3b0008af48251e 2016-05-23 16:00:28 +02:00
Even Rouault
107eb31531 Improve perf of opj_t1_dec_sigpass_mqc_vsc() and opj_t1_dec_refpass_mqc_vsc() with loop unrolling 2016-05-23 13:45:15 +02:00
Even Rouault
8371491a99 Better inlining of opj_t1_updateflagscolflags() w.r.t. flags_stride 2016-05-23 11:53:54 +02:00
Even Rouault
956c31d5a6 opj_t1_dec_clnpass(): remove useless test in the runlen decoding path (of the non VSC case) 2016-05-23 11:53:54 +02:00
Even Rouault
93f7f90711 opj_t1_decode_cblks(): tiny perf increase when loop unrolling 2016-05-23 11:53:53 +02:00
Even Rouault
1da397e94a Tier 1 decoding: add a colflags array
Addition flag array such that colflags[1+0] is for state of col=0,row=0..3,
colflags[1+1] for col=1, row=0..3, colflags[1+flags_stride] for col=0,row=4..7, ...
This array avoids too much cache trashing when processing by 4 vertical samples
as done in the various decoding steps.
2016-05-23 11:53:53 +02:00
Even Rouault
31882ad7f4 Const'ify lut arrays so they are in the read-only data section 2016-05-22 00:54:06 +02:00
Even Rouault
ba1edf6cd4 Reduce number of occurrences of orient function argument
This is essentially used to shift inside the lut_ctxno_zc, which we
can precompute at the beginning of opj_t1_decode_cblk() /
opj_t1_encode_cblk()
2016-05-22 00:50:34 +02:00
Even Rouault
23a01dfdef Specialize decoding passes for 64x64 code blocks 2016-05-21 16:27:35 +02:00
Even Rouault
d8fef96f23 Improve code generation in opj_t1_dec_clnpass()
Add a opj_t1_dec_clnpass_step_only_if_flag_not_sig_visit() method that
does the job of opj_t1_dec_clnpass_step_only() assuming the conditions
are met. And use it in opj_t1_dec_clnpass(). The compiler generates
more efficient code.
2016-05-21 15:52:02 +02:00
Even Rouault
c539808d09 opj_t1_updateflags(): tiny optimization
We can avoid using a loop-up table with some shift arithmetics.
2016-05-21 15:46:56 +02:00
Kal Conley
426bf8d337 Move some MQC functions into a header for speed
Allow these hot functions to be inlined. This boosts decode performance by ~10%.
2016-05-21 15:18:07 +02:00
Antonin Descampe
d0babeb6f6 WIP automatic release 2016-05-15 18:17:24 +02:00
Antonin Descampe
d1ca2b4f29 WIP: debug travis run script 2016-05-15 00:53:24 +02:00
Antonin Descampe
8ba0de3e45 Update travis and appveyor to enable automatic releases on tag commit 2016-05-15 00:42:54 +02:00
Antonin Descampe
2e0779e250 Update version number in CMakeLists.txt 2016-05-13 12:31:56 +02:00
Antonin Descampe
e55130d3c5 Update NEWS 2016-05-13 12:25:55 +02:00
Stefan Weil
4d2b6a671a Update implementation of opj_calloc (#705) 2016-05-10 22:08:49 +02:00
Stefan Weil
aae066debc Add missing source for the JPIP library and executables (issue #658) (#659)
They all need opj_malloc and other functions from opc_malloc.c.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-05-10 22:02:49 +02:00
mayeut
6609719b40 Correct expected result for test of issue 495 2016-05-08 20:26:12 +02:00
mayeut
1a8318f6c2 Fix Out-of-Bounds Access in function opj_tgt_reset
Fix uclouvain/openjpeg#775
2016-05-08 20:10:13 +02:00
mayeut
162f6199c0 Fix Heap Buffer Overflow in function color_cmyk_to_rgb
Fix uclouvain/openjpeg#774
2016-05-08 19:18:05 +02:00
mayeut
8f9cc62b3f Fix division by zero
Fix uclouvain/openjpeg#733
2016-05-08 18:40:12 +02:00
Matthieu Darbois
44a499f2ac Update lcms2 (#773)
Update to mm2/Little-CMS@e342f44
2016-05-03 22:22:03 +02:00
julienmalik
94cfb1b008 Merge pull request #769 from julienmalik/cmake_lowercase
Use lowercase for cmake commands consistenly
2016-05-02 21:57:55 +02:00
Julien Malik
17a0a8a195 Use lowercase for cmake commands consistenly
Inspired from https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/Maintenance/HowToCreateTheCMakeCaseConversion.txt
This needs vim 7.3 and fails with vim 7.4

This also fixes a number of :
- missing empty line at end of files
- useless space at end of lines
2016-05-02 16:05:41 +02:00
julienmalik
ba0cf122f6 Merge pull request #767 from julienmalik/fix_memset_null_pointer
Fix UBSan gcc warning for first arg to memset non null
2016-05-02 14:34:32 +02:00
julienmalik
da56086e01 Merge pull request #768 from julienmalik/filter_clang_warnings
Ignore clang's summary warning
2016-05-02 14:32:08 +02:00
Julien Malik
04b8cbd27a Ignore clang's summary warning
This assumes prior text has matched some other warning expression.

This reduces the warnings reported for clang build on the dashboard,
which were caused only by the "XXX warnings generated." message.
For some reason they were not reported when not using ctest launchers.

This commit allows to confidently use ctest launchers to improve
dashboard reports.
2016-05-02 12:55:43 +02:00
Julien Malik
e1e018a8dc Fix UBSan gcc warning for first arg to memset non null 2016-05-02 12:13:24 +02:00
Matthieu Darbois
b51d088267 Update to libtiff-4.0.6 (#764) 2016-05-01 18:05:46 +02:00
mayeut
4f11e89c80 Add tests for recent issues
Update uclouvain/openjpeg#725
Update uclouvain/openjpeg#726
2016-04-30 18:51:36 +02:00
Matthieu Darbois
9a20f8e8d1 Update lcms (#544)
Update to mm2/Little-CMS@0e8234e090
2016-04-30 17:58:04 +02:00
Antonin Descampe
72deb588cb Merge pull request #706 from mayeut/issue135
Fix issue 135
The fix is legal regarding the standard but I did not manage to find out if it covers a bug in opj_t2_read_packet_data or if the file is corrupted
2016-04-30 13:51:01 +02:00
mayeut
cd77b6003b Fix some coverity warnings 2016-04-30 12:15:22 +02:00
mayeut
f40a2ff2ad Fix bad call to fclose with NULL pointer 2016-04-30 01:50:33 +02:00
Matthieu Darbois
be42e72d22 Fix warnings (#763) 2016-04-30 01:12:16 +02:00
Matthieu Darbois
15f081c896 Fix Out-Of-Bounds Read in sycc42x_to_rgb function (#745)
42x Images with an odd x0/y0 lead to subsampled component starting at the
2nd column/line.
That is offset = comp->dx * comp->x0 - image->x0 = 1

Fix #726
2016-04-30 00:33:27 +02:00
Matthieu Darbois
ad593c9e06 Fix heap-buffer-overflow in color_esycc_to_rgb (#748)
When all components do not have the same dx/dy, components buffer are
read beyond their end.
Do not convert in this case.

Update uclouvain/openjpeg#725
2016-04-29 23:51:14 +02:00
julienmalik
319fc971fe cppcheck fix for openjp2 (#740) 2016-04-29 23:49:17 +02:00
Matthieu Darbois
e166e4a209 Check SSIZ is valid in opj_j2k_read_siz (#762) 2016-04-28 19:20:14 +02:00
Matthieu Darbois
29313eb5f1 Fix unsigned int overflow reported by UBSan (#761)
* Fix unsigned int overflow reported by UBSan

Please add -DOPJ_UBSAN_BUILD to CFLAGS when building with
-fsanitize=undefined,unsigned-integer-overflow

It seems clang/gcc do not allow to disable checking for block of code
other than function or file.
2016-04-28 13:16:43 +02:00
julienmalik
e982d03966 Fix implicit float-to-bool conversions (#752) 2016-04-28 11:52:45 +02:00
Matthieu Darbois
66fd497765 Fix unsigned int overflow reported by UBSan (#759) 2016-04-28 00:18:37 +02:00
mayeut
20789fed4e Fix issue 135
dwt_interleave_h.gsr105.jp2 now has the same output as kakadu
issue399 is corrupted. Only the corrupted part changes.

Update known failures for x86 MD5

NR-DEC-kodak_2layers_lrcp.j2c-31-decode-md5
NR-DEC-kodak_2layers_lrcp.j2c-32-decode-md5
NR-DEC-issue135.j2k-68-decode-md5
2016-04-27 23:15:47 +02:00
julienmalik
5947e10ff7 Add clang 3.9 build to Travis matrix (#753) 2016-04-27 23:05:43 +02:00
Matthieu Darbois
e6881e7527 Fix negative shift left reported by UBSan (#758)
Follow-up of #757

This shall have no performance impact on 2’s complement machine where
the compiler replaces the multiplication by power of two (constant) by
a left shift.
Verified at least on MacOS Xcode 7.3, same assembly generated after fix.
2016-04-27 21:56:09 +02:00
Stefan Weil
2296dc9e68 Remove whitespace and CR at line endings (#678)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-04-26 22:12:11 +02:00
Matthieu Darbois
6f2ac3ee36 Fix negative shift left reported by UBSan (#757)
This shall have no performance impact on 2’s complement machine where
the compiler replaces the multiplication by power of two (constant) by
a left shift.
Verified at least on MacOS Xcode 7.3, same assembly generated after fix.
2016-04-26 22:06:06 +02:00
Matthieu Darbois
c559c62853 Do not define __attribute__ in opj_includes.h (#751)
Fix #727
2016-04-23 14:17:31 +02:00
Matthieu Darbois
a9feb9addd Merge pull request #750 from mayeut/issue-729-2
Allow to read/write 3/5/7/9/11/13/15 bpp TIF files
2016-04-23 10:51:46 +02:00
mayeut
74e814358c Allow to write 3/5/7/9/11/13/15 bpp TIF files
Update uclouvain/openjpeg#729
2016-04-23 04:29:03 +02:00
mayeut
54393d9e38 Allow to read 3/5/7/9/11/13/15 bpp TIF files 2016-04-23 04:24:04 +02:00
Matthieu Darbois
06e8dc9edd Merge pull request #746 from senbox-org/update_cmake_jpylyzer
Update cmake & jpylyzer for travis builds
2016-04-22 12:54:25 +02:00
Matthieu Darbois
f5446fdcfb Merge pull request #747 from julienmalik/update_libpng
update libpng to from 1.6.17 to 1.6.21
2016-04-22 10:48:40 +02:00
Julien Malik
8611d127db Import pnglibconf.h.prebuilt as new pnglibconf.h 2016-04-22 00:16:16 +02:00
Julien Malik
889bf16791 update libpng to from 1.6.17 to 1.6.21 2016-04-21 18:49:15 +02:00
Julien Malik
6ea2ff0b06 Update jpylyzer to 1.17.0 2016-04-21 17:58:19 +02:00
Julien Malik
3436c4e9ba upgrade cmake to 3.5.2 2016-04-21 17:53:40 +02:00
Antonin Descampe
e1a93d9e59 Merge pull request #708 from GrokImageCompression/issue_695
issue #695 MQ Encode: ensure that bp pointer never points to uninitialized memory
2016-04-18 10:51:51 +02:00
Antonin Descampe
a1c0ee9a86 Merge pull request #734 from senbox-org/opj_dump_dead_code
Remove dead code in opj_dump
2016-04-12 10:48:02 +02:00
Antonin Descampe
40b5a53d2f Merge pull request #735 from senbox-org/cppcheck_fix_openjp2
Fix uninitialized variable reported by cppcheck
2016-04-12 10:47:28 +02:00
Julien Malik
e7797b97a1 Fix uninitialized variable reported by cppcheck
Also reorder initialization to follow declaration order
2016-04-09 19:02:05 +02:00
Julien Malik
5e5f6999a8 Remove dead code in opj_dump 2016-04-09 18:34:11 +02:00
Aaron Boxer
0069a2bd2f suppress valgrind error - avoid accessing uninitialized memory in mq encoder 2016-01-30 10:05:46 -05:00
Aaron Boxer
e3100f714c issue #695 MQ Encode: ensure that bp pointer never points to uninitialized memory 2016-01-28 19:34:00 -05:00
Antonin Descampe
5c5ae1d51a fixed tile numbering
Fixes #245
2016-01-25 17:30:43 +01:00
Antonin Descampe
3767af52de Merge pull request #648 from stweil/alloc
Fix support of posix_memalloc for Linux
2016-01-23 19:43:09 +01:00
mayeut
1b86fb6f48 Update known failures 2016-01-11 00:35:47 +01:00
Matthieu Darbois
a42d03df79 Merge pull request #551 from mayeut/coc-qcc
Add COC/QCC in main header when needed
2016-01-11 00:23:44 +01:00
Mathieu Malaterre
cb33ff43bb Merge pull request #690 from rouault/failed_malloc_opj_dwt_encode_procedure
[git/2.1 regression] Fix opj_write_tile() failure when numresolutions=1
2016-01-09 14:53:29 +01:00
Even Rouault
6a1974d40d Add comment explaining bj is not use when l_data_size == 0 2016-01-09 14:30:48 +01:00
Even Rouault
87c0d7dc1e [git/2.1 regression] Fix opj_write_tile() failure when numresolutions=1
When trying the GDAL OpenJPEG driver against openjpeg current master HEAD,
I get failures when trying to create .jp2 files. The driver uses
opj_write_tile() and in some tests numresolutions = 1.

In openjp2/dwt.c:410, l_data_size = opj_dwt_max_resolution( tilec->resolutions,tilec->numresolutions) * (OPJ_UINT32)sizeof(OPJ_INT32);
is called and returns l_data_size = 0. Now in git opj_malloc() has a special case
for 0 to return a NULL pointer whereas previously it relied on system malloc(),
which in my case didn't return NULL.

So only test the pointer value if l_data_size != 0. This makes the GDAL
autotest suite to pass again.
2016-01-08 19:38:45 +01:00
Matthieu Darbois
0dd44e7dba Merge pull request #687 from stweil/memalign
Fix fatal crash on 64 bit Linux
2016-01-06 23:15:05 +01:00
Stefan Weil
9cad6bc1f6 Fix fatal crash on 64 bit Linux
By default, OpenJPEG uses the function memalign to allocate aligned
memory on Linux systems. That function needs malloc.h which was
missing. This results in a compiler warning:

openjpeg/src/lib/openjp2/opj_malloc.c:63:3: warning:
 implicit declaration of function ‘memalign’
 [-Wimplicit-function-declaration]

On hosts where sizeof(int) < sizeof(void *) the return value of memalign
will be truncated which results in an invalid pointer.

That caused "make test" to produce lots of segmentation faults when
running on a 64 bit Linux host.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-01-06 21:40:09 +01:00
Stefan Weil
79b1c4cc85 Fix whitespace issues in opj_malloc.c
Some lines ended with spaces. Remove them.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-01-06 21:40:01 +01:00
Stefan Weil
c00ee8bff7 Fix support of posix_memalign for Linux
posix_memalign is only declared conditionally in stdlib.h,
so add one of the possible definitions to get the declaration.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-01-06 18:06:45 +01:00
Matthieu Darbois
a205f70328 Merge pull request #686 from mayeut/master
[libtiff] Add missing include statement for ssize_t
Close #681
2016-01-06 18:04:51 +01:00
mayeut
9c5b30005e Add missing include statement for ssize_t
Update uclouvain/openjpeg#681
2016-01-06 17:37:37 +01:00
mayeut
83e5e2703e Merge remote-tracking branch 'uclouvain/master' 2016-01-06 17:09:14 +01:00
Matthieu Darbois
3a0253f4e2 Merge pull request #684 from stweil/typo
Fix duplicate article in comments
2016-01-06 17:01:48 +01:00
Stefan Weil
99c4f621bd Fix duplicate article in comments
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-01-06 08:55:29 +01:00
mayeut
2e4fadf330 Merge remote-tracking branch 'uclouvain/master' 2016-01-03 02:09:04 +01:00
Matthieu Darbois
8f9905936c Merge pull request #679 from stweil/grammar
Fix grammar in comment
2015-12-31 11:45:51 +01:00
Stefan Weil
a834ab305f Fix grammar in comment
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-12-31 10:13:26 +01:00
Matthieu Darbois
51efe91971 Merge pull request #665 from jwilk/spelling
Fix typos
2015-12-23 20:55:47 +01:00
Jakub Wilk
4ddc2627dd Fix typos 2015-11-27 21:38:41 +01:00
mayeut
5d56fb3115 Add known failures
2 more tests failing under AppVayor since nov-6 update
Update #655
2015-11-07 14:50:28 +01:00
Matthieu Darbois
51cbcd5748 Merge pull request #654 from mayeut/master
Fix undefined size jp2 box handling
2015-11-07 14:35:45 +01:00
mayeut
f51d52f85a Revert "Check for appveyor update"
This reverts commit c414d9c238f404980e6e8b17db652a7fb2635cdf.
2015-11-07 02:59:38 +01:00
mayeut
c414d9c238 Check for appveyor update 2015-11-07 02:40:18 +01:00
mayeut
e5ca873ab1 Fix missing bracket 2015-11-07 02:06:22 +01:00
mayeut
601aa38c30 fix appveyor build 2015-11-07 02:04:10 +01:00
mayeut
fb4be3894e Fix undefined size jp2 box handling
Update #653
2015-11-07 01:35:43 +01:00
mayeut
c37d69b25e Fix Travis cmake install 2015-11-02 22:28:30 +01:00
mayeut
a77717583e Update cmake for travis ASan build 2015-11-02 22:02:55 +01:00
Matthieu Darbois
968085190c Merge pull request #651 from stweil/fix
opj_decompress: Update error message
2015-11-02 21:49:25 +01:00
Stefan Weil
93a61459cd opj_decompress: Update error message
The png format is also supported, so add it to the message.
Remove also the unneeded blank character before \n.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-11-01 21:01:20 +01:00
mayeut
38ffbbe42e Fin compiler warnings 2015-11-01 17:08:47 +01:00
mayeut
ce26e523dd Fix compiler warnings 2015-11-01 16:56:50 +01:00
Stefan Weil
7dfcbf9d7b convert: Fix compiler warnings
Fix this and other similar compiler warnings:

src/bin/jp2/convert.c: In function ‘tga_readheader’:
src/bin/jp2/convert.c:595:5: warning:
 dereferencing type-punned pointer will break strict-aliasing rules
 [-Wstrict-aliasing]
     cmap_len = get_ushort(*(unsigned short*)(&tga[5]));

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-11-01 16:54:38 +01:00
Stefan Weil
4ac509182a convert: Remove unneeded type casts
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-11-01 16:53:55 +01:00
Matthieu Darbois
0ae66e891a Merge pull request #647 from stweil/master
Fix typo in comments
2015-10-30 22:50:06 +01:00
Stefan Weil
9f78c68953 Fix typo in comments
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-10-29 20:37:27 +01:00
Matthieu Darbois
f080ab8ce0 Merge pull request #638 from stweil/master
Fix format strings and unneeded assignment
2015-10-21 20:53:22 +02:00
mayeut
e975ca2832 Merge branch 'master' into coc-qcc 2015-10-21 20:45:50 +02:00
Matthieu Darbois
b06bed7b7b Merge pull request #644 from smuehlst/opj_aligned_malloc
Avoid pointer arithmetic with (void *) pointers
2015-10-21 10:10:38 +02:00
Stephan Mühlstrasser
b7a162348d Avoid pointer arithmetic with (void *) pointers. 2015-10-21 09:01:31 +02:00
Stephan Mühlstrasser
540aa58f6c Merge branch 'master' into opj_aligned_malloc
Conflicts:
	src/lib/openjp2/opj_malloc.c
2015-10-21 08:57:45 +02:00
mayeut
d48be27f5a Generic aligned malloc implementation update.
Update #642
2015-10-21 00:09:04 +02:00
Stephan Mühlstrasser
eaf55b677c Generic aligned malloc implementation.
Used for platforms where none of posix_memalign(), memalign() and
_aligned_malloc() is available.
2015-10-20 21:34:54 +02:00
Stephan Mühlstrasser
0967d64854 Generic aligned malloc implementation.
Used for platforms where none of posix_memalign(), memalign() and
_aligned_malloc() is available.
2015-10-20 13:02:51 +02:00
Matthieu Darbois
5799672237 Merge pull request #641 from smuehlst/opj_hp_issue_640
Fix HP compiler warning about redeclaration of function
Fix #640
Fix #243
2015-10-19 22:23:54 +02:00
Stephan Mühlstrasser
a1fc83cc25 Fix HP compiler warning about redeclaration of function (#640)
HP compiler warns:
cc: "dwt.c", line 798: warning 562: Redeclaration of "opj_v4dwt_decode"
with a different storage class specifier: "opj_v4dwt_decode" will have
internal linkage.
cc: "t2.c", line 1341: warning 562: Redeclaration of "opj_t2_init_seg"
with a different storage class specifier: "opj_t2_init_seg" will have
internal linkage.
2015-10-19 12:14:27 +02:00
Stefan Weil
ad7eb5630e Fix format strings and unneeded assignment
The static code analyzer cppcheck warns about unsigned integers
which use "%d" in the format string.

It also warns about an unneeded assignment.

Fix both issues.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-10-18 19:52:57 +02:00
Matthieu Darbois
4831badeb4 Merge pull request #637 from stweil/fixes
Fix repository for JPEG2000 test data
2015-10-18 14:42:58 +02:00
mayeut
80be580d50 Merge branch 'master' into coc-qcc 2015-10-18 03:23:38 +02:00
Matthieu Darbois
05b3afd28f Merge pull request #636 from uclouvain/opj_malloc-625
Update allocation functions
Fix #625 
Fix #624
Fix #635
2015-10-18 03:14:55 +02:00
mayeut
e1122a8f50 Cleanup includes 2015-10-18 02:52:33 +02:00
mayeut
f9d47e28b9 Fix _aligned_malloc usage 2015-10-18 02:23:01 +02:00
mayeut
8034ffde8b Fix inconsistent behavior of malloc(0)
Update #635
Update #625
2015-10-17 02:55:09 +02:00
mayeut
b3a15954f6 Add missing checks. Fix crash on failed allocation. 2015-10-17 02:16:17 +02:00
mayeut
83249c318f Fixed crash on encoding
Update #624
Update #625
2015-10-17 01:30:23 +02:00
Matthieu Darbois
b1a8e1adcb Change link for appveyor 2015-10-15 23:31:42 +02:00
Matthieu Darbois
ee04854e1a Merge pull request #634 from smuehlst/opj_aix_issue_633
Fix  #633.
2015-10-15 13:14:58 +02:00
Stephan Mühlstrasser
b3c581760f Fix OpenJPEG GitHub issue #633.
"opj_includes.h" must be included before system headers, otherwise
inconsistent definitions of configuration macros lead to build
failures on AIX.
2015-10-15 10:53:33 +02:00
Matthieu Darbois
bd3959dc77 Merge pull request #632 from mayeut/travis-reduce
travis-ci: Include add ons in matrix
2015-10-15 01:18:17 +02:00
mayeut
fd424cfb66 travis-ci: Include add ons in matrix 2015-10-15 00:58:58 +02:00
mayeut
e734f0522a Remove useless environment variables 2015-10-15 00:17:05 +02:00
mayeut
9729405a8f Add ABI check for PR 2015-10-14 22:43:39 +02:00
Matthieu Darbois
65f78eaa73 Use SPDX full name & identifier for license 2015-10-13 23:54:18 +02:00
Matthieu Darbois
08238dbed6 Add appveyor status badge & license badge 2015-10-13 23:24:10 +02:00
mayeut
c8d03fea9b Merge branch 'master' into coc-qcc 2015-10-13 21:57:58 +02:00
mayeut
6721f8a53f Correct unbound variable 2015-10-13 21:37:11 +02:00
Matthieu Darbois
54a5860ee2 Merge pull request #627 from mayeut/appveyor
Add Appveyor
2015-10-13 21:27:01 +02:00
Mathieu Malaterre
372fead0d7 Remove the explicit restrict keyword
It would trigger a compiler error on xlc compiler.  Fixes #620
2015-10-13 21:07:11 +02:00
Giuseppe Baruffa
98324bbd6b I do not recall exactly... I would say that the correct version should be
if (!JPWL_ASSUME)
    return false;

meaning that once JPWL_ASSUME=1 the code will pass over such errors and try to decode anyway (just paired with the other JPWL_ASSUME on line 1112).

Fixes #596
2015-10-13 15:20:54 +02:00
mayeut
522d13af2a Update ci install script 2015-10-12 21:29:16 +02:00
Mathieu Malaterre
26dcb7c125 Remove a possible uninitialized variable
Fixes #629
2015-10-12 21:29:12 +02:00
Mathieu Malaterre
51a67a9cbf Minor style fix to remove c++ comments 2015-10-12 21:25:53 +02:00
Mathieu Malaterre
dd81b5892d minor tweaks to the code 2015-10-12 21:24:10 +02:00
mayeut
0cd240e2e3 Add appveyor.yml 2015-10-11 17:59:54 +02:00
mayeut
dac03fd168 Add exceptions 2015-10-11 17:33:40 +02:00
mayeut
d02bf257a6 Find out Visual Studio version 2015-10-11 17:10:48 +02:00
mayeut
0f1b1c63b4 Add exceptions 2015-10-11 13:47:44 +02:00
mayeut
11a27e6d20 Correct exceptions 2015-10-10 23:43:50 +02:00
Mathieu Malaterre
ab8929262a Fix an issue with parenthesis 2015-10-10 21:03:44 +02:00
mayeut
813121e688 Add exceptions 2015-10-10 20:01:03 +02:00
mayeut
7a7901cd6d Correct script 2015-10-10 19:29:53 +02:00
mayeut
c5a8732b0e Update kdu copy 2015-10-10 19:26:42 +02:00
mayeut
101a0034e2 Re-enable cloning data 2015-10-10 19:20:50 +02:00
mayeut
2c8ba10cc9 update script 2015-10-10 19:15:52 +02:00
mayeut
30a0180d84 correct kdu copy 2015-10-10 19:02:35 +02:00
mayeut
99c4376aed kdb copy 2015-10-10 18:58:26 +02:00
mayeut
c3493063b9 correct OPJ_SITE 2015-10-10 18:45:58 +02:00
mayeut
4042210416 run with appveyor 2015-10-10 18:39:59 +02:00
Mathieu Malaterre
dc869c2985 Add paranoid sentinels 2015-10-10 18:38:08 +02:00
mayeut
caeb91121a export updated path 2015-10-10 18:34:21 +02:00
mayeut
891e7c298a debug appveyor 2015-10-10 18:29:37 +02:00
mayeut
d60937922f correct warnings 2015-10-10 18:24:57 +02:00
mayeut
229d9cdb9c export TRAVIS_OS_NAME 2015-10-10 18:21:42 +02:00
mayeut
f0a980ec16 verbose 2015-10-10 18:19:09 +02:00
mayeut
cc9bf1d557 Use make under windows 2015-10-10 18:15:28 +02:00
mayeut
a01f7cdee0 debug appveyor 2015-10-10 18:01:43 +02:00
Mathieu Malaterre
d753441028 implement a portable aligned realloc 2015-10-10 17:51:29 +02:00
mayeut
53d7f70c15 remove cygwin specifics 2015-10-10 17:51:13 +02:00
mayeut
70a16d80d9 Debug build 2015-10-10 17:31:04 +02:00
mayeut
4560d270e0 Correct make script 2015-10-10 17:27:49 +02:00
mayeut
f33f50126c Add OPJ_BINARY_DIR 2015-10-10 17:25:50 +02:00
mayeut
8d2019ae73 Correct source path 2015-10-10 17:16:25 +02:00
mayeut
cf6db1641a get proper path 2015-10-10 17:12:05 +02:00
mayeut
9df5546838 Change OS guessing 2015-10-10 17:05:11 +02:00
mayeut
b816ac185b change os guessing 2015-10-10 16:50:30 +02:00
mayeut
d92c2b2117 Run under appveyor 2015-10-10 16:44:07 +02:00
mayeut
d035952c52 jpylyzer download 2015-10-10 15:18:12 +02:00
mayeut
1ed6ede703 Debug wget jpylyzer 2015-10-10 15:14:16 +02:00
mayeut
d03c4770cb Continue debugging wget jpylyzer 2015-10-10 15:08:25 +02:00
mayeut
50b561e911 Debug wget jpylyzer on appveyor 2015-10-10 14:57:25 +02:00
Mathieu Malaterre
2d410fc74b do not use aligned_alloc since it requires c11 2015-10-10 14:54:21 +02:00
mayeut
d5c460fc5f Download jpylyzer for windows 2015-10-10 14:51:30 +02:00
mayeut
62006e2b26 which provided by git, try wget 2015-10-10 14:30:15 +02:00
mayeut
d05b19072d Add appveyor support 2015-10-10 14:19:57 +02:00
mayeut
32ac092dec Disable ABI check. Keep API check. 2015-10-10 00:23:54 +02:00
mayeut
27102f0b06 Update ABI tools 2015-10-09 23:51:54 +02:00
mayeut
87d44603a0 Update exception list for gcc 4.6.4 2015-10-09 23:19:23 +02:00
mayeut
74f71ec923 Use matrix 2015-10-09 23:00:06 +02:00
mayeut
5c3632b00e Remove travis debugging 2015-10-09 22:24:51 +02:00
mayeut
a4eade843f disable output for diff build 2015-10-09 22:23:32 +02:00
mayeut
cba89a62a1 Revert modification made to check incompatibility 2015-10-09 22:20:16 +02:00
mayeut
4123c0ba86 Merge branch 'master' into travis-abi 2015-10-09 22:16:37 +02:00
mayeut
1a9cb9aef7 Use gcc-4.8 for ABI tracker 2015-10-09 22:09:50 +02:00
Mathieu Malaterre
0dc4914b4e cleanup header file and move to implementation 2015-10-09 22:04:04 +02:00
mayeut
e224dee4b8 travis debugging 2015-10-09 21:52:39 +02:00
mayeut
d2ddf006a6 retrieve & compile wdiff 2015-10-09 21:48:33 +02:00
mayeut
a7ae153a46 ABI Check 2015-10-09 21:20:54 +02:00
mayeut
de0a9ed103 Revert "Make sure to allocate on 16bits alignement. Fix issue #624"
This reverts commit 553714a87a92930dd69f5762e0615c12dfcbd873.
2015-10-09 21:13:06 +02:00
Mathieu Malaterre
553714a87a Make sure to allocate on 16bits alignement. Fix issue #624 2015-10-09 15:37:09 +02:00
mayeut
1b2ebfc69a Add ABI tracker 2015-10-08 20:06:59 +02:00
mayeut
3259fe2ff8 Merge branch 'master' into coc-qcc 2015-10-08 19:11:52 +02:00
Matthieu Darbois
bbef2a9da3 Merge pull request #584 from mayeut/travis-matrix
Add Travis-ci build matrix
2015-10-08 19:04:24 +02:00
mayeut
5b6ff103bd Merge branch 'master' into travis-matrix 2015-10-07 21:14:38 +02:00
mayeut
c86827952f Merge remote-tracking branch 'uclouvain/master' 2015-10-07 21:07:24 +02:00
Matthieu Darbois
9b437b0c6a Merge pull request #623 from stweil/c++
Fix warnings for C++
2015-10-07 21:05:25 +02:00
Stefan Weil
c8ae3c5225 Fix warnings for C++
g++ complains about invalid conversions like these ones:

error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
error: invalid conversion from ‘void*’ to ‘opj_precision* {aka opj_prec*}’ [-fpermissive]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-10-07 20:53:57 +02:00
Matthieu Darbois
07f65540b5 Merge pull request #622 from smuehlst/opj_enum_bit_flags
Fixed problem that C++ compilation failed because of enum variable.
Fixes  #619
2015-10-07 20:44:05 +02:00
Stephan Mühlstrasser
8414870ca7 Fixed problem that C++ compilation failed because of enum variable.
Replaced usage of an enum typedef for a variable that is used
for bit flags with OPJ_UINT32 type.
2015-10-07 12:28:12 +02:00
mayeut
2dab5fed59 Merge branch 'master' into coc-qcc 2015-10-06 20:55:36 +02:00
mayeut
26b2728c49 Merge branch 'master' into travis-matrix 2015-10-06 20:54:16 +02:00
mayeut
e526d435cc Merge remote-tracking branch 'uclouvain/master' 2015-10-06 20:48:37 +02:00
Matthieu Darbois
f8c8222660 Merge pull request #618 from smuehlst/opj_malloc_casts
Added missing casts for return values of opj_malloc()/opj_calloc().
2015-10-06 16:24:20 +02:00
Stephan Mühlstrasser
d6b51b7041 Added missing casts for return values of opj_malloc()/opj_calloc(). 2015-10-06 15:33:46 +02:00
mayeut
987f96004f Merge branch 'master' into travis-matrix 2015-10-05 21:50:59 +02:00
mayeut
0b6a592372 Merge remote-tracking branch 'uclouvain/master' 2015-10-05 21:49:39 +02:00
Matthieu Darbois
83c9e0b1f2 Merge pull request #617 from mayeut/tpsot-tnsot-noseek
Add check for seek support before trying TPsot==TNsot workaround
2015-10-05 11:45:56 +02:00
mayeut
db23831d57 Add check for seek support before trying TPsot==TNsot workaround 2015-10-02 22:33:44 +02:00
Stefan Weil
0cfe2ca4a9 Fix repository for JPEG2000 test data
The data is now maintained in a git repository on Github.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-09-29 15:28:43 +02:00
mayeut
cf352af089 Fix up-scaling bit depth
Fixes #609
2015-09-29 09:28:34 +02:00
Matthieu Darbois
c59f464a3f Merge pull request #610 from stweil/master
Fix some typos found by codespell
2015-09-29 08:24:43 +02:00
Stefan Weil
05235963d9 Fix typo in variable name
This makes checks with codespell easier.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-09-29 05:57:09 +02:00
Stefan Weil
99fc1ab306 Fix typos in comments and string
Most typos were found by codespell.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-09-29 05:55:43 +02:00
mayeut
f7dbcf1512 Merge branch 'master' into travis-matrix 2015-09-25 22:27:56 +02:00
mayeut
838dfb8058 Provide safer string copy than strncpy
As per @boxerab suggestion in commit
b9ca882749597e4943e609daba1d3c27694fe2ff
2015-09-25 22:04:58 +02:00
mayeut
4da7e9617f Fix resource leak 2015-09-25 00:39:05 +02:00
mayeut
b9ca882749 Fix resource leaks & unchecked resource allocations 2015-09-25 00:08:34 +02:00
mayeut
f9df8ba19a Fix some resource leaks 2015-09-24 23:32:03 +02:00
mayeut
09c35dcb84 Merge branch 'master' into travis-matrix 2015-09-23 21:20:11 +02:00
mayeut
f82d7f3a63 Use buffer on stack to read TGA header
Fixes a potential leak
Fixes #601
2015-09-23 21:17:06 +02:00
mayeut
faf63fddad Fix warning in rle4 decoding 2015-09-23 21:09:19 +02:00
Matthieu Darbois
281537851b Add Coverity Scan status 2015-09-17 14:24:06 +02:00
mayeut
55dbf8acff Fix resource leak in opj_j2k_create_cstr_index
Fixes #599
2015-09-17 12:46:42 +02:00
mayeut
c16c91797f Fix resource leak in opj_j2k_encode
Fixes #598
2015-09-17 12:41:41 +02:00
mayeut
a4e93c3b0a fix resource leak in opj_j2k_decode_one_tile
Fixes #597
2015-09-17 12:31:18 +02:00
mayeut
4bb5e24d23 Merge branch 'master' into coc-qcc 2015-09-17 02:12:27 +02:00
Mathieu Malaterre
6cb56b36f6 Update opj_decompress man page 2015-09-16 20:54:34 +02:00
Mathieu Malaterre
9c911c0e1e Update the version number 2015-09-16 20:49:45 +02:00
mayeut
3ea4486bed Travis-ci update
Correct case in config
Check DynamicAnalysis result
2015-09-14 20:09:50 +02:00
mayeut
6e11b55441 Travis-ci add linux gcc x86_64 Debug 2015-09-14 19:37:56 +02:00
mayeut
c6b2fdf572 correct MemCheck log filename 2015-09-13 16:34:17 +02:00
mayeut
700f8cb4f8 Ignore ctest return code
ctest behavior is not consistent across versions.
Ignore return code & parse logs
2015-09-13 16:09:24 +02:00
mayeut
7d32f11a6f Merge branch 'master' into travis-matrix 2015-09-13 14:58:01 +02:00
Matthieu Darbois
b4e8a425ae Merge pull request #590 from mayeut/master
Correct leak in color_cielab_to_rgb
2015-09-13 14:55:13 +02:00
mayeut
c8a3117659 Fix function name 2015-09-13 14:51:00 +02:00
mayeut
49cbc11a19 Correct leak in color_cielab_to_rgb 2015-09-13 14:42:56 +02:00
mayeut
3d295431e6 Travis set ASan build to -O1 2015-09-12 20:21:52 +02:00
mayeut
c08bd89739 Travis fix error when no tests are done 2015-09-12 20:06:31 +02:00
mayeut
1621df453d Travis error on new failures 2015-09-12 19:32:05 +02:00
mayeut
0b611c5250 Travis full matrix 2015-09-12 18:21:25 +02:00
mayeut
b8ba5a8357 Travis mingw 2015-09-12 18:12:38 +02:00
mayeut
9add0fe298 Travis mingw 2015-09-12 18:10:38 +02:00
mayeut
ecb00ea4e4 Travis mingw 2015-09-12 18:06:31 +02:00
mayeut
cde7423958 Travis add mingw 2015-09-12 17:56:29 +02:00
mayeut
6c157b60f2 Fix Travis ASan build 2015-09-12 16:37:47 +02:00
mayeut
fc131a1339 Travis ASan build 2015-09-12 16:36:19 +02:00
mayeut
4f157f3cf0 Fix matrix for debug build 2015-09-12 16:16:19 +02:00
mayeut
41730e8cc6 Travis add debug config 2015-09-12 16:11:56 +02:00
mayeut
82c238f504 Fix OPJ_CI_SKIP_TESTS 2015-09-12 15:52:13 +02:00
mayeut
52c36b4955 Add 32 bit build 2015-09-12 15:48:23 +02:00
mayeut
b7069ce2b2 Download kakadu on osx 2015-09-12 13:03:50 +02:00
mayeut
cc2ae75450 Fix build with gcc 4.6.3 2015-09-12 05:50:57 +02:00
mayeut
b97aadcf3e Fix travis build with make 2.8.7 2015-09-12 05:44:52 +02:00
mayeut
1e2dcaf7b3 Add ctest script 2015-09-12 05:26:19 +02:00
mayeut
175eceb020 Fix matrix 2015-09-12 03:19:42 +02:00
mayeut
7981908754 Fix unbound variable 2015-09-12 03:13:45 +02:00
mayeut
9258f8f6a7 Use make to unzip kakadu 2015-09-12 03:02:42 +02:00
mayeut
41a96aee5a Fix fetching of openjpeg-data
Fetch from master branch if TRAVIS_BRANCH doesn’t exist
2015-09-12 02:59:49 +02:00
mayeut
897d2c0b75 Enhance travis run script 2015-09-12 02:34:14 +02:00
mayeut
e3579b6c1d Revert "Setup travis matrix"
This reverts commit 8d46ac19ff34bd1ac1c23cf2acba0951c1c69459.
2015-09-12 02:20:22 +02:00
mayeut
8d46ac19ff Setup travis matrix
This is just to get some ideas of what can be done.
Update uclouvain/openjpeg#581
2015-09-12 02:19:28 +02:00
Matthieu Darbois
4b02d246a4 Merge pull request #578 from mayeut/travis-ci
Travis-ci update, use Kakadu for testing
2015-09-11 21:36:07 +02:00
mayeut
47b7b2787b Echo Kakadu copyright notice
Move to script so that travis-ci doesn’t hide this by default
2015-09-11 21:25:45 +02:00
mayeut
c31a28fcd1 Echo Kakadu copyright notice 2015-09-11 21:21:22 +02:00
mayeut
cd10f46572 Echo Kakadu copyright notice 2015-09-11 21:15:17 +02:00
mayeut
29ce132df4 Echo Kakadu copyright notice 2015-09-11 21:04:49 +02:00
Matthieu Darbois
5d953558de Merge pull request #579 from mayeut/lossless
Correct lossless issue on linux x86
Fix #571
2015-09-11 14:39:43 +02:00
Matthieu Darbois
bac2c9e0a3 Change test in opj_tcd_makelayer
Remove float equality test. Such a test has no meaning.
2015-09-11 14:17:30 +02:00
Matthieu Darbois
ee0f313848 Update check in opj_tcd_makelayer to be robust to different float precisions 2015-09-10 15:46:51 +02:00
Matthieu Darbois
ccdce606f1 Fix threshold calculation
It doesn't change the outcome of the test suite, that's weird...
2015-09-10 15:10:14 +02:00
mayeut
d7d9f84707 Remove invalid assert in compare_images 2015-09-10 08:04:59 +02:00
mayeut
4cde646cd7 Add test for uclouvain/openjpeg#571 2015-09-10 01:24:46 +02:00
mayeut
5f02757eef Correct lossless issue on linux x86
Update uclouvain/openjpeg#571
2015-09-10 00:39:23 +02:00
mayeut
4f5ec07c31 Remove C++ comment 2015-09-09 23:38:46 +02:00
mayeut
0a27667878 Add notice for kakadu use 2015-09-09 21:35:50 +02:00
mayeut
66d890bf22 Merge remote-tracking branch 'uclouvain/master' into coc-qcc 2015-09-08 22:33:07 +02:00
mayeut
dd00120e96 Add Kakadu tests 2015-09-08 22:24:06 +02:00
mayeut
e71247bb90 correct untar of jpylyzer 2015-09-08 01:50:18 +02:00
mayeut
a024980007 Add jpylyzer tests 2015-09-08 01:47:26 +02:00
mayeut
dc46d267f0 Add build results to CDash 2015-09-08 01:19:44 +02:00
mayeut
c32809d464 Submit test results to CDash 2015-09-08 00:32:20 +02:00
mayeut
5be56d582c Set tests succeed for now 2015-09-07 23:31:28 +02:00
mayeut
bd291ae5a8 Add tests when running travis-ci 2015-09-07 23:19:40 +02:00
mayeut
f1ba09f690 Add tests when running travis-ci 2015-09-07 23:16:48 +02:00
mayeut
4eabbc8661 Add travis-ci build status 2015-09-07 22:47:32 +02:00
mayeut
e4be47279d Add travis-ci script 2015-09-07 22:40:11 +02:00
mayeut
29c644ec49 Correct mismatching delete
Fixes #575
2015-09-07 19:24:20 +02:00
mayeut
940100c28a Fix potential use-after-free in opj_j2k_write_mco function
Fixes #563
2015-09-06 17:24:03 +02:00
mayeut
c31fb68ccc fix resource leak in jpwl
Fixes #573
2015-09-06 17:18:37 +02:00
Matthieu Darbois
15d07f33d1 Merge pull request #572 from mayeut/master
Correct CMake version requirements
2015-09-01 20:53:25 +02:00
mayeut
c5dd6035c9 Correct CMake version requirements
Update uclouvain/openjpeg#488
2015-09-01 20:43:43 +02:00
mayeut
2eb97a851d Update tests 2015-08-23 12:32:21 +02:00
mayeut
8a95efcd3f Fix some UBSan warnings 2015-08-23 11:43:38 +02:00
mayeut
38770403d4 Fix some calculations in opj_tcd_init_tile
Fixes #486
Fixes #394
Update #480
Update #388
2015-08-23 11:38:04 +02:00
Matthieu Darbois
589cc547b9 Merge pull request #567 from mayeut/master
Add tests for CMYK/esYCC/CIELab
2015-08-21 21:44:05 +02:00
mayeut
a521472427 Add tests for CMYK/esYCC/CIELab 2015-08-21 21:41:50 +02:00
mayeut
d4ac2f613d Fix formatting 2015-08-21 20:17:55 +02:00
mayeut
fa9142b7e4 Fix formatting 2015-08-21 20:15:50 +02:00
mayeut
f98df1c715 TIFF can output CMYK 2015-08-21 19:54:22 +02:00
Matthieu Darbois
3109759fd7 Merge pull request #559 from szukw000/cmyk-cielab-esycc
Add support for CIELab, EYCC and CMYK
2015-08-21 19:48:31 +02:00
mayeut
0a4ac0852a Merge remote-tracking branch 'uclouvain/master' into coc-qcc 2015-07-31 01:50:55 +02:00
mayeut
dc34a6cc8c Add test for #388 2015-07-31 01:48:51 +02:00
szukw000
238f4419ab Defines three new functions
Declares three new functions
Calls the three new functions
Collects data for CIELab, sets the color_space for EYCC and CMYK
2015-07-30 23:31:12 +00:00
mayeut
60301842c7 Sync coc-qcc branch with master 2015-07-31 01:07:14 +02:00
ak-dxdy
acbb297a0a Small correction + attempt to understand git-openjpeg workflow 2015-07-31 00:51:31 +02:00
ak-dxdy
4fc1073809 French comments replaced by English ones 2015-07-31 00:51:08 +02:00
Matthieu Darbois
7c688c3453 Merge pull request #558 from mayeut/remove-printf
Remove printf/fprintf to stdout/stderr throughout openjp2 lib
2015-07-30 23:37:20 +02:00
mayeut
372c887aad Fix typo (that brakes building with '-DBUILD_MJ2:bool=on')
Fixes #556
2015-07-30 23:34:12 +02:00
mayeut
0df90afdf7 Remove printf/fprintf to stdout/stderr throughout openjp2 lib
Update uclouvain/openjpeg#246
2015-07-30 23:26:31 +02:00
Matthieu Darbois
75a33de3bc Merge pull request #552 from mayeut/jpylyzer
Add jpylyzer tests for JP2 compression
2015-07-30 18:13:15 +02:00
Matthieu Darbois
f026c0541e Merge pull request #555 from rdieter/master
better -ffast-math handling
2015-07-30 18:09:42 +02:00
Rex Dieter
e4735c703d better -ffast-math handling
issue #488

See also
http://public.kitware.com/pipermail/cmake/2015-April/060479.html
2015-07-30 09:54:07 -05:00
mayeut
ae7953849b Add jpylyzer tests for JP2 compression
Unify syntax
2015-07-30 01:33:04 +02:00
mayeut
1947323329 Add jpylyzer tests for JP2 compression 2015-07-30 01:27:34 +02:00
mayeut
c3d9719cd4 Write COC/QCC in Main Header
Update uclouvain/openjpeg#459
2015-07-29 00:29:49 +02:00
mayeut
2263b6bacc Start support for qcc/coc 2015-07-28 23:58:10 +02:00
Matthieu Darbois
5b66156be4 Merge pull request #550 from mayeut/msvc-emul
Use __emul under msvc x86 for fast 64 = 32 * 32
2015-07-27 20:14:18 +02:00
mayeut
b0035538af Use __emul under msvc x86 for fast 64 = 32 * 32
Update uclouvain/openjpeg#220
2015-07-27 20:12:48 +02:00
mayeut
45ccf501f0 Fix ARM build with Visual Studio 2015-07-26 21:12:36 +02:00
mayeut
15e4168ee2 Remove some warnings when building
Update #442
2015-07-26 19:19:31 +02:00
mayeut
2452bb7c45 Remove some warnings when building
Update #442
2015-07-26 19:01:52 +02:00
mayeut
85904a3291 Fix libtiff build with Visual Studio 2010 2015-07-26 18:49:23 +02:00
Matthieu Darbois
012f22958a Merge pull request #549 from mayeut/master
Update convert for PNG output
2015-07-26 18:29:30 +02:00
mayeut
f3dad25c77 Update convert for PNG output
Update uclouvain/openjpeg#264
2015-07-26 18:28:03 +02:00
mayeut
e6cf1744d4 Remove some warnings when building
Update #442
2015-07-26 13:41:59 +02:00
Matthieu Darbois
db9b3400e5 Merge pull request #548 from mayeut/master
Remove some warnings when building
2015-07-26 02:42:41 +02:00
mayeut
c423cc84e7 Remove some warnings when building
Update #442
2015-07-26 02:41:39 +02:00
Matthieu Darbois
d87de3a88d Merge pull request #547 from mayeut/libpng-1.6.17
Switch to libpng-1.6.17
2015-07-25 20:33:36 +02:00
mayeut
6007ac5c56 Switch to libpng-1.6.17 2015-07-25 19:48:21 +02:00
Matthieu Darbois
335e972554 Merge pull request #528 from mayeut/zlib-1.2.8
Update zlib to version 1.2.8
2015-07-25 19:00:51 +02:00
Matthieu Darbois
8c4afeff40 Merge pull request #521 from manisandro/bigendian
Fix opj_write_bytes_BE
Fixes #472 
Fixes #345 
Fixes #518
2015-07-25 15:54:26 +02:00
mayeut
ffd9db9700 Remove some warnings when building
Update #442
2015-07-25 03:16:16 +02:00
mayeut
b190a91ab5 Remove some warnings when building
Update #442
2015-07-24 23:55:45 +02:00
Matthieu Darbois
f6843d5511 Merge pull request #545 from mayeut/master
Add some missing static keywords
2015-07-23 07:49:58 +02:00
mayeut
a56819eaab Add some missing static keywords
Update uclouvain/openjpeg#243
2015-07-23 07:48:42 +02:00
Matthieu Darbois
d6f2d26430 Merge pull request #543 from mayeut/master
Prevent overflow when coding 16 bits images
2015-07-22 00:19:38 +02:00
mayeut
9ac3a1572e Prevent overflow when coding 16 bits images
Update uclouvain/openjpeg#539
2015-07-22 00:10:32 +02:00
Matthieu Darbois
0905cab40a Merge pull request #542 from mayeut/lcms2-2.6
Switch to libcms2-2.6
2015-07-22 00:03:44 +02:00
mayeut
2fc9d4956a Switch to libcms2-2.6 2015-07-21 23:49:11 +02:00
Matthieu Darbois
28c6f54798 Merge pull request #533 from mayeut/refactor-read-ppX
Refactor opj_j2k_read_ppm & opj_j2k_read_ppt
Fixes uclouvain/openjpeg#470
Fixes uclouvain/openjpeg#288
Fixes uclouvain/openjpeg#532
2015-07-21 01:26:02 +02:00
Matthieu Darbois
2c7dab7655 Merge pull request #534 from mayeut/issue-235
Add checks for odd looking cmap & for cmap outside jp2h box
2015-07-21 00:47:23 +02:00
mayeut
96ae1b8dfc Add test for odd looking cmap & for cmap outside jp2h
Update uclouvain/openjpeg#235
2015-07-21 00:46:55 +02:00
mayeut
1bbb607069 Merge remote-tracking branch 'uclouvain/master' into issue-235 2015-07-21 00:20:05 +02:00
Matthieu Darbois
fd1f7cf297 Merge pull request #538 from mayeut/master
Update PNG support
Fixes #536
2015-07-19 17:48:46 +02:00
mayeut
5bb074611a Update PNG support
Only input modified for now
Update uclouvain/openjpeg#536
Update uclouvain/openjpeg#264
2015-07-19 17:42:11 +02:00
mayeut
46c1dd22fc Correct error message for invalid TIFF input 2015-07-19 15:01:12 +02:00
Matthieu Darbois
06f6911d7b Merge pull request #537 from mayeut/master
Various Minor fixes
2015-07-18 21:46:59 +02:00
mayeut
ae4799ad07 Add some missing static
Still needs to check j2k.c & jp2.c
Update uclouvain/openjpeg#243
2015-07-18 02:39:32 +02:00
mayeut
b88025b38f Add headers to CMake target 2015-07-18 01:50:17 +02:00
Matthieu Darbois
b59085db0c Merge pull request #535 from mayeut/converttif
Update TIFF conversion to support more bit depth.
2015-07-18 00:33:02 +02:00
mayeut
8048bbc7a2 Add tests for TIFF input with Alpha channel
Update uclouvain/openjpeg#322
2015-07-18 00:07:04 +02:00
mayeut
d1591be3d7 Add tests for TIFF output
Update uclouvain/openjpeg#322
2015-07-17 23:22:40 +02:00
mayeut
6b7ad74e26 Add tests for TIFF input
Update uclouvain/openjpeg#322
2015-07-16 23:20:50 +02:00
mayeut
635a358962 Fix build warnings in converttif.c 2015-07-16 06:51:21 +02:00
mayeut
8f798864a9 Update imagetotif to support more output TIF formats
Update uclouvain/openjpeg#322
Update uclouvain/openjpeg#264
2015-07-16 00:26:02 +02:00
mayeut
ac9fb5a302 Update tiftoimage to support more input TIF formats
Update uclouvain/openjpeg#322
Update uclouvain/openjpeg#264
2015-07-14 23:51:02 +02:00
mayeut
775ee87776 Add checks for odd looking cmap & for cmap outside jp2h box
Update uclouvain/openjpeg#235
Update uclouvain/openjpeg#447
2015-07-12 19:39:30 +02:00
mayeut
0b1f8eb6f7 Merge pull request #529 from renevanderark/master
fix Suspicious code in j2k.c
Fixes #517
2015-07-12 19:20:57 +02:00
mayeut
c887df12a3 Refactor opj_read_ppm
Update uclouvain/openjpeg#470
Update uclouvain/openjpeg#288
2015-07-12 18:09:30 +02:00
mayeut
d1b053afe2 Refactor opj_j2k_read_ppt
Update uclouvain/openjpeg#470
Update uclouvain/openjpeg#532
2015-07-12 15:55:58 +02:00
mayeut
5e1474cc92 Merge pull request #531 from mayeut/issue-289
Add option to force component splitting in imagetopnm
2015-07-11 11:42:58 +02:00
mayeut
dc43ebf96c Add option to force component splitting in imagetopnm
Update uclouvain/openjpeg#289
2015-07-11 11:35:21 +02:00
Antonin Descampe
a7060dae1c updated doxygen website references 2015-07-10 18:03:28 +02:00
Rene van der Ark
ba05549b0f fix Suspicious code in j2k.c #517 2015-07-08 11:13:31 +02:00
mayeut
fb0e397330 Update zlib to version 1.2.8 2015-07-04 18:45:06 +02:00
mayeut
35ddb3abc7 Fix CMake warning when testing for LFS
Update issue #442
2015-07-04 17:33:28 +02:00
mayeut
237ddd72f1 Merge pull request #514 from mayeut/issue-254
Correctly decode files with incorrect tile-part header fields (TPsot==TNsot)
Fixes uclouvain/openjpeg#254
2015-07-04 00:47:59 +02:00
mayeut
c999b6c0f0 uclouvain/openjpeg#254 Add build option to disable the fix 2015-07-04 00:04:55 +02:00
mayeut
4e0de649bd uclouvain/openjpeg#254 Update MD5 sums for tests 2015-07-03 23:25:14 +02:00
Aaron Boxer
6b0a8e3a0f upgraded to libtiff v4.0.4 2015-07-03 19:19:17 +02:00
Antonin Descampe
eadfad7a50 commented out printf line 2015-07-03 17:36:39 +02:00
Antonin Descampe
14361eee24 commented out a printf line 2015-07-03 16:35:16 +02:00
Aaron Boxer
c9e231508b various small T1 optimizations 2015-07-03 15:23:15 +02:00
Aaron Boxer
6347686385 fixed a few bugs 2015-07-03 15:22:58 +02:00
Aaron Boxer
1a8f929111 visual studio lrintf is very slow - do not use 2015-07-03 15:22:42 +02:00
Aaron Boxer
56d3f5af6e add timing to compress and decompress 2015-07-03 15:20:11 +02:00
Sandro Mani
c665e81a39 Fix opj_write_bytes_BE (#518) 2015-06-25 23:11:22 +02:00
Antonin Descampe
c6c49865fe Update README.md 2015-06-24 17:11:09 +02:00
Antonin Descampe
52d27be5c2 Update README.md 2015-06-17 14:24:25 +02:00
Antonin Descampe
6e0118231a Update README.md 2015-06-17 14:15:26 +02:00
Antonin Descampe
da3786d2d1 Merge pull request #510 from radarhere/patch-1
Fixed typos
2015-06-16 14:01:53 +02:00
Andrew Murray
8d770ece9a Fixed typos 2015-06-16 15:07:20 +10:00
Antonin Descampe
0a0cb190da Merge pull request #507 from htmfilho/master
Formatted the readme file
2015-06-15 09:56:50 +02:00
Hildeberto Mendonça
79b079bdc0 Update README.md 2015-06-13 15:39:03 +02:00
Hildeberto Mendonça
dbb67194b2 Formatted the readme file
Put the extension `md` to allow GitHub to identify the file and transform it to HTML, improving the presentation of the project. Formatted the file to markdown. Put links to references.
2015-06-13 15:33:37 +02:00
Hildeberto Mendonça
c255e0140c Update README.md 2015-06-13 15:24:45 +02:00
Hildeberto Mendonça
2bd6aa54d6 Update and rename README to README.md 2015-06-13 15:23:02 +02:00
mayeut
c7535d084e Merge branch 'master' into issue-254 2015-06-05 20:42:57 +02:00
Matthieu Darbois
c0d7afe15c [trunk] Fix offset computations in opj_j2k_update_image_data
Update issue 481
2015-06-03 20:56:13 +00:00
Matthieu Darbois
6def7e38b4 [trunk] Fix wrong return value for opj_setup_encoder & opj_set_decoded_resolution_factor (fixes issue 497)
Thanks Aaron.
2015-05-29 21:58:08 +00:00
Matthieu Darbois
73881d0e52 [trunk] Fix sscanf format specifier (fixes issue 494)
Thanks Aaron.
2015-05-28 22:16:49 +00:00
Matthieu Darbois
e3291c4e1f [trunk] Fix overflow in opj_image_comp_header_update (fixes issue 495) 2015-05-27 23:05:16 +00:00
Matthieu Darbois
0fa5a17c98 [trunk] Correct potential double free on malloc failure in opj_j2k_copy_default_tcp_and_create_tcp (fixes issue 492) 2015-05-19 21:57:27 +00:00
Matthieu Darbois
757f9394bf [trunk] Add check for number of layers & cblkw/cblkh values (fixes issue 475) 2015-05-19 21:24:44 +00:00
Matthieu Darbois
daed8cc919 [trunk] Add check for at most 1 COD marker per tile. 1 COD marker for MH (fixes issue 476) 2015-05-19 20:13:37 +00:00
mayeut
d1a941ea50 Revert "Correct overflows in opj_j2k_update_image_data"
This reverts commit 1fb24aba4b29b7cd1b6880d8f0b08196a12efc2c.
2015-05-16 14:22:16 +02:00
mayeut
00a47c1e06 Implement TNsot correction for non conforming files 2015-05-16 11:15:29 +02:00
mayeut
1fb24aba4b Correct overflows in opj_j2k_update_image_data 2015-05-16 02:51:31 +02:00
Antonin Descampe
2d24b6000d [trunk] added overflow checks (fixes issue 431)
Thanks mdarbois
2015-02-02 16:11:31 +00:00
Antonin Descampe
8b5e2a5143 [trunk] fixes a bug that prevented opj_decompress to take directory as input (fixes issue 463)
Thanks Aaron.
2015-02-02 16:11:23 +00:00
Matthieu Darbois
3ed5858902 [trunk] use hidden visibility for static library (fixes issue 354) 2015-01-25 16:59:39 +00:00
Antonin Descampe
7a8cdc4bb0 [trunk] fixed a bug encoutntered when multiple MCT markers are provided
Update issue 430
Cc: savmickael@gmail.com
@Mickael: this revision affects your work on custom MCT. Is there a way
you could provide test data to add to our test suite ? Thanks
2015-01-20 16:29:16 +00:00
Antonin Descampe
4c0ed02806 [trunk] checks for JP2 signature and file type boxes more carefully
Update issue 430
2015-01-20 14:27:20 +00:00
Antonin Descampe
5d00b719f4 [trunk] fixed a buffer overflow in opj_tcd_init_decode_tile
Update issue 431
2015-01-15 18:16:29 +00:00
Matthieu Darbois
42132ed6b5 [trunk] removed warning from convertbmp.c
Update  issue 442
2014-12-27 11:31:43 +00:00
Matthieu Darbois
31f5efe453 [trunk] fixed typo in opj_decompress (fixes issue 465) 2014-12-26 15:37:16 +00:00
Matthieu Darbois
78a7762e3f [trunk] removed unnecessary operation in opj_bio_flush (fixes issue 461) 2014-12-23 16:05:19 +00:00
Matthieu Darbois
33f52fb611 [trunk] removed warning from convert.c
Update  issue 442
2014-12-23 16:03:45 +00:00
Matthieu Darbois
81abe5b3bb [trunk] fixed imagetoraw unsigned 16bits conversion (fixes issue 460) 2014-12-23 15:06:23 +00:00
Matthieu Darbois
4a09296771 [trunk] removed warning from convertbmp.c
Update  issue 442
2014-12-23 10:13:28 +00:00
Matthieu Darbois
6922124c4c [trunk] fixed colorspace mapping for raw grayscale images (fixes issue 456) 2014-12-22 18:39:14 +00:00
Matthieu Darbois
59b844347c [trunk] fixed component precision upscaling in opj_decompress (fixes issue 458) 2014-12-22 15:50:32 +00:00
Matthieu Darbois
bde5ba6ae8 [trunk] fixed compression check for 1 bit unsigned component (fixes issue 457) 2014-12-22 15:00:12 +00:00
Matthieu Darbois
16240e21f9 [trunk] updated BMP format input support
Update  issue 203
2014-12-22 14:40:31 +00:00
Matthieu Darbois
33a0e66eb1 [trunk] updated BMP format input support
Update  issue 203
2014-12-22 13:14:37 +00:00
Matthieu Darbois
f7ff08de5a [trunk] updated tests to get BMP RLE8 tested
Update  issue 203
2014-12-20 18:58:28 +00:00
Matthieu Darbois
f1bae45c76 [trunk] fixed BMP reading for 8bpp when width & 3 == 1
Update  issue 203
2014-12-20 18:45:53 +00:00
Matthieu Darbois
65c07b42e3 [trunk] updated tests
Update  issue 415
2014-12-20 15:08:55 +00:00
Matthieu Darbois
3888daac6a [trunk] fixed test issues (fixes issue 454) 2014-12-20 13:27:30 +00:00
Matthieu Darbois
e966fef3eb [trunk] fixed a possible overflow in opj_t1_encode_cblks call to opj_int_fix_mul (fixes issue 141) 2014-12-20 13:03:11 +00:00
Matthieu Darbois
a504edf724 [trunk] fixed return value for compare_raw_files (fixes issue 453) 2014-12-20 12:42:40 +00:00
Matthieu Darbois
dde788b59e [trunk] Updated checks regarding number of decomposition levels when compressing
Update  issue 215
2014-12-19 22:56:00 +00:00
Matthieu Darbois
58fc86452d [trunk] Fixed a crash on illegal tile offset when decoding
Update  issue 427
2014-12-18 22:56:38 +00:00
Matthieu Darbois
c0cb119c0e [trunk] Fixed a crash on 0xh or wx0 image size decoding
Update  issue 427
2014-12-18 22:19:52 +00:00
Matthieu Darbois
9a21e1eef0 [trunk] removed warnings when building tcd.c (Update issue 442) 2014-12-15 18:48:50 +00:00
Matthieu Darbois
a0688a9874 [trunk] Add SSE2/SSE41 implementations for mct.c (fixes issue 451) 2014-12-13 12:29:22 +00:00
Matthieu Darbois
d0ce2ced53 [trunk] Speed-up opj_int_fix_mul by removing unneeded operation
Update  issue 220
2014-12-13 10:27:21 +00:00
Matthieu Darbois
e05d2901ec [trunk] Reduce encoder code block memory usage for non 64x64 code block sizes (fixes issue 444) 2014-12-12 21:54:22 +00:00
Matthieu Darbois
c0710f557c [trunk] Fixed invalid check in in tiff reading method (fixes issue 449) 2014-12-11 20:21:26 +00:00
Matthieu Darbois
f095027329 [trunk] add test for compression using MCT with alpha channel
Update  issue 415
2014-12-09 19:45:12 +00:00
Antonin Descampe
8d320bbdf8 [trunk] check number of components when getting mct norm (fixes issue 436) 2014-12-09 12:09:08 +00:00
Matthieu Darbois
776b83ddbc [trunk] Fixed compilation error under Visual Studio 2003 (fixes issue 351) 2014-12-09 05:44:55 +00:00
Matthieu Darbois
04ace2a558 [trunk] Fixed typo in opj_compress error report (fixes issue 350) 2014-12-02 20:18:50 +00:00
Matthieu Darbois
46afb746f0 [trunk] removed warnings when configuring with CMake 3.x on MacOS (fixes issue 443) 2014-11-25 23:57:37 +00:00
Matthieu Darbois
570dd13f55 [trunk] removed some warnings when configuring with CMake 3.x on MacOS
Update  issue 443

Warnings related to OPJ_USE_DSYMUTIL are fixed
2014-11-25 21:52:24 +00:00
Matthieu Darbois
63f877769c [trunk] removed some warnings when building src/bin/jp2/convert.c
Update  issue 442
2014-11-25 20:06:12 +00:00
Matthieu Darbois
04c6bb4a72 [trunk] removed warnings when building jp2.c (Update issue 442) 2014-11-24 21:31:09 +00:00
Matthieu Darbois
131cc98491 [trunk] added an option to upsample image components in opj_decompress
Update  issue 289

Issue is left open since there's still one image failing the tests.
2014-11-22 17:59:07 +00:00
Matthieu Darbois
13bcb63b73 [trunk] fixed pnmtoimage for odd pgm files (fixes issue 294) 2014-11-22 14:09:16 +00:00
Matthieu Darbois
0ba5d15b58 [trunk] fixed warning in option to force rgb output in opj_decompress (fixes issue 282) 2014-11-22 12:30:04 +00:00
Matthieu Darbois
7e38446075 [trunk] added option to force rgb output in opj_decompress (fixes issue 282 , fixes issue 286) 2014-11-22 00:04:39 +00:00
Matthieu Darbois
548aff34f4 [trunk] added check for tile component data size overflow (fixes issue 432) 2014-11-21 21:35:43 +00:00
Matthieu Darbois
8397eac382 [trunk] added check for pclr box validity (fixes issue 429) 2014-11-20 23:47:09 +00:00
Matthieu Darbois
a2c2d86d3d [trunk] fixed memleak in abnormal condition (fixes issue 437) 2014-11-20 20:13:47 +00:00
Matthieu Darbois
3bc360fc9d [trunk] added option to force output bit depth in opj_decompress (fixes issue 283) 2014-11-19 20:05:39 +00:00
Matthieu Darbois
ae1da37558 [trunk] replace OPJ_MACRO_TCD_ALLOCATE macro by inlined function (fixes issue 433) 2014-11-19 19:08:09 +00:00
Matthieu Darbois
f57f59b10d [trunk] remove warning during build (fixes issue 435) 2014-11-18 18:30:44 +00:00
Matthieu Darbois
b65e3ebdb6 [trunk] fixed a bug leading to jpwl build failure & add related odd width/height sYCC tests (fixes issue 422) 2014-11-18 00:07:50 +00:00
Matthieu Darbois
50acc339c5 [data] added new non-regression tests from foxit
Update issue 415
Issue not closed as in the mean time there are other images to include
2014-11-17 22:02:38 +00:00
Matthieu Darbois
f123ce8f8a [trunk] fixed a bug preventing palette image with cdef to decode properly using opj_get_decoded_tile (fixes issue 428) 2014-11-17 21:46:43 +00:00
Antonin Descampe
c3629e37a2 [trunk] significantly reduces memory for single tile RGB encoding (fixes
issue 375)
2014-11-03 14:51:41 +00:00
Antonin Descampe
cf5153c518 [trunk] add a cdef box when alpha component is present (fixes issue 416) 2014-11-03 14:12:01 +00:00
Antonin Descampe
3b7dced8e6 [trunk] fixed a bug preventing palette image with cdef to decode properly (fixes issue 412) 2014-10-30 18:26:10 +00:00
Antonin Descampe
03a410e03d [trunk] fixed a bug that was preventing image with per channel alpha to decode properly (fixes issue 414) 2014-10-30 18:26:04 +00:00
Antonin Descampe
0a6eaaa605 [trunk] add a check on precinct size (fixes issue 420) 2014-10-30 18:00:45 +00:00
Antonin Descampe
7f8f284ee5 [trunk] prevent overflow in j2k.c
Update issue 392

Issue left open to solve problem on x64-Asan and to investigate Matthieu's suggestion
2014-10-30 11:53:06 +00:00
Antonin Descampe
09fb8b6989 [trunk] add Aaron Boxer as contributor 2014-10-22 23:01:04 +00:00
Antonin Descampe
9e6c62199a [trunk] re-arrange contributors alphabetically and add Matthieu Darbois 2014-10-22 22:59:35 +00:00
Antonin Descampe
d47f7a249d [trunk] workaround to make MD5 work under valgrind on MacOSX (fixes issue 410) 2014-10-22 22:52:01 +00:00
Antonin Descampe
7280263988 [trunk] Added new non-regression tests from foxit issues
Update issue 415
2014-10-22 22:38:55 +00:00
Antonin Descampe
3e1fad2da4 [trunk] resets resno_decoded for each tile (fixes issue 399) 2014-10-22 13:16:35 +00:00
Antonin Descampe
d72940c56b [trunk] resets code-blocks reused for other tiles than the first one (fixes issue 418) 2014-10-22 13:16:12 +00:00
Antonin Descampe
ad4fad0965 [trunk] add a check on mandatory headers in Main Header (fixes issue 408) 2014-10-22 10:30:35 +00:00
Antonin Descampe
aff9cb39ed [trunk] fixed invalid member values from opj_read_header or opj_decode (fixes issue 411) 2014-10-21 15:22:22 +00:00
Antonin Descampe
0a3f234df7 [trunk] verify channel definitions is complete when cdef is present (fixes issue 397) 2014-10-21 12:54:08 +00:00
Antonin Descampe
efb70af001 [trunk] add a check on the number of resolution passed to cmdline (fixes issue 352) 2014-10-21 12:47:48 +00:00
Antonin Descampe
e65303b903 [trunk] added check on JP2_IHDR box (fixes issue 364) 2014-10-21 12:35:16 +00:00
Antonin Descampe
413de4fbfa [trunk] add a check on Zppm value in PPM markers (fixes issue 393) 2014-10-21 12:27:58 +00:00
Antonin Descampe
984351f86f [trunk] Add option to call dsymutil on built binaries (fixes issue 409) 2014-10-15 10:24:49 +00:00
Antonin Descampe
f8796711e8 [trunk] add a check on progression order (fixes issue 413) 2014-10-15 10:14:54 +00:00
Antonin Descampe
0b540067b1 [trunk] add a check for illegal SCod value (fixes issue 400) 2014-10-15 08:48:19 +00:00
Antonin Descampe
3df347eded [trunk] additional checks for marker size inconsistency (fixes issue 363) 2014-10-14 15:15:09 +00:00
Antonin Descampe
eb7c6d295a [trunk] fixed potential negative size params (fixes issue 390) 2014-10-06 21:05:32 +00:00
Antonin Descampe
f126eb0d41 [trunk] added box length inconsistency check
Update issue 364

issue364-38.patch applied. Thanks Matthieu.
2014-10-06 21:05:27 +00:00
Antonin Descampe
7256e43c48 [trunk] fixed PDF crash in Chrome (fixes issue 362) 2014-10-06 21:05:21 +00:00
Antonin Descampe
a0a3af1dee [trunk] removed illegal character in comment 2014-10-03 19:52:20 +00:00
Antonin Descampe
48832d944f [trunk]fixes buffer overflow in t2.c
Update issue 390
Summary: check for negative-size params in code
Patch from Matthieu applied. Left open to apply this to other places in
code.
2014-10-03 10:15:28 +00:00
Antonin Descampe
06bd61b571 [trunk] c++-style comment removed (fixes issue 407) 2014-10-02 07:44:53 +00:00
Antonin Descampe
a1c754c737 [trunk] fixed warning from r2891 2014-10-01 12:11:43 +00:00
Antonin Descampe
fef1276901 [trunk] fixed bad use of case statement (fixes issue 381) 2014-09-30 12:19:13 +00:00
Antonin Descampe
45f33cdbd6 [trunk] check possible overflow on size in opj_t2_read_packet_data
Update issue 390
Labels: Priority-Critical
Should be rechecked with ASan and pdfium
2014-09-30 10:07:09 +00:00
Antonin Descampe
1acfa211ae [trunk] fixes heap-buffer-overflow in parse_cmdline_encoder
Fixes issue 403
Thanks Matthieu
2014-09-30 09:48:26 +00:00
Antonin Descampe
2f3fd1194e [trunk] prevent overflow in opj_t2_read_packet_header (update issue 389) 2014-09-30 09:26:44 +00:00
Antonin Descampe
f08af3ed82 [trunk] Ensure cblk->data pointer is correctly initialized (updates issue 391). Still need to check if it does not fail anymore with ASan. 2014-09-29 12:03:50 +00:00
Antonin Descampe
2720a1a405 [trunk] fixed tile numbering in output message (fixes issue 370) 2014-09-29 12:03:36 +00:00
Mathieu Malaterre
31fd8d3fe8 trunk: extend support for pdf2jp2 2014-09-19 15:48:48 +00:00
Antonin Descampe
6868ee373e added memory allocation checks (fixes issue 355) 2014-09-19 10:26:35 +00:00
Antonin Descampe
b9a247b559 fixes install name id on OSX builds (fixes issue 367) 2014-09-19 09:30:12 +00:00
Antonin Descampe
50a205d20f [trunk] improve memory management (fixes issue 359) 2014-09-16 15:48:04 +00:00
Antonin Descampe
b0072bf658 [trunk] allow compilation with MinGW32 (fixes issue 361) 2014-09-16 15:38:11 +00:00
Antonin Descampe
2c810567dd [trunk] Changed error to warning when no EOC found in codestream (fixes
issue 366)
2014-07-14 07:42:50 +00:00
Antonin Descampe
0a1a29a7fe [trunk] replaced malloc with opj_malloc. (Fixes issue 368). 2014-07-03 16:05:56 +00:00
Antonin Descampe
7d21871ed8 [trunk] fixes issue #357. MCT is automatically disabled when
subsamppling is detected.
2014-07-03 09:15:13 +00:00
Antonin Descampe
a38b97fae0 [trunk] moved comment marker setup from opj_compress to the library 2014-07-01 13:51:55 +00:00
Antonin Descampe
45313a8dfa [trunk] fixed warning in j2k.c about sign conversion 2014-04-28 09:38:44 +00:00
Mathieu Malaterre
b08135e7c1 [trunk] Finalize API for openjpeg 2.1
public header will only contains minimal information: major, minor and build version
Prefix has been changed from OPENJPEG to OPJ for consistency
SOVERSION has been removed from header (ABI vs API info)
OPJ_VERSION string has been removed, since it is accessible already (PACKAGE_VERSION)
Fixes issue 342
2014-04-28 09:17:31 +00:00
Mathieu Malaterre
4bac8488df [trunk] Properly handle failure to compress (remove file)
Fixes issue 323
2014-04-28 07:54:33 +00:00
Mathieu Malaterre
de04302c15 [trunk] Missing endianess setting
Fixes issue 337
2014-04-28 07:44:39 +00:00
Mathieu Malaterre
997758f91c [trunk] properly handle pkg-config on non-UNIX hosts
Fixes issue 340
2014-04-28 07:34:26 +00:00
Mathieu Malaterre
763214f7c0 [trunk] Provide #ifdef blockers for OpenJPEG Version
Fixes issue 342
2014-04-28 07:32:35 +00:00
Antonin Descampe
77e8dad503 [trunk] fixed typo in NEWS 2014-04-27 21:31:32 +00:00
Antonin Descampe
1758445a75 [trunk] updated NEWS for 2.1.0 2014-04-25 09:22:49 +00:00
Mathieu Malaterre
7a77a8047d [trunk] Make sure OpenJPIP compiles on WIN32 2014-04-24 11:24:56 +00:00
Antonin Descampe
d8767cbcb7 [trunk] fixed reference to opj_stream_set_user_data_v3 in jpip sources. 2014-04-24 08:51:29 +00:00
Antonin Descampe
7924d3a456 [trunk]removed '-x' option for index file as long as it's broken 2014-04-23 15:19:57 +00:00
Antonin Descampe
ec84bafcd8 [trunk]re-formatted help display in executables 2014-04-23 14:09:20 +00:00
Antonin Descampe
08c09b74cf [trunk]formatted some messages. Removed -version option to disambiguate
with -v(erbose) option, added version info in help display
2014-04-23 09:12:30 +00:00
Antonin Descampe
7aece5e8e7 [trunk]Replaced deprecated opj_stream_set_user_data function from API
with its 'v3' version, and removed all other 'v3' suffixes from API.
2014-04-23 07:46:11 +00:00
Antonin Descampe
8d93eae64a [trunk] fixed some warning and errors formatting and add a '-version'
option to opj_compress and opj_decompress binaries
2014-04-22 21:22:49 +00:00
Antonin Descampe
9a3d660d1b [trunk] fixed warning related to r2837 and move new field at the end of
parameters structure.
2014-04-17 09:54:38 +00:00
Antonin Descampe
7199d9b5d3 [trunk] refactoring of rsiz, profiles, and extensions management 2014-04-17 09:31:37 +00:00
Antonin Descampe
d19a4ab676 [trunk] updated copyright and added copyright notice required by ISO, in each file; updated AUTHORS, NEWS 2014-04-03 15:30:57 +00:00
Antonin Descampe
f105cb5471 [trunk] removed debug message in CMakeLists.txt 2014-04-02 16:37:07 +00:00
Antonin Descampe
4db4198722 [trunk] fixed a bug triggering SEGFAULT on debug mode (uninitialized
structure)
2014-04-02 16:25:40 +00:00
Mathieu Malaterre
616a3345c4 [trunk] Properly copy/paste code from the autotools
gcc correctly fails compiling this code, I needed to move the code outside the main function to get the error. This actually match the autotools (incorrect) code. We'll see how they fix this code in future release.
This make the code compatible with previous openjpeg version and remove C99 requirement.
Fixes issue 316
2014-03-27 15:07:58 +00:00
Mathieu Malaterre
1f8d84a562 [trunk] Make sure to use long long (this is not C89). However this should be ok on most compilers nowadays
Update issue 316
2014-03-26 16:20:13 +00:00
Antonin Descampe
a54d757a3e [trunk] fixed warnings triggered on linux related to r2802 2014-03-26 15:17:17 +00:00
Mathieu Malaterre
b5eb374fb9 [trunk] Run test suite on issue 316 dataset
Update issue 316
2014-03-26 15:16:24 +00:00
Antonin Descampe
f1d69068c7 [trunk] add ability in opj_compress to input subsampled images through
'-F' (aka raw option). Let the user input raw images with 444, 422, 420
(etc) subsampling. To be used in conjunction with '-mct 0' option to
compress subsampled YCC images.
2014-03-26 14:26:49 +00:00
Mathieu Malaterre
ee130e2306 [trunk] Add small utilities to extract JP2 files from PDF 2014-03-26 11:52:01 +00:00
Mathieu Malaterre
9ba6bc6042 [trunk] Make sure to test value not pointer
Update issue 302
2014-03-25 16:34:59 +00:00
Antonin Descampe
5e1a0fad08 [trunk] fixed bug related to r2791 2014-03-25 15:35:33 +00:00
Mathieu Malaterre
c05118dc49 [trunk] Add sentinel in case list empty.
I was getting a cmake error `list sub-command REMOVE_ITEM requires list to be present`
2014-03-25 15:29:19 +00:00
Mathieu Malaterre
1adf89d5d2 [trunk] Import change from 2.0 branch 2014-03-25 15:21:53 +00:00
Antonin Descampe
666f71b2a1 [trunk] fixed warning due induced by r2791 2014-03-25 13:29:11 +00:00
Antonin Descampe
2b7d5b18f3 [trunk] add "-mct {0,1,2}" option to opj_compress to allow MCT to be
disabled if needed.
2014-03-25 12:38:29 +00:00
Mathieu Malaterre
18d5d25cb6 [trunk] Make sure to not use alpha pointer if it is not an RGBA input
Fixes issue 310
2014-03-25 11:47:34 +00:00
Mathieu Malaterre
492d8ab7d9 [trunk] Rework previous commit r2610
This way we are able to gently deprecate the old API, and preserve ABI
Update issue 306
2014-03-25 10:23:40 +00:00
Mathieu Malaterre
2b93727bea [trunk] Add documentation 2014-03-25 10:22:40 +00:00
Mathieu Malaterre
18c5be69e9 [trunk] Make sure to exit early instead of looping on every single pixels 2014-03-24 16:01:51 +00:00
Mathieu Malaterre
5a70e97f51 [trunk] Fix typo in comment (this is not j2k_dump) 2014-03-24 09:49:04 +00:00
Mathieu Malaterre
f4707da97a [trunk] Revert r2764. It breaks ~230 tests as seen on continuous. Since no dataset is available, the issue 296 will be left open.
Update issue 296
2014-03-18 15:19:29 +00:00
Mathieu Malaterre
51ab074d50 [trunk] User can now control source/target java version
Fixes issue 303
2014-03-18 15:00:23 +00:00
Mathieu Malaterre
6d9e8a5a63 [trunk] Import git commit fc884aee2b69c78500e65c3d05bf216791a9ea4a from ghostscript team
Fixes issue 296
2014-03-18 14:43:47 +00:00
Mathieu Malaterre
008de86533 [trunk] Import git commit 99a6f1af177c15f4db475186b79d169c993494ef from ghostscript team
Update issue 296
2014-03-18 14:43:18 +00:00
Mathieu Malaterre
ae49fd1aa9 [trunk] Update big endian handling no such thing as WORDS_BIGENDIAN (prefer OPJ_BIG_ENDIAN)
Update issue 302
2014-03-18 14:37:33 +00:00
Mathieu Malaterre
79d18f7fd0 [trunk] Now that dataset from issue 297 have been imported, run test suite.
None of the dataset triggered any buffer overflow. Recent changes in trunk handle all those cases.
Update issue 297
2014-03-18 10:21:11 +00:00
Mathieu Malaterre
99d1859a44 [trunk] Explicitely reject file4/file6 scenario
Update issue 286
2014-03-17 16:18:22 +00:00
Mathieu Malaterre
866cd28ad4 [trunk] Update BSD-4 copyright into a BSD-3 copyright
Fixes issue 300
2014-03-17 15:02:49 +00:00
Mathieu Malaterre
71a9f498b5 [trunk] Since r2747 we are now able to track which files are missing from the test_suite. Add them. 2014-03-14 15:52:22 +00:00
Mathieu Malaterre
b607da8ae9 [trunk] add mecanism to track of addition of new regression files in svn/data. It will report when a J2K files is added but no test is found in the test_suite file 2014-03-14 15:51:53 +00:00
Mathieu Malaterre
a43d206b93 [trunk] Remove duplicate content from test_inline.c
Thanks to Matthieu Darbois for report (and patch)
Fixes issue 285
2014-03-14 15:10:31 +00:00
Mathieu Malaterre
15863e7170 [trunk] rework code from r2463. Really there has been some code duplication from r2413
Thanks to John Rogers (oracle.com) for report
2014-03-14 15:06:20 +00:00
Mathieu Malaterre
5e91877636 [trunk] rework code from r2463. Really there has been some code duplication from r2413
Thanks to John Rogers (oracle.com) for report
2014-03-14 15:04:24 +00:00
Mathieu Malaterre
7e1d012161 [trunk] Now that issue 165 dataset is in non regression repository, activate code to reject them
Fixes issue 165
2014-03-14 15:01:13 +00:00
Mathieu Malaterre
de74605777 [trunk] Fix issue with & vs &&
Fixes issue 277
2014-03-14 14:46:40 +00:00
Mathieu Malaterre
e8abf1fb25 [trunk] Add internal implementation to dump all tiles/comp info
Eg: opj_dump -f 8 -i input.j2k
Update issue 3
2014-03-14 13:53:36 +00:00
Mathieu Malaterre
b7fe7d25e1 [trunk] Prevent a leak when reading PPT markers
Update issue 295
2014-03-14 12:27:01 +00:00
Mathieu Malaterre
138a65d6c1 [trunk] Move INLINE definition within openjpeg.h header since application may use it 2014-03-14 12:02:05 +00:00
Mathieu Malaterre
9d0bdf69e5 [trunk] Apply final missing patch from sumatrapdf team:
http://bugs.ghostscript.com/show_bug.cgi?id=694893
Update issue 231
2014-03-14 11:59:18 +00:00
Mathieu Malaterre
9194dfb94b [trunk] Rework r2731 since it breaks non-regression testing 2014-03-14 11:42:26 +00:00
Mathieu Malaterre
b7ebf54a29 [trunk] Be more verbose about failure.
Update issue 294
2014-03-14 11:37:44 +00:00
Mathieu Malaterre
3a80b72ac8 [trunk] Add a temporary work around for issue 293
As described in the bug report the default allocation mecanism for codeblock data is too small for those dataset (16bits). We would need a finer (more granular) mecanism to reallocated only on demand. For now this help the two failing tests to pass.
Fixes issue 293
2014-03-14 10:54:08 +00:00
Mathieu Malaterre
3e33012bd9 [trunk] Mark OpenJPEG to be ABI incompatible with previous one, move to SONAME 7
Also declare this is 2.1.0 (or very close)
2014-03-14 09:30:03 +00:00
Mathieu Malaterre
fd3f7ca2bb [trunk] Remove warnings about unused values introduced in r2710
Thanks to Matthieu Darbois for patch
Fixes issue 290
2014-03-14 08:44:53 +00:00
Mathieu Malaterre
6e22c4f68a [trunk] Add some sanity checks when reading Ippm(i) segments
Update issue 288
2014-03-13 15:34:36 +00:00
Mathieu Malaterre
565ef29ae3 [trunk] Make sure to reallocate ppm data buffer when multiple Ippm(i) buffer are found
This handle the case where remaining data is exactly Nppm(i)
Fixes issue 287
2014-03-13 13:47:44 +00:00
Mathieu Malaterre
68398b2a5a [trunk] Add documentation to the checkmd5refs cmake module (used for regression testing) 2014-03-13 12:37:36 +00:00
Mathieu Malaterre
5624e4a25f [trunk] Always report when decompression failed as return code value 2014-03-13 12:31:41 +00:00
Mathieu Malaterre
92e07f3b74 [trunk] Fix test NR-DEC-issue171.jp2-71-decode-md5 after recent code change 2014-03-13 12:26:30 +00:00
Mathieu Malaterre
8447f0a323 [trunk] Add a double check for user input 2014-03-13 12:26:06 +00:00
Mathieu Malaterre
f0a2fdd508 [trunk] Fix compilation on VS2010 (snprintf is not C89). C++11 should avoid this in the future 2014-03-13 11:03:05 +00:00
Mathieu Malaterre
320784659d [trunk] Just in case this would be helpful for other, here is the code used to track issue 80
Update issue 80
2014-03-13 10:56:48 +00:00
Mathieu Malaterre
51ab8cd67d [trunk] Tweak documentation in t2.c. Be more verbose in case of failure. 2014-03-13 10:46:54 +00:00
Mathieu Malaterre
237253d83b [trunk] Add some documention in the pi code 2014-03-13 10:42:06 +00:00
Mathieu Malaterre
fe100fb490 [trunk] Add debug code to extract decompressed image right before PCLR handling
Update issue 235
2014-03-13 10:35:41 +00:00
Mathieu Malaterre
c7b646e23a [trunk] Add a small helper to spli ppm into 3 pgm files
Update issue 235
2014-03-13 09:57:20 +00:00
Mathieu Malaterre
41add6882b [trunk] Make sure to use 8bits buffer when applying the ICC profile.
Fixes issue 281
2014-03-12 14:18:25 +00:00
Mathieu Malaterre
dd0d2c2f0a [trunk] Add debug info to be able to test integration with littlecms 2014-03-12 13:55:41 +00:00
Mathieu Malaterre
d38e32c036 [trunk] TIFF files in test suite can have 1 or 3 components 2014-03-12 11:32:44 +00:00
Mathieu Malaterre
73315c2edc [trunk] Simplify code when reading in TIFF images 2014-03-12 10:50:47 +00:00
Mathieu Malaterre
6b51d11d08 [trunk] Make sure when reading POC that number of layers (layer end) is within acceptable bound.
Fixes issue 80
2014-03-12 10:10:21 +00:00
Mathieu Malaterre
59270c39a7 [trunk] Re-active old warning about missing SOP marker 2014-03-11 15:21:12 +00:00
Mathieu Malaterre
db82cf7778 [trunk] Add debug info to track issue 80
Update issue 80
2014-03-11 15:17:39 +00:00
Mathieu Malaterre
ddb1d57766 [trunk] Rework assertion to work on 32bits system 2014-03-11 12:56:52 +00:00
Mathieu Malaterre
5dd770746b [trunk] Fix remainings warnings on linux/32bits arch 2014-03-11 10:28:04 +00:00
Mathieu Malaterre
fa436eb368 [trunk] Rework fseek ifdefs blockers, it breaks the 64bits behavior for fseeko 2014-03-11 10:27:01 +00:00
Mathieu Malaterre
fcc658f106 [trunk] Fix compilation errors when JPWL and/or MJ2 are build 2014-03-11 09:11:35 +00:00
Mathieu Malaterre
2e7b8fb9a1 [trunk] Another final round of fixes for sign conversion warnings.
Fixes issue 256
2014-03-10 16:43:04 +00:00
Mathieu Malaterre
1778e2576e [trunk] Another round of fixes for sign conversion warnings.
Update issue 256
2014-03-10 16:17:12 +00:00
Mathieu Malaterre
73c9e85642 [trunk] Another round of fixes for sign conversion warnings.
Update issue 256
2014-03-10 16:17:01 +00:00
Mathieu Malaterre
76557d2eb3 [trunk] Another round of fixes for sign conversion warnings.
Update issue 256
2014-03-10 15:51:05 +00:00
Mathieu Malaterre
9095c7361e [trunk] Remove old warnings about deprecated API 2014-03-10 14:51:59 +00:00
Mathieu Malaterre
c02c1432e8 [trunk] Remove a set of warning about sign conversion
Update issue 266
2014-03-10 14:15:27 +00:00
Mathieu Malaterre
8411ed4f80 [trunk] Remove warning about sign conversion in color.c
Update issue 256
2014-03-10 14:05:25 +00:00
Mathieu Malaterre
4de95f320f [trunk] Run richter test suite, correct a regression introduced in r2668 2014-03-10 13:51:16 +00:00
Mathieu Malaterre
aea18173d1 [trunk] Tweak JP2 conformance test suite add documentation 2014-03-10 13:31:51 +00:00
Mathieu Malaterre
856fc0652f [trunk] Properly handle number of components to run kakadu test suite.
Update issue 266
2014-03-10 13:05:20 +00:00
Mathieu Malaterre
b01c1240cf [trunk] Fix simple sign conversion warnings only visible on 32bits arch 2014-03-10 12:22:56 +00:00
Mathieu Malaterre
836ec05920 [trunk] Handle multi components files with PGM outputs 2014-03-10 12:20:55 +00:00
Mathieu Malaterre
9a52b30c3d [trunk] Properly handle PGM file generation when fullpath is specified in the cmd line
This will break a very old behavior (since 2005), but avoid writing in un-expected places for users
This also make the behavior similar with PGX file generation
2014-03-10 10:52:09 +00:00
Mathieu Malaterre
76af73bc72 [trunk] Fix inversion in code convention 2014-03-10 10:43:45 +00:00
Mathieu Malaterre
f7bc0b49cb [trunk] Fix typo in the code 2014-03-10 10:12:25 +00:00
Mathieu Malaterre
9155e98911 [trunk] rework actual code to handle DOS/UNIX end of lines in a transparent manner.
This will help cross compilation cases
2014-03-10 10:09:30 +00:00
Mathieu Malaterre
7aee50de97 [trunk] First pass to cleanup compare_dump_files 2014-03-10 09:56:22 +00:00
Mathieu Malaterre
24966ffbda [trunk] Fix compilation when TIFF lib is neither found nor compiled 2014-03-10 09:36:14 +00:00
Mathieu Malaterre
666ef53fd2 [trunk] Make sure to always initialize variable 2014-03-10 08:40:02 +00:00
Mathieu Malaterre
e02ba05034 [trunk] Fix warnings about shadow variables 2014-03-10 08:25:08 +00:00
Mathieu Malaterre
b478912910 [trunk] remove a warning when using strict prototype 2014-03-10 08:15:43 +00:00
Mathieu Malaterre
2001932c56 [trunk] Remove 2 warnings about set but not used variables 2014-03-10 08:13:05 +00:00
Mathieu Malaterre
f54de95802 [trunk] Upon failure, need to return proper return code 2014-03-07 17:23:19 +00:00
Mathieu Malaterre
fa1c2454e6 [trunk] Add new test suite that run on kakadu conformance images 2014-03-07 17:18:13 +00:00
Mathieu Malaterre
6b94237679 [trunk] Cleanup commit. Rename compare family since comparePGX now support TIFF.
Rename compareRAWimage for clarity since it merely compare files (not images).
2014-03-07 16:24:24 +00:00
Mathieu Malaterre
aedff8a000 [trunk] Use C-style comments 2014-03-07 16:17:21 +00:00
Mathieu Malaterre
a0aa8dd851 [trunk] Rework the code to simplify cleanup code 2014-03-07 16:15:59 +00:00
Mathieu Malaterre
440ef4873b [trunk] Also override the default error handler for TIFF files 2014-03-07 14:33:03 +00:00
Mathieu Malaterre
ffad2fbe55 [trunk] Another round of fixes for sign conversion warnings.
Update issue 256
2014-03-07 14:14:31 +00:00
Mathieu Malaterre
cc1354ebfa [trunk] Another round of fixes for sign conversion warnings.
Update issue 256
2014-03-07 14:00:47 +00:00
Mathieu Malaterre
581d2ba8b4 [trunk] Rework r2597, make sure test suite is passing now.
Update issue 256
2014-03-07 13:50:58 +00:00
Mathieu Malaterre
61348b20b4 [trunk] Another round of fixes for sign conversion warnings.
Update issue 256
2014-03-07 13:43:15 +00:00
Mathieu Malaterre
e619e06078 [trunk] Another round of fixes for sign conversion warnings.
Update issue 256
2014-03-07 13:40:54 +00:00
Mathieu Malaterre
4f84d1693a [trunk] Another round of fixes for sign conversion warnings.
Update issue 256
2014-03-07 13:37:45 +00:00
Mathieu Malaterre
71d244a5b6 [trunk] Another round of fixes for sign conversion warnings.
Update issue 256
2014-03-07 13:33:47 +00:00
Mathieu Malaterre
f9a0f869e3 [trunk] Another round of fixes for sign conversion warnings.
Update issue 256
2014-03-07 13:31:25 +00:00
Mathieu Malaterre
33c472d734 [trunk] Redo r2623, and remove guilty section
Update issue 256
2014-03-07 13:29:35 +00:00
Mathieu Malaterre
a8eb122c1f [trunk] Revert r2623 for now 2014-03-07 13:14:26 +00:00
Mathieu Malaterre
956b1a7697 [trunk] Another round of fixes for sign conversion warnings.
Update issue 256
2014-03-07 12:06:00 +00:00
Mathieu Malaterre
472ce19183 [trunk] Another round of fixes for sign conversion warnings.
Update issue 256
2014-03-07 12:01:41 +00:00
Mathieu Malaterre
740924fa61 [trunk] Another round of fixes for sign conversion warnings.
Update issue 256
2014-03-07 11:59:29 +00:00
Mathieu Malaterre
01b4bb5447 [trunk] Another round of fixes for sign conversion warnings.
Update issue 256
2014-03-07 11:57:37 +00:00
Mathieu Malaterre
ee3b02932a [trunk] Another round of fixes for sign conversion warnings.
Update issue 256
2014-03-07 11:43:50 +00:00
Mathieu Malaterre
2a07d3d26b [trunk] Another round of fixes for sign conversion warnings.
Update issue 256
2014-03-07 11:28:34 +00:00
Mathieu Malaterre
e238148d42 [trunk] Another round of fixes for sign conversion warnings.
Update issue 256
2014-03-07 11:27:34 +00:00
Mathieu Malaterre
9d21695476 [trunk] As reported by clang analyzer thoses values were never read 2014-03-07 11:20:59 +00:00
Mathieu Malaterre
22d11a9ccb [trunk] Remove mem leak and warning reported by clang 2014-03-07 11:17:51 +00:00
Mathieu Malaterre
fc9248ea2b [trunk] Remove simple warnings about format 2014-03-07 11:11:43 +00:00
Mathieu Malaterre
c302979738 [trunk] Remove simple warning about functions not used 2014-03-07 11:08:35 +00:00
Mathieu Malaterre
e4d077bc98 [trunk] Another round of fixes for sign conversion warnings.
Update issue 256
2014-03-07 11:06:13 +00:00
Mathieu Malaterre
76cd9b7f72 [trunk] Another round of fixes for sign conversion warnings.
Update issue 256
2014-03-07 10:25:16 +00:00
Mathieu Malaterre
e71431ec78 [trunk] Fix simple warning about sign conversion
Update issue 256
2014-03-07 10:21:51 +00:00
Mathieu Malaterre
7b335eb635 [trunk] Another of fixes for warning about sign conversion
Update issue 256
2014-03-07 10:19:39 +00:00
Mathieu Malaterre
c0c086388b [trunk] Fix warning about sign conversion
Update issue 256
2014-03-07 10:03:56 +00:00
Mathieu Malaterre
048c8302fe [trunk] un-deprecated opj_stream_destroy API, import patch manually
In some case user still want to be able to call opj_stream_destroy.
Fixes issue 227
2014-03-07 09:58:32 +00:00
Mathieu Malaterre
a7b051b172 [trunk] Update memory management mecanism
Fixes issue 253
2014-03-07 09:44:32 +00:00
Mathieu Malaterre
5f7ad58f48 [trunk] Remove self-assignement.
Fixes issue 273
2014-03-07 09:33:32 +00:00
Mathieu Malaterre
016b9fc052 [trunk] Fix compilation in visual studio, inline cannot be used directly.
Fixes issue 272
2014-03-07 09:15:27 +00:00
Mathieu Malaterre
99b40e8257 [trunk] Remove warning about implicitly defined function 2014-03-07 09:14:39 +00:00
Mathieu Malaterre
a734e447b5 [trunk] Remove TIFF warning handler. This help test suite run smoothly on windows by removing the message box.
Fixes issue 276
2014-03-07 09:03:15 +00:00
Mathieu Malaterre
37128c34a9 [trunk] Fix mem leaks reported by cppcheck 2014-03-07 08:48:47 +00:00
Mathieu Malaterre
f5630ab88e [trunk] Simplify code and remove bogus out of bound check 2014-03-07 08:11:49 +00:00
Mathieu Malaterre
6790587db8 [trunk] Revert r2597 for now, since it breaks a lot of tests 2014-03-06 17:25:08 +00:00
Mathieu Malaterre
445f696dc6 [trunk] Remove warning about sign conversion.
Update issue 256
2014-03-06 16:59:34 +00:00
Mathieu Malaterre
dd5c3a9c8e [trunk] Remove some easy warnings 2014-03-06 16:29:03 +00:00
Mathieu Malaterre
0f45e38b52 [trunk] Remove warning about sign conversion.
Update issue 256
2014-03-06 16:26:24 +00:00
Mathieu Malaterre
93bc3cb628 [trunk] Remove warning about sign conversion.
Update issue 256
2014-03-06 16:01:23 +00:00
Mathieu Malaterre
79faedfb9b [trunk] Remove warning about sign conversion.
Update issue 256
2014-03-06 15:16:44 +00:00
Mathieu Malaterre
17d9caae83 [trunk] Remove warning about sign conversion.
Update issue 256
2014-03-06 15:10:39 +00:00
Mathieu Malaterre
eea18e856e [trunk] Remove warning about sign conversion.
Update issue 256
2014-03-06 15:05:00 +00:00
Mathieu Malaterre
7e64eb5414 [trunk] Remove some easy warnings about sign compare reported by gcc 2014-03-06 15:00:41 +00:00
Mathieu Malaterre
8a959bb1f4 [trunk] Remove out of bound access in code and simplify code. this is a test tool, security is not an issue here. 2014-03-06 14:50:42 +00:00
Mathieu Malaterre
8d3ef0729c [trunk] Remove simple warning about unused variables 2014-03-06 14:47:52 +00:00
Mathieu Malaterre
275680bdb7 [trunk] Make sure that all output files from the test suite are using a different output name
Fixes issue 271
2014-03-06 14:43:21 +00:00
Mathieu Malaterre
4d5d1f0f66 [trunk] Handle cmap where direct use is specified (issue235_cmapsubbox.jp2)
I doubt the old code ever work. The new code copy the old codestream bytes into the new components (instead of copying the pointer).
Technically the issue235.jp2 file should be handled since I.5.3.5 specifies that:
...
If the JP2 Header box does not contain a Component Mapping box, the components shall be mapped directly to channels,
such that component i is mapped to channel i.
...
Update issue 235
2014-03-05 09:45:04 +00:00
Mathieu Malaterre
1ef677f264 [trunk] Make sure to reject images such as 1336.pdf.asan.47.376.jp2
Fixes issue 267
2014-03-04 10:32:26 +00:00
Mathieu Malaterre
07193e2a34 [trunk] remove more conversion warning in multi-lines macro.
C allow simple tricks such as to find those:
gcc -E tcd.c | sed '/^\#/d' | indent -st -i2 > clean.c
Update issue 256
2014-03-04 09:58:07 +00:00
Mathieu Malaterre
f7da94610d [trunk] Remove some conversion warnings reported by gcc
Update issue 256
2014-03-04 09:55:38 +00:00
Mathieu Malaterre
872368d25c [trunk] Remove another warning. ftell returns long int
Update issue 256
2014-03-04 09:32:19 +00:00
Mathieu Malaterre
36320b4bf4 [trunk] Remove more conversion warnings.
Update issue 256
2014-03-04 09:30:07 +00:00
Mathieu Malaterre
7185faa857 [trunk] Remove warning about conversion.
Update issue 256
2014-03-04 09:19:49 +00:00
Mathieu Malaterre
0c80fcff2a [trunk] Add a TIFF compare function (PEAK/MSE)
Fixes issue 100
2014-03-04 09:14:47 +00:00
Mathieu Malaterre
51caff5dcf [trunk] Revert portion of r2562, need to investigate issue.
Update issue 269
2014-03-04 08:40:06 +00:00
Mathieu Malaterre
d643ff5dbc [trunk] Remove remaining conversion issues in mqc.c 2014-03-03 16:11:41 +00:00
Mathieu Malaterre
44ca89eff7 [trunk] Remove remainings conversion issues in t2.c + clock.c 2014-03-03 16:08:03 +00:00
Mathieu Malaterre
7afad19c77 [trunk] Remove a simple warning about int -> float conversion 2014-03-03 16:02:36 +00:00
Mathieu Malaterre
765c4ab4f4 [trunk] rework code to avoid a warning. this also remove a division and prefer bit-shift 2014-03-03 16:02:16 +00:00
Mathieu Malaterre
24eca792ff [trunk] Remove some more warnings about conversion 2014-03-03 15:55:27 +00:00
Mathieu Malaterre
b1b17ee264 [trunk] Prefer compile time constant to avoid conversion double -> int 2014-03-03 15:55:06 +00:00
Mathieu Malaterre
74600cfb14 [trunk] Review warning about types conversion, and add cast when needed 2014-03-03 15:47:23 +00:00
Mathieu Malaterre
171ec1583d [trunk] Remove some simple warnings about conversion 2014-03-03 12:13:11 +00:00
Mathieu Malaterre
80c5106015 [trunk] fgets takes an int as parameter 2014-03-03 12:11:53 +00:00
Mathieu Malaterre
e92fe4c1a4 [trunk] Remove warning about cast double -> int. Instead use bit-shifting (compile time computation) 2014-03-03 12:01:36 +00:00
Mathieu Malaterre
11f402b44a [trunk] Remove easy to fix warnings about conversion 2014-03-03 12:00:24 +00:00
Mathieu Malaterre
18049fe3e0 [trunk] Import left over from patch submitted as issue 225 (comment #14)
Update issue 225
2014-03-03 11:48:27 +00:00
Mathieu Malaterre
b330c10492 [trunk] remove some simple warnings about unused params 2014-03-03 11:40:59 +00:00
Mathieu Malaterre
25255c4ed1 [trunk] remove all api with invalid FILE* parameters which could leads to issues when applications are compiled with different flags from openjpeg.
Fixes issue 198
2014-03-03 11:36:31 +00:00
Mathieu Malaterre
16febebd28 [trunk] Explicitely trigger issue 229, there may be an impact in code execution. The assert may get removed afterward
Update issue 229
2014-03-03 11:30:54 +00:00
Mathieu Malaterre
339952c2af [trunk] Remove simple warnings 2014-03-03 10:41:13 +00:00
Mathieu Malaterre
75715635e8 [trunk] Remove 3635.pdf.asan.77.2930.jp2 from opj_dump tests
Update issue 250
2014-03-03 10:38:41 +00:00
Mathieu Malaterre
9863d8d1d2 [trunk] Avoid conflicting declarion for fseek in openjp2 vs fseek in openjpip 2014-03-03 08:49:28 +00:00
Mathieu Malaterre
3ecccb7410 [trunk] Fix md5 values for decode-md5 tests.
Update issue 250
2014-03-03 08:45:21 +00:00
Mathieu Malaterre
3c7a7a1675 [trunk] Remove deprecated functions.
Update issue 268
2014-03-03 08:30:36 +00:00
Mathieu Malaterre
d14c475de7 [trunk] Remove warning about unused function
Update issue 268
2014-03-03 08:27:40 +00:00
Mathieu Malaterre
a68a3feb60 [trunk] Remove deprecated functions (not called anywhere in the code base).
Update issue 268
2014-03-03 08:17:20 +00:00
Mathieu Malaterre
43382a9b9c [trunk] Remove unused variables from test 2014-03-03 07:58:59 +00:00
Mathieu Malaterre
a149502c01 [trunk] Remove some simple warnings about var being set but not used 2014-03-02 10:23:05 +00:00
Mathieu Malaterre
decace60da [trunk] Remove warning about -2147483648 (aka INT_MIN), causing this decimal constant is unsigned only in ISO C90 2014-03-02 10:20:57 +00:00
Mathieu Malaterre
2c876b6765 [trunk] Remove simple warnings about comments, missing case in switch statement 2014-03-02 10:16:54 +00:00
Mathieu Malaterre
6d0785a78f [trunk] Fix compilation on MSVC compiler 2014-03-01 10:41:46 +00:00
Mathieu Malaterre
ec593a2549 [trunk] Partially rework r2506, original patch from issue 171 was totally bogus (untested?) and did break most of the test (eg. p1_04 family)
convert.c duplicate a lot of code, this patch only adresses the PGX codec section of the code.
Update issue 171
Update issue 264
2014-02-28 17:29:28 +00:00
Mathieu Malaterre
978de6fb97 [trunk] Make sure to run *-decode-md5 only after *-decode tests. Update md5 since recent code change. 2014-02-28 16:04:11 +00:00
Mathieu Malaterre
c53e2960a0 [trunk] Remove easy uint32 <-> int32 conversions 2014-02-28 16:01:07 +00:00
Mathieu Malaterre
cf91ebf278 [trunk] Re-import chunk from r2458 that made textGBR.jp2 to fail otherwise
Update issue 225
2014-02-28 15:27:30 +00:00
Mathieu Malaterre
fd5f21af00 [trunk] Rework r2458, instead we should reject 451.pdf.SIGSEGV.ce9.3723 since tile-parts are out of order (as per kakadu behavior).
Update issue 225
2014-02-28 15:24:33 +00:00
Mathieu Malaterre
1b93cb8c0a [trunk] Mark a file as being invalid for opj_dump 2014-02-28 15:14:53 +00:00
Mathieu Malaterre
a9e6268766 [trunk] Fix JPIP test with updated md5sum 2014-02-28 14:54:37 +00:00
Mathieu Malaterre
fc855084a0 [trunk] Really apply r2460 this time, but fix the original typo in the submitted patch
Update issue 225
2014-02-28 14:52:58 +00:00
Mathieu Malaterre
b7bccf86c3 [trunk] final round of minor cleanups 2014-02-28 14:38:45 +00:00
Mathieu Malaterre
6ee2a51edc [trunk] Remove PNG generation code for now 2014-02-28 14:31:01 +00:00
Mathieu Malaterre
d2dc1597fe [trunk] Prefer strcpy since it copies trailing 0 directly 2014-02-28 14:23:30 +00:00
Mathieu Malaterre
82647e79c7 [trunk] Simplify code to centralize code cleanup 2014-02-28 14:17:30 +00:00
Mathieu Malaterre
ecbebe2847 [trunk] Some code cleanup add sentinels 2014-02-28 13:59:59 +00:00
Mathieu Malaterre
816db977fd [trunk] Remove a simple warning, and use static to detect unused functions. Simplify function declarations. 2014-02-28 13:19:03 +00:00
Mathieu Malaterre
cbe77e2412 [trunk] run test suite on dataset from issue 171
Fixes issue 171
2014-02-28 12:30:11 +00:00
Mathieu Malaterre
1eb67ca49d [trunk] Remove some simple warnings in opj_dump 2014-02-28 12:06:57 +00:00
Mathieu Malaterre
7a89d731f7 [trunk] Merge final patch from issue 171 with code simplification. also handles signed case properly.
Fixes issue 171
2014-02-28 09:52:35 +00:00
Mathieu Malaterre
65503dad73 [trunk] Fix find_path behavior within cross-compilation execution 2014-02-28 08:28:25 +00:00
Mathieu Malaterre
a347262468 [trunk] Import patch from issue 218. No dataset to check, so blindly applied it.
Fixes issue 218
2014-02-27 17:21:00 +00:00
Mathieu Malaterre
6a6fa7027a [trunk] Import patch from issue 171. Only the imagetoraw part was not applied.
Update issue 171
2014-02-27 17:04:06 +00:00
Mathieu Malaterre
86cdc91180 [trunk] Try to run test suite on invalid dataset from sumatrapdf team
Update issue 225
2014-02-27 15:00:54 +00:00
Mathieu Malaterre
094465a710 [trunk] run test suite to illustrate patch from r2458 2014-02-27 14:43:17 +00:00
Mathieu Malaterre
6ae56f302e [trunk] Make sure that opj_decompress only output a single component
Update issue 110
2014-02-27 14:17:53 +00:00
Mathieu Malaterre
ad895fadb1 [trunk] add issue 46 to the test suite
Fixes issue 46
2014-02-27 10:03:11 +00:00
Mathieu Malaterre
7c120281c7 [trunk] improve command line parser syntax checking 2014-02-27 10:02:46 +00:00
Mathieu Malaterre
8a4095b405 [trunk] add a sentinel in debug code 2014-02-27 09:56:06 +00:00
Mathieu Malaterre
a7cc5b6a5d [trunk] simplify code using for loop 2014-02-27 08:38:55 +00:00
Mathieu Malaterre
ac1dfd4662 [trunk] Import test case from issue 208. This appears to be fixed now.
Fixes issue 208
2014-02-26 17:13:46 +00:00
Mathieu Malaterre
abf2f7f05e [trunk] Run test suite on dataset from issue 211. Test is now passing nicely.
Fixes issue 211
2014-02-26 16:31:27 +00:00
Mathieu Malaterre
1c209d711e [trunk] run test suite on dataset from issue 135. Add fake md5sum to make sure tests is failing.
Update issue 135
2014-02-26 16:20:36 +00:00
Mathieu Malaterre
91f521ef92 [trunk] Update missing md5sums 2014-02-26 15:55:49 +00:00
Mathieu Malaterre
9ac3ae1270 [trunk] kakadu does not support 451.pdf.SIGSEGV.ce9.372 we should not pretend to be able to decompress it
Update issue 225
2014-02-26 15:41:57 +00:00
Mathieu Malaterre
d74579aa38 [trunk] Run test suite on issue 141. Add a fake dataset to report that test is failing.
Update issue 141
2014-02-26 15:21:03 +00:00
Mathieu Malaterre
6deb1a83b5 [trunk] Add more details in case test fails 2014-02-26 15:14:27 +00:00
Mathieu Malaterre
6f3a7ef3c8 [trunk] run test suite on input dataset from issue 134
Fixes issue 134
2014-02-26 14:32:11 +00:00
Mathieu Malaterre
9f3687f917 [trunk] fixes test NR-DEC-file409752.jp2-40-decode, use proper naming convention (need to keep file extension) 2014-02-26 14:28:17 +00:00
Mathieu Malaterre
5e77c4e936 [trunk] add test suite for issue 142
Fixes issue 142
2014-02-26 14:24:02 +00:00
Mathieu Malaterre
97c376e06d [trunk] When no output PGX file is found, report an error 2014-02-26 14:23:30 +00:00
Mathieu Malaterre
8f4d674442 [trunk] Add missing include dir for wx app 2014-02-26 14:04:03 +00:00
Mathieu Malaterre
7f277fea94 [trunk] Remove some simple warnings about cast, and unused functions 2014-02-26 14:00:21 +00:00
Mathieu Malaterre
52440cc2e6 [trunk] Remove a simple warning about a cast 2014-02-26 12:54:02 +00:00
Mathieu Malaterre
3fe9243e1c [trunk] revert r2460 since it breaks ETS-C1P0-p0_03.j2k-decode.
Update issue 225
2014-02-26 12:33:49 +00:00
Mathieu Malaterre
05dae25a22 [trunk] Revert r2453 since it breaks conformance test ETS-C1P1-p1_06.j2k-decode 2014-02-26 12:30:44 +00:00
Mathieu Malaterre
23ea270881 [trunk] Import patch from sumatrapdf team. This handle testcase 1336.pdf.asan.47.376
Update issue 225
2014-02-26 11:27:01 +00:00
Mathieu Malaterre
7247543da3 [trunk] Import patch from sumatrapdf team. This handle testcase 1888.pdf.asan.35.988
Update issue 225
2014-02-26 11:26:09 +00:00
Mathieu Malaterre
37a8d2acc1 [trunk] Import patch from sumatrapdf team. This handle testcase 1851.pdf.SIGSEGV.ce9.948
Update issue 225
2014-02-26 11:25:27 +00:00
Mathieu Malaterre
4a7ba87d99 [trunk] Import patch from sumatrapdf team. Start using new color space when found.
Update issue 225
2014-02-26 11:24:38 +00:00
Mathieu Malaterre
51e3764519 [trunk] Import patch from sumatrapdf team. This handle some Part-2 compliant file, by being more tolerant in COLR box. No testcase for now.
Fixes issue 247
2014-02-26 11:22:34 +00:00
Mathieu Malaterre
533d92aa8e [trunk] Import patch from sumatrapdf team. This handle some testcase with no input dataset, but changes looks ok.
Update issue 225
2014-02-26 11:21:18 +00:00
Mathieu Malaterre
19887b7b8c [trunk] Import patch from sumatrapdf team. This handle testcase 2977.pdf.asan.67.2198
Update issue 225
2014-02-26 11:17:18 +00:00
Mathieu Malaterre
005e75bdc3 [trunk] Import (ugly) patch from sumatrapdf team. This feels like a hack rather than a solution.
Fixes issue 226
2014-02-26 11:16:32 +00:00
Mathieu Malaterre
5f3470fcd0 [trunk] Import patch from sumatrapdf team. This handle testcase 3635.pdf.asan.77.2930
Update issue 225
2014-02-26 11:14:27 +00:00
Mathieu Malaterre
adb237cfa8 [trunk] Import patch from sumatrapdf team. Original commit is 5b0c9985e3359aca9b3fcfd94424166aa61a141a.
Update issue 225
2014-02-26 11:13:21 +00:00
Mathieu Malaterre
29a29d6210 [trunk] Import patch from sumatrapdf team. This handle testcase 451.pdf.SIGSEGV.ce9.3723
Update issue 225
2014-02-26 11:11:33 +00:00
Mathieu Malaterre
3a155ceda6 [trunk] Import patch from sumatrapdf team. This handle testcase 2.pdf.SIGFPE.706.1112
Update issue 225
2014-02-26 11:10:40 +00:00
Mathieu Malaterre
7195a23a9d [trunk] Import patch from sumatrapdf team. This handle testcase 1610.pdf.SIGSEGV.59c.681
Update issue 225
2014-02-26 11:09:59 +00:00
Mathieu Malaterre
0ae6ff8018 [trunk] Import patch from sumatrapdf team. This handle testcase 2539.pdf.SIGFPE.706.1712
Update issue 225
2014-02-26 11:09:20 +00:00
Mathieu Malaterre
241769dc2f [trunk] Import patch from sumatrapdf team. This handle testcase 4035.pdf.SIGSEGV.d8b.3375
Update issue 225
2014-02-26 11:08:25 +00:00
Mathieu Malaterre
4a39ee9bbc [trunk] Import patch from sumatrapdf team. Add detection for testcase 1802.pdf.SIGSEGV.36e.894
Update issue 225
2014-02-26 11:06:18 +00:00
Mathieu Malaterre
1dedf7f0cd [trunk] Import patch from sumatrapdf team. Add a new function to check color box.
Update issue 225
2014-02-26 11:05:31 +00:00
Mathieu Malaterre
70ede09310 [trunk] Import patch from sumatrapdf team. This patch adds new colorspace handling.
Update issue 225
2014-02-26 11:04:33 +00:00
Mathieu Malaterre
3da30304fc [trunk] Import patch from sumatrapdf team. This adds alpha handling. This patch changes ABI.
Update issue 225
2014-02-26 11:03:55 +00:00
Mathieu Malaterre
820c04c679 [trunk] Update file extension function to handle cases where filename containes multiples dots.
Update issue 250
2014-02-26 10:48:06 +00:00
Mathieu Malaterre
9d848e3f5e [trunk] Clearly indicate that mem-b2ace68c-1381.jp2 should not be decompressed.
Update issue 250
2014-02-26 09:57:38 +00:00
Mathieu Malaterre
d5f71c2e1d [trunk] Fix TestJPIP1 on case sensitive system 2014-02-26 09:51:37 +00:00
Mathieu Malaterre
36a7d23273 [trunk] regex would not be used to remove java deprecation warning from dashboard 2014-02-26 09:47:53 +00:00
Mathieu Malaterre
c4317177f3 [trunk] Remove simple warnings about unused functions 2014-02-26 09:46:01 +00:00
Mathieu Malaterre
e231a84b2f [trunk] Properly store and use value returned by fread. Also invert nmemb and size in fread call.
Fixes issue 262
2014-02-26 09:40:19 +00:00
Mathieu Malaterre
b56fb96b1b [trunk] Fix invalid write access in JPIP code.
Fixes issue 261
2014-02-26 09:35:11 +00:00
Mathieu Malaterre
163c7e3460 [trunk] Run decoder on input dataset from issue 254. Add fake md5sum to make sure the test is failing.
Update issue 254
2014-02-25 17:15:22 +00:00
Mathieu Malaterre
4c1023dac6 [trunk] deprecationg warning issued by java compiler should be ignored 2014-02-25 16:53:42 +00:00
Mathieu Malaterre
563d238fa0 [trunk] Create a new static *_impl function to avoid a warning triggered by the deprecation mecanism
Fixes issue 257
2014-02-25 16:49:26 +00:00
Mathieu Malaterre
9021776963 [trunk] New decoded files are passing. Adding reference files.
Update issue 225
2014-02-25 16:36:26 +00:00
Mathieu Malaterre
18771f1b6a [trunk] For now assume any provided stream should not get decompressed.
Update issue 225
2014-02-25 16:16:34 +00:00
Mathieu Malaterre
ed2af11102 [trunk] Run decoder on issue 229 test cases
Update issue 229
2014-02-25 15:36:09 +00:00
Mathieu Malaterre
7dd65e84e6 [trunk] Revert r2415 for now since it introduce large regression 2014-02-25 14:14:56 +00:00
Mathieu Malaterre
e260ec6e9d [trunk] Import commit 87b08a096bb8ad61f9dbe4811e208d9c9d7fe63b from ghostpdl
don't define lrintf for MSVC 2013 (fix compilation breakage)

Update issue 225
2014-02-25 14:03:30 +00:00
Mathieu Malaterre
7ce3f3c1a6 [trunk] Import commit 4cee6ceab21025079f439bb152fb9d8ae8c5c832 from ghostpdl
Bug 694906: fix potential heap overflow in opj_t2_read_packet_header

Update issue 225
2014-02-25 13:50:29 +00:00
Mathieu Malaterre
a466755bbb [trunk] import commit 83dad6a76536222a3a51146f942e733a2e90ec52 from ghostpdl
fix potential NULL-pointer dereference caused by testing the wrong variable
after opj_realloc (happens only in OOM situations)

Update issue 225
2014-02-25 13:39:50 +00:00
Mathieu Malaterre
901c9d8ae0 [trunk] Import commit fc884aee2b69c78500e65c3d05bf216791a9ea4a from ghostpdl
prevent heap overflow in opj_t2_read_packet_header

Also prevent a double-free of segment data under OOM conditions.

Problem found in a test file, 1802.pdf.SIGSEGV.36e.894 supplied
by Mateusz "j00ru" Jurczyk and Gynvael Coldwind of the Google
Security Team using Address Sanitizer. Many thanks!

Update issue 225
2014-02-25 13:38:32 +00:00
Mathieu Malaterre
6145c82804 [trunk] Import commit 8ec8321df613986e8642e2975f7182072eb4be62 from ghostpdl
make opj_stream_set_user_data accept a NULL stream
for consistency with opj_stream_set_* which does so.

Update issue 225
2014-02-25 13:33:43 +00:00
Mathieu Malaterre
876c02206d [trunk] Import commit f4139d702559649e577a5df9cfd64b0ca6107a7a from ghostpdl
Several functions accept a buffer size but never actually check whether
the buffer overflows during reading/writing. This fixes all cases where
a size variable has explicitly been marked as unused (through a (void)
cast).

This was discovered while investigating an assertion caused by
7cc691f332f26802c64cdc47e17bff8b_signal_sigabrt_7ffff6d59425_2247_2509.pdf
among others.

Thanks to Mateusz Jurczyk and Gynvael Coldwind of the Google Security
Team for providing the example files.
2014-02-25 13:28:37 +00:00
Mathieu Malaterre
3ca312033f [trunk] Clarify raw input in openjpeg. LSB vs MSB are now documented.
Fixes issue 62
2014-02-25 10:35:07 +00:00
Mathieu Malaterre
1378475573 [trunk] Run test case for issue 228. Output has been validated.
Fixes issue 228
2014-02-25 10:30:40 +00:00
Mathieu Malaterre
00b049866b [trunk] Run sumatrapdf test cases 2014-02-25 10:06:37 +00:00
Mathieu Malaterre
d847e477f0 [trunk] add missing private lib. Update issue 223 2014-02-24 17:22:48 +00:00
Mathieu Malaterre
c55e164e87 [trunk] Make sure to always output pgx file. Handle case where multiple pgx files are generated. Fixes all tests. 2014-02-24 16:55:13 +00:00
Mathieu Malaterre
531cd5dd14 [trunk] add test demonstrating a regression in 1.5.0 and up. Update issue 205 2014-02-24 16:09:42 +00:00
Mathieu Malaterre
ff0a9f763e [trunk] improve test suite by checking against a reference md5 2014-02-24 16:07:21 +00:00
Mathieu Malaterre
228e0a3d79 [trunk] Fix a simple mem leak 2014-02-24 14:55:32 +00:00
Mathieu Malaterre
f38e29d00a [trunk] Fix two simple warnings about sign mismatch 2014-02-24 14:50:40 +00:00
Mathieu Malaterre
963283d7d0 [trunk] Fix warning about signed/unsigned mismatch 2014-02-24 14:27:02 +00:00
Mathieu Malaterre
c91044a4a7 [trunk] Make sure to handle ret value, and properly initialize output file 2014-02-24 14:22:25 +00:00
Mathieu Malaterre
f42c26adbd [trunk] Make sure to handle ret value in test 2014-02-24 14:10:11 +00:00
Mathieu Malaterre
9efad43509 [trunk] Prefer the new style cmake: add_test command
Fixes issues 258
2014-02-24 12:48:23 +00:00
Mathieu Malaterre
33d8f08964 [trunk] Fix a warning about type conversion. Use a trick where unsigned wrapping is legal 2014-02-24 08:52:44 +00:00
Antonin Descampe
e826e9281e [trunk] replaced fprintf with event_mgr in cinema-related stuff in j2k.c 2014-02-12 16:33:19 +00:00
Antonin Descampe
780120c9a2 [trunk] moved logic related to cinema profiles in library (was in
opj_compress.c). This enables one using the library with its own
executable to easily ask for cinema profiles.
2014-02-12 16:16:21 +00:00
Antonin Descampe
d6c0c85125 [trunk] added a warning when tif conversion changes input image bitdepth 2014-02-12 15:16:36 +00:00
Antonin Descampe
c81fb397bb [trunk]re-indenting convert.c 2014-02-12 14:56:49 +00:00
Mathieu Malaterre
caf4e46e06 Update kakadu cmake module 2014-02-07 10:37:06 +00:00
Antonin Descampe
ff1a30d80a [trunk] added some tests for Cinema2k 48fps and Cinema 4k 24 fps. Fixed
a bug in comparePGXimages.c leading to huge Test.xml file uploaded to
DashBoard
2014-01-23 16:33:13 +00:00
Antonin Descampe
d143f49a66 [trunk] fixed another DCI compliance bug 2014-01-23 09:39:02 +00:00
Antonin Descampe
58698b789a [trunk] uncomment tests mistakenly commented in previous commit 2014-01-22 18:44:11 +00:00
Antonin Descampe
ee3f2ffa19 [trunk] fixed several bugs in cinema mode (2K 24/48 fps, and 4K). Trunk
now produces compliant DCI code-streams.
2014-01-22 18:41:34 +00:00
Antonin Descampe
c59124dfe2 [trunk] fixed indentation in opj_compress.c, renamed 2 internal
functions, added some comments
2014-01-16 14:21:14 +00:00
Antonin Descampe
7b14cf8558 [trunk] fixed DCI-compliant codestream generation (-cinema2K and - 2014-01-16 12:55:14 +00:00
Antonin Descampe
05f796d2fa trunk: fixed cmake config so as to be able to link opj_jpip_server with FCGI. 2013-10-30 08:59:23 +00:00
Antonin Descampe
bd8c91b37d trunk: fixed cmake config so as to be able to link opj_jpip_server with FCGI. 2013-10-30 08:57:18 +00:00
Antonin Descampe
7294cdef3e trunk: disabling class-0 conformance tests for now (bad implentation of tests) 2013-10-28 23:31:55 +00:00
Rex Dieter
4d7b6374c8 complete openjpeg2 pkgconfig support, bug #68 2013-10-15 19:17:51 +00:00
Mathieu Malaterre
5855da5a15 [trunk] Import patch from bug #241 2013-09-26 09:28:47 +00:00
Antonin Descampe
34fd493512 test: modified class-0 conformance testing to comply with constraints 2013-07-11 16:48:49 +00:00
Mickael Savinaud
da4bd9b110 [trunk] use the private version of opj_config to avoid compilation error into mj2 2013-03-25 13:43:14 +00:00
Mickael Savinaud
7fbf6df09e [trunk] use opj_config_private.h into the opj_inttypes.h 2013-03-25 13:36:26 +00:00
Mickael Savinaud
68415d040f [trunk] separate the opj_config file between public and private part to avoid expose unused variables into the public API. 2013-03-25 12:43:27 +00:00
Mickael Savinaud
8ee74f6bff [trunk] update test suite because now illegalcolortransform.j2k could be decoded 2013-03-25 09:54:15 +00:00
Mickael Savinaud
bf0fa4089f [trunk] enhance the support of sYCC into opj_decompress application (thanks winfried). 2013-03-24 23:12:41 +00:00
Mickael Savinaud
07ae149955 [trunk] managed nicely the case where TPSot value is incorrect (thanks winfried). Update the test suite to check this case. Updates issue 202. Updates issue 206. Update issue 208 2013-03-24 22:50:46 +00:00
Mickael Savinaud
ecb93d97a5 [trunk] add access to opj_apps_config.h to old applications 2013-03-17 22:22:11 +00:00
Mickael Savinaud
f769d5e27f [trunk] manage correctly the case where meth value is not correct (thanks winfried) 2013-03-17 18:27:41 +00:00
Mickael Savinaud
1e414c8f37 [trunk] correct issue 188 (thanks winfried) and add test about it. Fixes issue 188 2013-03-17 18:16:03 +00:00
Mickael Savinaud
07e6994be1 [trunk] use OPJ_ prefix on HAVE variable also for tests 2013-03-17 17:08:12 +00:00
Mickael Savinaud
0abf4f8fbb [trunk]remove wrong code in mj2 library detected by winfried (thanks to you) 2013-03-17 17:06:30 +00:00
Mickael Savinaud
a13e4a77e0 [trunk] use everywhere the new opj_ prefix for HAVE variables and use the opj_apps_config file (thanks to winfried) 2013-03-17 17:03:00 +00:00
Mickael Savinaud
6de2271e2a [trunk] use the home made macro to ensure the existence of some include file 2013-03-13 15:21:20 +00:00
Mickael Savinaud
021e255282 [trunk] use the opj_ prefix for the HAVE_FSEEKO variable 2013-03-13 15:17:35 +00:00
Mickael Savinaud
92b1e038c1 [trunk] correct missing variable in openjpeg config file 2013-03-13 10:18:04 +00:00
Mickael Savinaud
a8c33ae219 [trunk] remove some unused variable from opj_config and rename other one with opj_ prefix 2013-03-03 18:06:27 +00:00
Mickael Savinaud
e7bc30b409 [trunk] split into two config files config options related to the lib and to the application. 2013-03-03 17:55:35 +00:00
Mickael Savinaud
efaefa21fc [trunk] add the prefix opj_ to deprecated everywhere 2013-02-18 13:19:52 +00:00
Mickael Savinaud
42bd417acf [trunk] update documentation of new functions _v3 and mark deprecated related functions 2013-02-17 22:57:14 +00:00
Mickael Savinaud
af58e8e8f9 [trunk] move to the new API for function opj_stream_create_default_file_stream. Use now opj_stream_create_default_file_stream_v3 (WIP) 2013-02-17 10:34:31 +00:00
Mickael Savinaud
4bf4a7668e [trunk] move to the new API for function opj_stream_destroy. Use now opj_stream_destroy_v3 (WIP) 2013-02-16 17:39:23 +00:00
Mickael Savinaud
c03ca9c73c [trunk] rename deprecated macro with opj_ prefix and use it for opj_stream_destroy function 2013-02-16 17:31:22 +00:00
Mickael Savinaud
d5884afcf3 [trunk] add functions to avoid to use FILE* into the API (thanks winfried).
Update issue 120 and update issue 198
2013-02-16 17:20:55 +00:00
Mickael Savinaud
a2aeafe85b [trunk] add a test related to issue 202 2013-02-04 13:22:56 +00:00
Mickael Savinaud
0109b39f58 [trunk] update convert about png writing with additional metadata (thanks winfried) 2013-02-03 10:18:10 +00:00
Mickael Savinaud
752e978d56 [trunk] update test suite for issue 5 and 62 2013-02-03 09:55:31 +00:00
Mickael Savinaud
8b36a11f2b [trunk] backout one part of the rev 2266 2013-02-03 09:07:23 +00:00
Mathieu Malaterre
ccd448d626 [trunk] JP3D: Fix issue with Z handling in packet iterator 2013-01-03 14:26:38 +00:00
Mathieu Malaterre
44fb38949b [trunk] JP3D: Handles errors properly 2013-01-03 14:25:49 +00:00
Mathieu Malaterre
ad1532ed57 [trunk] JP3D: remove old debug 2013-01-03 14:22:34 +00:00
Mathieu Malaterre
caaec3bb05 [trunk] JP3D: convert from DOS to UNIX eol 2013-01-02 18:19:56 +00:00
Mathieu Malaterre
df47fae287 [trunk] JP3D: remove exe bit from source files 2013-01-02 18:16:14 +00:00
Mickael Savinaud
b65bf48369 [trunk] merge from branch 1.5 a correction about large code-block data (decoding part) and add tests about issue 5 and issue 62 2012-12-18 17:46:33 +00:00
Mathieu Malaterre
4c02acb728 [trunk] remove left over from v2 transition 2012-12-11 14:15:46 +00:00
Mathieu Malaterre
8c9151c86b [trunk] JP3D: completely redo the opj_tgt_create function. Take as input the initial opj_tgt_create as found in openjpeg 1.5, and extend with the 3rd dimension. 2012-12-11 14:09:24 +00:00
Rex Dieter
c075742bc8 Doxyfile: HTML_TIMESTAMP = NO
helps when comparing the output of multiple runs,
and distros will appreciate avoiding multilib conflicts.
2012-12-07 15:07:50 +00:00
Mickael Savinaud
b42cf317d6 [trunk] correct the new name of OPJ_HAVE_STDINT_H everywhere 2012-12-04 13:13:50 +00:00
Mickael Savinaud
f5429e4ce8 [trunk] remove SSIZE which is unused in openjpeg and rename HAVE_STDINT_H to OPJ_HAVE_STDINT_H 2012-12-04 12:51:00 +00:00
Mickael Savinaud
82dad8e629 [trunk] add openjpeg.h in some files of openjpip to use some opj type (thanks winfried) 2012-12-04 12:20:30 +00:00
Mickael Savinaud
59aa37fe2b [trunk] move typedef from opj_stdint.h to openjpeg.h and add an include of stdio.h in openjpeg.h. Fixes issue 197 2012-12-03 13:26:30 +00:00
Mickael Savinaud
0adb43f06e [trunk] correct the encoding of colr box information (thanks Winfried) 2012-12-03 13:04:43 +00:00
Mickael Savinaud
87e09a09da [trunk]add the pkgconfig support for openjp2 (thanks Winfried) 2012-12-03 12:21:48 +00:00
Mathieu Malaterre
ba630816bc [trunk] JP3D codec was trying to pull information from the registration parameter in COM. This is non-standard. 2012-11-28 13:37:50 +00:00
Mathieu Malaterre
863fdafcd5 [trunk] As per T.809 code block are not shifted in JP3D
Table A.7 
3D code-block width, height and depth exponent values xcb = value, ycb = value
or zcb = value.
NOTE – This redefines Rec. ITU-T T.800 | ISO/IEC 15444-1 significantly! The 3D
code-block width, height and depth are limited to powers of two with the minimum
size being 20 and the maximum being 210.
Further, the 3D code-block size is restricted so that 4 ≤ xcb+ycb+zcb ≤ 18.
2012-11-28 13:06:02 +00:00
Mathieu Malaterre
be5e6941bf [trunk] JP3D: this is safe to write comment using Registration: ISO-8859-15 2012-11-28 12:21:51 +00:00
Mathieu Malaterre
7980115412 [trunk] JP3D fix issue with Registration value in COM marker. Move COM marker just before COD. 2012-11-28 12:18:17 +00:00
Mathieu Malaterre
cab86a0deb [trunk] jp3d: fix command line parsing for subsampling 2012-11-28 12:04:40 +00:00
Mathieu Malaterre
be3a1da14a [trunk] Fix issue with ITU-T T.809 (05/2011)
- ZSI is now known as NSI (FF54)
- NSI now stores Ndim (=3)
- CAP extended marker was not set properly
2012-11-28 11:46:16 +00:00
Mathieu Malaterre
650c587875 [trunk] Fix compilation issue where size_t would be undefined 2012-11-28 10:54:33 +00:00
Mickael Savinaud
d29c5760bd [test] update the list of files which will be gracefully rejected when they are dump 2012-11-27 09:24:24 +00:00
Mickael Savinaud
ee9d777d69 [trunk] add empty test about the issue 197. Updates issue 197 2012-11-27 09:11:16 +00:00
Mickael Savinaud
59582bafa3 [trun[trunk] check if the dx and dy steps are not incorrect according to the JPEG2000 norm (thanks Even).
Test associated to this issue should nicely fail. Fixes issue 194
2012-11-26 16:24:29 +00:00
Mickael Savinaud
1ad85ac9ee [trunk] check if the number of tiles is not incorrect regarding the JPEG2000 norm (thanks Even).
Test associated to this issue should nicely fail. Fixes issue 163
2012-11-26 16:13:32 +00:00
Mickael Savinaud
999a84c77a [trunk] test about issue 192 should nicely fail 2012-11-26 16:03:35 +00:00
Mickael Savinaud
48e0d167aa [trunk] check the index of the component in read_qcc (thanks Even). fixes issue 192 2012-11-26 15:58:14 +00:00
Mickael Savinaud
f14da66ce5 [trunk] update test suite with issue 191 to 194 and update patch for 191 which should fail properly 2012-11-26 13:37:33 +00:00
Mickael Savinaud
14ab311d2f [trunk] fix issue 191 (thanks Even) 2012-11-19 13:37:04 +00:00
Mickael Savinaud
02ab4363b6 [trunk]remove not used structures 2012-11-19 10:31:43 +00:00
Mickael Savinaud
e1f7c73324 [trunk] remove the extended struct it is a bad idea 2012-11-16 15:40:23 +00:00
Mickael Savinaud
3042fc2a29 [trunk] add extended capacities for future development 2012-11-16 09:35:42 +00:00
Mathieu Malaterre
a622c1c2fe [trunk] rename USE_LEGACY into OPJ_USE_LEGACY for consistency with other #define 2012-11-16 09:31:12 +00:00
Mathieu Malaterre
b3e467dcba [trunk] Attempt to fix compilation error with mj2 2012-11-16 09:19:11 +00:00
Mathieu Malaterre
c0259255b0 [trunk] Attempt to fix compilation error with mj2 2012-11-16 09:18:03 +00:00
Mickael Savinaud
9398bc1764 [trunk] solve the problem with new opj_ symbols in color.c 2012-11-16 08:36:23 +00:00
Mickael Savinaud
fcf9fa3651 [trunk] add opj_ prefix to some internal define and use the new opj type instead of int and float in some files 2012-11-16 08:29:43 +00:00
Mickael Savinaud
583df79be9 [trunk]rename the cinema option to old one 2012-11-15 19:24:51 +00:00
Mickael Savinaud
0e0b892493 [trunk] update some applications with new OPJ_BOOL type 2012-11-15 19:18:43 +00:00
Mickael Savinaud
78a8d64a92 [trunk] use OPJ_INT32 instead of int in t2.c 2012-11-15 16:46:08 +00:00
Mickael Savinaud
5433e4dab8 [trunk] rename function with the new opj_ prefix 2012-11-15 16:42:55 +00:00
Mickael Savinaud
c3c59b010b [trunk] solve a potential bug when we test the realloc 2012-11-15 16:37:57 +00:00
Mickael Savinaud
8eb481b6c6 [trunk] add an assert to spot a problem. update issue 189 2012-11-15 16:28:44 +00:00
Mickael Savinaud
d5efeb7df5 [trunk]update the copyright, the authors and thanks to respect the license 2012-11-15 15:22:29 +00:00
Mickael Savinaud
f663042893 [trunk] propagate the new OPJ_ symbol and type to openjpip 2012-11-15 14:43:50 +00:00
Mickael Savinaud
f07c1a11a0 [trunk]rename decompress options with the goog name 2012-11-15 14:29:38 +00:00
Mickael Savinaud
ce297bfa9e runk] fix the documentation of the API 2012-11-15 14:22:13 +00:00
Mickael Savinaud
ba1682c120 [trunk] avoid memory leak in j2k_random_tile_access.c 2012-11-15 13:51:00 +00:00
Mickael Savinaud
e212154d8d [trunk]extend last commits to apps 2012-11-15 13:38:35 +00:00
Mickael Savinaud
ec0fe09138 [trunk] move opj_bool to OPJ_BOOL to follow the other type 2012-11-15 13:13:36 +00:00
Mickael Savinaud
8562ed3018 [trunk]remove OPJ_LIMIT_DECODING struct which is not useful for v2 API 2012-11-15 13:02:33 +00:00
Mickael Savinaud
21b0ccf859 [trunk] rename public symbols with OPJ_ prefix (enum part) 2012-11-15 12:58:32 +00:00
Mickael Savinaud
84c93c2fea [trunk] rename public symbols with OPJ_ prefix 2012-11-15 12:25:11 +00:00
Mickael Savinaud
e3c2305ff4 [trunk] remove warnings raised by flags -Wall -Wextra -pedantic 2012-11-13 17:35:15 +00:00
Mickael Savinaud
0e3c467a5b [trunk] remove warnings raised by vs11-beta analyzer 2012-11-13 16:59:03 +00:00
Mickael Savinaud
94880d8f36 [trunk] remove warnings raised by flags -Wall -Wextra -pedantic 2012-11-13 15:26:13 +00:00
Mickael Savinaud
7307bb6e9a [trunk] remove warnings raised by flags -Wall -Wextra -pedantic and vs9 analyzer 2012-11-13 15:16:35 +00:00
Mickael Savinaud
4263410fe8 [trunk] remove warnings raised by flags -Wall -Wextra -pedantic 2012-11-13 12:59:35 +00:00
Mickael Savinaud
cb0eb855ca [trunk] manage the case where the SOT marker is alone, PSot=12 (case of PHR data).
Fixes  issue 162
2012-11-13 11:18:58 +00:00
Mickael Savinaud
569d0ec7cc [trunk] avoid memory leak in opj_t2_decode_packets 2012-11-13 09:47:16 +00:00
Mickael Savinaud
1021e87522 [trunk] add some new tests related to new data; indicate that some tests should failed because data are wrong 2012-11-12 16:32:28 +00:00
Mathieu Malaterre
dc34cf362f [trunk] Add more testing to the tile access/random
Update issue 186
2012-11-08 16:47:35 +00:00
Mathieu Malaterre
e71749428c [trunk] Fix what looks like a copy/paste error
Update issue 186
2012-11-08 16:45:27 +00:00
Mathieu Malaterre
8f58b776b0 [trunk] Add more test in j2k_random_tile_access
Update issue 186
2012-11-08 16:41:01 +00:00
Mathieu Malaterre
fb0a11636f [trunk] Add new tests (j2k_random_tile_access) 2012-11-08 16:30:46 +00:00
Mickael Savinaud
7bf09734d7 [trunk] remove old structure from testempty 2012-10-30 08:12:32 +00:00
Mickael Savinaud
853bcb3c64 [trunk] add documentation 2012-10-29 22:12:02 +00:00
Mickael Savinaud
4d32395fe1 [trunk]OPJ_STREAM_READ is now equal to OPJ_TRUE and OPJ_STREAM_WRITE to OPJ_FALSE 2012-10-29 22:06:28 +00:00
Mickael Savinaud
a6a141d326 [trunk] move opj_event_mgr struct from openjpeg. h to event.h 2012-10-29 22:02:02 +00:00
Mickael Savinaud
e0161e03db [trunk] remove old struct from V1 and not used in V2 2012-10-29 21:49:33 +00:00
Mathieu Malaterre
82d29d4c2a [trunk] Remove bool.h, use opj_bool instead
Fix remaining opj_calloc/malloc/free issues
2012-10-29 16:24:39 +00:00
Mathieu Malaterre
1a5791750b [trunk] Fix simple warning about unused variables 2012-10-29 16:07:24 +00:00
Mathieu Malaterre
482d9b58b3 [trunk] Make sure to use off_t 2012-10-29 16:07:09 +00:00
Mathieu Malaterre
5903dd7d82 [trunk] Remove temp fix now that mj2 is fixed 2012-10-29 15:28:59 +00:00
Mathieu Malaterre
301b1ffbc7 [trunk] Update version number to 2.0. This will help for testing generating scripts 2012-10-29 14:36:35 +00:00
Mathieu Malaterre
759be64115 [trunk] Fix remainings issues with doxygen doc
Convert DOS files to UNIX eol
2012-10-29 14:35:11 +00:00
Mickael Savinaud
ece2a2d6c2 [trunk] Normalize the return type of opj_read_from_file regarding the test in the calling function 2012-10-29 13:53:02 +00:00
Mathieu Malaterre
f31957c502 [trunk] Remove some simple warnings about missing prototypes 2012-10-29 13:28:51 +00:00
Mathieu Malaterre
fb69541cfa [trunk] Fix compilation when JPIP is OFF 2012-10-29 13:27:39 +00:00
Mathieu Malaterre
e189679ebc [trunk] Merge back JPIP modification into v2
This commit imports changes from openjpip.c from r2122 into openjpeg.c
2012-10-29 10:12:03 +00:00
Mickael Savinaud
18e7fcc37f [trunk] remove warnings related to the use of -Wall -Wextra -pedantic 2012-10-29 10:08:35 +00:00
Mickael Savinaud
1c8a657044 [trunk] finish to remove the old cio_ struct (last comment is incomplete) 2012-10-26 10:10:22 +00:00
Mickael Savinaud
cdea5c8eef [trunk] remove some warnings from -Wall -Wextra -pedantic 2012-10-26 10:04:55 +00:00
Mickael Savinaud
bcc386e3bb [trunk]remove some warnings raised by Wall 2012-10-26 09:39:52 +00:00
Mickael Savinaud
a2bd3bb75b [trunk] use the right cp structure in image.h 2012-10-26 07:52:27 +00:00
Mickael Savinaud
b63d618e48 [trunk] remove last warnings from t1 2012-10-25 17:31:18 +00:00
Mickael Savinaud
8864c2d59b [trunk] rename t1_getwmsedec_v2 to opj_t1_getwmsedec and remove t1_getwmsedec 2012-10-25 17:27:22 +00:00
Mickael Savinaud
c75073fbf4 [trunk] cancel previous commit about use of t1_decode_cblks from v2. We should use t1_decode_cblks from 1.5 because it is faster (rev 557) 2012-10-25 17:23:54 +00:00
Mickael Savinaud
cf4529d058 [trunk] use the opj_ prefix for last t1 functions 2012-10-25 15:50:58 +00:00
Mickael Savinaud
9b6900b058 [trunk] [trunk] remove old opj_tcp and rename opj_tcp_v2 to opj_tcp 2012-10-25 15:15:02 +00:00
Mickael Savinaud
7f7ef068fc [trunk] [trunk] remove old opj_cp and rename opj_cp_v2 to opj_cp 2012-10-25 15:09:31 +00:00
Mickael Savinaud
a41790ce8a [trunk] [trunk] remove old opj_t2 and rename opj_t2_v2 to opj_t2 2012-10-25 14:54:19 +00:00
Mickael Savinaud
06615a556d [trunk] rename opj_tcd_truct_v2 to opj_tcd_struct 2012-10-25 14:49:10 +00:00
Mickael Savinaud
94a69c2b31 [trunk] rename opj_j2k_v2 to opj_j2k 2012-10-25 14:27:09 +00:00
Mickael Savinaud
425ff2f81d [trunk] remove old opj_j2k struct 2012-10-25 14:22:29 +00:00
Mickael Savinaud
2257166e61 [trunk] rename opj_jp2_v2 to opj_jp2 2012-10-25 14:16:19 +00:00
Mickael Savinaud
56cf5f4f67 [trunk] remove old opj_jp2 struct 2012-10-25 14:11:19 +00:00
Mickael Savinaud
668484ba8f [trunk] correct a mis use of an old struct 2012-10-25 14:10:01 +00:00
Mickael Savinaud
f824078c14 [trunk] rename opj_event_msg_v2 to opj_event_msg 2012-10-25 13:49:20 +00:00
Mickael Savinaud
3250833a62 [trunk]remove old opj_event_mgr function 2012-10-25 13:46:40 +00:00
Mickael Savinaud
8bc24912d1 [trunk] style 2012-10-25 13:35:30 +00:00
Mickael Savinaud
52f6f7e0c7 [trunk] remove cio deprecated functions 2012-10-25 13:29:41 +00:00
Mickael Savinaud
ee8ee69c30 [trunk]clean jpip marker functions but it is still experimental 2012-10-25 13:15:37 +00:00
Mickael Savinaud
4941ebcc91 [trunk] remove jpt.c/.h which used functions not used by v2. The code is always available in branch 1.5 2012-10-25 11:45:44 +00:00
Mathieu Malaterre
9adbea785b [trunk] Fix remaining issue with OPJ_CALLCONV 2012-10-25 10:41:55 +00:00
Mathieu Malaterre
fd19413196 [trunk] Add documentation for stable API/ABI and gcc flags on UNIX 2012-10-25 08:44:27 +00:00
Mathieu Malaterre
6300a8a0a2 [trunk] marking as deprecated the old cio interface 2012-10-25 08:38:04 +00:00
Mathieu Malaterre
66c1228c95 [trunk] Remove some simple warnings about missing prototypes 2012-10-25 08:20:12 +00:00
Mathieu Malaterre
4585b23552 [trunk] Fix OpenJPWL compilation
Simply move files over from branch 1.5 onto current trunk, and use current openmj2 copy (it contains a copy of openjpeg 1.5.x)
2012-10-25 08:15:41 +00:00
Mathieu Malaterre
23a624f73a [trunk] Since r2060 (and r2059) openjpip is now a first class shared library, instead of a local static lib which expose all the symbols.
As such re-apply changes from r2077 which were removed in r2122
Also remove old code for now removed opj_jpip_compress
2012-10-25 07:53:22 +00:00
Mathieu Malaterre
f3d7d2f7b1 [trunk] Rework r2077
r2077 did expose too much of the detail implementation of OpenJPEG. Rework dependencies in between JPIP file level details and JPIP client/server arch.
Move JPIP file level functionalities back into OpenJP2 as was the case in openjpeg 1.5.x. Use new cio func.
2012-10-25 07:39:59 +00:00
Mathieu Malaterre
0358983ee6 [trunk] Add missing newline 2012-10-25 07:06:12 +00:00
Mathieu Malaterre
a0977266b4 [trunk] Run fix_comment on invert.c 2012-10-25 06:58:30 +00:00
Mickael Savinaud
76947f0074 [trunk] add the support of complex mct encoding when we setup the j2k encoder 2012-10-24 15:19:51 +00:00
Mickael Savinaud
f649754018 [trunk] correct a small warning raised by continous 2012-10-24 14:52:15 +00:00
Mickael Savinaud
b1c5ce2517 [trunk] remove old structures from tcd.h 2012-10-24 14:38:07 +00:00
Mickael Savinaud
f2db5ec4fb [trunk] use the right v2 structure 2012-10-24 14:10:03 +00:00
Mickael Savinaud
db08494776 [trunk] rename flag_t to opj_flag_t 2012-10-24 14:06:10 +00:00
Mickael Savinaud
9166d595e6 [trunk] use new opj prefix and type with raw functions 2012-10-24 13:18:12 +00:00
Mickael Savinaud
f1061c8763 [trunk] remove a usefulness test before a free 2012-10-24 13:05:30 +00:00
Mickael Savinaud
fca9803bee [trunk] update jp2./.h to v2 style: use new OPJ type, manage case where bpcc box is available even if ihdr indicate that it is not needed; resolve a LH TODO 2012-10-24 12:49:28 +00:00
Mickael Savinaud
0d841b5e05 [trunk] add documentation to the message handler functions 2012-10-24 11:17:48 +00:00
Mickael Savinaud
216791c3fb [trunk] Finalize dwt.v/.h with the v2 style : remove last functions already optimized, add opj_ prefix, use new name of the functions 2012-10-24 09:29:34 +00:00
Mickael Savinaud
12c4e68058 [trunk] finalize bio.c/.h related to the v2 style 2012-10-24 09:09:37 +00:00
Mathieu Malaterre
b4b451863d [trunk] Remove SONAME from Java binding 2012-10-22 10:49:22 +00:00
Mathieu Malaterre
f2808de855 [trunk] Fix java binding installation 2012-10-22 10:41:44 +00:00
Mathieu Malaterre
9b2897ccd9 [trunk] Fix another set of issue with calling convention 2012-10-15 15:52:43 +00:00
Mathieu Malaterre
3c4698435c [trunk] Fix issue on windows OS. Need to explicitely state the calling convention 2012-10-15 15:50:05 +00:00
Mathieu Malaterre
98682e1073 [trunk] Remove some warnings about missing prototypes (gcc) 2012-10-15 15:47:56 +00:00
Mathieu Malaterre
d6bcb8b7e0 [trunk] Fix JPIP compilation. Some prototypes were not respected. 2012-10-15 15:47:19 +00:00
Mickael Savinaud
a501237ae3 [trunk] propagate the renaming to openjpwl 2012-10-15 13:32:07 +00:00
Mickael Savinaud
f6622c2fbb [trunk] fix a compilation error with windows and new public function opj_j2k_start_compress 2012-10-15 13:00:31 +00:00
Mickael Savinaud
b08b90d71c [trunk]rename j2k_lib to opj_clock 2012-10-15 12:58:32 +00:00
Mickael Savinaud
b46ed8c7a3 [trunk] modify type of opj_clock function 2012-10-15 12:43:44 +00:00
Mathieu Malaterre
45869ce843 [trunk] Fix issue during renaming of man page 2012-10-15 11:57:47 +00:00
Mathieu Malaterre
dff377a741 [trunk] Fix compilation:
- using mingw32 compiler (missing exported symbols)
- using -fvisibility=hidden (gcc on UNIX)
2012-10-15 09:44:34 +00:00
Mathieu Malaterre
b24cf8d157 [trunk] Fix Java binding compilation. Need to link against openmj2 for now to resolve all symbols.
Add a local indec.c (pulled from opj 1.5 branch)
2012-10-15 09:43:28 +00:00
Mathieu Malaterre
2ad90b7c41 [trunk] Fix missing -lm to openjpwl 2012-10-15 08:38:48 +00:00
Mathieu Malaterre
a40fc41988 [trunk] Fix missing link to zlib 2012-10-15 08:13:27 +00:00
Mathieu Malaterre
3416c6d91b [trunk] Fix openmj2 compilation in static mode. 2012-10-15 08:09:31 +00:00
Mathieu Malaterre
54c2bcb60f [trunk] Fix compilation in static mode. Prevent duplicate symbols with convert.c implementation 2012-10-15 08:02:30 +00:00
Mathieu Malaterre
44a5108e1d [trunk] Add missing newline character 2012-10-15 07:57:19 +00:00
Mathieu Malaterre
d8715871fa [trunk] Fix issues in man pages. 2012-10-15 07:52:27 +00:00
Mathieu Malaterre
772fcc963c [trunk] Fix installaiton of header file 2012-10-15 07:52:07 +00:00
Mathieu Malaterre
75b7104724 [trunk] remove left-over from ->jpip_on implementation. JPIP is now completely removed from openjp2 and openmj2. Document jpip_iptr_offset variable 2012-10-15 07:38:10 +00:00
Mathieu Malaterre
fe3c1f9061 [trunk] Fix warning for no previous prototype by using static function 2012-10-15 07:31:05 +00:00
Mathieu Malaterre
e30818ce39 [trunk] Fix advanced (and experimental) Java binding. As reported on the mailing list. 2012-10-10 13:26:29 +00:00
Mathieu Malaterre
2e30886a0d [trunk] Fix openmj2/mj2 compilation
As reported on the mailing list, it is better to have a working (compiling) mj2 codec rather than nothing. mj2 uses it own copy of openjpeg 1.5

Update issue 177
2012-10-09 09:45:43 +00:00
Mathieu Malaterre
b18ffbd08a [trunk] Use opj_malloc/opj_free in jpip bin
Update issue 177
2012-10-09 09:44:24 +00:00
Mathieu Malaterre
16d2dc662f [trunk] FolderReorgProposal task. Remove left over of JPIP
JPIP code was moved from JP2 to openjpip

Update issue 177
2012-10-09 09:11:24 +00:00
Mathieu Malaterre
9832c911b3 [trunk] Update JPIP (FolderReorgProposal task)
This commit does three things:
- Use opj_malloc/calloc/free instead of the default C ones.
- Update JPIP API to start using cio _v2 API
- Create a new opj_jpip_compress which is the replacement for image_to_j2k -jpip

Update issue 177
2012-10-08 15:59:17 +00:00
Mathieu Malaterre
23f5eeec20 [trunk] Make openjpip a first class shared lib, for future linking 2012-10-05 17:05:06 +00:00
Mathieu Malaterre
16106b2978 [trunk] First step in moving JPIP code out of openjp2 2012-10-05 16:57:30 +00:00
Mickael Savinaud
c66e6be4a4 [trunk] update t1_generate_luts.c with the right ouput to generate t1_luts 2012-10-05 12:34:46 +00:00
Mathieu Malaterre
eda4c26d24 [trunk] Fix spelling. writting -> writing 2012-10-05 09:20:05 +00:00
Mickael Savinaud
4b140e060b [trunk] rename int.h to opj_intmath.h and rename all its functions with opj_ prefix 2012-10-05 09:10:15 +00:00
Mickael Savinaud
1fefa03329 [trunk] move fix_mul inside int.h and remove fix.h from the project 2012-10-05 08:32:05 +00:00
Mickael Savinaud
37ff9b029c [trunk] remove warnings 2012-10-05 08:18:55 +00:00
Mickael Savinaud
e798fe37e1 [trunk]remove warnings in pi.c through the update of poc struct types with new opj_types. 2012-10-03 17:03:41 +00:00
Mickael Savinaud
f4a8f7165c [trunk] update global functions of tgt with opj_ prefix 2012-10-03 15:06:58 +00:00
Mickael Savinaud
2d52e409c2 [trunk] (style) move global pi functions to the right place and update indentation 2012-10-03 14:41:40 +00:00
Mickael Savinaud
1b5e677d0c [trunk] remove old v1 functions and rename pi_initialise_encode_v2 to opj_pi_initialise_encode; pi_create_encode_v2 to opj_pi_create_decode; pi_destroy_v2 to opj_pi_destroy; pi_create_decode_v2 to opj_pi_create_decode 2012-10-03 14:29:26 +00:00
Mickael Savinaud
c508923f04 [trunk] update pi_check_next_level with the opj_ prefix and change output type to be more convenient 2012-10-03 13:25:03 +00:00
Mickael Savinaud
6c4024796e [trunk]rename pi_update_encoding_parameters to opj_pi_update_encoding_parameters 2012-10-03 12:50:44 +00:00
Mickael Savinaud
bd2c6cfa55 [trunk] replace pi_next by opj_pi_next 2012-10-03 12:43:15 +00:00
Mickael Savinaud
bd74db932e [trunk] update local function of pi.c with the opj_ prefix and the new opj types 2012-10-03 12:39:17 +00:00
Mickael Savinaud
439337fb1b [trunk] update mqc global functions with opj_ prefix 2012-10-03 12:12:33 +00:00
Mickael Savinaud
5ffe6f5acf [trunk] add comments to check some parts of mqc.c and update types 2012-10-03 11:45:53 +00:00
Mickael Savinaud
f281f8cb75 upadate mqc with new opj_type and use opj_ prefix for local functions 2012-10-03 11:38:12 +00:00
Mickael Savinaud
3a46e2d86b [trunk] correct warnings linked to static dwt functions because declaration is not hide when we use SSE 2012-10-03 09:52:09 +00:00
Mickael Savinaud
6a84a1788b {trunk]update mct functions with opj_ prefix and new opj type
add some comments
2012-10-03 09:47:50 +00:00
Mickael Savinaud
df870e5241 [trunk] update global functions of bio.c with opj_prefix and new opj type 2012-10-03 09:04:44 +00:00
Mathieu Malaterre
82afd3a891 [trunk] Set of warnings fix for gcc -pedantic 2012-10-02 09:41:51 +00:00
Mathieu Malaterre
514fc72050 [trunk] Build small internal tools to generate t1_luts.h 2012-10-02 07:45:49 +00:00
Mathieu Malaterre
4dba9aed22 [trunk] Import opj_malloc.h from branch 1.5.x 2012-10-02 06:51:59 +00:00
Mathieu Malaterre
a46dbe6941 [trunk] V2 will be release with SOVERSION=6 2012-10-01 15:45:24 +00:00
Mathieu Malaterre
394db7b738 [trunk] Remove old function tgt_create
Fix some warnings about size_t
2012-10-01 15:29:36 +00:00
Mathieu Malaterre
3ad58ee1f5 [trunk] Update README to reflect FolderReorgProposal
Update issue 177
2012-10-01 15:16:33 +00:00
Mathieu Malaterre
00aa77f2d9 [trunk] FolderReorgProposal fix. 3rd party variables were not set
Update issue 177
2012-10-01 14:50:26 +00:00
Mathieu Malaterre
60fc79c717 [trunk] Requires CMake 2.8.2 at least 2012-10-01 14:18:20 +00:00
Mathieu Malaterre
f501186b18 [trunk] Fix minor cmake style 2012-10-01 12:29:09 +00:00
Mathieu Malaterre
fe6d9ed9ba [trunk] import unit testing from 1.5.x branch 2012-10-01 12:26:27 +00:00
Mathieu Malaterre
c450d418ef [trunk] remove warnings generated by all project in thirdparties 2012-10-01 11:14:20 +00:00
Mathieu Malaterre
c3b1af023b [trunk] Discard warnings from tiff package 2012-10-01 11:06:10 +00:00
Mathieu Malaterre
bf37be46b8 [trunk] rename PACKAGE_VERSION to OPJ_PACKAGE_VERSION
This prevent conflicts with TIFF package which also defines PACKAGE_VERSION
2012-10-01 10:39:39 +00:00
Mathieu Malaterre
4466c31fc2 [trunk] Fix missing include directory 2012-10-01 10:20:31 +00:00
Mathieu Malaterre
b2bebcf5ce [trunk] fix compilation on windows where getopt is not available 2012-10-01 10:19:12 +00:00
Mathieu Malaterre
de33ba029b [trunk] Fix missing getopt symbols on windows 2012-10-01 10:11:46 +00:00
Mathieu Malaterre
465db44499 [trunk] FolderReorgProposal task: Fix openjp2 lib name 2012-10-01 10:08:01 +00:00
Mathieu Malaterre
abdb8ee3f7 [trunk] Fix a set of warnings about C90 issues 2012-10-01 10:01:09 +00:00
Mathieu Malaterre
aa6b4b4970 [trunk] FolderReorgProposal task. Do not rebuild doxygen always
Update issue 177
2012-10-01 09:37:19 +00:00
Mathieu Malaterre
25cbfcf34a [trunk] FolderReorgProposal task: cleanup doxygen
Update issue 177
2012-10-01 09:20:30 +00:00
Mathieu Malaterre
cffc33a51c [trunk] FolderReorgProposal task: fix jpip doxygen
Update issue 177
2012-10-01 08:43:02 +00:00
Mathieu Malaterre
5db7b01fa2 [trunk] FolderReorgProposal task: Fix doxygen
Update issue 177
2012-10-01 08:30:04 +00:00
Mathieu Malaterre
1ca5ca8392 [trunk] FolderReorgProposal task: update install instruction
Update issue 177
2012-10-01 07:59:48 +00:00
Mathieu Malaterre
93761d9ab5 [trunk] FolderReorgProposal task: move source code to source dir 2012-10-01 07:49:52 +00:00
Mathieu Malaterre
bb16d8816c [trunk] FolderReorgProposal task: only keep a single build system 2012-10-01 07:33:59 +00:00
Mickael Savinaud
e1cd500ac5 [trunk] update the name of the executable used for the tests 2012-09-30 16:28:32 +00:00
Mathieu Malaterre
2d09cbfd21 [trunk] FolderReorgProposal task: rename JP3D CLI tools
Update issue 177
2012-09-28 09:57:19 +00:00
Mathieu Malaterre
d84b16caf9 [trunk] FolderReorgProposal task: rename MJ2/JPIP CLI tools
Update issue 177
2012-09-28 09:52:57 +00:00
Mathieu Malaterre
95f06f0591 [trunk] FolderReorgProposal task: fix JPWL
Update issue 177
2012-09-28 09:26:51 +00:00
Mathieu Malaterre
3bf4d635f2 [trunk] FolderReorgProposal task: rename cli tools
Update issue 177
2012-09-28 09:12:22 +00:00
Mathieu Malaterre
a4fa18e92d [trunk] FolderReorgProposal task: Fix Viewer
Update issue 177
2012-09-28 08:59:10 +00:00
Mathieu Malaterre
f71af2a2ef [trunk] FolderReorgProposal task: refactor MJ2
Update issue 177
2012-09-28 08:51:14 +00:00
Mathieu Malaterre
3e62f8d9b7 [trunk] FolderReorgProposal task: add JP3D
Update issue 177
2012-09-28 08:32:34 +00:00
Mathieu Malaterre
028720c9ec [trunk] Continue FolderReorgProposal task. Missing java wrapping
Update issue 177
2012-09-28 08:17:02 +00:00
Mathieu Malaterre
d518970039 [trunk] Start FolderReorgProposal task
Update issue 177
2012-09-28 08:11:41 +00:00
Mickael Savinaud
8363a6ab1e update j2k_lib with new opj type 2012-09-27 14:50:06 +00:00
Mickael Savinaud
a540dcd2e2 correct a warning in image.c 2012-09-27 14:48:47 +00:00
Mickael Savinaud
58b2c6c4a5 clean function_list functions 2012-09-27 14:47:34 +00:00
Mickael Savinaud
34ffde6799 [trunk] Rename bio_create and bio_destroy with opj_ prefix 2012-09-27 14:42:08 +00:00
Mickael Savinaud
e7cd945000 [trunk] udpate local functions of bio.c with opj_prefix and new opj types
update opj_bio structure
2012-09-27 14:36:30 +00:00
Mickael Savinaud
ccf0f05e98 [trunk] update t1_luts.h with opj type 2012-09-27 14:28:32 +00:00
Mickael Savinaud
36672ad50e [trunk] update some local function of t1 with opj_prefix and new opj type 2012-09-27 14:16:05 +00:00
Mickael Savinaud
8bee3d89c5 rename opj_t1_enc_clnpass and opj_t1_enc_clnpass_step with opj_ prefix and update types used in theses functions 2012-09-27 14:09:41 +00:00
Mickael Savinaud
cf212e55ac [trunk]rename t1_enc_refpass_step and t1_enc_repass with opj_ prefix and update types used in theses functions 2012-09-27 13:56:48 +00:00
Mickael Savinaud
a00f61bd5d {trunk] remove old v1 style function t1_encode_cblk
rename t1_encode_cblk_v2 to opj_t1_encode_cblk
2012-09-27 13:51:01 +00:00
Mickael Savinaud
dca76de872 [trunk] remove old v1 function t1_encode_blocks 2012-09-27 13:43:27 +00:00
Mickael Savinaud
70540f9563 [trunk] remove old v1 style t1_decode_cblk function and rename t1_decode_cblk_v2 to opj_t1_decode_cblk
rename t1_dec_sigpass t1_dec_sigpass_step, t1_updateflags, t1_dec_refpass, t1_dec_refpass_step with opj_prefix and v2 type
delete unused functions in new V2 t1 framework: t1_dec_refpass_raw, t1_dec_refpass_mqc, t1_dec_refpass_mqc_vsc, t1_dec_refpass_step_raw, t1_dec_refpass_step_mqc, t1_dec_refpass_step_mqc_vsc, t1_dec_sigpass_raw, t1_dec_sigpass_mqc, t1_dec_sigpass_mqc_vsc, t1_dec_sigpass_step_raw, t1_dec_sigpass_step_mqc, t1_dec_sigpass_step_mqc_vsc
2012-09-27 13:28:44 +00:00
Mickael Savinaud
a545cb7cff [trunk]remove t2_init_seg
rename t2_init_seg_v2 to opj_t2_init_seg
rename t2_encode_packet_v2 to opj_t2_encode_packet
2012-09-27 13:22:32 +00:00
Mickael Savinaud
9a86a3bd23 [trunk] remove t2_destroy, t2_decode_packets and t2_decode_packet
rename from t2_destroy_v2 to opj_t2_destroy
rename from t2_decode_packets_v2 to opj_t2_decode_packets
rename from t2_decode_packet_v2 to opj_t2_decode_packet
2012-09-27 13:14:15 +00:00
Mickael Savinaud
69673635ef [trunk] remove old v1 style function t2_create
rename t2_create_v2 to opj_t2_create
2012-09-27 13:03:35 +00:00
Mickael Savinaud
77e6971bbb [trunk] remove t2_encode_packet and t2_encode_packets
rename from t2_encode_packets_v2 to opj_t2_encode_packets
2012-09-27 12:53:36 +00:00
Mickael Savinaud
a9a1336502 [trunk] update t2_getnumpasses from V2 branch and put opj_ prefix 2012-09-27 09:54:35 +00:00
Mickael Savinaud
9103674950 [trunk] update t2_putnumpasses with V2 style 2012-09-27 09:48:18 +00:00
Mickael Savinaud
2af39ac017 [trunk] rename t2_getcommacode to opj_t2_getcommacode 2012-09-27 09:40:45 +00:00
Mickael Savinaud
d47b8fef18 [trunk] modify output type of t2_getcommacode 2012-09-27 09:29:47 +00:00
Mickael Savinaud
f8fc214b11 [trunk] rename local functions in t2 with opj_ prefix 2012-09-27 09:14:58 +00:00
Mickael Savinaud
7861bfa45e rename from t2_skip_packet to opj_t2_skip_packet;
rename from t2_skip_packet_data to opj_t2_skip_packet_data;
2012-09-27 08:56:00 +00:00
Mathieu Malaterre
02734264a1 [trunk] Fix possible code execution vuln
Thanks to Huzaifa Sidhpurwala of Red Hat Security Response Team for patch + dataset to reproduce issue.
Technically kdu_expand works fine on the image...

Fixes issue 175
2012-09-12 17:11:17 +00:00
Mathieu Malaterre
4a845f3d04 [trunk] Fix one remaining issue with C90 compat 2012-09-10 12:46:42 +00:00
Mathieu Malaterre
0452ebdfcd [trunk] Use new gcc feature to actually hide exported symbols
Right now we are only using the Windows/POSIX compatibility layer. This means that we have only been marking explicitely which symbols to export.
What this also means is that for one to explicitely remove non-explicitely marked symbols, one has to set -fvisibility=hidden as CFLAGS
2012-09-10 12:38:22 +00:00
Mathieu Malaterre
c8b8c4cf30 [trunk] no need to export MCT_ELEMENT_SIZE symbol 2012-09-10 12:34:46 +00:00
Mathieu Malaterre
1ff1401ff1 [trunk] Fix Heap-based buffer-overflow when decoding openjpeg image
Thanks to Huzaifa Sidhpurwala of Red Hat Security Response Team for report
This does not affect release 1.5.0 and/or 1.5 release branch.

Fixes issue 170
2012-09-10 11:05:15 +00:00
Mathieu Malaterre
3991bbe595 [trunk] Fix some C90 issues. 2012-09-10 09:42:29 +00:00
Mathieu Malaterre
20beb093a1 [trunk] Fix all C90 issues using gcc -pedantic -Wno-long-long to track them
As a side effect, fix all comment style to remove extra gcc output

Fixes issue 173
2012-09-10 09:04:47 +00:00
Mickael Savinaud
3135642ff5 [trunk] Remove CMake-language block-end command arguments
Ancient versions of CMake required else(), endif(), and similar block termination commands to have arguments matching the command starting the block.  This is no longer the preferred style.
Thanks to Hans Johnson
2012-08-30 17:20:03 +00:00
Mickael Savinaud
d5bb3b0039 [trunk] Convert CMake-language commands to lower case
Ancient CMake versions required upper-case commands.  Later command names became case-insensitive.  Now the preferred style is lower-case.
This also changes all the key words to lower case. The primary reason for changing key words is that all documentation for CMakeLists.txt now shows the key words as lower case. Even the printed “Mastering CMake v5” uses lower case.
Thanks to Hans Johnson
2012-08-30 17:14:39 +00:00
Mickael Savinaud
f16216e270 [trunk] STYLE: Clean up documentation errors
Functions should only have formal documentation in one place, and preferably in the declaration (i.e. repeated documentaiton should not be at both the declaration and the definition, because it causes too much maintenance to keep them syncronized).  In cases where the definition is also the declaration (as is often the case for static functions in the .c files) the documentation was preserved at the first use of the function signature.
Functions that are formally documented should contain documentation for each function argument. 
The clang 3.1 compiler issues documentation warnings when the documentation block with @params preceeding a declaration does not match the argument list.  This patch set follows a convention used elsewere in openjpeg to add a placeholder FIXME DOC description where one was previously missing.
Thanks to Hans Johnson.
2012-08-30 16:56:31 +00:00
Mickael Savinaud
de9e1a0693 [trunk] Remove all non-ascii characters (Several compilers and development tools are confused by non-ascii characters in source code. These have been removed) thanks to Hans Johnson 2012-08-30 16:51:30 +00:00
Mickael Savinaud
47b18d89f6 [trunk] COMP: Fix one warning identified by clang31 :
openjpeg/applications/codec/j2k_dump.c:362 col 29: warning: equality comparison
with extraneous parentheses
(thanks to Hans Johnson)
2012-08-30 16:34:17 +00:00
Mickael Savinaud
3f5b474b16 [trunk] COMP: Remove compiler warning (warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]) thnaks to Hans Johnson 2012-08-30 16:22:40 +00:00
Mickael Savinaud
b103fec939 [trunk] COMP: _v2 code remove (thanks to Hans Johnson and Winfried) 2012-08-30 15:43:09 +00:00
Luc Hermitte
728be68bfe [trunk] memory leaks on ppm_data, found in tests NR-p1_05.j2k-dump, NR-p1_03.j2k-dump, ETS-C1P1-p1_03.j2k-decode, ETS-C0P1-p1_03.j2k-decode, ETS-C0P1-p1_05.j2k-decode 2012-08-23 19:37:31 +00:00
Luc Hermitte
5820e97abe [trunk] realloc is misused and may leak memory (Issue#168) (complements: compilation errors) 2012-08-23 19:34:41 +00:00
Luc Hermitte
4e81ea2a8a [trunk] realloc is misused and may leak memory (Issue#168) 2012-08-22 18:45:31 +00:00
Luc Hermitte
7bfdb31c77 [trunk] j2k_to_image gives fff-topic error message for non-openable files (Issue#167) 2012-08-22 18:22:20 +00:00
Mickael Savinaud
44cec04294 fix a compilation error 2012-08-17 15:02:18 +00:00
Mickael Savinaud
c60a84b6f5 rename t1_enc_sigpass_step and t1_enc_sigpass with opj_ prefix and update type 2012-08-17 14:56:42 +00:00
Mickael Savinaud
3b953cc763 remove deprecated v1 style function t1_destroy; rename t1_destroy_v2 to opj_t1_destroy
remove deprecated v1 style function t1_decode_cblks; rename t1_decode_cblks_v2 to opj_t1_decode_cblks
remove deprecated v1 style function t1_encode_cblks; rename t1_encode_cblks_v2 to opj_t1_encode_cblks
remove deprecated v1 style function t1_create; rename t1_create_v2 to opj_t1_create
2012-08-17 14:28:50 +00:00
Mickael Savinaud
859ce39666 rename local functions and struct with opj_ prefix 2012-08-17 13:47:45 +00:00
Mickael Savinaud
7c6ea4ed00 rename local dwt functions
remove deprecated v1 style function dwt_decode_tile; rename dwt_decode_tile_v2 to opj_dwt_decode_tile
2012-08-17 09:12:07 +00:00
Mickael Savinaud
3dab3be859 remove deprecated v1 style function dwt_encode; rename dwt_encode_v2 to opj_dwt_encode
remove deprecated v1 style function dwt_decode; rename dwt_decode_v2 to opj_dwt_decode
remove deprecated v1 style function dwt_getgain; rename dwt_getgain_v2 to opj_dwt_getgain
add opj_dwt_getnorm, opj_dwt_getnorm_real functions 
remove deprecated v1 style function dwt_encode_real; rename dwt_encode_real_v2 to opj_dwt_encode_real
remove deprecated v1 style function dwt_getgain_real; rename dwt_getgain_real_v2 to opj_dwt_getgain_real
rename dwt_calc_explicit_stepsizes to opj_dwt_calc_explicit_stepsizes
2012-08-17 08:27:57 +00:00
Mickael Savinaud
062ed99894 rename local tcd functions with opj_ prefix 2012-08-16 16:44:09 +00:00
Mickael Savinaud
d275fc90cf remove deprecated v1 style function tcd_decode_tile; rename tcd_decode_tile_v2 to opj_tcd_decode_tile
remove deprecated v1 style function tcd_free_decode
remove deprecated v1 style function tcd_free_decode_tile
2012-08-16 16:27:59 +00:00
Mickael Savinaud
dbc4c47b15 remove deprecated v1 style function tcd_destroy; rename tcd_destroy_v2 to opj_tcd_destroy
rename tcd_init_v2 to opj_tcd_init 
remove deprecated v1 style function tcd_malloc_encode
remove deprecated v1 style function tcd_free_encode
remove deprecated v1 style function tcd_init_encode
remove deprecated v1 style function tcd_malloc_decode
remove deprecated v1 style function tcd_malloc_decode_tile
remove deprecated v1 style function tcd_makelayer_fixed; rename tcd_makelayer_fixed_v2 to opj_tcd_makelayer_fixed
remove deprecated v1 style function tcd_rateallocate_fixed; rename tcd_rateallocate_fixed_v2 to opj_tcd_rateallocate_fixed
remove deprecated v1 style function tcd_makelayer; rename tcd_makelayer_v2 to opj_tcd_makelayer
remove deprecated v1 style function tcd_rateallocate; rename tcd_rateallocate_v2 to opj_tcd_rateallocate
remove deprecated v1 style function tcd_encode_tile; rename tcd_encode_tile_v2 to opj_tcd_encode_tile
2012-08-16 16:23:07 +00:00
Mickael Savinaud
e6d97ce928 remove deprecated v1 style function tcd_create; rename tcd_create_v2 to opj_tcd_create 2012-08-16 15:51:55 +00:00
Mickael Savinaud
b7473285ec rename tcd functions with opj_ prefix 2012-08-16 15:48:20 +00:00
Mickael Savinaud
8b7107b81f optimization of dwt_deinterleave_h, dwt_deinterleave_v from v2 branch; update type with OPJ_type 2012-08-16 15:33:33 +00:00
Mickael Savinaud
d1251b2850 correct warnings in j2k.c 2012-08-16 14:29:02 +00:00
Mickael Savinaud
e972589554 remove deprecated v1 style function j2k_write_eoc; rename j2k_write_eoc_v2 to opj_j2k_write_eoc 2012-08-16 14:19:00 +00:00
Mickael Savinaud
0f19c958da remove deprecated v1 style function j2k_read_eoc; rename j2k_read_eoc_v2 to opj_j2k_read_eoc 2012-08-16 14:16:28 +00:00
Mickael Savinaud
2935fbc089 clean style and remove old v1 style structure in j2k.c 2012-08-16 14:08:58 +00:00
Mickael Savinaud
f47fc4f111 remove deprecated v1 style function j2k_add_mhmarker; rename j2k_add_mhmarker_v2 to opj_j2k_add_mhmarker
remove deprecated v1 style function j2k_add_tlmarker; rename j2k_add_tlmarker_v2 to opj_j2k_add_tlmarker
2012-08-16 13:53:23 +00:00
Mickael Savinaud
01c95cb07e remove deprecated v1 style function j2k_create_compress; rename opj_j2k_create_compress_v2 to opj_j2k_create_compress 2012-08-16 13:46:43 +00:00
Mickael Savinaud
1f94541732 rename j2k functions with opj_ prefix 2012-08-16 13:44:02 +00:00
Mickael Savinaud
ff43b4dca0 remove deprecated v1 style function j2k_setup_encoder; rename opj_j2k_setup_encoder_v2 to opj_j2k_setup_encoder 2012-08-16 13:37:34 +00:00
Mickael Savinaud
5d494e940f remove deprecated v1 style function j2k_get_num_tp; rename j2k_get_num_tp_v2 to opj_j2k_get_num_tp 2012-08-16 13:34:26 +00:00
Mickael Savinaud
30de580afe remove deprecated v1 style function j2k_calculate_tp; rename j2k_calculate_tp_v2 to opj_j2k_calculate_tp 2012-08-16 13:31:22 +00:00
Mickael Savinaud
0c13350ea4 rename local j2k function with opj_ prefix 2012-08-16 13:28:52 +00:00
Mickael Savinaud
83a661c360 remove deprecated v1 style function j2k_write_rgn; rename j2k_write_rgn_v2 to opj_j2k_write_rgn 2012-08-16 13:20:16 +00:00
Mickael Savinaud
38ec1325c4 remove deprecated v1 style function j2k_write_sod; rename j2k_write_sod_v2 to opj_j2k_write_sod 2012-08-16 13:16:38 +00:00
Mickael Savinaud
2ca2e83ce5 remove deprecated v1 style function j2k_write_sot; rename j2k_write_sot_v2 to opj_j2k_write_sot 2012-08-16 13:14:00 +00:00
Mickael Savinaud
a9908ba7bd remove deprecated v1 style function j2k_write_tlm; rename j2k_write_tlm_v2 to opj_j2k_write_tlm 2012-08-16 13:11:26 +00:00
Mickael Savinaud
9f874c00aa rename local j2k function with opj_ prefix 2012-08-16 13:09:36 +00:00
Mickael Savinaud
b52cdf6a95 rename local j2k function with opj_ prefix 2012-08-16 13:07:36 +00:00
Mickael Savinaud
40e637d9e1 remove deprecated v1 style function j2k_write_poc; rename j2k_write_poc_v2 to opj_j2k_write_poc
rename j2k_write_poc_in_memory to opj_j2k_write_poc_in_memory
rename j2k_get_max_poc_size to opj_j2k_get_max_poc_size
2012-08-16 13:03:20 +00:00
Mickael Savinaud
21c76d97bb remove deprecated v1 style function j2k_write_qcd; rename j2k_write_qcd_v2 to opj_j2k_write_qcd
remove deprecated v1 style function j2k_write_qcc; rename j2k_write_qcc_v2 to opj_j2k_write_qcc
remove deprecated v1 style function j2k_write_qcx; rename j2k_write_qcc_in_memory to 
rename j2k_get_max_qcc_size to opj_j2k_get_max_qcc_size
2012-08-16 12:58:30 +00:00
Mickael Savinaud
4b3147ede7 rename j2k_get_max_coc_size to opj_j2k_get_max_coc_size 2012-08-16 12:51:46 +00:00
Mickael Savinaud
a037a66ea4 remove deprecated v1 style function j2k_write_cod; rename j2k_write_cod_v2 to opj_j2k_write_cod
remove deprecated v1 style function j2k_write_coc; rename j2k_write_coc_v2 to opj_j2k_write_coc
remove deprecated v1 style function j2k_write_cox; rename j2k_write_coc_in_memory to opj_j2k_write_coc_in_memory
2012-08-16 12:47:45 +00:00
Mickael Savinaud
c071819c26 remove deprecated v1 style function j2k_write_com; rename j2k_write_com_v2 to opj_j2k_write_com 2012-08-16 12:38:23 +00:00
Mickael Savinaud
28e018de8a remove deprecated v1 style function j2k_write_siz; rename j2k_write_siz_v2 to opj_j2k_write_siz 2012-08-16 12:36:05 +00:00
Mickael Savinaud
65102c0ba5 rename j2k_write_soc_v2 to opj_j2k_write_soc 2012-08-16 12:33:43 +00:00
Mickael Savinaud
ff8e97310d remove deprecated v1 style function j2k_write_soc 2012-08-16 12:32:34 +00:00
Mickael Savinaud
2546661aeb remove deprecated v1 style functions j2k_destroy_decompress, j2k_decode_jpt_stream, j2k_destroy_compress and j2k_encode 2012-08-16 12:29:59 +00:00
Mickael Savinaud
fdeed49637 rename local j2k function with opj_ prefix 2012-08-16 12:20:46 +00:00
Mickael Savinaud
fab7693da5 free local memory in image_to_j2k application 2012-08-16 12:03:20 +00:00
Mickael Savinaud
582323d63c rename j2k functions with opj_ prefix 2012-08-16 11:51:34 +00:00
Mickael Savinaud
a6522d3706 remove warnings from dwt.c 2012-08-16 10:46:57 +00:00
Mickael Savinaud
28a0028762 Correct the wrong output management of opj_stream_read_seek function (thanks to EvenR) 2012-08-16 09:13:58 +00:00
Mickael Savinaud
ec19c32b63 remove old v1 style functions from jp2.c 2012-08-13 11:43:02 +00:00
Mickael Savinaud
ec9aceb96f rename local jp2 functions with opj_ prefix 2012-08-13 10:10:25 +00:00
Mickael Savinaud
0e1c2e3378 rename jp2_write_jp_v2 to opj_jp2_write_jp 2012-08-13 10:03:57 +00:00
Mickael Savinaud
094b952d70 remove deprecated v1 style function jp2_write_jp 2012-08-13 09:58:43 +00:00
Mickael Savinaud
3821a4e054 rename jp2_write_jp2c_v2 to opj_jp2_write_jp2c 2012-08-13 09:57:09 +00:00
Mickael Savinaud
d24404ca9a remove deprecated v1 style function jp2_write_jp2c 2012-08-13 09:55:57 +00:00
Mickael Savinaud
fb2d6e8870 rename local function in jp2.c with the opj_ prefix 2012-08-13 09:44:40 +00:00
Mickael Savinaud
e421cbac2a rename jp2_write_ftyp_v2 to opj_jp2_write_ftyp 2012-08-13 09:39:51 +00:00
Mickael Savinaud
a71310f58b remove deprecated v1 style function jp2_write_ftyp 2012-08-13 09:36:53 +00:00
Mickael Savinaud
43c392626b rename jp2_write_colr_v2 to opj_jp2_write_colr 2012-08-13 09:35:16 +00:00
Mickael Savinaud
d286573958 remove deprecated v1 style function jp2_write_colr 2012-08-13 09:33:00 +00:00
Mickael Savinaud
ff889c40da rename jp2_write_bpcc_v2 to opj_jp2_write_bpcc 2012-08-13 09:31:24 +00:00
Mickael Savinaud
0ecdbe8614 remove deprecated v1 style function jp2_write_bpcc 2012-08-13 09:29:37 +00:00
Mickael Savinaud
8b3500a2a9 rename jp2_write_ihdr_v2 to opj_jp2_write_ihdr 2012-08-13 09:27:58 +00:00
Mickael Savinaud
c5fd56606d remove deprecated v1 style function jp2_write_ihdr 2012-08-13 09:25:41 +00:00
Mickael Savinaud
dd86b85664 rename jp2 functions with V2 style and opj_ prefix 2012-08-13 09:24:15 +00:00
Mickael Savinaud
3ec9f5fa0b remove deprecated v1 style functions jp2_write_jp2h 2012-08-13 08:54:42 +00:00
Mickael Savinaud
3bf3ce06f7 remove deprecated v1 style functions : jp2_create_compress, jp2_destroy_compress, opj_jp2_encode 2012-08-13 08:53:17 +00:00
Mickael Savinaud
cc1d601722 fix some warnings in jp2.c 2012-08-13 08:30:00 +00:00
Mickael Savinaud
e8c1b849b7 fix compilation error with win platform 2012-08-13 07:49:49 +00:00
Luc Hermitte
de44b71b12 [trunk] fix possible memory leak on realloc failure 2012-08-10 17:15:57 +00:00
Mickael Savinaud
df70c7136d use internal type to reduce warnings in jp2.c 2012-08-10 11:21:48 +00:00
Mickael Savinaud
bf2b9ea539 rename jp2_read_boxhdr_v2 to opj_jp2_read_boxhdr 2012-08-10 11:00:40 +00:00
Mickael Savinaud
b0b46c331e remove deprecated v1 style function jp2_read_boxhdr 2012-08-10 10:57:51 +00:00
Mickael Savinaud
b3269581ea rename local function in jp2.c with the opj_ prefix 2012-08-10 10:55:10 +00:00
Mickael Savinaud
699edd4393 rename jp2_read_jp_v2 to opj_jp2_read_jp 2012-08-10 10:34:40 +00:00
Mickael Savinaud
9128c6c17b remove deprecated v1 style function jp2_read_jp2c, jp2_read_struct 2012-08-10 10:27:17 +00:00
Mickael Savinaud
f121223ed8 rename jp2_read_ftyp_v2 to opj_jp2_read_ftyp 2012-08-10 10:24:09 +00:00
Mickael Savinaud
3c0e360df1 remove deprecated v1 style function jp2_read_ftyp 2012-08-10 10:22:51 +00:00
Mickael Savinaud
1de6f5fcf6 rename jp2_read_colr_v2 to opj_jp2_read_colr, jp2_read_pclr_v2 to opj_jp2_read_pclr, jp2_read_cmap_v2 to opj_jp2_read_cmap, jp2_read_cdef_v2 to opj_jp2_read_cdef 2012-08-10 10:19:11 +00:00
Mickael Savinaud
5bf4b718d4 remove deprecated v1 style function jp2_read_colr, jp2_read_pclr, jp2_read_cmap, jp2_read_cdef 2012-08-10 10:01:47 +00:00
Mickael Savinaud
f912007fe8 rename jp2_read_bpcc_v2 to opj_jp2_read_bpcc 2012-08-10 09:53:28 +00:00
Mickael Savinaud
377809a35b remove deprecated v1 style function jp2_read_bpcc 2012-08-10 09:50:23 +00:00
Mickael Savinaud
f0f981b80d rename jp2_read_ihdr_v2 to opj_jp2_read_ihdr 2012-08-10 09:47:56 +00:00
Mickael Savinaud
2b9302632c remove deprecated v1 style function jp2_read_ihdr 2012-08-10 09:46:31 +00:00
Mickael Savinaud
a59a1552ad rename jp2_read_jp2h_v2 to opj_jp2_read_jp2h 2012-08-10 09:43:28 +00:00
Mickael Savinaud
4a80e821df remove deprecated v1 style function jp2_read_jp2h 2012-08-10 09:39:40 +00:00
Mickael Savinaud
6822291f91 remove deprecated v1 style function jp2_destroy_decompress 2012-08-10 09:33:54 +00:00
Mickael Savinaud
863aacaee3 rename local functions with opj_ prefix in j2k.c (part 2) 2012-08-10 09:27:45 +00:00
Mickael Savinaud
00a2bf7120 rename local functions with opj_ prefix in j2k.c 2012-08-10 09:14:49 +00:00
Mickael Savinaud
6ac5acf765 rename some j2k decoding functions with new prefix opj_ 2012-08-10 08:21:31 +00:00
Mickael Savinaud
ce7583f173 rename mct function read/write function with opj_ prefix 2012-08-10 08:07:30 +00:00
Mickael Savinaud
24b10ac585 rename j2k_read_mct to opj_j2k_read_mct, j2k_read_mco to opj_j2k_read_mco, j2k_read_mcc to opj_j2k_read_mcc 2012-08-10 07:58:23 +00:00
Mickael Savinaud
706371e24f rename j2k_read_cbd to opj_j2k_read_cbd 2012-08-10 07:54:33 +00:00
Mickael Savinaud
5de8639685 rename j2k_read_com_v2 to opj_j2k_read_unk 2012-08-10 07:51:29 +00:00
Mickael Savinaud
d42e26d59c remove deprecated v1 style function j2k_read_unk 2012-08-10 07:49:52 +00:00
Mickael Savinaud
6ea06e87bb rename j2k_read_com_v2 to opj_j2k_read_com 2012-08-10 07:44:47 +00:00
Mickael Savinaud
5eb8a44317 remove deprecated v1 style function j2k_read_com 2012-08-10 07:42:41 +00:00
Mickael Savinaud
c89fb0b828 rename j2k_read_crg_v2 to opj_j2k_read_crg 2012-08-10 07:37:58 +00:00
Mickael Savinaud
52e111dbb7 remove deprecated v1 style function j2k_read_crg 2012-08-10 07:36:16 +00:00
Mickael Savinaud
36b5109387 rename j2k_read_ppt_v2 to opj_j2k_read_ppt 2012-08-10 07:32:57 +00:00
Mickael Savinaud
c07b085c81 remove deprecated v1 style function j2k_read_ppt 2012-08-10 07:29:57 +00:00
Mickael Savinaud
065c442141 remove deprecated v1 style function j2k_read_cox 2012-08-10 07:27:04 +00:00
Mickael Savinaud
83b570d981 correct a compilation error about misplaced declaration 2012-08-10 07:13:30 +00:00
Mickael Savinaud
2afdee9c7d remove deprecated v1 style function j2k_read_ppm 2012-08-09 17:10:56 +00:00
Mickael Savinaud
a7e809e1f7 rename j2k_read_plt_v2 to opj_j2k_read_plt 2012-08-09 17:09:26 +00:00
Mickael Savinaud
deb7cb708f remove deprecated v1 style function j2k_read_plt 2012-08-09 17:07:26 +00:00
Mickael Savinaud
fcd7db6cd1 rename j2k_read_plm_v2 to opj_j2k_read_plm 2012-08-09 17:06:13 +00:00
Mickael Savinaud
68adbd2e05 rename j2k_read_tlm_v2 to opj_j2k_read_tlm 2012-08-09 17:03:11 +00:00
Mickael Savinaud
b6258d612b remove deprecated v1 style function j2k_read_tlm 2012-08-09 17:01:20 +00:00
Mickael Savinaud
93cb76a292 rename j2k_read_poc_v2 to opj_j2k_read_poc 2012-08-09 16:57:45 +00:00
Mickael Savinaud
6191f69f0c remove deprecated v1 style function j2k_read_poc 2012-08-09 16:56:00 +00:00
Mickael Savinaud
d416e6c854 remove deprecated v1 style function j2k_read_qcx 2012-08-09 16:54:01 +00:00
Mickael Savinaud
3a63d978dd rename j2k_read_qcc_v2 to opj_j2k_read_qcc 2012-08-09 16:52:05 +00:00
Mickael Savinaud
d2a78c33df remove deprecated v1 style function j2k_read_qcc 2012-08-09 16:50:21 +00:00
Mickael Savinaud
679f91482e rename j2k_read_qcd_v2 to opj_j2k_read_qcd 2012-08-09 16:48:48 +00:00
Mickael Savinaud
d380a8554d remove deprecated v1 style function j2k_read_qcd 2012-08-09 16:47:08 +00:00
Mickael Savinaud
4f36ad0cc1 rename j2k_read_rgn_v2 to opj_j2k_read_rgn 2012-08-09 16:45:18 +00:00
Mickael Savinaud
90ba7fbf1f remove deprecated v1 style function j2k_read_rgn 2012-08-09 16:43:00 +00:00
Mickael Savinaud
76658477af rename j2k_read_coc_v2 to opj_j2k_read_coc 2012-08-09 16:40:22 +00:00
Mickael Savinaud
ffb6a9c74b remove deprecated v1 style function j2k_read_coc 2012-08-09 16:38:11 +00:00
Mickael Savinaud
21d334389f rename j2k_read_cod_v2 to opj_j2k_read_cod 2012-08-09 16:36:06 +00:00
Mickael Savinaud
94a5e081e5 remove deprecated v1 style function j2k_read_cod 2012-08-09 16:34:28 +00:00
Mickael Savinaud
5e78d72ef2 rename j2k_read_siz_v2 to opj_j2k_read_siz 2012-08-09 15:59:14 +00:00
Mickael Savinaud
5c303e2bb5 remove deprecated v1 style function j2k_read_siz 2012-08-09 15:56:27 +00:00
Mickael Savinaud
4c1cb388af rename j2k_read_sod_v2 to opj_j2k_read_sod 2012-08-09 15:44:55 +00:00
Mickael Savinaud
144bd4a878 remove deprecated v1 style function j2k_read_sod 2012-08-09 15:42:35 +00:00
Mickael Savinaud
91737aff68 rename j2k_read_sot_v2 to opj_j2k_read_sot 2012-08-09 15:39:41 +00:00
Mickael Savinaud
2391b40f47 remove deprecated v1 style function j2k_read_sot 2012-08-09 15:36:16 +00:00
Mickael Savinaud
6a8aff5a74 rename j2k_read_soc_v2 to opj_j2k_read_soc 2012-08-09 15:32:18 +00:00
Mickael Savinaud
c0ec5d404b remove deprecated v1 style function j2k_read_soc 2012-08-09 15:28:38 +00:00
Mickael Savinaud
10e9a6b6cd rename j2k_decode_v2 to opj_j2k_decode 2012-08-09 15:16:33 +00:00
Mickael Savinaud
a51aed7ce2 remove deprecated v1 style function j2k_decode 2012-08-09 15:13:33 +00:00
Mickael Savinaud
71e0106846 rename j2k_setup_decoder_v2 to opj_j2k_setup_decoder 2012-08-09 15:08:33 +00:00
Mickael Savinaud
3ce9af7fce remove deprecated v1 style function j2k_setup_decoder 2012-08-09 15:04:09 +00:00
Mickael Savinaud
05e8aae95e rename j2k_create_decompress_v2 to opj_j2k_create_decompress 2012-08-09 15:00:50 +00:00
Mickael Savinaud
381de6b7cb remove deprecated v1 style function j2k_create_decompress and jp2_create_decompress 2012-08-09 14:57:03 +00:00
Mickael Savinaud
c077645f77 rename jp2_decode_v2 to opj_jp2_decode 2012-08-09 14:46:11 +00:00
Mickael Savinaud
ebc3263987 remove deprecated v1 style function opj_jp2_decode 2012-08-09 14:42:37 +00:00
Mickael Savinaud
cf6e5bf01f rename jp2_setup_decoder_v2 to opj_jp2_setup_decoder 2012-08-09 14:38:55 +00:00
Mickael Savinaud
958c615a83 remove deprecated v1 style function jp2_setup_decoder 2012-08-09 14:31:02 +00:00
Mickael Savinaud
8e5070f469 [trunk] add the support of the flag ignore_pclr_cmap_cdef into the V2 jp2 functions (but not for box reading); no tests modified 2012-08-09 14:28:35 +00:00
Mickael Savinaud
4397b675cb [trunk] begin to clean the old V1 style message event management 2012-08-09 14:00:31 +00:00
Mickael Savinaud
9ed88f6a8d [trunk] clean jp2_read_ihdr_v2 interface 2012-08-09 13:22:25 +00:00
Mickael Savinaud
f12fde9132 [trunk] rename opj_destroy_cstr_info_v2 to opj_destroy_cstr_info 2012-08-09 12:56:43 +00:00
Mickael Savinaud
1c4ea6d246 remove deprecated v1 style function opj_destroy_cstr_info 2012-08-09 12:52:28 +00:00
Mickael Savinaud
a6d76b3c48 [trunk] move functions in openjpeg.c in two parts compression vs decompression 2012-08-09 12:51:16 +00:00
Mickael Savinaud
5d0ace0577 [trunk] rename opj_encode_v2 to opj_encode 2012-08-09 12:42:46 +00:00
Mickael Savinaud
7b88544d46 [trunk] remove deprecated v1 style function opj_encode and opj_encode_with_info 2012-08-09 12:40:22 +00:00
Mickael Savinaud
6767ea2456 [trunk] rename opj_setup_encoder_v2 to opj_setup_encoder 2012-08-09 12:35:13 +00:00
Mickael Savinaud
459db3d64b remove deprecated v1 style function opj_setup_encoder 2012-08-09 12:31:46 +00:00
Mickael Savinaud
d009cf618a rename opj_create_compress_v2 to opj_create_compress 2012-08-09 12:28:51 +00:00
Mickael Savinaud
9a9897a9de [trunk] remove deprecated v1 style function opj_create_compress 2012-08-09 12:26:04 +00:00
Mickael Savinaud
3f9fb13df6 remove deprecated v1 style function opj_decode and opj_decode_with_info 2012-08-09 12:16:59 +00:00
Mickael Savinaud
52f414669a [trunk] rename opj_setup_decoder_v2 to opj_setup_decoder 2012-08-09 12:11:24 +00:00
Mickael Savinaud
b34215906c [trunk] remove deprecated v1 style function opj_setup_decoder 2012-08-09 11:56:14 +00:00
Mickael Savinaud
fb768ac792 [trunk] remove deprecated v1 style function opj_destroy_decompress 2012-08-09 11:53:33 +00:00
Mickael Savinaud
35289bffe2 [trunk] rename opj_create_decompress_v2 to opj_create_decompress 2012-08-09 11:51:07 +00:00
Mickael Savinaud
ef00fdf472 [trunk] remove V1 style function opj_create_decompress 2012-08-09 11:46:19 +00:00
Mickael Savinaud
3de7e8358f [trunk] define local functions of j2k.c as static and clean style 2012-08-09 11:35:06 +00:00
Mickael Savinaud
28ac2f49dc [trunk] move allocation of cstr_index->tile_index to the end of the header reading 2012-08-09 11:12:28 +00:00
Mickael Savinaud
c38b5d5eb9 Add file type detection in test_tile_decoder to support JP2 file as input 2012-08-09 11:05:58 +00:00
Mickael Savinaud
180d06613a Use the right file as input for the test ttd2 2012-08-09 09:29:42 +00:00
Mickael Savinaud
c3ee4212f0 Reorganize and clean style of test_tile_decoder.c 2012-08-09 08:07:57 +00:00
Mathieu Malaterre
efafbe9a5c [trunk] Use const keyword when appropriate 2012-07-25 13:10:43 +00:00
Mathieu Malaterre
e38680a4df [trunk] Import changes from 1.5 branch 2012-07-25 13:10:21 +00:00
Mathieu Malaterre
f28fc6f2e1 [trunk] Fix r156 to compile on compilers where false is not defined. 2012-07-11 14:59:41 +00:00
Mathieu Malaterre
5ba8d36687 [trunk] This fixes issues seen on PDF files
Fixes issue 156
2012-07-11 14:55:39 +00:00
Mathieu Malaterre
178236cc5f [trunk] Fix heap buffer overflow
Enforce sanity checks on tile number and tile length, even when the (rather
broken) USE_JPWL code isn't enabled.
Import r1727 from branch 1.5
2012-07-10 13:09:45 +00:00
Mickael Savinaud
79a0533c69 [trunk] use new names for baseline 2012-06-01 07:53:44 +00:00
Mathieu Malaterre
64363995be [trunk] Fix a simple leak in test_tile_encoder 2012-05-29 14:27:42 +00:00
Mathieu Malaterre
426ad6e3a3 [trunk] Adding more tests. tte5.j2k looks as if the tile compression is broken 2012-05-29 14:25:23 +00:00
Mathieu Malaterre
0d0e7a1008 [trunk] The two files in Issue145 have a precision < 8-bit:
therefore 'jp2_read_pclr' must be changed.

j2k_to_image fails to create RGB/RGBA images with a
precision < 8-bit: therefore 'imagetopng' must be
changed.
Fixes issue 145
2012-05-29 13:55:49 +00:00
Mathieu Malaterre
806545df34 [trunk] Fix installation issues. Thanks to winfried for patch.
Fixes issue 149
2012-05-29 13:44:27 +00:00
Mathieu Malaterre
b8cc257ac5 [trunk] Follow up to r1691. Handle signed case. 2012-05-29 09:33:28 +00:00
Mathieu Malaterre
bdb4d96678 [trunk] Add new behavior for codecs. Now supports little endian RAWL format. It is now possible to encode directly little endian raw file, by simply using the rawl extension. Code has been modified to use strcasecmp instead of strncasecmp to cope with 4 letters files extensions.
Update issue 141
2012-05-29 09:30:03 +00:00
Mathieu Malaterre
0c5fb4a81b [trunk] Add commented out code for tile support in applications. 2012-05-29 09:07:49 +00:00
Mathieu Malaterre
3ff48f27cf [trunk] error message typo, refer PLT instead of PLM 2012-05-22 16:07:38 +00:00
Mathieu Malaterre
f0c732452f [trunk] add sentinel when tile_index is null 2012-05-21 08:38:13 +00:00
Mathieu Malaterre
a4d1b1ba21 [trunk] Enable tile decoding/encoding round trip 2012-05-21 08:05:29 +00:00
Mathieu Malaterre
0447ea94c1 Activate tile decoding system to reproduce issues 2012-05-21 08:03:58 +00:00
Mickael Savinaud
38fd7a84c7 Comment the using of j2k_add_marker function into a v2 function. 2012-05-21 06:51:07 +00:00
Mickael Savinaud
ee17910ec5 use the correct event handler in j2k_to_image.c 2012-05-14 17:47:10 +00:00
Mickael Savinaud
717a7dbfde resolve bug under win arch with test_tile_encoder.c 2012-05-14 17:25:10 +00:00
Mickael Savinaud
0fb6576511 2012-05-14 17:17:53 +00:00
Mathieu Malaterre
383495c863 [trunk] Start activating tile tests 2012-05-14 16:05:55 +00:00
Mathieu Malaterre
b55abf5730 [trunk] Need to use new interface opj_event_msg_v2, instead of old opj_event_msg. Remove some simple warnings 2012-05-14 15:20:20 +00:00
Mathieu Malaterre
3e1aa456b9 [trunk] Pointer is opj_jp2_v2_t, not opj_jp2_t 2012-05-14 15:19:40 +00:00
Mathieu Malaterre
00558adda8 [trunk] Wrong struct size. Use opj_jp2_v2_t instead 2012-05-14 14:51:26 +00:00
Mathieu Malaterre
1c3273aab2 [trunk] Make sure the memory is initialized. valgrind was complaning in mqc_init_enc we were reading uninit value. See also comment in r479: FIXME: mqc_init_enc and mqc_byteout underrun the buffer if we don't do this. Why? 2012-05-14 14:38:02 +00:00
Mathieu Malaterre
589b247926 [trunk] Fix minor typo in error message. 2012-05-14 14:36:24 +00:00
Mickael Savinaud
6965e3e03c adding jp2_encode_v2 from v2 branches; using the right return value for opj_stream_flush 2012-05-14 11:04:59 +00:00
Mickael Savinaud
202d5ab754 correct style in cio.c and use only op_bool return value; correct error in jp2.c and some style 2012-05-14 10:02:59 +00:00
Mickael Savinaud
1023be33fb add new functions in jp2 codec from v2 branches; solve bug in j2k_setup_encoder_v2 2012-05-14 09:37:36 +00:00
Mathieu Malaterre
595c00f55c [trunk] Fix remaining compilation errors 2012-05-14 07:17:42 +00:00
Mickael Savinaud
5aaa5eab70 remove opj_event_mgr struct from test_tile_decoder 2012-05-14 07:13:27 +00:00
Mathieu Malaterre
70b24b021a [trunk] Fix using proper v2 function 2012-05-14 07:11:02 +00:00
Mathieu Malaterre
af96c721c4 [trunk] Import from v2 test_tile_decoder 2012-05-14 07:03:33 +00:00
Mickael Savinaud
a9b653db26 Correct a mistake about declaration of j2k_write_eoc_v2 2012-05-14 06:24:27 +00:00
Mickael Savinaud
80c23d4519 solve problem with input of image_to_j2k; using the right return type comparison for opj_stream_flush; add j2k_write_com_v2, j2k_write_poc_v2, j2k_write_eoc_v2 and j2k_write_tlm_v2 2012-05-13 22:13:58 +00:00
Mickael Savinaud
821d7a8941 remove a fixme about tcd_deallocate and encodind precint 2012-05-13 15:48:19 +00:00
Mickael Savinaud
e7c8a22c67 [trunk] style 2012-05-02 13:37:54 +00:00
Mickael Savinaud
5652ccc780 [trunk] correct a bug in jpip building induced by the previous commit 2012-05-02 13:30:41 +00:00
Mickael Savinaud
055d429ae1 [trunk] Enhance support of events like the v2 branch. Use right name of variables. 2012-05-02 07:01:13 +00:00
Mathieu Malaterre
8231897b26 [trunk] apply patch from winfried on the mailing list. For more info see: https://groups.google.com/group/openjpeg/msg/e631d586a31c6de4 2012-04-23 13:28:20 +00:00
Mathieu Malaterre
df7e656034 Fix a set of warnings reported by gcc in cio.c. This patch impact the API directly (remove left over 32bits API) 2012-04-23 09:16:17 +00:00
Mathieu Malaterre
d045409b9f Adding sentinel code for debug 2012-04-23 09:15:29 +00:00
Mickael Savinaud
7f3f4cfdd0 [trunk] correct a wrong assert in j2k.c 2012-04-13 14:36:30 +00:00
Mathieu Malaterre
ef044d9f17 [trunk] attempt to fix clang/3.1 compilation error remotely 2012-03-27 08:11:14 +00:00
Mathieu Malaterre
9642c7f990 [trunk] fix compilation on OS where ssize_t is not defined. 2012-03-27 07:44:28 +00:00
Mathieu Malaterre
0c5193c588 [trunk] Final touch to get rid of most truncation warnings 2012-03-26 16:42:52 +00:00
Mathieu Malaterre
f2c2b3fc7a [trunk] one more round of warnings fixes 2012-03-26 16:18:58 +00:00
Mathieu Malaterre
1228e0e925 [trunk] change char* to const char* when possible. Remove more warnings 2012-03-26 16:08:05 +00:00
Mathieu Malaterre
3a3820bedc [trunk] remove warnings from jp2k decoder 2012-03-26 16:00:26 +00:00
Mathieu Malaterre
91ee6ed60f [trunk] change char* to const char* when possible. Remove more warnings 2012-03-26 15:56:04 +00:00
Mathieu Malaterre
7e28fdc176 [trunk] another round of compilation fixes 2012-03-26 15:37:04 +00:00
Mathieu Malaterre
569bc02649 [trunk] another set of warnings fixes for LFS support 2012-03-26 15:04:49 +00:00
Mathieu Malaterre
178309be47 [trunk] Fix equality into test 2012-03-26 14:50:34 +00:00
Mathieu Malaterre
2fb7ac9a58 [trunk] remove some simple warnings 2012-03-26 14:50:14 +00:00
Mathieu Malaterre
2e493cb89a [trunk] According to JPIP/A.2.3 in class identifiers should be an unsigned integer. Since portion of codes was using Byte8_t and other was using int, pick Byte8_t as best matching type 2012-03-26 14:44:12 +00:00
Mathieu Malaterre
cdf0d77b20 [trunk] continue work on getting API to use off_t instead of long toward LFS support in JPIP (sock_manager) 2012-03-26 14:23:33 +00:00
Mathieu Malaterre
ccdfaa9115 [trunk] continue work on getting API to use off_t instead of long toward LFS support in JPIP (auxtrans_manager) 2012-03-26 14:14:19 +00:00
Mathieu Malaterre
34af05ec30 [trunk] continue work on getting API to use off_t instead of long toward LFS support in JPIP (metadata_manager) 2012-03-26 13:53:25 +00:00
Mathieu Malaterre
6bd41e47ac [trunk] continue work on getting API to use off_t instead of long toward LFS support in JPIP (manfbox_manager) 2012-03-26 13:49:32 +00:00
Mathieu Malaterre
45d11c53f0 [trunk] continue work on getting API to use off_t instead of long toward LFS support in JPIP (j2kheader_manager) 2012-03-26 13:47:52 +00:00
Mathieu Malaterre
50a68d7d59 [trunk] continue work on getting API to use off_t instead of long toward LFS support in JPIP (index_manager) 2012-03-26 13:34:16 +00:00
Mathieu Malaterre
cc47b5a78c [trunk] continue work on getting API to use off_t instead of long toward LFS support in JPIP (marker_param_t) 2012-03-26 13:18:09 +00:00
Mathieu Malaterre
34b4ec3624 [trunk] fix another simple warning 2012-03-26 13:15:40 +00:00
Mathieu Malaterre
86ed364dc0 [trunk] explicit cast missing 2012-03-26 13:02:40 +00:00
Mathieu Malaterre
438cde4e70 [trunk] remove simple warnings. 2012-03-26 13:01:41 +00:00
Mathieu Malaterre
3b268d1656 [trunk] continue work on getting API to use off_t instead of long toward LFS support in JPIP (codestream_param_t) 2012-03-26 12:59:33 +00:00
Mathieu Malaterre
0a97782339 [trunk] continue work on getting API to use off_t instead of long toward LFS support in JPIP 2012-03-26 12:31:27 +00:00
Mathieu Malaterre
1cf1d6146c [trunk] Start working on LFS support in JPIP code section 2012-03-26 09:48:53 +00:00
Mathieu Malaterre
f3217ac170 [trunk] ICC profile length is always an unsigned integer 2012-03-26 09:19:45 +00:00
Mathieu Malaterre
c8125f8710 [trunk] make openjpeg consistant with itself, and adapt sign of struct variables 2012-03-26 09:15:26 +00:00
Mathieu Malaterre
1e3bc7c069 [trunk] Fix a potential issue with truncation of pointers diff 2012-03-26 08:51:12 +00:00
Mathieu Malaterre
34df9f3dbf [trunk] Fix some simple warnings reported by -Wconversion 2012-03-26 08:47:06 +00:00
Mathieu Malaterre
72bb159a7e [trunk] fix compilation when jpwl option is ON. 2012-03-26 08:41:48 +00:00
Mickael Savinaud
afe4e345d2 [trunk] add missing file needed to compile last commit 2012-03-26 06:48:45 +00:00
Mickael Savinaud
855b5b513d [trunk] add test_tile_encoder test and function related 2012-03-23 17:47:53 +00:00
Mathieu Malaterre
b9d271c1a8 [trunk] Fix invalid truncation from off_t to int (thanks to -Wconversion for report) 2012-03-19 14:24:26 +00:00
Mathieu Malaterre
b3931741ef [trunk] Missing PRId64 for MS compilers 2012-03-19 13:46:34 +00:00
Mathieu Malaterre
ede48e285f [trunk] Forgot portion of the previous commit. 2012-03-19 13:42:53 +00:00
Mathieu Malaterre
8890539f47 [trunk] use autotools convention where #ifdef BLA, should be provided by #define BLA 1. This is to cope with pseudo autotools generated tif header. 2012-03-19 13:10:46 +00:00
Mathieu Malaterre
ff72dd8d2c [trunk] start using new functionalities from opj_inttypes in jpip code and main openjpeg 2012-03-19 11:18:24 +00:00
Mathieu Malaterre
e07b265009 [trunk] move functionalities of stdint/inttype into opj_stdint/opj_inttypes 2012-03-19 10:15:46 +00:00
Mathieu Malaterre
8d0e5899b9 [trunk] Remove remaining of OPJ_INT64_F/OPJ_UINT64_F before move to C99 convention 2012-03-19 10:00:06 +00:00
Mathieu Malaterre
e6f8b59010 [trunk] replace more void* object pointer to proper function pointer: opj_procedure. Remove some warnings reported by gcc -pedantic 2012-03-19 09:51:23 +00:00
Mathieu Malaterre
8e65846f32 [trunk] add debug statement for Win7-VS2008-32bits-trunk-Debug-OSGeo4W 2012-03-19 09:11:58 +00:00
Mathieu Malaterre
96d4d3f3be [trunk] Quick fix for MS compilers which do not ship inttypes.h 2012-03-17 18:20:52 +00:00
Mathieu Malaterre
811c01cc2e [trunk] Fix compilation win32 with shared libs on (export symbol name) 2012-03-17 18:06:54 +00:00
Mathieu Malaterre
e24127771e [trunk] Fix numerous warnings about signed vs unsigned comparison. Adapt opj_procedure type to what it should hev been IMHO. Start using PRIi64 for printf and int64_t 2012-03-17 18:06:22 +00:00
Mathieu Malaterre
b3f00d05a8 [trunk] remove a warning, about ISO C restricts enumerator values to range of 'int' 2012-03-17 17:03:16 +00:00
Mathieu Malaterre
652d34b0a8 [trunk] HACK: This commit remove some JPWL related code just to allow compilation. See r1564 for more info 2012-03-17 15:05:38 +00:00
Mathieu Malaterre
7539577b46 [trunk] Fix compilation when zlib.h is in user specified directory. 2012-03-17 14:51:40 +00:00
Mathieu Malaterre
41ee6006c4 [trunk] Fix compilation on 32bits/PowerPC arch (debian/linux) 2012-03-15 13:36:12 +00:00
Mathieu Malaterre
813ba42cfc [trunk] make sure to build as universal build when OS is APPLE 2012-03-15 13:35:30 +00:00
Mathieu Malaterre
80076276e1 [trunk] remove a warning about no end of file 2012-03-15 13:35:04 +00:00
Mickael Savinaud
3a78e8010d [trunk] modify image_to_j2k and the lib to support functionalities given by the v2 alpha branch 2012-03-15 10:23:20 +00:00
Mathieu Malaterre
d9940f416b [trunk] Fix issue with space 2012-03-12 16:43:27 +00:00
Mathieu Malaterre
dd998e7fd3 [trunk] Add support for compiling libtiff with VS2008 2012-03-12 16:40:29 +00:00
Mathieu Malaterre
747db4d940 [trunk] Add support for MSVC 2010 compiler (32bits) 2012-03-12 15:40:22 +00:00
Mathieu Malaterre
ecd5c523dc [trunk] Update libtiff to 4.0.1 to support BigTIFF. openjpeg/tiff 4.0.1 currently builds on linux/x86_64 and linux/mingw32. 2012-03-12 11:35:35 +00:00
Mathieu Malaterre
3de14fc63e [trunk] Use stdint.h when available to compute fixed-type definition. 2012-03-11 15:12:31 +00:00
Mathieu Malaterre
7f166eaee7 [trunk] Backport diff from openjpeg 1.5 branch 2012-03-11 14:56:29 +00:00
Mickael Savinaud
ab7b5e48c4 [trunk] reverted to revision 1536 2012-03-09 17:34:05 +00:00
Mickael Savinaud
345b5cfc5c [trunk] add j2k_post_write_tile in trunk from branch v2 2012-03-09 17:16:24 +00:00
Mickael Savinaud
1ac93c3a72 [trunk] add j2k_get_tile_data in trunk from branch v2 2012-03-09 17:16:16 +00:00
Mickael Savinaud
4b8c29a708 [trunk] add tcd_get_encoded_tile_size in trunk from branch v2alpha 2012-03-09 17:16:04 +00:00
Mickael Savinaud
04b057d22c [trunk] add j2k_pre_write_tile function in trunk from v2alpha 2012-03-09 17:15:55 +00:00
Mickael Savinaud
fcfb8dd2ed [trunk] first steps about merge compression WIP 2012-03-09 17:15:41 +00:00
Mathieu Malaterre
4a2673772a [trunk] Fix a bunch of warning about C++ comments in C code. 2012-03-02 15:53:14 +00:00
Mathieu Malaterre
b9e216ac6f [trunk] merge r1229 from branch 1.5 over to trunk 2012-03-02 15:24:12 +00:00
Mathieu Malaterre
e78e2885fe [trunk] minor style to sync with branch 1.5 2012-03-02 15:21:51 +00:00
Mathieu Malaterre
777f2e7547 [trunk] convert from DOS eol to UNIX eol 2012-03-02 15:12:24 +00:00
Mathieu Malaterre
27e494d25c [trunk] Sync with branch 1.5 2012-03-02 15:09:51 +00:00
Mathieu Malaterre
d88156d998 [trunk] merge r1234 from branch 1.5 over to trunk 2012-03-02 15:07:07 +00:00
Mathieu Malaterre
44a3af51f0 [trunk] merge r1322 from branch 1.5 over to trunk 2012-03-02 15:04:45 +00:00
Mathieu Malaterre
79f090d92b [trunk] merge r1197, r1199, r1228, r1230 and r1232 from branch 1.5 over to trunk 2012-03-02 15:02:48 +00:00
Mathieu Malaterre
54c65fdad0 [trunk] merge r1479 from branch 1.5 over to trunk 2012-03-02 14:55:16 +00:00
Mathieu Malaterre
e917802316 [trunk] merge r1323 from branch 1.5 over to trunk 2012-03-02 14:52:18 +00:00
Mathieu Malaterre
6a19a31171 [trunk] Remove exe bit on CMakeLists.txt. Set from DOS eol to UNIX eol 2012-03-02 14:33:29 +00:00
Mathieu Malaterre
a06b7f2ae0 [trunk] Sync with 1.5 branch 2012-03-02 14:31:46 +00:00
Mathieu Malaterre
405b1067e2 [trunk] Backout r1513 for now. 2012-03-02 14:29:08 +00:00
Mathieu Malaterre
10cb93283a [trunk] merge rev 1330/1331 from branch 1.5 onto trunk 2012-03-02 14:24:39 +00:00
Mathieu Malaterre
d28e8f537a [trunk] merge rev 1333 from 1.5 to trunk 2012-03-02 14:19:44 +00:00
Mathieu Malaterre
24d7f54662 [trunk] merge rev 1228 from 1.5 to trunk 2012-03-02 14:14:31 +00:00
Mathieu Malaterre
687a43e199 [trunk] Import change from 1.5 branch over to trunk 2012-03-02 14:01:15 +00:00
Mathieu Malaterre
07ef7d750b [trunk] Synchronize with 1.5 branch, installation convention 2012-03-02 13:59:12 +00:00
Mathieu Malaterre
ea2b1d36aa [trunk] minor coding style change to match 1.5 2012-03-02 13:57:04 +00:00
Mathieu Malaterre
c7540fba94 [trunk] Import getopt modification from 1.5 branch 2012-03-02 13:50:29 +00:00
Mathieu Malaterre
3d9198592b [trunk] Import remaning bits from JPIP/1.5 over to trunk 2012-03-02 11:09:16 +00:00
Mathieu Malaterre
d6357bacdd [trunk] Merge rev 1068 into trunk 2012-03-02 10:58:43 +00:00
Mathieu Malaterre
647551b8e4 [trunk] Remove junk from merge 2012-03-02 10:49:53 +00:00
Mathieu Malaterre
b158c25dc3 [trunk] Import rev 1103 into trunk. 2012-03-02 10:46:04 +00:00
Mickael Savinaud
bc8a3c5b6f [trunk] correct bug when we expand the list of marker in a tile 2012-03-02 10:42:11 +00:00
Mickael Savinaud
c149db2205 [trunk] check the PSot value during the reading of SOT marker 2012-03-02 10:38:01 +00:00
Mathieu Malaterre
b5495ec972 [trunk] do not distribute binary in the source code. Remove *.jar files 2012-03-02 10:35:42 +00:00
Mathieu Malaterre
472c390e75 [trunk] import JPIP modifications for build-system from 1.5 2012-03-02 10:23:20 +00:00
Mathieu Malaterre
3d9a41e4b4 [trunk] Import applications modifications from 1.5 over to trunk 2012-03-02 10:01:00 +00:00
Mathieu Malaterre
9f77b065d3 [trunk] Convert from DOS eol to UNIX eol 2012-03-02 09:55:28 +00:00
Mathieu Malaterre
7abbe1e8d8 [trunk] Backport from OPJViewer version 1.5 over to trunk 2012-03-02 09:47:55 +00:00
Mathieu Malaterre
004b6ed60f [trunk] Remove left-over Makefile 2012-03-02 09:44:52 +00:00
Mathieu Malaterre
d12f30f90c [trunk] Sync OPJViewer with 1.5 version 2012-03-02 09:41:31 +00:00
Mathieu Malaterre
c433c2f2e2 [trunk] Backport toplevel files from 1.5 2012-03-02 09:26:15 +00:00
Mathieu Malaterre
9e52c330ae [trunk] Remove copyrighted material from java-jni. Import patch from 1.5 over to trunk/JavaOpenJPEG 2012-03-02 09:20:13 +00:00
Mathieu Malaterre
564deec2c4 [trunk] Backport toplevel changes from 1.5 over to trunk. Remove hand-generated CHANGES file 2012-03-02 09:11:48 +00:00
Mathieu Malaterre
6fd0ffccbf [trunk] Merge the CMake/ dir from opj 1.5 2012-02-13 11:20:26 +00:00
Mathieu Malaterre
ee957a4285 Integrate some more diffs from the 1.5 branch 2012-02-13 09:42:26 +00:00
Mathieu Malaterre
c63331a303 Start merging of the 1.5 branch into trunk. Start with doc 2012-02-13 09:27:50 +00:00
Antonin Descampe
4d2c44ca87 add opj_logo.icns for trunk and 1.5 2012-01-11 12:19:18 +00:00
Mathieu Malaterre
596b5cd732 Fix test NR-ENC-Bretagne2.ppm-4-encode on linux. 2011-12-20 17:54:04 +00:00
Mathieu Malaterre
8ff1ba325d Fix strange line, as reported by lockalsash (gmail.com) 2011-12-20 17:11:22 +00:00
Mathieu Malaterre
a19d7e3680 minor typo 2011-12-12 11:19:13 +00:00
Mickael Savinaud
90eeb25770 [trunk] remove some warnings detected by cppcheck 2011-12-07 09:53:46 +00:00
Mathieu Malaterre
bfe8b81d18 Add new mechanism for cppcheck 2011-12-06 16:03:05 +00:00
Mathieu Malaterre
ec71c19be7 Update changelog 2011-12-06 09:47:10 +00:00
Mathieu Malaterre
cce1fc9c65 Apply patch from Brad Hards to fix some typos. 2011-12-06 09:46:40 +00:00
Mathieu Malaterre
79fee501af Apply doxygen fixes suggested by Brad Hards on opj mailing list. 2011-12-03 17:26:59 +00:00
Mathieu Malaterre
12dfaa2d74 Sorry. Reverting mistake. 2011-12-02 15:35:47 +00:00
Mathieu Malaterre
d4e5366fe6 Simplify code. Use standard find_package call instead. ctest script will need to handle this now 2011-12-02 15:30:19 +00:00
Mathieu Malaterre
d7388d7e80 Add CPack stuff 2011-12-02 14:52:34 +00:00
Mickael Savinaud
5c363b76ee [trunk] fix a bug during the creation of the codestream index 2011-12-01 13:46:09 +00:00
Julien Malik
440adddcde [trunk] fix warnings when printing large integers 2011-12-01 10:50:14 +00:00
Mickael Savinaud
af9ad1580a [trunk] fix a warning about a recent commit (1104) 2011-12-01 09:10:26 +00:00
Julien Malik
d569430cc6 [trunk] fix compilation of j2k_random_access on Visual C++ 2011-12-01 09:02:04 +00:00
Julien Malik
c39bea2017 [trunk] make large file support variables persistent in CMake to allow reconfiguration 2011-11-30 19:43:48 +00:00
Julien Malik
a361f618a1 [trunk] fix call to opj_destroy_cstr_info_v2 in j2k_random_tile_access 2011-11-30 19:41:57 +00:00
Mickael Savinaud
8c2d8bc85f [trunk] fix bug during random access to tile (tile already decoded) 2011-11-30 17:31:47 +00:00
Mickael Savinaud
563b56e09c [trunk] fix error about the way to detect the additional test suite 2011-11-30 17:31:42 +00:00
Julien Malik
455f675806 [trunk] implement Large File support in the library 2011-11-30 16:55:25 +00:00
Mickael Savinaud
3932e860ca [trunk] fix error with new way to detect kdu_expand 2011-11-29 09:28:02 +00:00
Julien Malik
b3368a85da [trunk] add support for Large File in autoconf 2011-11-28 15:35:16 +00:00
Julien Malik
defe0b25dd [trunk] fix definition of _FILE_OFFSET_BITS macro on platform where it is needed 2011-11-28 15:32:33 +00:00
Julien Malik
b68ed904b1 [trunk] add definitions for 64 bits integer types, and define OPJ_OFF_T to map to OPJ_INT64 systematically 2011-11-28 15:32:29 +00:00
Julien Malik
2eba4fb96b [trunk] activate LargeFileSupport in CMake 2011-11-28 15:32:22 +00:00
Julien Malik
27ba604ad7 [trunk] search for kdu_expand in a more cmake-compliant way 2011-11-27 22:27:50 +00:00
Julien Malik
769982d058 [trunk] clean up redundant includes already handled in opj_includes.h 2011-11-27 21:57:16 +00:00
Julien Malik
674d702257 [trunk] backout wrong changeset 1091 - see issue 123 2011-11-27 20:28:24 +00:00
Julien Malik
c974cb1b8e [trunk] support seeking in files larger than 2 GB 2011-11-24 15:30:09 +00:00
Mathieu Malaterre
20c05a3add Remove duplicate definition 2011-11-24 12:50:54 +00:00
Mathieu Malaterre
c27322ff04 Cleanup jpip cmake compilation 2011-11-24 10:42:47 +00:00
Mathieu Malaterre
6e624946d2 add note for cmake 2011-11-24 10:20:49 +00:00
Mathieu Malaterre
ab9a63bbea Use cmake style define. Fix big endian issue on dual OS (eg. Tiger) 2011-11-24 10:17:49 +00:00
Mathieu Malaterre
3a8438e1f8 minor reindentation 2011-11-24 10:17:01 +00:00
Mathieu Malaterre
0e49c6affd Remove exe bit from source files 2011-11-24 10:16:01 +00:00
Mathieu Malaterre
8bcf78cd78 fix variable name to be hidden 2011-11-24 10:15:43 +00:00
Mathieu Malaterre
ffc944976b Avoid message pollution during cmake configuration time 2011-11-24 10:14:55 +00:00
Mickael Savinaud
1b52be6246 [trunk] WIP: fix bug with windows platform and j2k_dump 2011-11-21 17:18:33 +00:00
Mickael Savinaud
e7e1ec6e84 [trunk] WIP: fix bug with windows platform and j2k_to_image 2011-11-18 08:42:57 +00:00
Mickael Savinaud
ff3c441023 [trunk] WIP: fix bug when decoding an area or a tile with special resolution 2011-11-17 14:29:36 +00:00
Mickael Savinaud
aaf6e84373 [trunk] WIP: enhance j2k_to_image with new get_decoded_tile functionality 2011-11-17 14:24:51 +00:00
Mickael Savinaud
380a357b08 [trunk] WIP: clean j2k_dump and enhance j2k_dump with commit 1052 2011-11-17 14:23:19 +00:00
Mickael Savinaud
8026d0b2e7 [trunk] WIP: add a set decoded resolution factor function and update j2k_to_image help about decoded region 2011-11-17 14:21:11 +00:00
Kaori Hagihara
b41cad58cb [trunk][JPIP] fixed opj_server execusion error (instant terminating) with autotool, cmake still need to be fixed 2011-11-16 20:00:13 +00:00
Mickael Savinaud
39e12244cc [trunk] fix tests/nonregresion/CMakeList.txt 2011-11-10 17:38:08 +00:00
Mickael Savinaud
c4c01b61e6 [trunk] WIP: fix get_decoded_tile function to avoid error with output image 2011-11-09 16:15:15 +00:00
Mickael Savinaud
eb3cd22aa3 [trunk] fix bug with mj2 applications (credit to winfried) 2011-11-09 14:47:44 +00:00
Mickael Savinaud
5b35f5fb69 [trunk] enhance mj2 when read jp2h (credit to winfried) 2011-11-09 14:38:12 +00:00
Mickael Savinaud
11d875d043 [trunk] check if the file extension is the same as the infile format (credit to winfried) 2011-11-09 14:32:54 +00:00
Julien Malik
ac946a4602 [trunk] add some sanity check in CMakeLists to prevent STRING(REGEX..) call issues 2011-11-09 14:23:03 +00:00
Kaori Hagihara
815e2f3d03 [trunk][JPIP] enabled OpenJPEG V2 API 2011-11-08 15:22:02 +00:00
Mickael Savinaud
bd8bca87b2 [trunk] WIP: add get_decoded_tile functionality 2011-11-08 13:21:17 +00:00
Mickael Savinaud
9110aa09a4 [trunk] WIP: clean and enhance j2k files 2011-11-08 13:15:21 +00:00
Mickael Savinaud
fe085a631d [trunk] WIP: clean and enhance openjpeg.c 2011-11-08 13:13:05 +00:00
Mickael Savinaud
c7489af844 [trunk] WIP: clean and enhance openjpeg.h and add deprecated macro 2011-11-08 13:09:53 +00:00
Kaori Hagihara
32a653e67e [trunk][JPIP] updated main page of doxygen 2011-11-08 10:17:52 +00:00
Kaori Hagihara
d16c93aa08 solved memory leak of opj_server, and removed redundant defines 2011-11-03 17:20:00 +00:00
Antonin Descampe
46367a7a7b [trunk][JPIP] additional patches for autotools and cmake 2011-11-02 00:54:19 +00:00
Kaori Hagihara
83a25c06ef additional patches for autotool are applied 2011-10-26 10:20:57 +00:00
Kaori Hagihara
db7db67851 fixed client viewer to be compatible with server response header both Content-type and Content-Type 2011-10-25 22:16:56 +00:00
Kaori Hagihara
8d7073abf6 patches for cmake and autotool are applied 2011-10-25 21:10:48 +00:00
Mickael Savinaud
f1c8dd887b [trunk] WIP: add a file to exclude some valgrind errors (detected with ctest_memcheck) related to png lib found with ubuntu10.04 platform 2011-10-25 12:31:27 +00:00
Mickael Savinaud
08bc3b0386 [trunk] WIP: solve problems with reading of elements outside the tilec->data buffer in dwt 2011-10-25 12:27:51 +00:00
Mickael Savinaud
2808de6084 [trunk] WIP: manage output image with area correponding to the set decoded area 2011-10-21 16:38:08 +00:00
Mickael Savinaud
028088f5f0 [trunk] WIP: enhance codestream index generation 2011-10-21 16:36:04 +00:00
Mickael Savinaud
21178c3571 [trunk] WIP: isolate dump test suite 2011-10-20 15:10:59 +00:00
Mickael Savinaud
b8214e260c WIP: remove memory leak about new jp2_read_marker function 2011-10-20 13:18:52 +00:00
Mickael Savinaud
45d813b62c [trunk] WIP: remove previous commit about memory leak with ppm read function 2011-10-20 09:19:35 +00:00
Mickael Savinaud
73b3e0e50e [trunk] WIP: solve memory leak with ppm read function 2011-10-20 08:33:00 +00:00
Kaori Hagihara
255fcbc3a5 start using API style in openJPIP library 2011-10-19 23:29:57 +00:00
Mickael Savinaud
47d93279ff [trunk] WIP: solve problem with writing of tga image from an image with signd=1 (credit to Winfried) 2011-10-19 13:18:06 +00:00
Mickael Savinaud
5b93ae8628 [trunk] WIP: solve some memory leak in test compare functions 2011-10-19 13:06:49 +00:00
Kaori Hagihara
436318a8c8 adapt makefiles to the new structure 2011-10-18 14:31:06 +00:00
Kaori Hagihara
57a328c7a9 rearranged opj_server, opj_dec_server directory 2011-10-18 12:38:31 +00:00
Kaori Hagihara
2cd3f046e5 enable all progression orders 2011-10-14 17:10:30 +00:00
Kaori Hagihara
5c88c1376c include stdlib.h for calloc 2011-10-13 20:00:19 +00:00
Mickael Savinaud
2d39e5d7a5 [trunk] WIP: resolve heap corruption with p0_07.j2k (credit to Winfried) 2011-10-12 14:44:46 +00:00
Mickael Savinaud
27e255fa75 [trunk] WIP: correct some memory leaks in applications functions 2011-10-12 14:42:21 +00:00
Mickael Savinaud
195190b612 [trunk] WIP: add a read CBD marker function (JPEG2000 part 2) 2011-10-12 14:36:39 +00:00
Mickael Savinaud
aeabfaf417 [trunk] WIP: add a read MCO marker function (JPEG2000 part 2) 2011-10-12 14:34:17 +00:00
Mickael Savinaud
f62201ba9d [trunk] WIP: add a read MCC marker function (JPEG2000 part 2) 2011-10-12 14:32:29 +00:00
Mickael Savinaud
5cf331d881 [trunk] WIP: add a read MCT marker function (JPEG2000 part 2) 2011-10-12 14:30:22 +00:00
Kaori Hagihara
28c90cce6c enable layers requests; restricting the number of codesream quality layers 2011-10-12 13:25:53 +00:00
Mickael Savinaud
ca5b10938a [trunk] WIP: correct a segfault inside j2k_dump output 2011-10-11 13:49:58 +00:00
Kaori Hagihara
acd4cc6f5c -J option for -jpip added into the option list 2011-10-11 13:01:38 +00:00
Kaori Hagihara
7ac3a36229 change -v option was renamed to -u, which is equivalent to -TP long option 2011-10-11 10:57:41 +00:00
Mickael Savinaud
a6178c1de6 [trunk] WIP: correct some segfault with win platform and remove a aligned allocation which produce error when a realloc is done on this pointer 2011-10-11 10:09:02 +00:00
Mickael Savinaud
990dd18474 [trunk] WIP: add stream length value to read unknown marker size, backport 855 into V2 framework, correct memory leak into get_cstr_info 2011-10-11 08:01:31 +00:00
Mickael Savinaud
c4642d4fda [trunk] WIP: add output elements about decoding of jp2 files with last tile part lenght equal zero 2011-10-11 07:54:27 +00:00
Mickael Savinaud
c7d3b83164 [trunk] WIP: correct mistake with JP2 files and manage correctly the text_GBR.jp2 filecase 2011-10-11 07:49:16 +00:00
Kaori Hagihara
7c87bb35c4 change -v option was reactivated for JPIP 2011-10-10 16:10:49 +00:00
Kaori Hagihara
f20530dce2 enable JPT-stream request from client viewer option 2011-10-10 13:15:18 +00:00
Antonin Descampe
5d5adf7c7e [trunk][JPIP]removed obsolete indexer utility 2011-10-10 10:02:20 +00:00
Vincent Torri
fc01873d60 [trunk] fix name 2011-10-10 06:52:07 +00:00
Vincent Torri
81b9e78565 [trunk] add libopenjpeg-jpwl.pc.in. fix output when --disable-shared or --disable-static is passed to configure. Minor clean up of configure.ac. 2011-10-10 06:51:08 +00:00
Vincent Torri
cee4505172 [trunk] fix 'distcheck' rule 2011-10-10 06:26:34 +00:00
Mickael Savinaud
4d4b29ea94 [trunk] WIP: correct mistake in text output inside set_decoded_area function (credit to Winfried) 2011-10-07 21:57:09 +00:00
Mickael Savinaud
efd780f82a [trunk] WIP: update jp2 dump functions with the new V2 framework 2011-10-07 17:31:35 +00:00
Mickael Savinaud
cc0ff6b0bf [trunk] WIP: update output filename of conformance dump test to be compatible with new baseline 2011-10-07 17:29:07 +00:00
Mickael Savinaud
35e13cf5e8 [trunk] correct wrong input in dump_codec function and add missing return value 2011-10-07 17:11:12 +00:00
Mickael Savinaud
238652b36c [trunk] WIP: correct mistake inside set_decoded_area function (credit to Francois De Vieilleville) 2011-10-07 14:36:29 +00:00
Mickael Savinaud
e4b728ccb9 [trunk] WIP: backport rev 967-969 about test suite enhancement and rename of opj_configh.cmake.in from opj-1.5 to trunk 2011-10-07 14:20:15 +00:00
Mickael Savinaud
68967aef72 [trunk] WIP: Enhance html documentation generation with cmake, add a mainpage to this documentation and bump version to 1.99.0 into the main CMakeLists (as rev951) 2011-10-06 08:41:49 +00:00
Mickael Savinaud
fd67d46be7 [trunk] WIP: fix build error with windows configuration induced by rev 960 2011-10-06 08:05:00 +00:00
Mickael Savinaud
ee0e8a3aad [trunk] WIP: fix the decoding process with conformance files and V2 framework 2011-10-05 16:27:16 +00:00
Vincent Torri
f4734d6b4d * [vincent] fix autotools for various compilation problems
* [vincent] fix indexer compilation. Patch from Winfried
2011-09-30 21:14:25 +00:00
Kaori Hagihara
656628e69b modified indexer for JPIP, JPP-stream 2011-09-30 17:15:06 +00:00
Kaori Hagihara
6b1bca80ee enabled JPP-stream 2011-09-30 15:31:06 +00:00
Vincent Torri
537a50214a [trunk] bump version to 1.99.0 2011-09-28 04:32:28 +00:00
Mickael Savinaud
67d04dd9ba [trunk] WIP: enhance the event management into the new API 2011-09-27 12:41:49 +00:00
Mickael Savinaud
b8efd02c7f [trunk] WIP: fix some warnings about a static function and j2k_read_unk_v2 2011-09-27 12:32:28 +00:00
Mickael Savinaud
a600d8f4e2 [trunk] WIP: add basis for a new output management of the codestream information and index 2011-09-27 12:14:11 +00:00
Mickael Savinaud
de7793e918 [trunk] WIP: fix some warnings from j2k_dump and index.c 2011-09-27 12:00:06 +00:00
Mickael Savinaud
a5e442d490 [trunk] WIP: fix build compilation (with autotools) with MJ2 option (credit to Winfried) 2011-09-22 09:31:45 +00:00
Mickael Savinaud
51513c4e6b WIP: fix build compilation error with windows platform about event_mgr management 2011-09-22 08:39:59 +00:00
Mickael Savinaud
5d0b813cec [trunk] WIP: clean the j2k_dump application and the lib regards to the event management 2011-09-21 16:37:45 +00:00
Mickael Savinaud
ba0c271774 Enhance the support of endianess with cmake and inside the code (credit to Winfried) 2011-09-21 10:01:54 +00:00
Mickael Savinaud
7062c01b68 WIP: fixed build issues with JPWL option ON 2011-09-20 14:50:04 +00:00
Mickael Savinaud
c0bad42eb1 WIP: fixed build issue with MJ2 option ON with new framework 2011-09-20 14:36:23 +00:00
Mickael Savinaud
af7ebd96a0 Enhance some new JPIP files about opj_config inclusion and using of free/calloc (credit to Julien Malik) 2011-09-19 16:53:10 +00:00
Mickael Savinaud
ac59fd1476 WIP: begin to test opj_decode_tile_data 2011-09-19 16:34:44 +00:00
Mickael Savinaud
6561d70664 WIP: update t1, t2, tcd to use same strut as in V2 2011-09-19 16:09:19 +00:00
Mickael Savinaud
1a5c59326a WIP: begin to test opj_read_tile_header with V2 style 2011-09-19 16:05:43 +00:00
Mickael Savinaud
d44375aece WIP: create a new framework to output file information 2011-09-19 16:01:49 +00:00
Mickael Savinaud
cf37058d7c WIP: remove a piece of code copy by the merge op at the wrong place 2011-09-19 15:51:20 +00:00
Mickael Savinaud
dcb3fcbfa7 WIP: begin to clean j2k_dump and some other small things 2011-09-19 13:55:06 +00:00
Mickael Savinaud
6ece3f6792 WIP: enchance the new version with some bug fixes from v1 and from me 2011-09-19 13:47:35 +00:00
Mickael Savinaud
3b30e42551 WIP: add support of jp2 for new j2k_dump function and some other small stuff 2011-09-19 13:36:07 +00:00
Mickael Savinaud
b0ef524b9e WIP: new image_header struct is used and enable used of cstr_info 2011-09-19 13:30:21 +00:00
Mickael Savinaud
b138aaae08 WIP: manage the case of event_mgr is not provided to setup_decoder function 2011-09-19 13:18:19 +00:00
Mickael Savinaud
3953661078 WIP: insert elements from V2 framework into the trunk (add missing files) 2011-09-19 13:12:01 +00:00
Mickael Savinaud
b551844cc2 Work In Progress: insert elements from V2 framework into the trunk 2011-09-19 13:04:04 +00:00
Kaori Hagihara
93f3e2b007 Add README description for stateless requests 2011-09-16 14:36:51 +00:00
Kaori Hagihara
0a42a8bc46 opj_dec_server enabled stateless requests 2011-09-16 14:20:00 +00:00
Kaori Hagihara
8097b07661 opj_viewer_xerces enabled stateless requests 2011-09-16 14:18:22 +00:00
Kaori Hagihara
1475cabfa0 opj_viewer enabled stateless requests 2011-09-16 14:17:45 +00:00
Antonin Descampe
6a1573c228 TRUNK: fixed autotools for new indexer option 2011-09-09 18:54:05 +00:00
Antonin Descampe
d26e1d783f forgot the CHANGES file in r913 2011-09-09 14:53:38 +00:00
Antonin Descampe
fa720c1858 TRUNK:added a new indexer functionality to the library. With the new -jpip option at encoding, the user can now generate a JP2 file including an XML box with the index used when browsing the image with JPIP 2011-09-09 14:49:08 +00:00
Mickael Savinaud
bc7c3e44d5 fixed windows nighlty crash about one missing opj_getopt() (and warning with other platform) 2011-09-02 08:34:38 +00:00
Kaori Hagihara
480ca88b68 changed terminating status of opj_server in debug/non-server mode 2011-09-01 13:32:42 +00:00
Antonin Descampe
aba0e602ed renamed getopt.{c/h} to opj_getopt.{c/h} and forced the use of these files rather than the system ones. This fixed issue 78. Credit to Winfried. 2011-09-01 11:24:08 +00:00
Mickael Savinaud
22a2f98ced fixed a segfault with fgets return value for some cases inside test function compare_dump_file() 2011-08-31 16:51:37 +00:00
Mickael Savinaud
aaa47850c3 enhance the encoding test suite and remove unsued CONFIGURE_FILE into a CMakeList 2011-08-31 13:33:40 +00:00
Mickael Savinaud
7c2feb78d2 added first version of the encoding tests suite 2011-08-30 16:07:43 +00:00
Kaori Hagihara
0c65d2cc0c reorganization of indexer before importing extentional libopenjpeg files 2011-08-28 21:43:57 +00:00
Antonin Descampe
13c5f806c6 fixed missing include directory in opj_client/opj_dec_server/CMakeLists.txt 2011-08-27 15:52:45 +00:00
Antonin Descampe
84d3b4de46 small changes in autotools files 2011-08-26 21:58:50 +00:00
Antonin Descampe
925a772dce fixed cmake and autotools files to reflect recent indexer changes in JPIP 2011-08-26 21:46:42 +00:00
Kaori Hagihara
95015f1104 modified indexer to use the latest openjpeg library 2011-08-26 16:57:34 +00:00
Antonin Descampe
dcbc727813 fixed cmake and autotools files to reflect recent changes in JPIP 2011-08-26 12:44:28 +00:00
Kaori Hagihara
3b9d4c8d50 fixed Makefile.nix to load openjpeg library from this archive 2011-08-26 11:50:50 +00:00
Kaori Hagihara
40fe9e6d67 added tid request support to JPIP client and JPIP server quit request 2011-08-25 17:13:04 +00:00
Kaori Hagihara
4da816e459 support tid request 2011-08-24 17:07:28 +00:00
Kaori Hagihara
9c475467d5 moved declarations of functions of opj_server for readability 2011-08-24 11:26:39 +00:00
Kaori Hagihara
0310cbad0a added cachemodel_manager, which had been managed in target_manager previously 2011-08-24 11:00:15 +00:00
Mathieu Malaterre
ef258914b2 Properly close bug #73, by providing a test for it. 2011-08-22 13:13:00 +00:00
Antonin Descampe
c025f363f5 updated INSTALL files, fixed a bug in CMakeLists.txt that prevented finding the data directory 2011-08-22 10:42:32 +00:00
Antonin Descampe
51187d06b3 INSTALL and THANKS files update 2011-08-22 09:59:03 +00:00
Antonin Descampe
8210b3c873 added NEWS, AUTHORS and THANKS files. Cosmetic changes in autotools files (in trunk) 2011-08-16 13:25:42 +00:00
Antonin Descampe
883e0826e2 removed obsolete testing directory and *.nix files (in trunk) 2011-08-16 09:33:37 +00:00
Antonin Descampe
003f9f7953 fixed cmake support for openjpip 2011-08-16 08:52:23 +00:00
Antonin Descampe
2880a679f0 fixed a bug in autotools files that prevented libfcgi to be correctly found in some cases (patch from V.Torri) 2011-08-15 13:22:46 +00:00
Antonin Descampe
4d6cff7eb8 minor changes in autotools installation README 2011-08-15 09:51:47 +00:00
Antonin Descampe
d8806649ab added cmake support to openjpip 2011-08-12 13:57:36 +00:00
Mickael Savinaud
dc9a65923a Fixed issue #76 (trunk) 2011-08-11 14:29:03 +00:00
Antonin Descampe
751d2a0fe7 minor bug fix in configure.ac (credit to Vincent Torri) 2011-08-11 12:22:31 +00:00
612 changed files with 149186 additions and 59543 deletions

17
.gitignore vendored Normal file
View File

@ -0,0 +1,17 @@
# Ignore files and directories made by `cmake .`.
CMakeFiles/
Makefile
cmake_install.cmake
/CMakeCache.txt
/CPackConfig.cmake
/CPackSourceConfig.cmake
/CTestCustom.cmake
/LICENSE.txt
/OpenJPEGConfig.cmake
/libopenjp2.pc
/src/bin/common/opj_apps_config.h
/src/lib/openjp2/opj_config.h
/src/lib/openjp2/opj_config_private.h
# Ignore directories made by `make`.
/bin/

93
.travis.yml Normal file
View File

@ -0,0 +1,93 @@
language: c
matrix:
include:
- os: osx
compiler: clang
env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release OPJ_CI_INCLUDE_IF_DEPLOY=1
- os: linux
compiler: gcc
env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release OPJ_CI_INCLUDE_IF_DEPLOY=1
- os: linux
compiler: gcc
env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release OPJ_NUM_THREADS=2
- os: linux
compiler: gcc
env: OPJ_CI_ARCH=i386 OPJ_CI_BUILD_CONFIGURATION=Release
addons:
apt:
packages:
- gcc-multilib
- os: linux
compiler: gcc
env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Debug
- os: linux
compiler: clang
env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Debug OPJ_CI_ASAN=1
- os: linux
compiler: clang-3.8
env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release
addons:
apt:
sources:
- llvm-toolchain-precise-3.8
- ubuntu-toolchain-r-test
packages:
- clang-3.8
- os: linux
compiler: x86_64-w64-mingw32-gcc
env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release
addons:
apt:
packages:
- gcc-mingw-w64-base
- binutils-mingw-w64-x86-64
- gcc-mingw-w64-x86-64
- gcc-mingw-w64
- os: linux
compiler: x86_64-w64-mingw32-gcc
env: OPJ_CI_ARCH=i386 OPJ_CI_BUILD_CONFIGURATION=Release
addons:
apt:
packages:
- gcc-mingw-w64-base
- binutils-mingw-w64-i686
- gcc-mingw-w64-i686
- gcc-mingw-w64
- os: linux
compiler: gcc-4.8
env: OPJ_CI_ABI_CHECK=1
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.8
- libelf-dev
- elfutils
- texinfo
- exuberant-ctags
install:
- ./tools/travis-ci/install.sh
script:
- ./tools/travis-ci/run.sh
- ./tools/travis-ci/abi-check.sh
before_deploy:
- export OPJ_RELEASE_PKG_FILE=$(ls build/openjpeg-${TRAVIS_TAG}*)
- echo "deploying $OPJ_RELEASE_PKG_FILE to GitHub releases"
deploy:
provider: releases
api_key:
secure: Npi13uOffALCVNwea4p4q8v85Lo/WsRqaeZQcWrAkt8MxRnfvWQtmnuwmHnVB6Cig+T1lVUHrklOaJIApIb6nkGq3CS/9bD8+SCS2NEdAAP/QYWnBi0ubWXVMRyDLypmwRpzLNSZ0xLYGFUl2PjieZYKRcz1dd/J7S+FnXhPtdjXweq0FS63zTcMe7ggjfmzSOWUCEFmMjZPaM0Be+3PweieCO1dxlHuy7ugCkx2S7d+5hNsicIhQmTADjqtJAkHoMhYqu6/yLFxhjO/+f938PATFULdODTvjCsUwdN/ySWi1Oj4uPAntfytZP7H6YrzLh8dS73QCsdkhhDJIgJskHIBSbRyyEVUnOvQgD9VaBVGHtc1KtZQTwc41OUO3BGPHl97s3oX6bqWqo/L53dB3TPHGx+1+2HL/F0zaDZuHhAKMkPwe8LFPMPB/ur65zXMHjnWb2ZTVVdoIvkbQ7nu8ApI60ejxocYBsEyAuC2CPXU2ki4jdEhm0E1hIziWNE9/LTuM17ziQuJ6WpXOSMrfP4o5aVDmLp5ZGBSocrspOksgyI9XogHaO/r+Y6N3exy+giObFfMHkZVUpsKrKmtOJ7TC1Vg5HsYGlWW8RN8dkJV47bUXm9K4sMos9eYMUt/czykPAs+132cogpII3QxXpFZQqZg6SEPVfOiyqQzTUI=
file_glob: true
file: "${OPJ_RELEASE_PKG_FILE}"
skip_cleanup: true
on:
repo: uclouvain/openjpeg
tags: true
condition: "$OPJ_CI_INCLUDE_IF_DEPLOY = 1"

13
AUTHORS
View File

@ -1,13 +0,0 @@
Authors of OpenJPEG
See also the files THANKS and CHANGES
David Janssens designed and implemented the first version of OpenJPEG.
Kaori Hagihara designed and implemented the first version of OpenJPIP.
Jerome Fimes implemented the alpha version of OpenJPEG v2.
Giuseppe Baruffa added the JPWL functionalities.
Yannick Verschueren,
Herve Drolon,
Francois-Olivier Devaux,
Antonin Descampe
improved the libraries and utilities.

21
AUTHORS.md Normal file
View File

@ -0,0 +1,21 @@
# Authors of OpenJPEG
See also [THANKS](https://github.com/uclouvain/openjpeg/blob/master/THANKS.md)
David Janssens designed and implemented the first version of OpenJPEG.
Kaori Hagihara designed and implemented the first version of OpenJPIP.
Jerome Fimes implemented the alpha version of OpenJPEG 2.0.
Giuseppe Baruffa added the JPWL functionalities.
Mickaël Savinaud implemented the final OpenJPEG 2.0 version based on a big merge between 1.5 version and alpha version of 2.0.
Mathieu Malaterre participated to the OpenJPEG 2.0 version and improved the libraries and utilities.
Yannick Verschueren,
Herve Drolon,
Francois-Olivier Devaux,
Antonin Descampe
improved the libraries and utilities.

446
CHANGELOG.md Normal file
View File

@ -0,0 +1,446 @@
# Changelog
## [v2.1.2](https://github.com/uclouvain/openjpeg/releases/v2.1.2) (2016-09-28)
[Full Changelog](https://github.com/uclouvain/openjpeg/compare/v2.1.1...v2.1.2)
**Closed issues:**
- null ptr dereference in convert.c:1331 [\#843](https://github.com/uclouvain/openjpeg/issues/843)
- Out-of-Bounds Read in function bmp24toimage of convertbmp.c [\#833](https://github.com/uclouvain/openjpeg/issues/833)
- Disable automatic compilation of t1\_generate\_luts in CMakeLists.txt [\#831](https://github.com/uclouvain/openjpeg/issues/831)
- CVE-2016-7163 Integer overflow in opj\_pi\_create\_decode [\#826](https://github.com/uclouvain/openjpeg/issues/826)
- Security Advisory for OpenJPEG [\#810](https://github.com/uclouvain/openjpeg/issues/810)
- Add dashboard with static lib [\#804](https://github.com/uclouvain/openjpeg/issues/804)
- hidden visibility for the static library / building with -DOPJ\_STATIC against shared lib [\#802](https://github.com/uclouvain/openjpeg/issues/802)
- Optimization when building library from source [\#799](https://github.com/uclouvain/openjpeg/issues/799)
- unsigned int16 on Solaris 11.2/sparc [\#796](https://github.com/uclouvain/openjpeg/issues/796)
- appveyor [\#793](https://github.com/uclouvain/openjpeg/issues/793)
- Please make a new release [\#782](https://github.com/uclouvain/openjpeg/issues/782)
- FFMpeg will not link to 2.1.1 release built as shared library [\#766](https://github.com/uclouvain/openjpeg/issues/766)
- API change since v2: opj\_event\_mgr\_t not available [\#754](https://github.com/uclouvain/openjpeg/issues/754)
- openjpeg.h needs dependencies [\#673](https://github.com/uclouvain/openjpeg/issues/673)
- "master" does not build on ubuntu [\#658](https://github.com/uclouvain/openjpeg/issues/658)
- Package 'openjp2', required by 'libopenjpip', not found [\#594](https://github.com/uclouvain/openjpeg/issues/594)
**Merged pull requests:**
- Fix PNM file reading [\#847](https://github.com/uclouvain/openjpeg/pull/847) ([mayeut](https://github.com/mayeut))
- Fix some issues reported by Coverity Scan [\#846](https://github.com/uclouvain/openjpeg/pull/846) ([stweil](https://github.com/stweil))
- Fix potential out-of-bounds read \(coverity\) [\#844](https://github.com/uclouvain/openjpeg/pull/844) ([stweil](https://github.com/stweil))
- Remove TODO for overflow check [\#842](https://github.com/uclouvain/openjpeg/pull/842) ([mayeut](https://github.com/mayeut))
- Add overflow checks for opj\_aligned\_malloc [\#841](https://github.com/uclouvain/openjpeg/pull/841) ([mayeut](https://github.com/mayeut))
- Flags in T1 shall be unsigned [\#840](https://github.com/uclouvain/openjpeg/pull/840) ([mayeut](https://github.com/mayeut))
- Fix some warnings [\#838](https://github.com/uclouvain/openjpeg/pull/838) ([mayeut](https://github.com/mayeut))
- Fix issue 833. [\#834](https://github.com/uclouvain/openjpeg/pull/834) ([trylab](https://github.com/trylab))
- Add overflow checks for opj\_aligned\_malloc [\#832](https://github.com/uclouvain/openjpeg/pull/832) ([mayeut](https://github.com/mayeut))
- Add test for issue 820 [\#829](https://github.com/uclouvain/openjpeg/pull/829) ([mayeut](https://github.com/mayeut))
- Add test for issue 826 [\#827](https://github.com/uclouvain/openjpeg/pull/827) ([mayeut](https://github.com/mayeut))
- Fix coverity 113065 \(CWE-484\) [\#824](https://github.com/uclouvain/openjpeg/pull/824) ([mayeut](https://github.com/mayeut))
- Add sanity check for tile coordinates [\#823](https://github.com/uclouvain/openjpeg/pull/823) ([mayeut](https://github.com/mayeut))
- Add test for PR 818 [\#822](https://github.com/uclouvain/openjpeg/pull/822) ([mayeut](https://github.com/mayeut))
- Update to libpng 1.6.25 [\#821](https://github.com/uclouvain/openjpeg/pull/821) ([mayeut](https://github.com/mayeut))
- CVE-2016-8332: fix incrementing of "l\_tcp-\>m\_nb\_mcc\_records" in opj\_j2k\_read\_mcc [\#820](https://github.com/uclouvain/openjpeg/pull/820) ([mayeut](https://github.com/mayeut))
- Add overflow check in opj\_tcd\_init\_tile [\#819](https://github.com/uclouvain/openjpeg/pull/819) ([mayeut](https://github.com/mayeut))
- Fix leak & invalid behavior of opj\_jp2\_read\_ihdr [\#818](https://github.com/uclouvain/openjpeg/pull/818) ([mayeut](https://github.com/mayeut))
- Add overflow check in opj\_j2k\_update\_image\_data [\#817](https://github.com/uclouvain/openjpeg/pull/817) ([mayeut](https://github.com/mayeut))
- Change 'restrict' define to 'OPJ\_RESTRICT' [\#816](https://github.com/uclouvain/openjpeg/pull/816) ([mayeut](https://github.com/mayeut))
- Switch to clang 3.8 [\#814](https://github.com/uclouvain/openjpeg/pull/814) ([mayeut](https://github.com/mayeut))
- Fix an integer overflow issue [\#809](https://github.com/uclouvain/openjpeg/pull/809) ([trylab](https://github.com/trylab))
- Update to lcms 2.8 [\#808](https://github.com/uclouvain/openjpeg/pull/808) ([mayeut](https://github.com/mayeut))
- Update to libpng 1.6.24 [\#807](https://github.com/uclouvain/openjpeg/pull/807) ([mayeut](https://github.com/mayeut))
- Reenable clang-3.9 build on travis [\#806](https://github.com/uclouvain/openjpeg/pull/806) ([mayeut](https://github.com/mayeut))
- Bit fields type [\#805](https://github.com/uclouvain/openjpeg/pull/805) ([smuehlst](https://github.com/smuehlst))
- Add compilation test for standalone inclusion of openjpeg.h [\#798](https://github.com/uclouvain/openjpeg/pull/798) ([mayeut](https://github.com/mayeut))
- jpwl: Remove non-portable data type u\_int16\_t \(fix issue \#796\) [\#797](https://github.com/uclouvain/openjpeg/pull/797) ([stweil](https://github.com/stweil))
- Fix dependency for pkg-config \(issue \#594\) [\#795](https://github.com/uclouvain/openjpeg/pull/795) ([stweil](https://github.com/stweil))
- Add .gitignore [\#787](https://github.com/uclouvain/openjpeg/pull/787) ([stweil](https://github.com/stweil))
## [v2.1.1](https://github.com/uclouvain/openjpeg/releases/tag/v2.1.1) (2016-07-05)
[Full Changelog](https://github.com/uclouvain/openjpeg/compare/version.2.1...v2.1.1)
**Implemented enhancements:**
- opj\_malloc replacement [\#625](https://github.com/uclouvain/openjpeg/issues/625)
- backport "-p" and "-force-rgb" options in 1.5 [\#606](https://github.com/uclouvain/openjpeg/issues/606)
- Use travis-ci matrix build [\#581](https://github.com/uclouvain/openjpeg/issues/581)
- Add Coverity Scan analysis [\#580](https://github.com/uclouvain/openjpeg/issues/580)
- Unnecessary rate distortion calculations [\#479](https://github.com/uclouvain/openjpeg/issues/479)
- Add images from various security issues to test suite [\#415](https://github.com/uclouvain/openjpeg/issues/415)
- Coding speed for 9/7 on 32bits platforms \(x86/ARM\) can be improved with a quick fix [\#220](https://github.com/uclouvain/openjpeg/issues/220)
**Fixed bugs:**
- Out-of-Bounds Access in function opj\_tgt\_reset of tgt.c [\#775](https://github.com/uclouvain/openjpeg/issues/775)
- Heap Buffer Overflow in function color\_cmyk\_to\_rgb of color.c [\#774](https://github.com/uclouvain/openjpeg/issues/774)
- division-by-zero \(SIGFPE\) error in opj\_tcd\_init\_tile function \(line 730 of tcd.c\) [\#733](https://github.com/uclouvain/openjpeg/issues/733)
- Out-Of-Bounds Read in sycc422\_to\_rgb function [\#726](https://github.com/uclouvain/openjpeg/issues/726)
- Heap Corruption in opj\_free function [\#725](https://github.com/uclouvain/openjpeg/issues/725)
- Out-Of-Bounds Read in opj\_tcd\_free\_tile function [\#724](https://github.com/uclouvain/openjpeg/issues/724)
- Cannot handle box of undefined size [\#653](https://github.com/uclouvain/openjpeg/issues/653)
- Compilation fails without platform-supplied aligned malloc [\#642](https://github.com/uclouvain/openjpeg/issues/642)
- HP compiler warns about redeclaration of static function [\#640](https://github.com/uclouvain/openjpeg/issues/640)
- Implementation-defined behavior of malloc causes different behavior on Linux and AIX [\#635](https://github.com/uclouvain/openjpeg/issues/635)
- Build on AIX fails because "opj\_includes.h" is included after system headers [\#633](https://github.com/uclouvain/openjpeg/issues/633)
- Compiling with SSE2 on Linux 32-bit causes crashes in OpenJPEG [\#624](https://github.com/uclouvain/openjpeg/issues/624)
- Build on AIX fails because of "restrict" pointers [\#620](https://github.com/uclouvain/openjpeg/issues/620)
- bug in new tif conversion code [\#609](https://github.com/uclouvain/openjpeg/issues/609)
- bin/jp2/convert.c line 1085 Resource leak [\#607](https://github.com/uclouvain/openjpeg/issues/607)
- bin/jp2/convert.c memory leak [\#601](https://github.com/uclouvain/openjpeg/issues/601)
- Resource leak in opj\_j2k\_create\_cstr\_index in case of failure [\#599](https://github.com/uclouvain/openjpeg/issues/599)
- Resource leak in opj\_j2k\_encode in case of failure [\#598](https://github.com/uclouvain/openjpeg/issues/598)
- Resource leak in opj\_j2k\_decode\_one\_tile in case of failure [\#597](https://github.com/uclouvain/openjpeg/issues/597)
- Resource Leak [\#573](https://github.com/uclouvain/openjpeg/issues/573)
- opj\_compress fails to compress lossless on gcc/x86 \(-m32\) [\#571](https://github.com/uclouvain/openjpeg/issues/571)
- Use-after-free in opj\_j2k\_write\_mco [\#563](https://github.com/uclouvain/openjpeg/issues/563)
- openjpeg-master-2015-07-30 failed to compile on LINUX [\#556](https://github.com/uclouvain/openjpeg/issues/556)
- PNG images are always read as RGB\(A\) images [\#536](https://github.com/uclouvain/openjpeg/issues/536)
- g4\_colr.j2c not handled properly [\#532](https://github.com/uclouvain/openjpeg/issues/532)
- Bigendian: opj\_compress + opj\_decompress fails [\#518](https://github.com/uclouvain/openjpeg/issues/518)
- Suspicious code in j2k.c [\#517](https://github.com/uclouvain/openjpeg/issues/517)
- Decode times almost double\(!!\) on Visual Studio 2013, 2015 [\#505](https://github.com/uclouvain/openjpeg/issues/505)
- opj\_data/input/nonregression/issue226.j2k [\#500](https://github.com/uclouvain/openjpeg/issues/500)
- opj\_setup\_encoder always returns true [\#497](https://github.com/uclouvain/openjpeg/issues/497)
- Double free in j2k\_read\_ppm\_v3 parsing \(\(presumably invalid\) image. [\#496](https://github.com/uclouvain/openjpeg/issues/496)
- Invalid write in opj\_j2k\_update\_image\_data [\#495](https://github.com/uclouvain/openjpeg/issues/495)
- Undefined printf format specifier %ud used in code [\#494](https://github.com/uclouvain/openjpeg/issues/494)
- Potential double free on malloc failure in opj\_j2k\_copy\_default\_tcp\_and\_create\_tcp\(\) [\#492](https://github.com/uclouvain/openjpeg/issues/492)
- Do not link with -ffast-math [\#488](https://github.com/uclouvain/openjpeg/issues/488)
- Heap-buffer-overflow in opj\_dwt\_decode [\#486](https://github.com/uclouvain/openjpeg/issues/486)
- opj\_dump fails on Windows 7, 64 bits [\#482](https://github.com/uclouvain/openjpeg/issues/482)
- SIGSEGV in opj\_j2k\_update\_image\_data via pdfium\_test [\#481](https://github.com/uclouvain/openjpeg/issues/481)
- Heap-buffer-overflow in opj\_j2k\_tcp\_destroy [\#477](https://github.com/uclouvain/openjpeg/issues/477)
- Invalid image causes write past end of heap buffer [\#476](https://github.com/uclouvain/openjpeg/issues/476)
- Assertion `l\_res-\>x0 \>= 0' fails when parsing invalid images [\#475](https://github.com/uclouvain/openjpeg/issues/475)
- Bug on opj\_write\_bytes\_BE function [\#472](https://github.com/uclouvain/openjpeg/issues/472)
- Refactor j2k\_read\_ppm\_v3 function [\#470](https://github.com/uclouvain/openjpeg/issues/470)
- compression: strange precinct dimensions [\#466](https://github.com/uclouvain/openjpeg/issues/466)
- \(:- Console message in opj\_decompress -:\) [\#465](https://github.com/uclouvain/openjpeg/issues/465)
- opj\_decompress fails to decompress any files [\#463](https://github.com/uclouvain/openjpeg/issues/463)
- bio-\>ct is unnecessarily set to zero in opj\_bio\_flush method [\#461](https://github.com/uclouvain/openjpeg/issues/461)
- Maximal unsigned short is 65535, not 65536 [\#460](https://github.com/uclouvain/openjpeg/issues/460)
- OpenJpeg fails to encode components with different precision properly [\#459](https://github.com/uclouvain/openjpeg/issues/459)
- component precision upscaling isn't correct in opj\_decompress [\#458](https://github.com/uclouvain/openjpeg/issues/458)
- Multiple precision components won't get encoded to jp2 if 1 component is unsigned 1 bit [\#457](https://github.com/uclouvain/openjpeg/issues/457)
- Incorrect code in ../bin/jp2/convert.c, function rawtoimage\_common\(...\) [\#456](https://github.com/uclouvain/openjpeg/issues/456)
- \[OpenJPEG-trunk\] opj\_stream\_get\_number\_byte\_left throws assert [\#455](https://github.com/uclouvain/openjpeg/issues/455)
- NR-DEC-kodak\_2layers\_lrcp.j2c-31-decode-md5 fails randomly when running tests in parallel [\#454](https://github.com/uclouvain/openjpeg/issues/454)
- compare\_raw\_files doesn't report an error on invalid arguments / missing input files [\#453](https://github.com/uclouvain/openjpeg/issues/453)
- Forward discrete wavelet transform: implement periodic symmetric extension at boundaries [\#452](https://github.com/uclouvain/openjpeg/issues/452)
- Bug in tiff reading method in convert.c [\#449](https://github.com/uclouvain/openjpeg/issues/449)
- Image in pdf don't display [\#447](https://github.com/uclouvain/openjpeg/issues/447)
- Multiple issues causing opj\_decompress to segfault [\#446](https://github.com/uclouvain/openjpeg/issues/446)
- opj\_compress: 40% of encode time is spent freeing data [\#445](https://github.com/uclouvain/openjpeg/issues/445)
- Multiple warnings when configuring OpenJPEG on MacOS with CMake 3.x \(trunk\) [\#443](https://github.com/uclouvain/openjpeg/issues/443)
- valgrind memleak found [\#437](https://github.com/uclouvain/openjpeg/issues/437)
- global-buffer-overflow src/lib/openjp2/t1.c:1146 opj\_t1\_getwmsedec [\#436](https://github.com/uclouvain/openjpeg/issues/436)
- Warning introduced on trunk r2923 & r2924 [\#435](https://github.com/uclouvain/openjpeg/issues/435)
- heap-buffer-overflow in opj\_t1\_decode\_cblks [\#432](https://github.com/uclouvain/openjpeg/issues/432)
- Heap-buffer-overflow in opj\_tcd\_init\_decode\_tile [\#431](https://github.com/uclouvain/openjpeg/issues/431)
- Heap-buffer-overflow in opj\_j2k\_tcp\_destroy [\#430](https://github.com/uclouvain/openjpeg/issues/430)
- Heap-buffer-overflow in opj\_jp2\_apply\_pclr [\#429](https://github.com/uclouvain/openjpeg/issues/429)
- issue412 revisited [\#428](https://github.com/uclouvain/openjpeg/issues/428)
- Image distorted \(sides look cankered\) [\#423](https://github.com/uclouvain/openjpeg/issues/423)
- openjpeg-2.x-trunk-r2918 is broken in color.c [\#422](https://github.com/uclouvain/openjpeg/issues/422)
- Heap-buffer-overflow in opj\_tcd\_init\_decode\_tile [\#420](https://github.com/uclouvain/openjpeg/issues/420)
- Heap-use-after-free in opj\_t1\_decode\_cblks [\#418](https://github.com/uclouvain/openjpeg/issues/418)
- UNKNOWN in opj\_read\_bytes\_LE [\#417](https://github.com/uclouvain/openjpeg/issues/417)
- Transparency problem [\#416](https://github.com/uclouvain/openjpeg/issues/416)
- Image with per channel alpha \(cdef\) does not decode properly [\#414](https://github.com/uclouvain/openjpeg/issues/414)
- OpenJPEG crashes with attached image [\#413](https://github.com/uclouvain/openjpeg/issues/413)
- Palette image with cdef fails to decompress [\#412](https://github.com/uclouvain/openjpeg/issues/412)
- Invalid member values from opj\_read\_header or opj\_decode ? [\#411](https://github.com/uclouvain/openjpeg/issues/411)
- MD5 Checksum hangs under valgrind on MacOS X [\#410](https://github.com/uclouvain/openjpeg/issues/410)
- Heap-buffer-overflow in opj\_tcd\_get\_decoded\_tile\_size [\#408](https://github.com/uclouvain/openjpeg/issues/408)
- C++ style comments in trunk/src/lib/openjp2/j2k.c [\#407](https://github.com/uclouvain/openjpeg/issues/407)
- Backport bugfixes from trunk to 2.1 branch [\#405](https://github.com/uclouvain/openjpeg/issues/405)
- Heap-buffer-overflow in parse\_cmdline\_encoder [\#403](https://github.com/uclouvain/openjpeg/issues/403)
- Heap-buffer-overflow in opj\_v4dwt\_interleave\_h [\#400](https://github.com/uclouvain/openjpeg/issues/400)
- Heap-buffer-overflow in opj\_dwt\_decode [\#399](https://github.com/uclouvain/openjpeg/issues/399)
- Heap-use-after-free in opj\_t1\_decode\_cblks [\#398](https://github.com/uclouvain/openjpeg/issues/398)
- Heap-buffer-overflow in opj\_jp2\_apply\_cdef [\#397](https://github.com/uclouvain/openjpeg/issues/397)
- Heap-buffer-overflow in opj\_t2\_read\_packet\_header [\#396](https://github.com/uclouvain/openjpeg/issues/396)
- Heap-buffer-overflow in opj\_t2\_read\_packet\_header [\#395](https://github.com/uclouvain/openjpeg/issues/395)
- Heap-buffer-overflow in opj\_dwt\_decode\_1 [\#394](https://github.com/uclouvain/openjpeg/issues/394)
- Heap-double-free in j2k\_read\_ppm\_v3 [\#393](https://github.com/uclouvain/openjpeg/issues/393)
- Security hole in j2k.c [\#392](https://github.com/uclouvain/openjpeg/issues/392)
- Security: double-free in opj\_tcd\_code\_block\_dec\_deallocate [\#391](https://github.com/uclouvain/openjpeg/issues/391)
- check for negative-size params in code [\#390](https://github.com/uclouvain/openjpeg/issues/390)
- Heap-buffer-overflow in opj\_t2\_read\_packet\_header [\#389](https://github.com/uclouvain/openjpeg/issues/389)
- Heap overflow in OpenJpeg 1.5.2 [\#388](https://github.com/uclouvain/openjpeg/issues/388)
- openjpip.so.6 file too short [\#387](https://github.com/uclouvain/openjpeg/issues/387)
- Corrupted JP3D file [\#386](https://github.com/uclouvain/openjpeg/issues/386)
- variable assigned to itself [\#383](https://github.com/uclouvain/openjpeg/issues/383)
- Null pointer dereferencing [\#382](https://github.com/uclouvain/openjpeg/issues/382)
- bad use of case statement [\#381](https://github.com/uclouvain/openjpeg/issues/381)
- Release 2.1 as a Ubuntu package [\#380](https://github.com/uclouvain/openjpeg/issues/380)
- Bug in libopenjpwl.pc [\#374](https://github.com/uclouvain/openjpeg/issues/374)
- inconsistent tile numbering in decode output message [\#370](https://github.com/uclouvain/openjpeg/issues/370)
- error in code block calculations [\#369](https://github.com/uclouvain/openjpeg/issues/369)
- r2872 fails to compile due to "attempt to use poisoned malloc" error in j2k.c [\#368](https://github.com/uclouvain/openjpeg/issues/368)
- OSX build gives libopenjp2.6.dylib with not-absolute install name id [\#367](https://github.com/uclouvain/openjpeg/issues/367)
- opj\_decompress gives error but successfully decompress in OPJ 2.1 [\#366](https://github.com/uclouvain/openjpeg/issues/366)
- pngtoimage\(\) and imagetopng\(\) have wrong byte order for 16-Bit image [\#365](https://github.com/uclouvain/openjpeg/issues/365)
- PDF crash in chrome - part2 \(due to attachment limit\) [\#364](https://github.com/uclouvain/openjpeg/issues/364)
- PDF crash in chrome - part1 [\#363](https://github.com/uclouvain/openjpeg/issues/363)
- PDF crash in chrome - part0 [\#362](https://github.com/uclouvain/openjpeg/issues/362)
- Compilation fails on Windows with mingw32 gcc4.8 [\#361](https://github.com/uclouvain/openjpeg/issues/361)
- security issue [\#360](https://github.com/uclouvain/openjpeg/issues/360)
- improve memory management [\#359](https://github.com/uclouvain/openjpeg/issues/359)
- how to compress a yuv420 raw data using opj\_compress [\#357](https://github.com/uclouvain/openjpeg/issues/357)
- Some memory allocation are not checked [\#355](https://github.com/uclouvain/openjpeg/issues/355)
- Static library symbols shall be marked as hidden [\#354](https://github.com/uclouvain/openjpeg/issues/354)
- opj\_compress rejects valid bmp files [\#353](https://github.com/uclouvain/openjpeg/issues/353)
- opj\_compress crashes when number of resolutions is set to zero [\#352](https://github.com/uclouvain/openjpeg/issues/352)
- Compilation error under Visual Studio 2003 [\#351](https://github.com/uclouvain/openjpeg/issues/351)
- opj\_compress description example error \[Low priority\] [\#350](https://github.com/uclouvain/openjpeg/issues/350)
- opj\_write\_bytes\_BE is wrong in trunk [\#345](https://github.com/uclouvain/openjpeg/issues/345)
- PART1ONLY option in release.sh doesn't work properly [\#332](https://github.com/uclouvain/openjpeg/issues/332)
- openjpeg crash error [\#330](https://github.com/uclouvain/openjpeg/issues/330)
- openjpeg decompress error [\#329](https://github.com/uclouvain/openjpeg/issues/329)
- openjpeg decompress issue [\#326](https://github.com/uclouvain/openjpeg/issues/326)
- limited tif support [\#322](https://github.com/uclouvain/openjpeg/issues/322)
- asoc value of 65536 is allowed [\#321](https://github.com/uclouvain/openjpeg/issues/321)
- opj\_skip\_from\_file error [\#314](https://github.com/uclouvain/openjpeg/issues/314)
- Heavy quota usage in openjpeg [\#309](https://github.com/uclouvain/openjpeg/issues/309)
- Verify -help actually match letter [\#307](https://github.com/uclouvain/openjpeg/issues/307)
- g3\_colr.j2c not handled [\#288](https://github.com/uclouvain/openjpeg/issues/288)
- reopen/fix issue 165 [\#280](https://github.com/uclouvain/openjpeg/issues/280)
- kakadu conformance tests [\#279](https://github.com/uclouvain/openjpeg/issues/279)
- missing break after case statement in opj\_dwt\_decode\_real [\#274](https://github.com/uclouvain/openjpeg/issues/274)
- Run Coverity on trunk [\#270](https://github.com/uclouvain/openjpeg/issues/270)
- NR-ENC-random-issue-0005.tif-12-encode [\#259](https://github.com/uclouvain/openjpeg/issues/259)
- Use new add\_test signature to handle cross compilation [\#258](https://github.com/uclouvain/openjpeg/issues/258)
- Loss decoding quality in 2.0.0 [\#254](https://github.com/uclouvain/openjpeg/issues/254)
- Decompress that worked in 1.5.1 fails in 2.0 [\#252](https://github.com/uclouvain/openjpeg/issues/252)
- Expected endianness with raw input is not documented leading to SEGFAULT [\#251](https://github.com/uclouvain/openjpeg/issues/251)
- OpenJPEG writes to stderr [\#246](https://github.com/uclouvain/openjpeg/issues/246)
- Inconsistent logging of tile index [\#245](https://github.com/uclouvain/openjpeg/issues/245)
- patch for openjpeg-trunk-r2347 and BIG\_ENDIAN [\#242](https://github.com/uclouvain/openjpeg/issues/242)
- CMAP: MTYP == 0 \(direct use\) not handled properly [\#235](https://github.com/uclouvain/openjpeg/issues/235)
- Black Pixel [\#233](https://github.com/uclouvain/openjpeg/issues/233)
- opj\_compress runtime error after fresh Linux install due to apparent failure to execute ldconfig [\#219](https://github.com/uclouvain/openjpeg/issues/219)
- openjp2 debug works, release build does not [\#217](https://github.com/uclouvain/openjpeg/issues/217)
- openjpeg-branch15-r2299 and openjpeg-trunk-r2299 fail to decode a JP2 file [\#212](https://github.com/uclouvain/openjpeg/issues/212)
- openjpeg-trunk issue with Win7 [\#201](https://github.com/uclouvain/openjpeg/issues/201)
- undefined reference to `opj\_version' [\#200](https://github.com/uclouvain/openjpeg/issues/200)
- In tgt.c we used fprintf not the openjpeg message reporter [\#184](https://github.com/uclouvain/openjpeg/issues/184)
- Windows binaries not working under WinXP [\#176](https://github.com/uclouvain/openjpeg/issues/176)
- add ability to use intel ipp \(performance primitive\) within OpenJPEG [\#164](https://github.com/uclouvain/openjpeg/issues/164)
- Migration guide v2 [\#160](https://github.com/uclouvain/openjpeg/issues/160)
- Cannot decompress JPEG2000Aware3.18.7.3Win32\_kdutranscode6.3.1.j2k [\#158](https://github.com/uclouvain/openjpeg/issues/158)
- Cannot decompress JPEG2000Aware3.18.7.3Win32.j2k [\#157](https://github.com/uclouvain/openjpeg/issues/157)
- openjpeg@googlegroups.com has disappeard [\#153](https://github.com/uclouvain/openjpeg/issues/153)
- OpenJPEG 1.5.0 crashes on a ridiculously big file... [\#151](https://github.com/uclouvain/openjpeg/issues/151)
- opj\_image vs free [\#146](https://github.com/uclouvain/openjpeg/issues/146)
- Windows .dll file invalid [\#140](https://github.com/uclouvain/openjpeg/issues/140)
- Problem with second layer of a 2 layer coded LRCP \(with precincts\) [\#135](https://github.com/uclouvain/openjpeg/issues/135)
- version 1.4 crashes when opening PDF file with JPEG2000 images [\#133](https://github.com/uclouvain/openjpeg/issues/133)
- Setup a win64 dashboard [\#132](https://github.com/uclouvain/openjpeg/issues/132)
- J2KP4files/codestreams\_profile0/p0\_13.j2k question jpeg2000 [\#131](https://github.com/uclouvain/openjpeg/issues/131)
- Out of memory: Kill process 11204 \(opj\_server\) score 917 or sacrifice child [\#123](https://github.com/uclouvain/openjpeg/issues/123)
- FILE\* in opj API is unsafe [\#120](https://github.com/uclouvain/openjpeg/issues/120)
- third-party lib order [\#119](https://github.com/uclouvain/openjpeg/issues/119)
- openjpeg-1.5.0-Darwin-powerpc.dmg is huge ! [\#113](https://github.com/uclouvain/openjpeg/issues/113)
- misleading info in JP2 box lead to wrong number of components [\#110](https://github.com/uclouvain/openjpeg/issues/110)
- Image\_to\_j2k says that j2k files is generated but no file is on the HDD [\#109](https://github.com/uclouvain/openjpeg/issues/109)
- Error in openjpegV1.4 on compiling image\_to\_j2k: crash on reading bmp file [\#108](https://github.com/uclouvain/openjpeg/issues/108)
- Update to abi-compliance-checker 1.96 [\#106](https://github.com/uclouvain/openjpeg/issues/106)
- Decode error on the attached JPEG...works in KDU and with JASPER...please help! [\#101](https://github.com/uclouvain/openjpeg/issues/101)
- Mac binaries v1.4 is broken [\#95](https://github.com/uclouvain/openjpeg/issues/95)
- jp2\_read\_boxhdr\(\) has size bug in version 1 [\#92](https://github.com/uclouvain/openjpeg/issues/92)
- Support for Java JAI Imageio [\#90](https://github.com/uclouvain/openjpeg/issues/90)
- encoding test failing [\#86](https://github.com/uclouvain/openjpeg/issues/86)
- source archive on demand [\#85](https://github.com/uclouvain/openjpeg/issues/85)
- CMakeLists.txt and Makefile.am for JPIP are buggy [\#84](https://github.com/uclouvain/openjpeg/issues/84)
- pclr-cmap-cdef [\#82](https://github.com/uclouvain/openjpeg/issues/82)
- Error when compiling openjpeg\_v1\_4\_sources\_r697 [\#79](https://github.com/uclouvain/openjpeg/issues/79)
- J2K codec issue on Windows Mobile [\#77](https://github.com/uclouvain/openjpeg/issues/77)
- image\_to\_j2k.exe crashes on large .bmp file [\#75](https://github.com/uclouvain/openjpeg/issues/75)
- fatal error C1900 building the project on windows [\#65](https://github.com/uclouvain/openjpeg/issues/65)
- same option but different size [\#54](https://github.com/uclouvain/openjpeg/issues/54)
- Missing openjpegConfigure.h [\#38](https://github.com/uclouvain/openjpeg/issues/38)
- Not an issue in openjpeg, but ... [\#37](https://github.com/uclouvain/openjpeg/issues/37)
- OpenJPEG-1.3.0 pclr, cmap and cdef [\#27](https://github.com/uclouvain/openjpeg/issues/27)
- realloc maybe too big \(t2.c\) [\#26](https://github.com/uclouvain/openjpeg/issues/26)
- libopenjpeg/opj\_malloc.h breaks on FreeBSD/Darwin systems [\#20](https://github.com/uclouvain/openjpeg/issues/20)
- image\_to\_j2k not outputting to win32 console properly [\#18](https://github.com/uclouvain/openjpeg/issues/18)
- \[OpenJPEG\] OpenJPEG\_v13: tiled image part 2 [\#17](https://github.com/uclouvain/openjpeg/issues/17)
- JP2 Color Space modification by Matteo Italia [\#13](https://github.com/uclouvain/openjpeg/issues/13)
- Patch submission \( exotic video formats, and a few things \) [\#12](https://github.com/uclouvain/openjpeg/issues/12)
- 16 bits lossy compression [\#10](https://github.com/uclouvain/openjpeg/issues/10)
- pnm file formats not accepting bitdepth greater than 8 bpp [\#8](https://github.com/uclouvain/openjpeg/issues/8)
- Heap corruption in j2k encoder [\#5](https://github.com/uclouvain/openjpeg/issues/5)
- JPWL crash in marker reallocation\(+patch\), segfault while decoding image with main header protection [\#4](https://github.com/uclouvain/openjpeg/issues/4)
- a couple of small errors in libopenjpeg detected by coverity [\#1](https://github.com/uclouvain/openjpeg/issues/1)
**Closed issues:**
- Shared library build broken on ubuntu [\#728](https://github.com/uclouvain/openjpeg/issues/728)
- opj\_includes.h shouldn't define `\_\_attribute\_\_` [\#727](https://github.com/uclouvain/openjpeg/issues/727)
- Possible website problems due to Jekyll upgrade [\#713](https://github.com/uclouvain/openjpeg/issues/713)
- Stable Release? [\#712](https://github.com/uclouvain/openjpeg/issues/712)
- Meta Issue : try to fix some of these critical bugs before thinking about optimizing the library [\#710](https://github.com/uclouvain/openjpeg/issues/710)
- Tiled encoding broken for images with non power of 2 dimensions [\#702](https://github.com/uclouvain/openjpeg/issues/702)
- install\_name \(still\) not set on OS X [\#700](https://github.com/uclouvain/openjpeg/issues/700)
- Add section in wiki describing where one can get test images [\#699](https://github.com/uclouvain/openjpeg/issues/699)
- Make EvenManager into singleton [\#698](https://github.com/uclouvain/openjpeg/issues/698)
- Remove old branches from repo [\#696](https://github.com/uclouvain/openjpeg/issues/696)
- MQ Coder encode: Conditional jump or move depends on uninitialised value\(s\) [\#695](https://github.com/uclouvain/openjpeg/issues/695)
- Can we add these files to our test suite ? [\#688](https://github.com/uclouvain/openjpeg/issues/688)
- -t and -d command line flags for decode are not documented on OpenJPEG website [\#685](https://github.com/uclouvain/openjpeg/issues/685)
- Decoding at the precinct level [\#676](https://github.com/uclouvain/openjpeg/issues/676)
- Support unscaled 10 bit data for 2K cinema @ 48 FPS, as per DCI standard [\#671](https://github.com/uclouvain/openjpeg/issues/671)
- Use parallel jobs in ctest [\#664](https://github.com/uclouvain/openjpeg/issues/664)
- \[Security\]Multiple Memory error [\#663](https://github.com/uclouvain/openjpeg/issues/663)
- lossy encoding a 16 bit TIF file : severe artifiacts in decompressed image [\#660](https://github.com/uclouvain/openjpeg/issues/660)
- opj\_compress and opj\_decompress : get\_next\_file method uses hard-coded unix path separator [\#630](https://github.com/uclouvain/openjpeg/issues/630)
- Uninitialized variable [\#629](https://github.com/uclouvain/openjpeg/issues/629)
- Use of enum variable for bit flags prevents compilation as C++ source [\#619](https://github.com/uclouvain/openjpeg/issues/619)
- Serious problem with quantization during lossy encoding [\#615](https://github.com/uclouvain/openjpeg/issues/615)
- Decompression does not work with sequential data source [\#613](https://github.com/uclouvain/openjpeg/issues/613)
- potential overflow in opj\_tcd\_tile\_t [\#605](https://github.com/uclouvain/openjpeg/issues/605)
- Logical condition [\#596](https://github.com/uclouvain/openjpeg/issues/596)
- file9.jp2 does not dump correctly on 1.5 [\#595](https://github.com/uclouvain/openjpeg/issues/595)
- opj\_compress man page is missing documentation of -jpip option [\#593](https://github.com/uclouvain/openjpeg/issues/593)
- opj\_compress fails to compress lossless on gcc/x86 \(-m32\) in 1.5 branch [\#591](https://github.com/uclouvain/openjpeg/issues/591)
- Example: opj\_compress -i image.j2k -o image.pgm [\#577](https://github.com/uclouvain/openjpeg/issues/577)
- Mismatching delete [\#575](https://github.com/uclouvain/openjpeg/issues/575)
- Compilation fails on Win7 [\#546](https://github.com/uclouvain/openjpeg/issues/546)
- NR-JP2-file5.jp2-compare2base fails with third party libcms [\#540](https://github.com/uclouvain/openjpeg/issues/540)
- CTest spits out an error at the end of the test run [\#516](https://github.com/uclouvain/openjpeg/issues/516)
- opj\_uint\_adds\(\) is questionable [\#515](https://github.com/uclouvain/openjpeg/issues/515)
- Might consider renaming this method: [\#491](https://github.com/uclouvain/openjpeg/issues/491)
- opj\_compress run twice gives different fiile sizes for same file [\#490](https://github.com/uclouvain/openjpeg/issues/490)
- Android Support [\#483](https://github.com/uclouvain/openjpeg/issues/483)
- Add SSE2/SSE41 implementations for mct.c [\#451](https://github.com/uclouvain/openjpeg/issues/451)
- Reduce encoder code block memory usage for non 64x64 code block sizes [\#444](https://github.com/uclouvain/openjpeg/issues/444)
- valgrind "Uninitialized Memory Read" & "Uninitialized Memory Conditional" found [\#438](https://github.com/uclouvain/openjpeg/issues/438)
- No way to debug opj\_tcd\_init\_encode\_tile or opj\_tcd\_init\_decode\_tile [\#433](https://github.com/uclouvain/openjpeg/issues/433)
- Add option to call dsymutil on built binaries [\#409](https://github.com/uclouvain/openjpeg/issues/409)
- Allow opj\_compress and opj\_decompress to read/write images over stdin/stdout [\#379](https://github.com/uclouvain/openjpeg/issues/379)
- reduce memory significantly for single tile RGB encoding [\#375](https://github.com/uclouvain/openjpeg/issues/375)
- Switch code repo to github and start using pull request workflow [\#373](https://github.com/uclouvain/openjpeg/issues/373)
- This is a BigTIFF file. This format not supported [\#125](https://github.com/uclouvain/openjpeg/issues/125)
- Add a test suite to check the convert functions [\#99](https://github.com/uclouvain/openjpeg/issues/99)
- Add build config to the dashboard to verify the autotools build [\#88](https://github.com/uclouvain/openjpeg/issues/88)
**Merged pull requests:**
- Correct abi-check.sh for PR [\#791](https://github.com/uclouvain/openjpeg/pull/791) ([mayeut](https://github.com/mayeut))
- Update tcd.c [\#790](https://github.com/uclouvain/openjpeg/pull/790) ([maddin200](https://github.com/maddin200))
- Update lcms2 [\#773](https://github.com/uclouvain/openjpeg/pull/773) ([mayeut](https://github.com/mayeut))
- Use lowercase for cmake commands consistenly [\#769](https://github.com/uclouvain/openjpeg/pull/769) ([julienmalik](https://github.com/julienmalik))
- Ignore clang's summary warning [\#768](https://github.com/uclouvain/openjpeg/pull/768) ([julienmalik](https://github.com/julienmalik))
- Fix UBSan gcc warning for first arg to memset non null [\#767](https://github.com/uclouvain/openjpeg/pull/767) ([julienmalik](https://github.com/julienmalik))
- Update to libtiff-4.0.6 [\#764](https://github.com/uclouvain/openjpeg/pull/764) ([mayeut](https://github.com/mayeut))
- Fix warnings [\#763](https://github.com/uclouvain/openjpeg/pull/763) ([mayeut](https://github.com/mayeut))
- Check SSIZ is valid in opj\_j2k\_read\_siz [\#762](https://github.com/uclouvain/openjpeg/pull/762) ([mayeut](https://github.com/mayeut))
- Fix unsigned int overflow reported by UBSan [\#761](https://github.com/uclouvain/openjpeg/pull/761) ([mayeut](https://github.com/mayeut))
- Fix unsigned int overflow reported by UBSan [\#759](https://github.com/uclouvain/openjpeg/pull/759) ([mayeut](https://github.com/mayeut))
- Fix negative shift left reported by UBSan [\#758](https://github.com/uclouvain/openjpeg/pull/758) ([mayeut](https://github.com/mayeut))
- Fix negative shift left reported by UBSan [\#757](https://github.com/uclouvain/openjpeg/pull/757) ([mayeut](https://github.com/mayeut))
- Add clang 3.9 build to Travis matrix [\#753](https://github.com/uclouvain/openjpeg/pull/753) ([julienmalik](https://github.com/julienmalik))
- Fix implicit floating bool conversion [\#752](https://github.com/uclouvain/openjpeg/pull/752) ([julienmalik](https://github.com/julienmalik))
- Do not define \_\_attribute\_\_ in opj\_includes.h [\#751](https://github.com/uclouvain/openjpeg/pull/751) ([mayeut](https://github.com/mayeut))
- Allow to read/write 3/5/7/9/11/13/15 bpp TIF files [\#750](https://github.com/uclouvain/openjpeg/pull/750) ([mayeut](https://github.com/mayeut))
- Fix heap-buffer-overflow in color\_esycc\_to\_rgb [\#748](https://github.com/uclouvain/openjpeg/pull/748) ([mayeut](https://github.com/mayeut))
- update libpng to from 1.6.17 to 1.6.21 [\#747](https://github.com/uclouvain/openjpeg/pull/747) ([julienmalik](https://github.com/julienmalik))
- Update cmake & jpylyzer for travis builds [\#746](https://github.com/uclouvain/openjpeg/pull/746) ([julienmalik](https://github.com/julienmalik))
- Fix Out-Of-Bounds Read in sycc42x\_to\_rgb function [\#745](https://github.com/uclouvain/openjpeg/pull/745) ([mayeut](https://github.com/mayeut))
- cppcheck fix for openjp2 [\#740](https://github.com/uclouvain/openjpeg/pull/740) ([julienmalik](https://github.com/julienmalik))
- Fix uninitialized variable reported by cppcheck [\#735](https://github.com/uclouvain/openjpeg/pull/735) ([julienmalik](https://github.com/julienmalik))
- Remove dead code in opj\_dump [\#734](https://github.com/uclouvain/openjpeg/pull/734) ([julienmalik](https://github.com/julienmalik))
- issue \#695 MQ Encode: ensure that bp pointer never points to uninitialized memory [\#708](https://github.com/uclouvain/openjpeg/pull/708) ([boxerab](https://github.com/boxerab))
- Fix issue 135 [\#706](https://github.com/uclouvain/openjpeg/pull/706) ([mayeut](https://github.com/mayeut))
- Fix implementation of opj\_calloc [\#705](https://github.com/uclouvain/openjpeg/pull/705) ([stweil](https://github.com/stweil))
- \[git/2.1 regression\] Fix opj\_write\_tile\(\) failure when numresolutions=1 [\#690](https://github.com/uclouvain/openjpeg/pull/690) ([rouault](https://github.com/rouault))
- Fix fatal crash on 64 bit Linux [\#687](https://github.com/uclouvain/openjpeg/pull/687) ([stweil](https://github.com/stweil))
- \[libtiff\] Add missing include statement for ssize\_t [\#686](https://github.com/uclouvain/openjpeg/pull/686) ([mayeut](https://github.com/mayeut))
- Fix duplicate article in comments [\#684](https://github.com/uclouvain/openjpeg/pull/684) ([stweil](https://github.com/stweil))
- Fix grammar in comment [\#679](https://github.com/uclouvain/openjpeg/pull/679) ([stweil](https://github.com/stweil))
- Remove whitespace and CR at line endings [\#678](https://github.com/uclouvain/openjpeg/pull/678) ([stweil](https://github.com/stweil))
- Fix typos [\#665](https://github.com/uclouvain/openjpeg/pull/665) ([jwilk](https://github.com/jwilk))
- Add missing source for the JPIP library and executables \(issue \#658\) [\#659](https://github.com/uclouvain/openjpeg/pull/659) ([stweil](https://github.com/stweil))
- Fix undefined size jp2 box handling [\#654](https://github.com/uclouvain/openjpeg/pull/654) ([mayeut](https://github.com/mayeut))
- opj\_decompress: Update error message [\#651](https://github.com/uclouvain/openjpeg/pull/651) ([stweil](https://github.com/stweil))
- Fix support of posix\_memalloc for Linux [\#648](https://github.com/uclouvain/openjpeg/pull/648) ([stweil](https://github.com/stweil))
- Fix typo in comments [\#647](https://github.com/uclouvain/openjpeg/pull/647) ([stweil](https://github.com/stweil))
- Avoid pointer arithmetic with \(void \*\) pointers [\#644](https://github.com/uclouvain/openjpeg/pull/644) ([smuehlst](https://github.com/smuehlst))
- Fix HP compiler warning about redeclaration of function \(\#640\) [\#641](https://github.com/uclouvain/openjpeg/pull/641) ([smuehlst](https://github.com/smuehlst))
- Fix format strings and unneeded assignment [\#638](https://github.com/uclouvain/openjpeg/pull/638) ([stweil](https://github.com/stweil))
- Fix repository for JPEG2000 test data [\#637](https://github.com/uclouvain/openjpeg/pull/637) ([stweil](https://github.com/stweil))
- Update allocation functions [\#636](https://github.com/uclouvain/openjpeg/pull/636) ([mayeut](https://github.com/mayeut))
- Fix OpenJPEG GitHub issue \#633. [\#634](https://github.com/uclouvain/openjpeg/pull/634) ([smuehlst](https://github.com/smuehlst))
- travis-ci: Include add ons in matrix [\#632](https://github.com/uclouvain/openjpeg/pull/632) ([mayeut](https://github.com/mayeut))
- Add Appveyor [\#627](https://github.com/uclouvain/openjpeg/pull/627) ([mayeut](https://github.com/mayeut))
- Use Travis-ci to run ABI check [\#626](https://github.com/uclouvain/openjpeg/pull/626) ([mayeut](https://github.com/mayeut))
- Fix warnings for C++ [\#623](https://github.com/uclouvain/openjpeg/pull/623) ([stweil](https://github.com/stweil))
- Fixed problem that C++ compilation failed because of enum variable. [\#622](https://github.com/uclouvain/openjpeg/pull/622) ([smuehlst](https://github.com/smuehlst))
- Added missing casts for return values of opj\_malloc\(\)/opj\_calloc\(\). [\#618](https://github.com/uclouvain/openjpeg/pull/618) ([smuehlst](https://github.com/smuehlst))
- Add check for seek support before trying TPsot==TNsot workaround [\#617](https://github.com/uclouvain/openjpeg/pull/617) ([mayeut](https://github.com/mayeut))
- Fix some typos found by codespell [\#610](https://github.com/uclouvain/openjpeg/pull/610) ([stweil](https://github.com/stweil))
- Correct leak in color\_cielab\_to\_rgb [\#590](https://github.com/uclouvain/openjpeg/pull/590) ([mayeut](https://github.com/mayeut))
- Add Travis-ci build matrix [\#584](https://github.com/uclouvain/openjpeg/pull/584) ([mayeut](https://github.com/mayeut))
- Correct lossless issue on linux x86 [\#579](https://github.com/uclouvain/openjpeg/pull/579) ([mayeut](https://github.com/mayeut))
- Travis-ci update [\#578](https://github.com/uclouvain/openjpeg/pull/578) ([mayeut](https://github.com/mayeut))
- Correct CMake version requirements [\#572](https://github.com/uclouvain/openjpeg/pull/572) ([mayeut](https://github.com/mayeut))
- Add tests for CMYK/esYCC/CIELab [\#567](https://github.com/uclouvain/openjpeg/pull/567) ([mayeut](https://github.com/mayeut))
- Add support for CIELab, EYCC and CMYK [\#559](https://github.com/uclouvain/openjpeg/pull/559) ([szukw000](https://github.com/szukw000))
- Remove printf/fprintf to stdout/stderr throughout openjp2 lib [\#558](https://github.com/uclouvain/openjpeg/pull/558) ([mayeut](https://github.com/mayeut))
- better -ffast-math handling [\#555](https://github.com/uclouvain/openjpeg/pull/555) ([rdieter](https://github.com/rdieter))
- Add jpylyzer tests for JP2 compression [\#552](https://github.com/uclouvain/openjpeg/pull/552) ([mayeut](https://github.com/mayeut))
- Add COC/QCC in main header when needed [\#551](https://github.com/uclouvain/openjpeg/pull/551) ([mayeut](https://github.com/mayeut))
- Use \_\_emul under msvc x86 for fast 64 = 32 \* 32 [\#550](https://github.com/uclouvain/openjpeg/pull/550) ([mayeut](https://github.com/mayeut))
- Update convert for PNG output [\#549](https://github.com/uclouvain/openjpeg/pull/549) ([mayeut](https://github.com/mayeut))
- Remove some warnings when building [\#548](https://github.com/uclouvain/openjpeg/pull/548) ([mayeut](https://github.com/mayeut))
- Switch to libpng-1.6.17 [\#547](https://github.com/uclouvain/openjpeg/pull/547) ([mayeut](https://github.com/mayeut))
- Add some missing static keywords [\#545](https://github.com/uclouvain/openjpeg/pull/545) ([mayeut](https://github.com/mayeut))
- Switch to libcms2 mm2/Little-CMS@0e8234e090d6aab33f90e2eb0296f30aa0705e57 [\#544](https://github.com/uclouvain/openjpeg/pull/544) ([mayeut](https://github.com/mayeut))
- Prevent overflow when coding 16 bits images [\#543](https://github.com/uclouvain/openjpeg/pull/543) ([mayeut](https://github.com/mayeut))
- Switch to libcms2-2.6 [\#542](https://github.com/uclouvain/openjpeg/pull/542) ([mayeut](https://github.com/mayeut))
- Update PNG support [\#538](https://github.com/uclouvain/openjpeg/pull/538) ([mayeut](https://github.com/mayeut))
- Various Minor fixes [\#537](https://github.com/uclouvain/openjpeg/pull/537) ([mayeut](https://github.com/mayeut))
- Update TIFF conversion to support more bit depth. [\#535](https://github.com/uclouvain/openjpeg/pull/535) ([mayeut](https://github.com/mayeut))
- Add checks for odd looking cmap & for cmap outside jp2h box [\#534](https://github.com/uclouvain/openjpeg/pull/534) ([mayeut](https://github.com/mayeut))
- Refactor opj\_j2k\_read\_ppm & opj\_j2k\_read\_ppt [\#533](https://github.com/uclouvain/openjpeg/pull/533) ([mayeut](https://github.com/mayeut))
- Add option to force component splitting in imagetopnm [\#531](https://github.com/uclouvain/openjpeg/pull/531) ([mayeut](https://github.com/mayeut))
- fix Suspicious code in j2k.c \#517 [\#529](https://github.com/uclouvain/openjpeg/pull/529) ([renevanderark](https://github.com/renevanderark))
- Update zlib to version 1.2.8 [\#528](https://github.com/uclouvain/openjpeg/pull/528) ([mayeut](https://github.com/mayeut))
- Fix opj\_write\_bytes\_BE \(\#518\) [\#521](https://github.com/uclouvain/openjpeg/pull/521) ([manisandro](https://github.com/manisandro))
- Correctly decode files with incorrect tile-part header fields \(TPsot==TNsot\) [\#514](https://github.com/uclouvain/openjpeg/pull/514) ([mayeut](https://github.com/mayeut))
- Fixed typos [\#510](https://github.com/uclouvain/openjpeg/pull/510) ([radarhere](https://github.com/radarhere))
- Formatted the readme file [\#507](https://github.com/uclouvain/openjpeg/pull/507) ([htmfilho](https://github.com/htmfilho))
## [version.2.1](https://github.com/uclouvain/openjpeg/releases/tag/version.2.1) (2014-04-29)
List of fixed issues and enhancements unavailable, see [NEWS](https://github.com/uclouvain/openjpeg/blob/master/NEWS.md) or [Full Changelog](https://github.com/uclouvain/openjpeg/compare/version.2.0.1...version.2.1)
## [version.2.0.1](https://github.com/uclouvain/openjpeg/releases/tag/version.2.0.1) (2014-04-22)
List of fixed issues and enhancements unavailable, see [NEWS](https://github.com/uclouvain/openjpeg/blob/master/NEWS.md) or [Full Changelog](https://github.com/uclouvain/openjpeg/compare/version.1.5.2...version.2.0.1)
## [version.1.5.2](https://github.com/uclouvain/openjpeg/releases/tag/version.1.5.2) (2014-03-28)
List of fixed issues and enhancements unavailable, see [NEWS](https://github.com/uclouvain/openjpeg/blob/master/NEWS.md) or [Full Changelog](https://github.com/uclouvain/openjpeg/compare/version.2.0...version.1.5.2)
## [version.2.0](https://github.com/uclouvain/openjpeg/releases/tag/version.2.0) (2014-03-28)
List of fixed issues and enhancements unavailable, see [NEWS](https://github.com/uclouvain/openjpeg/blob/master/NEWS.md) or [Full Changelog](https://github.com/uclouvain/openjpeg/compare/version.1.5.1...version.2.0)
## [version.1.5.1](https://github.com/uclouvain/openjpeg/releases/tag/version.1.5.1) (2012-09-13)
List of fixed issues and enhancements unavailable, see [NEWS](https://github.com/uclouvain/openjpeg/blob/master/NEWS.md) or [Full Changelog](https://github.com/uclouvain/openjpeg/compare/version.1.5...version.1.5.1)
## [version.1.5](https://github.com/uclouvain/openjpeg/releases/tag/version.1.5) (2012-02-07)
List of fixed issues and enhancements unavailable, see [NEWS](https://github.com/uclouvain/openjpeg/blob/master/NEWS.md) or [Full Changelog](https://github.com/uclouvain/openjpeg/compare/version.1.3...version.1.5)
## [version.1.3](https://github.com/uclouvain/openjpeg/releases/tag/version.1.3) (2011-07-03)
List of fixed issues and enhancements unavailable, see [NEWS](https://github.com/uclouvain/openjpeg/blob/master/NEWS.md) or [Full Changelog](https://github.com/uclouvain/openjpeg/compare/version.1.4...version.1.3)
## [version.1.4](https://github.com/uclouvain/openjpeg/releases/tag/version.1.4) (2011-07-03)
List of fixed issues and enhancements unavailable, see [NEWS](https://github.com/uclouvain/openjpeg/blob/master/NEWS.md) or [Full Changelog](https://github.com/uclouvain/openjpeg/compare/version.1.2...version.1.4)
## [version.1.2](https://github.com/uclouvain/openjpeg/releases/tag/version.1.2) (2007-06-04)
List of fixed issues and enhancements unavailable, see [NEWS](https://github.com/uclouvain/openjpeg/blob/master/NEWS.md) or [Full Changelog](https://github.com/uclouvain/openjpeg/compare/version.1.1...version.1.2)
## [version.1.1](https://github.com/uclouvain/openjpeg/releases/tag/version.1.1) (2007-01-31)
List of fixed issues and enhancements unavailable, see [NEWS](https://github.com/uclouvain/openjpeg/blob/master/NEWS.md) or [Full Changelog](https://github.com/uclouvain/openjpeg/compare/version.1.0...version.1.1)
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*

1371
CHANGES

File diff suppressed because it is too large Load Diff

View File

@ -1,20 +0,0 @@
# Look for the header file.
FIND_PATH(FCGI_INCLUDE_DIR NAMES fastcgi.h)
# Look for the library.
FIND_LIBRARY(FCGI_LIBRARY NAMES fcgi)
# Handle the QUIETLY and REQUIRED arguments and set FCGI_FOUND to TRUE if all listed variables are TRUE.
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(FCGI DEFAULT_MSG FCGI_LIBRARY FCGI_INCLUDE_DIR)
# Copy the results to the output variables.
IF(FCGI_FOUND)
SET(FCGI_LIBRARIES ${FCGI_LIBRARY})
SET(FCGI_INCLUDE_DIRS ${FCGI_INCLUDE_DIR})
ELSE(FCGI_FOUND)
SET(FCGI_LIBRARIES)
SET(FCGI_INCLUDE_DIRS)
ENDIF(FCGI_FOUND)
MARK_AS_ADVANCED(FCGI_INCLUDE_DIRS FCGI_LIBRARIES)

View File

@ -1,20 +0,0 @@
# Look for the header file.
FIND_PATH(PTHREAD_INCLUDE_DIR NAMES pthread.h)
# Look for the library.
FIND_LIBRARY(PTHREAD_LIBRARY NAMES pthread)
# Handle the QUIETLY and REQUIRED arguments and set PTHREAD_FOUND to TRUE if all listed variables are TRUE.
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PTHREAD DEFAULT_MSG PTHREAD_LIBRARY PTHREAD_INCLUDE_DIR)
# Copy the results to the output variables.
IF(PTHREAD_FOUND)
SET(PTHREAD_LIBRARIES ${PTHREAD_LIBRARY})
SET(PTHREAD_INCLUDE_DIRS ${PTHREAD_INCLUDE_DIR})
ELSE(PTHREAD_FOUND)
SET(PTHREAD_LIBRARIES)
SET(PTHREAD_INCLUDE_DIRS)
ENDIF(PTHREAD_FOUND)
MARK_AS_ADVANCED(PTHREAD_INCLUDE_DIRS PTHREAD_LIBRARIES)

View File

@ -6,54 +6,81 @@
# you will eventually like to prefix the library to avoid linking confusion # you will eventually like to prefix the library to avoid linking confusion
# For this purpose you can define a CMake var: OPENJPEG_NAMESPACE to whatever you like # For this purpose you can define a CMake var: OPENJPEG_NAMESPACE to whatever you like
# e.g.: # e.g.:
# SET(OPENJPEG_NAMESPACE "GDCMOPENJPEG") # set(OPENJPEG_NAMESPACE "GDCMOPENJPEG")
CMAKE_MINIMUM_REQUIRED(VERSION 2.6) cmake_minimum_required(VERSION 2.8.2)
IF(COMMAND CMAKE_POLICY) if(COMMAND CMAKE_POLICY)
CMAKE_POLICY(SET CMP0003 NEW) cmake_policy(SET CMP0003 NEW)
ENDIF(COMMAND CMAKE_POLICY) if (NOT (${CMAKE_VERSION} VERSION_LESS 3.0))
cmake_policy(SET CMP0042 NEW)
endif()
endif()
IF(NOT OPENJPEG_NAMESPACE) if(NOT OPENJPEG_NAMESPACE)
SET(OPENJPEG_NAMESPACE "OPENJPEG") set(OPENJPEG_NAMESPACE "OPENJPEG")
SET(OPENJPEG_STANDALONE 1) set(OPENJPEG_STANDALONE 1)
ENDIF(NOT OPENJPEG_NAMESPACE) endif()
# In all cases: # In all cases:
STRING(TOLOWER ${OPENJPEG_NAMESPACE} OPENJPEG_LIBRARY_NAME) #string(TOLOWER ${OPENJPEG_NAMESPACE} OPENJPEG_LIBRARY_NAME)
set(OPENJPEG_LIBRARY_NAME openjp2)
PROJECT(${OPENJPEG_NAMESPACE} C) project(${OPENJPEG_NAMESPACE} C)
# Do full dependency headers. # Do full dependency headers.
INCLUDE_REGULAR_EXPRESSION("^.*$") include_regular_expression("^.*$")
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# OPENJPEG version number, useful for packaging and doxygen doc: # OPENJPEG version number, useful for packaging and doxygen doc:
SET(OPENJPEG_VERSION_MAJOR 1) set(OPENJPEG_VERSION_MAJOR 2)
SET(OPENJPEG_VERSION_MINOR 5) set(OPENJPEG_VERSION_MINOR 2)
SET(OPENJPEG_VERSION_BUILD 0) set(OPENJPEG_VERSION_BUILD 0)
SET(OPENJPEG_VERSION set(OPENJPEG_VERSION
"${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}") "${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}")
SET(PACKAGE_VERSION set(PACKAGE_VERSION
"${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}") "${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}")
SET(OPENJPEG_LIBRARY_PROPERTIES
# Because autotools does not support X.Y notation for SOVERSION, we have to use
# two numbering, one for the openjpeg version and one for openjpeg soversion
# version | soversion
# 1.0 | 0
# 1.1 | 1
# 1.2 | 2
# 1.3 | 3
# 1.4 | 4
# 1.5 | 5
# 1.5.1 | 5
# 2.0 | 6
# 2.0.1 | 6
# 2.1 | 7
# 2.1.1 | 7
# 2.1.2 | 7
# 2.2.0 | 8
# above is the recommendation by the OPJ team. If you really need to override this default,
# you can specify your own OPENJPEG_SOVERSION at cmake configuration time:
# cmake -DOPENJPEG_SOVERSION:STRING=42 /path/to/openjpeg
if(NOT OPENJPEG_SOVERSION)
set(OPENJPEG_SOVERSION 7)
endif(NOT OPENJPEG_SOVERSION)
set(OPENJPEG_LIBRARY_PROPERTIES
VERSION "${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}" VERSION "${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}"
SOVERSION "${OPENJPEG_VERSION_MAJOR}" SOVERSION "${OPENJPEG_SOVERSION}"
) )
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# Path to additional CMake modules # Path to additional CMake modules
SET(CMAKE_MODULE_PATH set(CMAKE_MODULE_PATH
${CMAKE_SOURCE_DIR}/CMake ${${OPENJPEG_NAMESPACE}_SOURCE_DIR}/cmake
${CMAKE_MODULE_PATH}) ${CMAKE_MODULE_PATH})
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# On Visual Studio 8 MS deprecated C. This removes all 1.276E1265 security # On Visual Studio 8 MS deprecated C. This removes all 1.276E1265 security
# warnings # warnings
IF(WIN32) if(WIN32)
IF(NOT BORLAND) if(NOT BORLAND)
IF(NOT CYGWIN) if(NOT CYGWIN)
IF(NOT MINGW) if(NOT MINGW)
IF(NOT ITK_ENABLE_VISUAL_STUDIO_DEPRECATED_C_WARNINGS) if(NOT ITK_ENABLE_VISUAL_STUDIO_DEPRECATED_C_WARNINGS)
ADD_DEFINITIONS( add_definitions(
-D_CRT_FAR_MAPPINGS_NO_DEPRECATE -D_CRT_FAR_MAPPINGS_NO_DEPRECATE
-D_CRT_IS_WCTYPE_NO_DEPRECATE -D_CRT_IS_WCTYPE_NO_DEPRECATE
-D_CRT_MANAGED_FP_NO_DEPRECATE -D_CRT_MANAGED_FP_NO_DEPRECATE
@ -65,198 +92,297 @@ IF(WIN32)
-D_CRT_VCCLRIT_NO_DEPRECATE -D_CRT_VCCLRIT_NO_DEPRECATE
-D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE
) )
ENDIF(NOT ITK_ENABLE_VISUAL_STUDIO_DEPRECATED_C_WARNINGS) endif()
ENDIF(NOT MINGW) endif()
ENDIF(NOT CYGWIN) endif()
ENDIF(NOT BORLAND) endif()
ENDIF(WIN32) endif()
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# Install directories # Install directories
# Build DOCUMENTATION (not in ALL target and only if Doxygen is found)
option(BUILD_DOC "Build the HTML documentation (with doxygen if available)." OFF)
STRING(TOLOWER ${PROJECT_NAME} projectname) string(TOLOWER ${PROJECT_NAME} projectname)
SET(OPENJPEG_INSTALL_SUBDIR "${projectname}-${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}") set(OPENJPEG_INSTALL_SUBDIR "${projectname}-${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}")
IF(NOT OPENJPEG_INSTALL_BIN_DIR) if(NOT OPENJPEG_INSTALL_BIN_DIR)
SET(OPENJPEG_INSTALL_BIN_DIR "bin") set(OPENJPEG_INSTALL_BIN_DIR "bin")
ENDIF(NOT OPENJPEG_INSTALL_BIN_DIR) endif()
IF(NOT OPENJPEG_INSTALL_LIB_DIR) if(NOT OPENJPEG_INSTALL_LIB_DIR)
SET(OPENJPEG_INSTALL_LIB_DIR "lib") set(OPENJPEG_INSTALL_LIB_DIR "lib")
ENDIF(NOT OPENJPEG_INSTALL_LIB_DIR) endif()
IF(NOT OPENJPEG_INSTALL_SHARE_DIR) if(NOT OPENJPEG_INSTALL_SHARE_DIR)
SET(OPENJPEG_INSTALL_SHARE_DIR "share") set(OPENJPEG_INSTALL_SHARE_DIR "share")
ENDIF(NOT OPENJPEG_INSTALL_SHARE_DIR) endif()
IF(NOT OPENJPEG_INSTALL_DATA_DIR) if(NOT OPENJPEG_INSTALL_DATA_DIR)
SET(OPENJPEG_INSTALL_DATA_DIR "${OPENJPEG_INSTALL_SHARE_DIR}/${OPENJPEG_INSTALL_SUBDIR}") set(OPENJPEG_INSTALL_DATA_DIR "${OPENJPEG_INSTALL_SHARE_DIR}/${OPENJPEG_INSTALL_SUBDIR}")
ENDIF(NOT OPENJPEG_INSTALL_DATA_DIR) endif()
IF(NOT OPENJPEG_INSTALL_INCLUDE_DIR) if(NOT OPENJPEG_INSTALL_INCLUDE_DIR)
SET(OPENJPEG_INSTALL_INCLUDE_DIR "include/") set(OPENJPEG_INSTALL_INCLUDE_DIR "include/${OPENJPEG_INSTALL_SUBDIR}")
ENDIF(NOT OPENJPEG_INSTALL_INCLUDE_DIR) endif()
IF(NOT OPENJPEG_INSTALL_MAN_DIR) if(BUILD_DOC)
SET(OPENJPEG_INSTALL_MAN_DIR "share/man/") if(NOT OPENJPEG_INSTALL_MAN_DIR)
ENDIF(NOT OPENJPEG_INSTALL_MAN_DIR) set(OPENJPEG_INSTALL_MAN_DIR "share/man/")
endif()
IF(NOT OPENJPEG_INSTALL_DOC_DIR) if(NOT OPENJPEG_INSTALL_DOC_DIR)
SET(OPENJPEG_INSTALL_DOC_DIR "share/doc/${OPENJPEG_INSTALL_SUBDIR}") set(OPENJPEG_INSTALL_DOC_DIR "share/doc/${OPENJPEG_INSTALL_SUBDIR}")
ENDIF(NOT OPENJPEG_INSTALL_DOC_DIR) endif()
endif()
IF(NOT OPENJPEG_INSTALL_PACKAGE_DIR) if(NOT OPENJPEG_INSTALL_JNI_DIR)
SET(OPENJPEG_INSTALL_PACKAGE_DIR "${OPENJPEG_INSTALL_SHARE_DIR}/${OPENJPEG_INSTALL_SUBDIR}") if(WIN32)
ENDIF(NOT OPENJPEG_INSTALL_PACKAGE_DIR) set(OPENJPEG_INSTALL_JNI_DIR ${OPENJPEG_INSTALL_BIN_DIR})
else()
set(OPENJPEG_INSTALL_JNI_DIR ${OPENJPEG_INSTALL_LIB_DIR})
endif()
endif()
if(NOT OPENJPEG_INSTALL_PACKAGE_DIR)
# We could install *.cmake files in share/ however those files contains
# hardcoded path to libraries on a multi-arch system (fedora/debian) those
# path will be different (lib/i386-linux-gnu vs lib/x86_64-linux-gnu)
set(OPENJPEG_INSTALL_PACKAGE_DIR "${OPENJPEG_INSTALL_LIB_DIR}/${OPENJPEG_INSTALL_SUBDIR}")
endif()
if (APPLE)
list(APPEND OPENJPEG_LIBRARY_PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${OPENJPEG_INSTALL_LIB_DIR}")
option(OPJ_USE_DSYMUTIL "Call dsymutil on binaries after build." OFF)
endif()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Big endian test: # Big endian test:
INCLUDE (${CMAKE_ROOT}/Modules/TestBigEndian.cmake) include (${CMAKE_ROOT}/Modules/TestBigEndian.cmake)
TEST_BIG_ENDIAN(OPJ_BIG_ENDIAN) TEST_BIG_ENDIAN(OPJ_BIG_ENDIAN)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Setup file for setting custom ctest vars # Setup file for setting custom ctest vars
CONFIGURE_FILE( configure_file(
${CMAKE_SOURCE_DIR}/CMake/CTestCustom.cmake.in ${${OPENJPEG_NAMESPACE}_SOURCE_DIR}/cmake/CTestCustom.cmake.in
${CMAKE_BINARY_DIR}/CTestCustom.cmake ${${OPENJPEG_NAMESPACE}_BINARY_DIR}/CTestCustom.cmake
@ONLY @ONLY
) )
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# OpenJPEG build configuration options. # OpenJPEG build configuration options.
OPTION(BUILD_SHARED_LIBS "Build OpenJPEG shared library and link executables against it." ON) option(BUILD_SHARED_LIBS "Build OpenJPEG shared library and link executables against it." ON)
SET (EXECUTABLE_OUTPUT_PATH ${OPENJPEG_BINARY_DIR}/bin CACHE PATH "Single output directory for building all executables.") set (EXECUTABLE_OUTPUT_PATH ${OPENJPEG_BINARY_DIR}/bin CACHE PATH "Single output directory for building all executables.")
SET (LIBRARY_OUTPUT_PATH ${OPENJPEG_BINARY_DIR}/bin CACHE PATH "Single output directory for building all libraries.") set (LIBRARY_OUTPUT_PATH ${OPENJPEG_BINARY_DIR}/bin CACHE PATH "Single output directory for building all libraries.")
MARK_AS_ADVANCED(LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH) mark_as_advanced(LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# configure name mangling to allow multiple libraries to coexist # configure name mangling to allow multiple libraries to coexist
# peacefully # peacefully
IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in) if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in)
SET(MANGLE_PREFIX ${OPENJPEG_LIBRARY_NAME}) set(MANGLE_PREFIX ${OPENJPEG_LIBRARY_NAME})
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in configure_file(${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in
${CMAKE_CURRENT_BINARY_DIR}/openjpeg_mangle.h ${CMAKE_CURRENT_BINARY_DIR}/openjpeg_mangle.h
@ONLY) @ONLY)
ENDIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in) endif()
#-----------------------------------------------------------------------------
# pkgconfig support
IF(UNIX)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/libopenjpeg1.pc.cmake
${CMAKE_CURRENT_BINARY_DIR}/libopenjpeg1.pc @ONLY)
INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/libopenjpeg1.pc DESTINATION
${OPENJPEG_INSTALL_SHARE_DIR}/pkgconfig )
INSTALL( CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink
\"libopenjpeg1.pc\"
\"\$ENV{DESTDIR}${OPENJPEG_INSTALL_LIB_DIR}/pkgconfig/libopenjpeg.pc\")")
ENDIF(UNIX)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Compiler specific flags: # Compiler specific flags:
IF(CMAKE_COMPILER_IS_GNUCC) if(CMAKE_COMPILER_IS_GNUCC)
# For all builds, make sure openjpeg is std99 compliant: # For all builds, make sure openjpeg is std99 compliant:
# SET(CMAKE_C_FLAGS "-Wall -std=c99 ${CMAKE_C_FLAGS}") # FIXME: this setting prevented us from setting a coverage build. # set(CMAKE_C_FLAGS "-Wall -std=c99 ${CMAKE_C_FLAGS}") # FIXME: this setting prevented us from setting a coverage build.
# Do not use ffast-math for all build, it would produce incorrect results, only set for release: # Do not use ffast-math for all build, it would produce incorrect results, only set for release:
SET(CMAKE_C_FLAGS_RELEASE "-ffast-math ${CMAKE_C_FLAGS_RELEASE}") set(OPENJPEG_LIBRARY_COMPILE_OPTIONS ${OPENJPEG_LIBRARY_COMPILE_OPTIONS} "$<$<CONFIG:Release>:-ffast-math>")
ENDIF(CMAKE_COMPILER_IS_GNUCC) endif()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# opj_config.h generation (1/2) # opj_config.h generation (1/2)
INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
# Check if some include files are provided by the system
include(EnsureFileInclude)
# These files are mandatory
ensure_file_include("string.h" HAVE_STRING_H YES)
ensure_file_include("memory.h" HAVE_MEMORY_H YES)
ensure_file_include("stdlib.h" HAVE_STDLIB_H YES)
ensure_file_include("stdio.h" HAVE_STDIO_H YES)
ensure_file_include("math.h" HAVE_MATH_H YES)
ensure_file_include("float.h" HAVE_FLOAT_H YES)
ensure_file_include("time.h" HAVE_TIME_H YES)
ensure_file_include("stdarg.h" HAVE_STDARG_H YES)
ensure_file_include("ctype.h" HAVE_CTYPE_H YES)
ensure_file_include("assert.h" HAVE_ASSERT_H YES)
# For the following files, we provide an alternative, they are not mandatory
ensure_file_include("stdint.h" OPJ_HAVE_STDINT_H NO)
ensure_file_include("inttypes.h" OPJ_HAVE_INTTYPES_H NO)
# why check this one ? for openjpip ?
include (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
CHECK_INCLUDE_FILE("strings.h" HAVE_STRINGS_H) CHECK_INCLUDE_FILE("strings.h" HAVE_STRINGS_H)
CHECK_INCLUDE_FILE("inttypes.h" HAVE_INTTYPES_H)
CHECK_INCLUDE_FILE("memory.h" HAVE_MEMORY_H)
CHECK_INCLUDE_FILE("stdint.h" HAVE_STDINT_H)
CHECK_INCLUDE_FILE("stdlib.h" HAVE_STDLIB_H)
CHECK_INCLUDE_FILE("string.h" HAVE_STRING_H)
CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H) CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H)
CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H) CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H)
CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H) CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H)
# Enable Large file support
include(TestLargeFiles)
OPJ_TEST_LARGE_FILES(OPJ_HAVE_LARGEFILES)
# Allocating Aligned Memory Blocks
include(CheckIncludeFiles)
check_include_files(malloc.h OPJ_HAVE_MALLOC_H)
include(CheckSymbolExists)
# _aligned_alloc https://msdn.microsoft.com/en-us/library/8z34s9c6.aspx
check_symbol_exists(_aligned_malloc malloc.h OPJ_HAVE__ALIGNED_MALLOC)
# posix_memalign (needs _POSIX_C_SOURCE >= 200112L on Linux)
set(CMAKE_REQUIRED_DEFINITIONS -D_POSIX_C_SOURCE=200112L)
check_symbol_exists(posix_memalign stdlib.h OPJ_HAVE_POSIX_MEMALIGN)
unset(CMAKE_REQUIRED_DEFINITIONS)
# memalign (obsolete)
check_symbol_exists(memalign malloc.h OPJ_HAVE_MEMALIGN)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Build Library # Build Library
INCLUDE_DIRECTORIES(BEFORE ${OPENJPEG_BINARY_DIR}) if(BUILD_JPIP_SERVER)
ADD_SUBDIRECTORY(libopenjpeg) find_package(CURL REQUIRED)
find_package(FCGI REQUIRED)
find_package(Threads REQUIRED)
if(NOT CMAKE_USE_PTHREADS_INIT)
message(FATAL_ERROR "Only pthread are supported")
endif()
endif()
add_subdirectory(src/lib)
option(BUILD_LUTS_GENERATOR "Build utility to generate t1_luts.h" OFF)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Build Applications # Build Applications
OPTION(BUILD_CODEC "Build the CODEC executables" ON) option(BUILD_CODEC "Build the CODEC executables" ON)
OPTION(BUILD_MJ2 "Build the MJ2 executables." OFF) option(BUILD_MJ2 "Build the MJ2 executables." OFF)
OPTION(BUILD_JPWL "Build the JPWL library and executables" OFF) option(BUILD_JPWL "Build the JPWL library and executables" OFF)
OPTION(BUILD_JPIP "Build the JPIP library and executables." OFF) option(BUILD_JPIP "Build the JPIP library and executables." OFF)
IF(BUILD_JPIP) if(BUILD_JPIP)
OPTION(BUILD_JPIP_SERVER "Build the JPIP server." OFF) option(BUILD_JPIP_SERVER "Build the JPIP server." OFF)
ENDIF(BUILD_JPIP) endif()
OPTION(BUILD_VIEWER "Build the OPJViewer executable (C++)" OFF) option(BUILD_VIEWER "Build the OPJViewer executable (C++)" OFF)
OPTION(BUILD_JAVA "Build the openjpeg jar (Java)" OFF) option(BUILD_JAVA "Build the openjpeg jar (Java)" OFF)
MARK_AS_ADVANCED(BUILD_VIEWER) option(BUILD_JP3D "Build the JP3D comp" OFF)
MARK_AS_ADVANCED(BUILD_JAVA) mark_as_advanced(BUILD_VIEWER)
mark_as_advanced(BUILD_JAVA)
mark_as_advanced(BUILD_JP3D)
IF(BUILD_CODEC OR BUILD_MJ2) if(BUILD_CODEC OR BUILD_MJ2)
# OFF: It will only build 3rd party libs if they are not found on the system # OFF: It will only build 3rd party libs if they are not found on the system
# ON: 3rd party libs will ALWAYS be build, and used # ON: 3rd party libs will ALWAYS be build, and used
OPTION(BUILD_THIRDPARTY "Build the thirdparty executables if it is needed" OFF) option(BUILD_THIRDPARTY "Build the thirdparty executables if it is needed" OFF)
ADD_SUBDIRECTORY(thirdparty) add_subdirectory(thirdparty)
ADD_SUBDIRECTORY(applications) add_subdirectory(src/bin)
ENDIF (BUILD_CODEC OR BUILD_MJ2) endif ()
add_subdirectory(wrapping)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# opj_config.h generation (2/2) # opj_config.h generation (2/2)
CONFIGURE_FILE("${OPENJPEG_SOURCE_DIR}/opj_config.h.cmake.in" configure_file(
"${OPENJPEG_BINARY_DIR}/opj_config.h" ${CMAKE_CURRENT_SOURCE_DIR}/src/lib/openjp2/opj_config.h.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/src/lib/openjp2/opj_config.h
@ONLY
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/src/lib/openjp2/opj_config_private.h.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/src/lib/openjp2/opj_config_private.h
@ONLY @ONLY
) )
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Build DOCUMENTATION (not in ALL target and only if Doxygen is found) # build documentation in doc subdir:
OPTION(BUILD_DOC "Build the HTML documentation (with doxygen if available)." OFF) if(BUILD_DOC)
IF(BUILD_DOC) add_subdirectory(doc)
ADD_SUBDIRECTORY(doc) endif()
ENDIF(BUILD_DOC)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Buld Testing # Buld Testing
OPTION(BUILD_TESTING "Build the tests." OFF) option(BUILD_TESTING "Build the tests." OFF)
IF(BUILD_TESTING) if(BUILD_TESTING)
IF(BUILD_CODEC) if(BUILD_CODEC)
ENABLE_TESTING() enable_testing()
INCLUDE(CTest) include(CTest)
# Search openjpeg data needed for the tests # Search openjpeg data needed for the tests
# They could be found via svn on the OpenJPEG google code project # They could be found via git on the OpenJPEG GitHub code project
# svn checkout http://openjpeg.googlecode.com/svn/data (about 70 Mo) # git clone https://github.com/uclouvain/openjpeg-data.git
FIND_PATH(OPJ_DATA_ROOT README-OPJ-Data find_path(OPJ_DATA_ROOT README-OPJ-Data
PATHS PATHS $ENV{OPJ_DATA_ROOT} ${CMAKE_SOURCE_DIR}/../data
$ENV{OPJ_DATA_ROOT} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
${CMAKE_SOURCE_DIR}/../data
) )
# Add repository where to find tests # Add repository where to find tests
ADD_SUBDIRECTORY(tests) add_subdirectory(tests)
ELSE(BUILD_CODEC) else()
message(FATAL_ERROR "You need build codec to run the tests") message(FATAL_ERROR "You need build codec to run the tests")
ENDIF(BUILD_CODEC) endif()
ENDIF(BUILD_TESTING) endif()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# install all targets referenced as OPENJPEGTargets # install all targets referenced as OPENJPEGTargets
INSTALL(EXPORT OpenJPEGTargets DESTINATION ${OPENJPEG_INSTALL_PACKAGE_DIR}) install(EXPORT OpenJPEGTargets DESTINATION ${OPENJPEG_INSTALL_PACKAGE_DIR})
CONFIGURE_FILE( ${OPENJPEG_SOURCE_DIR}/CMake/OpenJPEGConfig.cmake.in configure_file( ${${OPENJPEG_NAMESPACE}_SOURCE_DIR}/cmake/OpenJPEGConfig.cmake.in
${OPENJPEG_BINARY_DIR}/OpenJPEGConfig.cmake ${${OPENJPEG_NAMESPACE}_BINARY_DIR}/OpenJPEGConfig.cmake
@ONLY @ONLY
) )
INSTALL( FILES ${OPENJPEG_BINARY_DIR}/OpenJPEGConfig.cmake install( FILES ${OPENJPEG_BINARY_DIR}/OpenJPEGConfig.cmake
DESTINATION ${OPENJPEG_INSTALL_PACKAGE_DIR} DESTINATION ${OPENJPEG_INSTALL_PACKAGE_DIR}
) )
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# install CHANGES and LICENSE # install CHANGES and LICENSE
INSTALL( if(BUILD_DOC)
FILES CHANGES if(EXISTS ${OPENJPEG_SOURCE_DIR}/CHANGES)
LICENSE install(FILES CHANGES DESTINATION ${OPENJPEG_INSTALL_DOC_DIR})
DESTINATION ${OPENJPEG_INSTALL_DOC_DIR}) endif()
INCLUDE (CMake/OpenJPEGCPack.cmake) install(FILES LICENSE DESTINATION ${OPENJPEG_INSTALL_DOC_DIR})
endif()
include (cmake/OpenJPEGCPack.cmake)
#-----------------------------------------------------------------------------
# pkgconfig support
# enabled by default on Unix, disabled by default on other platforms
if(UNIX)
option(BUILD_PKGCONFIG_FILES "Build and install pkg-config files" ON)
else()
option(BUILD_PKGCONFIG_FILES "Build and install pkg-config files" OFF)
endif()
if(BUILD_PKGCONFIG_FILES)
# install in lib and not share (see multi-arch note above)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/lib/openjp2/libopenjp2.pc.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/libopenjp2.pc @ONLY)
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libopenjp2.pc DESTINATION
${OPENJPEG_INSTALL_LIB_DIR}/pkgconfig )
#
if(BUILD_JPWL)
# install in lib and not share (see multi-arch note above)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/lib/openjpwl/libopenjpwl.pc.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/libopenjpwl.pc @ONLY)
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libopenjpwl.pc DESTINATION
${OPENJPEG_INSTALL_LIB_DIR}/pkgconfig )
endif()
#
if(BUILD_JPIP)
# install in lib and not share (see multi-arch note above)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/lib/openjpip/libopenjpip.pc.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/libopenjpip.pc @ONLY)
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libopenjpip.pc DESTINATION
${OPENJPEG_INSTALL_LIB_DIR}/pkgconfig )
endif()
#
if(BUILD_JP3D)
# install in lib and not share (see multi-arch note above)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/lib/openjp3d/libopenjp3d.pc.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/libopenjp3d.pc @ONLY)
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libopenjp3d.pc DESTINATION
${OPENJPEG_INSTALL_LIB_DIR}/pkgconfig )
endif()
endif()
#-----------------------------------------------------------------------------

113
INSTALL
View File

@ -1,113 +0,0 @@
How to build and install openjpeg binaries
==========================================
UNIX/LINUX similar systems
--------------------------
1) Using autotools
It is highly recommended that pkg-config is installed. If needed, you have to
properly set the environment variable PKG_CONFIG_PATH so that the .pc files
are found.
To build from top-level directory, you can simply type:
./bootstrap.sh
./configure
make
To keep all build files in a separate directory, you can type instead:
./bootstrap.sh
mkdir build
cd build
../configure
make
To install:
sudo make install
To clean:
make clean
make distclean
To build doc (requires 'doxygen' to be found on your system):
(this will create an html directory in TOP_LEVEL/doc)
make doc
Main './configure' options (type './configure --help' for more details)
'--enable-mj2'
'--enable-jpwl'
'--enable-jpip'
'--prefix=/path/to/install/directory' (example : '--prefix=$PWD/installed')
'--enable-debug' (default : disabled)
You can also specify your own CFLAGS and LDFLAGS with (for example):
CFLAGS="-O3 -pipe" LDFLAGS="-Wl,-s" ./configure
The (optional) dependencies of some binaries are libpng, libtiff, libcms 1 or 2
and FastCGI. Only libtiff and FastCGI have no .pc file. There should be some
automatic detection if they are installed in /usr, /usr/local or /opt/local.
Otherwise, you can tune their detection (as well as for libpng and libcms1 or 2
too) with the environment variables:
TIFF_CFLAGS
TIFF_LIBS
FCGI_CFLAGS
FCGI_LIBS
See './configure --help' output for more details.
2) Using cmake (see www.cmake.org)
Type:
cmake .
make
If you are root:
make install
make clean
else:
sudo make install
make clean
To build the Doxygen documentation (Doxygen needs to be found on the system):
(A 'html' directory is generated in the 'doc' directory)
make doc
Binaries are located in the 'bin' directory.
Main available cmake flags:
* To specify the install path: '-DCMAKE_INSTALL_PREFIX=/path'
* To build the shared libraries and links the executables against it: '-DBUILD_SHARED_LIBS:bool=on' (default: 'ON')
Note: when using this option, static libraries are not built and executables are dynamically linked.
* To build the CODEC executables: '-DBUILD_CODEC:bool=on' (default: 'ON')
* To build the MJ2 executables: '-DBUILD_MJ2:bool=on' (default: 'OFF')
* To build the JPWL executables and JPWL library: '-DBUILD_JPWL:bool=on' (default: 'OFF')
* To build the JPIP library and utilities: '-DBUILD_JPIP:bool=on' (default: 'OFF')
* To enable testing (and automatic result upload to http://my.cdash.org/index.php?project=OPENJPEG):
cmake . -DBUILD_TESTING:BOOL=ON -DOPJ_DATA_ROOT:PATH='path/to/the/data/directory'
make
make Experimental
Note : JPEG2000 test files are available with 'svn checkout http://openjpeg.googlecode.com/svn/data' (about 70 Mo).
If '-DOPJ_DATA_ROOT:PATH' option is omitted, test files will be automatically searched in '${CMAKE_SOURCE_DIR}/../data',
corresponding to the location of the data directory when compiling from the trunk (and assuming the data directory has
been checked out of course).
MACOSX
------
The same building procedures as above (autotools and cmake) work for MACOSX.
The xcode project file can also be used.
If it does not work, try adding the following flag to the cmake command :
'-DCMAKE_OSX_ARCHITECTURES:STRING=i386'
WINDOWS
-------
If you're using cygwin or MinGW+MSYS, the same procedures as for Unix can be used.
Otherwise you can use cmake to generate project files for the IDE you are using (VC2010, etc).
Type 'cmake --help' for available generators on your platform.

75
INSTALL.md Normal file
View File

@ -0,0 +1,75 @@
# OpenJPEG installation
The build method maintained by OpenJPEG is [CMake](https://cmake.org/).
## UNIX/LINUX - MacOS (terminal) - WINDOWS (cygwin, MinGW)
To build the library, type from source tree directory:
```
mkdir build
cd build
cmake ..
make
```
Binaries are then located in the 'bin' directory.
To install the library, type with root privileges:
```
make install
make clean
```
To build the html documentation, you need doxygen to be installed on your system.
It will create an "html" directory in TOP\_LEVEL/build/doc)
```
make doc
```
Main available cmake flags:
* To specify the install path: '-DCMAKE\_INSTALL\_PREFIX=/path'
* To build the shared libraries and links the executables against it: '-DBUILD\_SHARED\_LIBS:bool=on' (default: 'ON')
> Note: when using this option, static libraries are not built and executables are dynamically linked.
* To build the CODEC executables: '-DBUILD\_CODEC:bool=on' (default: 'ON')
* [OBSOLETE] To build the MJ2 executables: '-DBUILD\_MJ2:bool=on' (default: 'OFF')
* [OBSOLETE] To build the JPWL executables and JPWL library: '-DBUILD\_JPWL:bool=on' (default: 'OFF')
* [OBSOLETE] To build the JPIP client (java compiler recommended) library and executables: '-DBUILD\_JPIP:bool=on' (default: 'OFF')
* [OBSOLETE] To build the JPIP server (need fcgi) library and executables: '-DBUILD\_JPIP\_SERVER:bool=on' (default: 'OFF')
* To enable testing (and automatic result upload to http://my.cdash.org/index.php?project=OPENJPEG):
```
cmake . -DBUILD_TESTING:BOOL=ON -DOPJ_DATA_ROOT:PATH='path/to/the/data/directory' -DBUILDNAME:STRING='name_of_the_build'
make
make Experimental
```
Note : test data is available on the following github repo: https://github.com/uclouvain/openjpeg-data
If '-DOPJ\_DATA\_ROOT:PATH' option is omitted, test files will be automatically searched in '${CMAKE\_SOURCE\_DIR}/../data'.
Note 2 : to execute the encoding test suite, kakadu binaries are needed to decode encoded image and compare it to the baseline. Kakadu binaries are freely available for non-commercial purposes at http://www.kakadusoftware.com. kdu\_expand will need to be in your PATH for cmake to find it.
Note 3 : OpenJPEG encoder and decoder (not the library itself !) depends on several libraries: png, tiff, lcms, z. If these libraries are not found on the system, they are automatically built from the versions available in the source tree. You can force the use of these embedded version with BUILD\_THIRDPARTY:BOOL=ON. On a Debian-like system you can also simply install these libraries with:
```
sudo apt-get install liblcms2-dev libtiff-dev libpng-dev libz-dev
```
Note 4 : On MacOS, if it does not work, try adding the following flag to the cmake command :
```
-DCMAKE_OSX_ARCHITECTURES:STRING=i386
```
## MacOS (XCode) - WINDOWS (VisualStudio, etc)
You can use cmake to generate the project files for the IDE you are using (VC2010, XCode, etc).
Type 'cmake --help' for available generators on your platform.
# Using OpenJPEG
To use openjpeg exported cmake file, simply create your application doing:
```
$ cat CMakeLists.txt
find_package(OpenJPEG REQUIRED)
include_directories(${OPENJPEG_INCLUDE_DIRS})
add_executable(myapp myapp.c)
target_link_libraries(myapp ${OPENJPEG_LIBRARIES})
```

14
LICENSE
View File

@ -1,11 +1,19 @@
/* /*
* Copyright (c) 2002-2012, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium * The copyright in this software is being made available under the 2-clauses
* Copyright (c) 2002-2012, Professor Benoit Macq * BSD License, included below. This software may be subject to other third
* Copyright (c) 2003-2012, Antonin Descampe * party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2003-2009, Francois-Olivier Devaux * Copyright (c) 2003-2009, Francois-Olivier Devaux
* Copyright (c) 2005, Herve Drolon, FreeImage Team * Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2002-2003, Yannick Verschueren * Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2001-2003, David Janssens * Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2011-2012, Centre National d'Etudes Spatiales (CNES), France
* Copyright (c) 2012, CS Systemes d'Information, France
*
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without

View File

@ -1,75 +0,0 @@
DISTCHECK_CONFIGURE_FLAGS = --enable-jpip=yes --enable-jpip-server=yes --enable-jpwl=yes --enable-mj2=yes
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = libopenjpeg applications doc
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libopenjpeg1.pc
if WANT_JPWL
pkgconfig_DATA += libopenjpeg-jpwl.pc
endif
MAINTAINERCLEANFILES = \
Makefile.in \
aclocal.m4 \
config.guess \
opj_config.h.in \
opj_config.h.in~ \
config.sub \
configure \
depcomp \
install-sh \
ltmain.sh \
missing
EXTRA_DIST = \
CMake/CTestCustom.cmake.in \
CMake/FindFCGI.cmake \
CMake/FindLCMS2.cmake \
CMake/FindLCMS.cmake \
CMake/OpenJPEGConfig.cmake.in \
CMakeLists.txt \
CTestConfig.cmake \
AUTHORS \
CHANGES \
INSTALL \
LICENSE \
NEWS \
README \
THANKS \
bootstrap.sh \
libopenjpeg1.pc.cmake \
libopenjpeg1.pc.in \
libopenjpeg-jpwl.pc.in \
opj_config.h.cmake.in \
m4/opj_check_lib.m4 \
m4/opj_doxygen.m4 \
m4/pkg.m4
.PHONY: doc
# Documentation
doc:
@echo "entering doc/"
@cd doc && make doc
install-data-hook:
if HAVE_WIN32
$(LN_S) -f libopenjpeg1.pc $(DESTDIR)$(pkgconfigdir)/libopenjpeg.pc
else
$(LN_S) -nf libopenjpeg1.pc $(DESTDIR)$(pkgconfigdir)/libopenjpeg.pc
endif
@echo -e " (PC)\t$(pkgconfigdir)/libopenjpeg1.pc" >> $(top_builddir)/report.txt
@echo -e " (LN)\t$(pkgconfigdir)/libopenjpeg.pc" >> $(top_builddir)/report.txt
if WANT_JPWL
@echo -e " (PC)\t$(pkgconfigdir)/libopenjpeg-jpwl.pc" >> $(top_builddir)/report.txt
endif
@cat $(top_builddir)/report.txt
@rm $(top_builddir)/report.txt
uninstall-hook:
rm -f $(DESTDIR)$(pkgconfigdir)/libopenjpeg.pc

34
NEWS
View File

@ -1,34 +0,0 @@
OpenJPEG NEWS - user visible changes
====================================
Changes from OpenJPEG 1.4.0 to OpenJPEG 1.5.0
----------------------------------------------
New Features:
* openjpip:
- complete client-server architecture for remote browsing of jpeg 2000 images.
- located in 'applications/jpip'.
- see corresponding README for more details.
API modifications:
* 'bool' type has been replaced by 'opj_bool' type. 'stdbool.h' is no more required.
Misc:
* added this NEWS file.
* improved cmake and autotools build methods.
* removed manual makefiles, VS project files and XCode project files.
* added a 'thirdparty' directory to contain all dependencies.
- These libraries will be build only if there are not found on the system.
- Note that libopenjpeg itself does not have any dependency.
* changed the directory hierarchy of the whole project. See README files for details.
* tests : a complete test suite has been setup.
- both JPEG 2000 conformance tests and non-regressions tests are configured.
- results are submitted to the OpenJPEG dashboard (http://my.cdash.org/index.php?project=OPENJPEG)
- images are located in 'http://openjpeg.googlecode.com/svn/data' folder.
- configuration files and utilities are located in 'tests' folder.
* OPJViewer re-activated (need wxWidgets)
* Huge amount of bug fixes. See CHANGES for details.

72
NEWS.md Normal file
View File

@ -0,0 +1,72 @@
# OpenJPEG NEWS
More details in the [Changelog](https://github.com/uclouvain/openjpeg/blob/master/CHANGELOG.md)
## OpenJPEG 2.1.2
* Bug fixes (including security fixes)
* No API/ABI break compared to v2.1.1
## OpenJPEG 2.1.1
* Huge amount of critical bugfixes
* Speed improvements
* No API/ABI break compared to v2.1
## OpenJPEG 2.1.0
### New Features
* Digital Cinema profiles have been fixed and updated
* New option to disable MCT if needed
* extended RAW support: it is now possible to input raw images
with subsampled color components (422, 420, etc)
* New way to deal with profiles
### API/ABI modifications
(see [here](http://www.openjpeg.org/abi-check/timeline/openjpeg/) for details)
* Removed deprecated functions
* opj_stream_create_default_file_stream(FILE*,...)
* opj_stream_create_file_stream(FILE*,...)
* opj_stream_set_user_data (opj_stream_t* p_stream, void * p_data)
* Added
* opj_stream_create_default_file_stream(char*,...)
* opj_stream_create_file_stream(char*,...)
* opj_stream_destroy(opj_stream_t*)
* opj_stream_set_user_data (opj_stream_t* p_stream, void * p_data,
... opj_stream_free_user_data_fn p_function)
* JPEG 2000 profiles and Part-2 extensions defined through '#define'
* Changed
* 'alpha' field added to 'opj_image_comp' structure
* 'OPJ_CLRSPC_EYCC' added to enum COLOR_SPACE
* 'OPJ_CLRSPC_CMYK' added to enum COLOR_SPACE
* 'OPJ_CODEC_JPP' and 'OPJ_CODEC_JPX' added to CODEC_FORMAT
(not yet used in use)
* 'max_cs_size' and 'rsiz' fields added to opj_cparameters_t
### Misc
* OpenJPEG is now officially conformant with JPEG 2000 Part-1
and will soon become official reference software at the
JPEG committee.
* Huge amount of bug fixes. See CHANGES for details.
## OpenJPEG 2.0.0
### New Features
* streaming capabilities
* merge JP3D
### API modifications
(see [here](http://www.openjpeg.org/abi-check/timeline/openjpeg/) for details)
* Use a 64bits capable API
### Misc
* removed autotools build system
* folders hierarchies reorganisation
* Huge amount of bug fixes. See CHANGES for details.

25
README
View File

@ -1,25 +0,0 @@
OPENJPEG LIBRARY and APPLICATIONS
----------------------------------
Details on folders hierarchy:
* libopenjpeg: contains the sources of the openjpeg library
* jpwl: contains the additional sources if you want to build a JPWL-flavoured library.
* applications: contains all applications that use the openjpeg library
* common: common files to all applications
* codec: a basic codec
* mj2: motion jpeg 2000 executables
* JavaOpenJPEG: java jni to use openjpeg in a java program
* jpip: complete client-server architecture for remote browsing of jpeg 2000 images. See corresponding README for more details.
* OPJViewer: gui for displaying j2k files (based on wxWidget)
* thirdparty: thirdparty libraries used by some applications. These libraries will be built only if there are not found on the system. Note that libopenjpeg itself does not have any dependency.
* doc: doxygen documentation setup file and man pages
* tests: configuration files and utilities for the openjpeg test suite. All test images are located in 'http://openjpeg.googlecode.com/svn/data' folder.
* CMake: cmake related files
* m4: autotools related files
see LICENSE for license and copyright information.
see INSTALL for installation procedures.
see NEWS for user visible changes in successive releases.
see CHANGES for per-revision changes.

82
README.md Normal file
View File

@ -0,0 +1,82 @@
# OPENJPEG Library and Applications
## What is OpenJPEG ?
OpenJPEG is an open-source JPEG 2000 codec written in C language. It has been developed in order to promote the use of [JPEG 2000](http://www.jpeg.org/jpeg2000), a still-image compression standard from the Joint Photographic Experts Group ([JPEG](http://www.jpeg.org)). Since April 2015, it is officially recognized by ISO/IEC and ITU-T as a [JPEG 2000 Reference Software](http://www.itu.int/rec/T-REC-T.804-201504-I!Amd2).
## Who can use the code ?
[![badge-license]][link-license]
Anyone. As the OpenJPEG code is released under the [BSD 2-clause "Simplified" License][link-license], anyone can use or modify the code, even for commercial applications. The only restriction is to retain the copyright in the sources or in the binaries documentation. Of course, if you modified the code in a way that might be of interest for other users, you are encouraged to share it (through a [github pull request](https://github.com/uclouvain/openjpeg/pulls) or by filling an [issue](https://github.com/uclouvain/openjpeg/issues)) but this is not a requirement.
## How to install and use OpenJPEG ?
API Documentation needs a major refactoring. Meanwhile, you can check [installation](https://github.com/uclouvain/openjpeg/wiki/Installation) instructions and [codec documentation](https://github.com/uclouvain/openjpeg/wiki/DocJ2KCodec).
## Current Status
[![badge-build]][link-build]
[![badge-msvc-build]][link-msvc-build]
[![badge-coverity]][link-coverity]
## Who are the developers ?
The library is developed and maintained by the Image and Signal Processing Group ([ISPGroup](http://sites.uclouvain.be/ispgroup/)), in the Université catholique de Louvain ([UCL](http://www.uclouvain.be/en-index.html), with the support of the [CNES](https://cnes.fr/), the [CS](http://www.c-s.fr/) company and the [intoPIX](http://www.intopix.com) company. The JPWL module has been developed by the Digital Signal Processing Lab ([DSPLab](http://dsplab.diei.unipg.it/)) of the University of Perugia, Italy ([UNIPG](http://www.unipg.it/)).
## Details on folders hierarchy
* src
* lib
* openjp2: contains the sources of the openjp2 library (Part 1 & 2)
* openjpwl: contains the additional sources if you want to build a JPWL-flavoured library.
* openjpip: complete client-server architecture for remote browsing of jpeg 2000 images.
* openjp3d: JP3D implementation
* openmj2: MJ2 implementation
* bin: contains all applications that use the openjpeg library
* common: common files to all applications
* jp2: a basic codec
* mj2: motion jpeg 2000 executables
* jpip: OpenJPIP applications (server and dec server)
* java: a Java client viewer for JPIP
* jp3d: JP3D applications
* tcltk: a test tool for JP3D
* wx
* OPJViewer: gui for displaying j2k files (based on wxWidget)
* wrapping
* java: java jni to use openjpeg in a java program
* thirdparty: thirdparty libraries used by some applications. These libraries will be built only if there are not found on the system. Note that libopenjpeg itself does not have any dependency.
* doc: doxygen documentation setup file and man pages
* tests: configuration files and utilities for the openjpeg test suite. All test images are located in [openjpeg-data](https://github.com/uclouvain/openjpeg-data) repository.
* cmake: cmake related files
See [LICENSE][link-license] for license and copyright information.
See [INSTALL](https://github.com/uclouvain/openjpeg/blob/master/INSTALL.md) for installation procedures.
See [NEWS](https://github.com/uclouvain/openjpeg/blob/master/NEWS.md) for user visible changes in successive releases.
## API/ABI
An API/ABI timeline is automatically updated [here][link-api-timeline].
OpenJPEG strives to provide a stable API/ABI for your applications. As such it
only exposes a limited subset of its functions. It uses a mechanism of
exporting/hiding functions. If you are unsure which functions you can use in
your applications, you should compile OpenJPEG using something similar to gcc:
`-fvisibility=hidden` compilation flag.
See also: http://gcc.gnu.org/wiki/Visibility
On windows, MSVC directly supports export/hiding function and as such the only
API available is the one supported by OpenJPEG.
[comment-license]: https://img.shields.io/github/license/uclouvain/openjpeg.svg "https://img.shields.io/badge/license-BSD--2--Clause-blue.svg"
[badge-license]: https://img.shields.io/badge/license-BSD--2--Clause-blue.svg "BSD 2-clause "Simplified" License"
[link-license]: https://github.com/uclouvain/openjpeg/blob/master/LICENSE "BSD 2-clause "Simplified" License"
[badge-build]: https://travis-ci.org/uclouvain/openjpeg.svg?branch=master "Build Status"
[link-build]: https://travis-ci.org/uclouvain/openjpeg "Build Status"
[badge-msvc-build]: https://ci.appveyor.com/api/projects/status/github/uclouvain/openjpeg?branch=master&svg=true "Windows Build Status"
[link-msvc-build]: https://ci.appveyor.com/project/detonin/openjpeg/branch/master "Windows Build Status"
[badge-coverity]: https://scan.coverity.com/projects/6383/badge.svg "Coverity Scan Build Status"
[link-coverity]: https://scan.coverity.com/projects/uclouvain-openjpeg "Coverity Scan Build Status"
[link-api-timeline]: http://www.openjpeg.org/abi-check/timeline/openjpeg "OpenJPEG API/ABI timeline"

33
THANKS
View File

@ -1,33 +0,0 @@
OpenJPEG THANKS file
Many people have contributed to OpenJPEG by reporting problems, suggesting various improvements,
or submitting actual code. Here is a list of these people. Help me keep
it complete and exempt of errors.
Mathieu Malaterre
Winfried Szukalski
Vincent Torri
Bob Friesenhahn
Callum Lerwick
Dzonatas Sol
Mickaël Savinaud
Julien Malik
Jerôme Fimes
Herve Drolon
Yannick Verschueren
Sebastien Lugan
Kaori Hagihara
Peter Wimmer
Francois-Olivier Devaux
Antonin Descampe
David Janssens
Pr. Benoit Macq
Luis Ibanez
Ben Boeckel
Vincent Nicolas
Glenn Pearson
Giuseppe Baruffa
Arnaud Maye
Rex Dieter
David Burken
Parvatha Elangovan

39
THANKS.md Normal file
View File

@ -0,0 +1,39 @@
# OpenJPEG THANKS file
Many people have contributed to OpenJPEG by reporting problems, suggesting various improvements,
or submitting actual code. Here is a list of these people. Help me keep
it complete and exempt of errors.
* Giuseppe Baruffa
* Ben Boeckel
* Aaron Boxer
* David Burken
* Matthieu Darbois
* Rex Dieter
* Herve Drolon
* Antonin Descampe
* Francois-Olivier Devaux
* Parvatha Elangovan
* Jerôme Fimes
* Bob Friesenhahn
* Kaori Hagihara
* Luc Hermitte
* Luis Ibanez
* David Janssens
* Hans Johnson
* Callum Lerwick
* Ke Liu (Tencent's Xuanwu LAB)
* Sebastien Lugan
* Benoit Macq
* Mathieu Malaterre
* Julien Malik
* Arnaud Maye
* Vincent Nicolas
* Aleksander Nikolic (Cisco Talos)
* Glenn Pearson
* Even Rouault
* Dzonatas Sol
* Winfried Szukalski
* Vincent Torri
* Yannick Verschueren
* Peter Wimmer

View File

@ -1,22 +0,0 @@
# Build the each application if it needed
IF(BUILD_CODEC)
ADD_SUBDIRECTORY(codec)
ENDIF(BUILD_CODEC)
IF(BUILD_MJ2)
ADD_SUBDIRECTORY(mj2)
ENDIF(BUILD_MJ2)
# Client & Server:
IF(BUILD_JPIP)
ADD_SUBDIRECTORY(jpip)
ENDIF(BUILD_JPIP)
IF(BUILD_VIEWER)
ADD_SUBDIRECTORY(OPJViewer)
ENDIF(BUILD_VIEWER)
IF(BUILD_JAVA)
ADD_SUBDIRECTORY(JavaOpenJPEG)
ENDIF(BUILD_JAVA)

View File

@ -1,19 +0,0 @@
MAINTAINERCLEANFILES = Makefile.in
SUBDIRS = codec
if WANT_MJ2
SUBDIRS += mj2
endif
if WANT_JPIP_CODE
SUBDIRS += jpip
endif
EXTRA_DIST = \
CMakeLists.txt \
common/color.c \
common/color.h \
common/format_defs.h \
common/opj_getopt.c \
common/opj_getopt.h

View File

@ -1,113 +0,0 @@
# Build the demo app, small examples
# First thing define the common source:
SET(common_SRCS
convert.c
index.c
${OPENJPEG_SOURCE_DIR}/applications/common/color.c
${OPENJPEG_SOURCE_DIR}/applications/common/opj_getopt.c
)
# Headers file are located here:
INCLUDE_DIRECTORIES(
${OPENJPEG_SOURCE_DIR}/libopenjpeg
${LCMS_INCLUDE_DIRNAME}
${OPENJPEG_SOURCE_DIR}/applications/common
${Z_INCLUDE_DIRNAME}
${PNG_INCLUDE_DIRNAME}
${TIFF_INCLUDE_DIRNAME}
)
IF(WIN32)
IF(BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DOPJ_EXPORTS)
ELSE(BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DOPJ_STATIC)
ENDIF(BUILD_SHARED_LIBS)
ENDIF(WIN32)
# Loop over all executables:
FOREACH(exe j2k_to_image image_to_j2k j2k_dump)
ADD_EXECUTABLE(${exe} ${exe}.c ${common_SRCS})
TARGET_LINK_LIBRARIES(${exe} ${OPENJPEG_LIBRARY_NAME}
${PNG_LIBNAME} ${TIFF_LIBNAME} ${LCMS_LIBNAME}
)
# To support universal exe:
IF(ZLIB_FOUND AND APPLE)
TARGET_LINK_LIBRARIES(${exe} z)
ELSe(ZLIB_FOUND AND APPLE)
TARGET_LINK_LIBRARIES(${exe} ${Z_LIBNAME})
ENDIF(ZLIB_FOUND AND APPLE)
# On unix you need to link to the math library:
IF(UNIX)
TARGET_LINK_LIBRARIES(${exe} m)
ENDIF(UNIX)
# Install exe
INSTALL(TARGETS ${exe}
EXPORT OpenJPEGTargets
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
)
ENDFOREACH(exe)
# Install man pages
INSTALL(
FILES ${OPENJPEG_SOURCE_DIR}/doc/man/man1/image_to_j2k.1
${OPENJPEG_SOURCE_DIR}/doc/man/man1/j2k_dump.1
${OPENJPEG_SOURCE_DIR}/doc/man/man1/j2k_to_image.1
DESTINATION ${OPENJPEG_INSTALL_MAN_DIR}/man1)
#
IF(BUILD_JPWL)
ADD_EXECUTABLE(JPWL_j2k_to_image
j2k_to_image.c
${common_SRCS}
)
SET_PROPERTY(
TARGET JPWL_j2k_to_image
APPEND PROPERTY COMPILE_DEFINITIONS USE_JPWL
)
TARGET_LINK_LIBRARIES(JPWL_j2k_to_image ${OPENJPEG_LIBRARY_NAME}_JPWL
${LCMS_LIBNAME} ${PNG_LIBNAME} ${TIFF_LIBNAME})
# To support universal exe:
IF(ZLIB_FOUND AND APPLE)
TARGET_LINK_LIBRARIES(JPWL_j2k_to_image z)
ELSe(ZLIB_FOUND AND APPLE)
TARGET_LINK_LIBRARIES(JPWL_j2k_to_image ${Z_LIBNAME})
ENDIF(ZLIB_FOUND AND APPLE)
IF(UNIX)
TARGET_LINK_LIBRARIES(JPWL_j2k_to_image m)
ENDIF(UNIX)
ADD_EXECUTABLE(JPWL_image_to_j2k
image_to_j2k.c
${common_SRCS}
)
SET_PROPERTY(
TARGET JPWL_image_to_j2k
APPEND PROPERTY COMPILE_DEFINITIONS USE_JPWL
)
TARGET_LINK_LIBRARIES(JPWL_image_to_j2k ${OPENJPEG_LIBRARY_NAME}_JPWL
${LCMS_LIBNAME} ${PNG_LIBNAME} ${TIFF_LIBNAME})
# To support universal exe:
IF(ZLIB_FOUND AND APPLE)
TARGET_LINK_LIBRARIES(JPWL_image_to_j2k z)
ELSe(ZLIB_FOUND AND APPLE)
TARGET_LINK_LIBRARIES(JPWL_image_to_j2k ${Z_LIBNAME})
ENDIF(ZLIB_FOUND AND APPLE)
IF(UNIX)
TARGET_LINK_LIBRARIES(JPWL_image_to_j2k m)
ENDIF(UNIX)
INSTALL(TARGETS JPWL_image_to_j2k JPWL_j2k_to_image
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
)
ENDIF(BUILD_JPWL)

View File

@ -1,118 +0,0 @@
MAINTAINERCLEANFILES = Makefile.in
bin_PROGRAMS = j2k_to_image image_to_j2k j2k_dump
if WANT_JPWL
bin_PROGRAMS += JPWL_j2k_to_image JPWL_image_to_j2k
endif
j2k_to_image_CPPFLAGS = \
-I. \
-I$(top_srcdir)/applications/codec \
-I$(top_builddir)/applications/codec \
-I$(top_srcdir)/applications/common \
-I$(top_builddir)/applications/common \
-I$(top_srcdir)/libopenjpeg \
-I$(top_builddir)/libopenjpeg \
@PNG_CFLAGS@ \
@TIFF_CFLAGS@ \
@LCMS1_CFLAGS@ \
@LCMS2_CFLAGS@
j2k_to_image_CFLAGS =
j2k_to_image_LDADD = $(top_builddir)/libopenjpeg/libopenjpeg.la @LCMS1_LIBS@ @LCMS2_LIBS@ @TIFF_LIBS@ @PNG_LIBS@ -lm
j2k_to_image_SOURCES = \
../common/color.c \
../common/opj_getopt.c \
convert.c \
index.c \
j2k_to_image.c \
../common/color.h
image_to_j2k_CPPFLAGS = \
-I. \
-I$(top_srcdir)/applications/codec \
-I$(top_builddir)/applications/codec \
-I$(top_srcdir)/applications/common \
-I$(top_builddir)/applications/common \
-I$(top_srcdir)/libopenjpeg \
-I$(top_builddir)/libopenjpeg \
@PNG_CFLAGS@ \
@TIFF_CFLAGS@
image_to_j2k_CFLAGS =
image_to_j2k_LDADD = $(top_builddir)/libopenjpeg/libopenjpeg.la @TIFF_LIBS@ @PNG_LIBS@ -lm
image_to_j2k_SOURCES = \
../common/opj_getopt.c \
convert.c \
index.c \
image_to_j2k.c \
convert.h \
../common/format_defs.h \
index.h
j2k_dump_CPPFLAGS = \
-I. \
-I$(top_srcdir)/applications/codec \
-I$(top_builddir)/applications/codec \
-I$(top_srcdir)/applications/common \
-I$(top_builddir)/applications/common \
-I$(top_srcdir)/libopenjpeg \
-I$(top_builddir)/libopenjpeg
j2k_dump_CFLAGS =
j2k_dump_LDADD = $(top_builddir)/libopenjpeg/libopenjpeg.la -lm
j2k_dump_SOURCES = \
../common/opj_getopt.c \
index.c \
j2k_dump.c \
../common/opj_getopt.h \
index.h
JPWL_j2k_to_image_CPPFLAGS = \
-I. \
-I$(top_srcdir)/applications/common \
-I$(top_builddir)/applications/common \
-I$(top_srcdir)/libopenjpeg \
-I$(top_builddir)/libopenjpeg \
-DUSE_JPWL \
@TIFF_CFLAGS@ \
@PNG_CFLAGS@ \
@LCMS1_CFLAGS@ \
@LCMS2_CFLAGS@
JPWL_j2k_to_image_CFLAGS =
JPWL_j2k_to_image_LDADD = $(top_builddir)/libopenjpeg/jpwl/libopenjpeg_JPWL.la @LCMS1_LIBS@ @LCMS2_LIBS@ @TIFF_LIBS@ @PNG_LIBS@
JPWL_j2k_to_image_SOURCES = \
../common/color.c \
../common/opj_getopt.c \
index.c \
convert.c \
j2k_to_image.c
JPWL_image_to_j2k_CPPFLAGS = \
-I. \
-I$(top_srcdir)/applications/common \
-I$(top_builddir)/applications/common \
-I$(top_srcdir)/libopenjpeg \
-I$(top_builddir)/libopenjpeg \
-DUSE_JPWL \
@TIFF_CFLAGS@ \
@PNG_CFLAGS@
JPWL_image_to_j2k_CFLAGS =
JPWL_image_to_j2k_LDADD = $(top_builddir)/libopenjpeg/jpwl/libopenjpeg_JPWL.la @TIFF_LIBS@ @PNG_LIBS@
JPWL_image_to_j2k_SOURCES = \
../common/opj_getopt.c \
index.c \
convert.c \
image_to_j2k.c
EXTRA_DIST = \
CMakeLists.txt \
windirent.h
install-data-hook:
@echo -e " (B)\t$(bindir)/j2k_to_image$(EXEEXT)" >> $(top_builddir)/report.txt
@echo -e " (B)\t$(bindir)/image_to_j2k$(EXEEXT)" >> $(top_builddir)/report.txt
@echo -e " (B)\t$(bindir)/j2k_dump$(EXEEXT)" >> $(top_builddir)/report.txt
if WANT_JPWL
@echo -e " (B)\t$(bindir)/JPWL_j2k_to_image$(EXEEXT)" >> $(top_builddir)/report.txt
@echo -e " (B)\t$(bindir)/JPWL_image_to_j2k$(EXEEXT)" >> $(top_builddir)/report.txt
endif

View File

@ -1,8 +0,0 @@
Simple codec compilation
------------------------
Once you've built the library, you might want to test it with a basic codec. To do this, go to the codec directory and either use the provided Makefile or use one of the following commands to build an encoder and decoder respectively:
gcc index.c convert.c image_to_j2k.c -o image_to_j2k -lopenjpeg -I ../libopenjpeg/ -lm -ltiff
gcc index.c convert.c j2k_to_image.c -o j2k_to_image -lopenjpeg -I ../libopenjpeg/ -lm -ltiff
You should add '-L..' to those lines if you did not use the 'install' target when building the library.

View File

@ -1,677 +0,0 @@
/*
* Copyright (c) 20010, Mathieu Malaterre, GDCM
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#ifdef _WIN32
#include "windirent.h"
#else
#include <dirent.h>
#endif /* _WIN32 */
#ifdef _WIN32
#include <windows.h>
#else
#include <strings.h>
#define _stricmp strcasecmp
#define _strnicmp strncasecmp
#endif /* _WIN32 */
#include "opj_config.h"
#include "openjpeg.h"
#include "j2k.h"
#include "jp2.h"
#include "opj_getopt.h"
#include "convert.h"
#include "index.h"
#include "format_defs.h"
typedef struct dircnt{
/** Buffer for holding images read from Directory*/
char *filename_buf;
/** Pointer to the buffer*/
char **filename;
}dircnt_t;
typedef struct img_folder{
/** The directory path of the folder containing input images*/
char *imgdirpath;
/** Output format*/
const char *out_format;
/** Enable option*/
char set_imgdir;
/** Enable Cod Format for output*/
char set_out_format;
}img_fol_t;
void decode_help_display(void) {
fprintf(stdout,"HELP for j2k_dump\n----\n\n");
fprintf(stdout,"- the -h option displays this help information on screen\n\n");
/* UniPG>> */
fprintf(stdout,"List of parameters for the JPEG 2000 "
#ifdef USE_JPWL
"+ JPWL "
#endif /* USE_JPWL */
"decoder:\n");
/* <<UniPG */
fprintf(stdout,"\n");
fprintf(stdout,"\n");
fprintf(stdout," -ImgDir \n");
fprintf(stdout," Image file Directory path \n");
fprintf(stdout," -i <compressed file>\n");
fprintf(stdout," REQUIRED only if an Input image directory not specified\n");
fprintf(stdout," Currently accepts J2K-files, JP2-files and JPT-files. The file type\n");
fprintf(stdout," is identified based on its suffix.\n");
fprintf(stdout," -o <output file>\n");
fprintf(stdout," OPTIONAL\n");
fprintf(stdout," Output file where file info will be dump.\n");
fprintf(stdout," By default it will be in the stdout.\n");
fprintf(stdout,"\n");
}
/* -------------------------------------------------------------------------- */
static void j2k_dump_image(FILE *fd, opj_image_t * img);
static void j2k_dump_cp(FILE *fd, opj_image_t * img, opj_cp_t * cp);
int get_num_images(char *imgdirpath){
DIR *dir;
struct dirent* content;
int num_images = 0;
/*Reading the input images from given input directory*/
dir= opendir(imgdirpath);
if(!dir){
fprintf(stderr,"Could not open Folder %s\n",imgdirpath);
return 0;
}
while((content=readdir(dir))!=NULL){
if(strcmp(".",content->d_name)==0 || strcmp("..",content->d_name)==0 )
continue;
num_images++;
}
return num_images;
}
int load_images(dircnt_t *dirptr, char *imgdirpath){
DIR *dir;
struct dirent* content;
int i = 0;
/*Reading the input images from given input directory*/
dir= opendir(imgdirpath);
if(!dir){
fprintf(stderr,"Could not open Folder %s\n",imgdirpath);
return 1;
}else {
fprintf(stderr,"Folder opened successfully\n");
}
while((content=readdir(dir))!=NULL){
if(strcmp(".",content->d_name)==0 || strcmp("..",content->d_name)==0 )
continue;
strcpy(dirptr->filename[i],content->d_name);
i++;
}
return 0;
}
int get_file_format(char *filename) {
unsigned int i;
static const char *extension[] = {"pgx", "pnm", "pgm", "ppm", "bmp","tif", "raw", "tga", "png", "j2k", "jp2", "jpt", "j2c", "jpc" };
static const int format[] = { PGX_DFMT, PXM_DFMT, PXM_DFMT, PXM_DFMT, BMP_DFMT, TIF_DFMT, RAW_DFMT, TGA_DFMT, PNG_DFMT, J2K_CFMT, JP2_CFMT, JPT_CFMT, J2K_CFMT, J2K_CFMT };
char * ext = strrchr(filename, '.');
if (ext == NULL)
return -1;
ext++;
if(ext) {
for(i = 0; i < sizeof(format)/sizeof(*format); i++) {
if(_strnicmp(ext, extension[i], 3) == 0) {
return format[i];
}
}
}
return -1;
}
char get_next_file(int imageno,dircnt_t *dirptr,img_fol_t *img_fol, opj_dparameters_t *parameters){
char image_filename[OPJ_PATH_LEN], infilename[OPJ_PATH_LEN],outfilename[OPJ_PATH_LEN],temp_ofname[OPJ_PATH_LEN];
char *temp_p, temp1[OPJ_PATH_LEN]="";
strcpy(image_filename,dirptr->filename[imageno]);
fprintf(stderr,"File Number %d \"%s\"\n",imageno,image_filename);
parameters->decod_format = get_file_format(image_filename);
if (parameters->decod_format == -1)
return 1;
sprintf(infilename,"%s/%s",img_fol->imgdirpath,image_filename);
strncpy(parameters->infile, infilename, sizeof(infilename));
/*Set output file*/
strcpy(temp_ofname,strtok(image_filename,"."));
while((temp_p = strtok(NULL,".")) != NULL){
strcat(temp_ofname,temp1);
sprintf(temp1,".%s",temp_p);
}
if(img_fol->set_out_format==1){
sprintf(outfilename,"%s/%s.%s",img_fol->imgdirpath,temp_ofname,img_fol->out_format);
strncpy(parameters->outfile, outfilename, sizeof(outfilename));
}
return 0;
}
/* -------------------------------------------------------------------------- */
int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *parameters,img_fol_t *img_fol, char *indexfilename) {
/* parse the command line */
int totlen, c;
opj_option_t long_option[]={
{"ImgDir",REQ_ARG, NULL ,'y'},
};
const char optlist[] = "i:o:h";
OPJ_ARG_NOT_USED(indexfilename);
totlen=sizeof(long_option);
img_fol->set_out_format = 0;
do {
c = opj_getopt_long(argc, argv,optlist,long_option,totlen);
if (c == -1)
break;
switch (c) {
case 'i': /* input file */
{
char *infile = opj_optarg;
parameters->decod_format = get_file_format(infile);
switch(parameters->decod_format) {
case J2K_CFMT:
case JP2_CFMT:
case JPT_CFMT:
break;
default:
fprintf(stderr,
"!! Unrecognized format for infile : %s [accept only *.j2k, *.jp2, *.jpc or *.jpt] !!\n\n",
infile);
return 1;
}
strncpy(parameters->infile, infile, sizeof(parameters->infile)-1);
}
break;
/* ------------------------------------------------------ */
case 'o': /* output file */
{
char *outfile = opj_optarg;
strncpy(parameters->outfile, outfile, sizeof(parameters->outfile)-1);
}
break;
/* ----------------------------------------------------- */
case 'h': /* display an help description */
decode_help_display();
return 1;
/* ------------------------------------------------------ */
case 'y': /* Image Directory path */
{
img_fol->imgdirpath = (char*)malloc(strlen(opj_optarg) + 1);
strcpy(img_fol->imgdirpath,opj_optarg);
img_fol->set_imgdir=1;
}
break;
/* ----------------------------------------------------- */
default:
fprintf(stderr,"WARNING -> this option is not valid \"-%c %s\"\n",c, opj_optarg);
break;
}
}while(c != -1);
/* check for possible errors */
if(img_fol->set_imgdir==1){
if(!(parameters->infile[0]==0)){
fprintf(stderr, "Error: options -ImgDir and -i cannot be used together !!\n");
return 1;
}
if(img_fol->set_out_format == 0){
fprintf(stderr, "Error: When -ImgDir is used, -OutFor <FORMAT> must be used !!\n");
fprintf(stderr, "Only one format allowed! Valid format PGM, PPM, PNM, PGX, BMP, TIF, RAW and TGA!!\n");
return 1;
}
if(!((parameters->outfile[0] == 0))){
fprintf(stderr, "Error: options -ImgDir and -o cannot be used together !!\n");
return 1;
}
}else{
if((parameters->infile[0] == 0) ) {
fprintf(stderr, "Example: %s -i image.j2k\n",argv[0]);
fprintf(stderr, " Try: %s -h\n",argv[0]);
return 1;
}
}
return 0;
}
/* -------------------------------------------------------------------------- */
/**
sample error callback expecting a FILE* client object
*/
void error_callback(const char *msg, void *client_data) {
FILE *stream = (FILE*)client_data;
fprintf(stream, "[ERROR] %s", msg);
}
/**
sample warning callback expecting a FILE* client object
*/
void warning_callback(const char *msg, void *client_data) {
FILE *stream = (FILE*)client_data;
fprintf(stream, "[WARNING] %s", msg);
}
/**
sample debug callback expecting no client object
*/
void info_callback(const char *msg, void *client_data) {
(void)client_data;
fprintf(stdout, "[INFO] %s", msg);
}
/* -------------------------------------------------------------------------- */
int main(int argc, char *argv[])
{
opj_dparameters_t parameters; /* decompression parameters */
img_fol_t img_fol;
opj_event_mgr_t event_mgr; /* event manager */
opj_image_t *image = NULL;
FILE *fsrc = NULL, *fout = NULL;
unsigned char *src = NULL;
int file_length;
int num_images;
int i,imageno;
dircnt_t *dirptr = NULL;
opj_dinfo_t* dinfo = NULL; /* handle to a decompressor */
opj_cio_t *cio = NULL;
opj_codestream_info_t cstr_info; /* Codestream information structure */
char indexfilename[OPJ_PATH_LEN]; /* index file name */
/* configure the event callbacks (not required) */
memset(&event_mgr, 0, sizeof(opj_event_mgr_t));
event_mgr.error_handler = error_callback;
event_mgr.warning_handler = warning_callback;
event_mgr.info_handler = info_callback;
/* set decoding parameters to default values */
opj_set_default_decoder_parameters(&parameters);
/* Initialize indexfilename and img_fol */
*indexfilename = 0;
memset(&img_fol,0,sizeof(img_fol_t));
/* parse input and get user encoding parameters */
if(parse_cmdline_decoder(argc, argv, &parameters,&img_fol, indexfilename) == 1) {
return 1;
}
/* Initialize reading of directory */
if(img_fol.set_imgdir==1){
num_images=get_num_images(img_fol.imgdirpath);
dirptr=(dircnt_t*)malloc(sizeof(dircnt_t));
if(dirptr){
dirptr->filename_buf = (char*)malloc(num_images*OPJ_PATH_LEN*sizeof(char)); /* Stores at max 10 image file names*/
dirptr->filename = (char**) malloc(num_images*sizeof(char*));
if(!dirptr->filename_buf){
return 1;
}
for(i=0;i<num_images;i++){
dirptr->filename[i] = dirptr->filename_buf + i*OPJ_PATH_LEN;
}
}
if(load_images(dirptr,img_fol.imgdirpath)==1){
return 1;
}
if (num_images==0){
fprintf(stdout,"Folder is empty\n");
return 1;
}
}else{
num_images=1;
}
/* */
if (parameters.outfile[0] != 0)
{
fout = fopen(parameters.outfile,"w");
if (!fout)
{
fprintf(stderr, "ERROR -> failed to open %s for reading\n", parameters.outfile);
return 1;
}
}
else
fout = stdout;
/*Encoding image one by one*/
for(imageno = 0; imageno < num_images ; imageno++)
{
image = NULL;
fprintf(stderr,"\n");
if(img_fol.set_imgdir==1){
if (get_next_file(imageno, dirptr,&img_fol, &parameters)) {
fprintf(stderr,"skipping file...\n");
continue;
}
}
/* read the input file and put it in memory */
/* ---------------------------------------- */
fsrc = fopen(parameters.infile, "rb");
if (!fsrc) {
fprintf(stderr, "ERROR -> failed to open %s for reading\n", parameters.infile);
return 1;
}
fseek(fsrc, 0, SEEK_END);
file_length = ftell(fsrc);
fseek(fsrc, 0, SEEK_SET);
src = (unsigned char *) malloc(file_length);
if (fread(src, 1, file_length, fsrc) != (size_t)file_length)
{
free(src);
fclose(fsrc);
fclose(fout);
fprintf(stderr, "\nERROR: fread return a number of element different from the expected.\n");
return 1;
}
fclose(fsrc);
/* decode the code-stream */
/* ---------------------- */
switch(parameters.decod_format) {
case J2K_CFMT:
{
/* JPEG-2000 codestream */
/* get a decoder handle */
dinfo = opj_create_decompress(CODEC_J2K);
/* catch events using our callbacks and give a local context */
opj_set_event_mgr((opj_common_ptr)dinfo, &event_mgr, stderr);
/* setup the decoder decoding parameters using user parameters */
opj_setup_decoder(dinfo, &parameters);
/* open a byte stream */
cio = opj_cio_open((opj_common_ptr)dinfo, src, file_length);
/* decode the stream and fill the image structure */
if (*indexfilename) /* If need to extract codestream information*/
image = opj_decode_with_info(dinfo, cio, &cstr_info);
else
image = opj_decode(dinfo, cio);
if(!image) {
fprintf(stderr, "ERROR -> j2k_to_image: failed to decode image!\n");
opj_destroy_decompress(dinfo);
opj_cio_close(cio);
fclose(fout);
free(src);
return 1;
}
/* dump image */
j2k_dump_image(fout, image);
/* dump cp */
j2k_dump_cp(fout, image, ((opj_j2k_t*)dinfo->j2k_handle)->cp);
/* close the byte stream */
opj_cio_close(cio);
/* Write the index to disk */
if (*indexfilename) {
opj_bool bSuccess;
bSuccess = write_index_file(&cstr_info, indexfilename);
if (bSuccess) {
fprintf(stderr, "Failed to output index file\n");
}
}
}
break;
case JP2_CFMT:
{
/* JPEG 2000 compressed image data */
/* get a decoder handle */
dinfo = opj_create_decompress(CODEC_JP2);
/* catch events using our callbacks and give a local context */
opj_set_event_mgr((opj_common_ptr)dinfo, &event_mgr, stderr);
/* setup the decoder decoding parameters using the current image and user parameters */
opj_setup_decoder(dinfo, &parameters);
/* open a byte stream */
cio = opj_cio_open((opj_common_ptr)dinfo, src, file_length);
/* decode the stream and fill the image structure */
if (*indexfilename) /* If need to extract codestream information*/
image = opj_decode_with_info(dinfo, cio, &cstr_info);
else
image = opj_decode(dinfo, cio);
if(!image) {
fprintf(stderr, "ERROR -> j2k_to_image: failed to decode image!\n");
opj_destroy_decompress(dinfo);
opj_cio_close(cio);
fclose(fout);
free(src);
return 1;
}
/* dump image */
if(image->icc_profile_buf)
{
free(image->icc_profile_buf); image->icc_profile_buf = NULL;
}
j2k_dump_image(fout, image);
/* dump cp */
j2k_dump_cp(fout, image, ((opj_jp2_t*)dinfo->jp2_handle)->j2k->cp);
/* close the byte stream */
opj_cio_close(cio);
/* Write the index to disk */
if (*indexfilename) {
opj_bool bSuccess;
bSuccess = write_index_file(&cstr_info, indexfilename);
if (bSuccess) {
fprintf(stderr, "Failed to output index file\n");
}
}
}
break;
case JPT_CFMT:
{
/* JPEG 2000, JPIP */
/* get a decoder handle */
dinfo = opj_create_decompress(CODEC_JPT);
/* catch events using our callbacks and give a local context */
opj_set_event_mgr((opj_common_ptr)dinfo, &event_mgr, stderr);
/* setup the decoder decoding parameters using user parameters */
opj_setup_decoder(dinfo, &parameters);
/* open a byte stream */
cio = opj_cio_open((opj_common_ptr)dinfo, src, file_length);
/* decode the stream and fill the image structure */
if (*indexfilename) /* If need to extract codestream information*/
image = opj_decode_with_info(dinfo, cio, &cstr_info);
else
image = opj_decode(dinfo, cio);
if(!image) {
fprintf(stderr, "ERROR -> j2k_to_image: failed to decode image!\n");
opj_destroy_decompress(dinfo);
opj_cio_close(cio);
fclose(fout);
free(src);
return 1;
}
/* close the byte stream */
opj_cio_close(cio);
/* Write the index to disk */
if (*indexfilename) {
opj_bool bSuccess;
bSuccess = write_index_file(&cstr_info, indexfilename);
if (bSuccess) {
fprintf(stderr, "Failed to output index file\n");
}
}
}
break;
default:
fprintf(stderr, "skipping file..\n");
continue;
}
/* free the memory containing the code-stream */
free(src);
src = NULL;
/* free remaining structures */
if(dinfo) {
opj_destroy_decompress(dinfo);
}
/* free codestream information structure */
if (*indexfilename)
opj_destroy_cstr_info(&cstr_info);
/* free image data structure */
opj_image_destroy(image);
}
fclose(fout);
return EXIT_SUCCESS;
}
static void j2k_dump_image(FILE *fd, opj_image_t * img) {
int compno;
fprintf(fd, "image {\n");
fprintf(fd, " x0=%d, y0=%d, x1=%d, y1=%d\n", img->x0, img->y0, img->x1, img->y1);
fprintf(fd, " numcomps=%d\n", img->numcomps);
for (compno = 0; compno < img->numcomps; compno++) {
opj_image_comp_t *comp = &img->comps[compno];
fprintf(fd, " comp %d {\n", compno);
fprintf(fd, " dx=%d, dy=%d\n", comp->dx, comp->dy);
fprintf(fd, " prec=%d\n", comp->prec);
/*fprintf(fd, " bpp=%d\n", comp->bpp);*/
fprintf(fd, " sgnd=%d\n", comp->sgnd);
fprintf(fd, " }\n");
}
fprintf(fd, "}\n");
}
static void j2k_dump_cp(FILE *fd, opj_image_t * img, opj_cp_t * cp) {
int tileno, compno, layno, bandno, resno, numbands;
fprintf(fd, "coding parameters {\n");
fprintf(fd, " tx0=%d, ty0=%d\n", cp->tx0, cp->ty0);
fprintf(fd, " tdx=%d, tdy=%d\n", cp->tdx, cp->tdy);
fprintf(fd, " tw=%d, th=%d\n", cp->tw, cp->th);
for (tileno = 0; tileno < cp->tw * cp->th; tileno++) {
opj_tcp_t *tcp = &cp->tcps[tileno];
fprintf(fd, " tile %d {\n", tileno);
fprintf(fd, " csty=%x\n", tcp->csty);
fprintf(fd, " prg=%d\n", tcp->prg);
fprintf(fd, " numlayers=%d\n", tcp->numlayers);
fprintf(fd, " mct=%d\n", tcp->mct);
fprintf(fd, " rates=");
for (layno = 0; layno < tcp->numlayers; layno++) {
fprintf(fd, "%.1f ", tcp->rates[layno]);
}
fprintf(fd, "\n");
for (compno = 0; compno < img->numcomps; compno++) {
opj_tccp_t *tccp = &tcp->tccps[compno];
fprintf(fd, " comp %d {\n", compno);
fprintf(fd, " csty=%x\n", tccp->csty);
fprintf(fd, " numresolutions=%d\n", tccp->numresolutions);
fprintf(fd, " cblkw=%d\n", tccp->cblkw);
fprintf(fd, " cblkh=%d\n", tccp->cblkh);
fprintf(fd, " cblksty=%x\n", tccp->cblksty);
fprintf(fd, " qmfbid=%d\n", tccp->qmfbid);
fprintf(fd, " qntsty=%d\n", tccp->qntsty);
fprintf(fd, " numgbits=%d\n", tccp->numgbits);
fprintf(fd, " roishift=%d\n", tccp->roishift);
fprintf(fd, " stepsizes=");
numbands = tccp->qntsty == J2K_CCP_QNTSTY_SIQNT ? 1 : tccp->numresolutions * 3 - 2;
for (bandno = 0; bandno < numbands; bandno++) {
fprintf(fd, "(%d,%d) ", tccp->stepsizes[bandno].mant,
tccp->stepsizes[bandno].expn);
}
fprintf(fd, "\n");
if (tccp->csty & J2K_CCP_CSTY_PRT) {
fprintf(fd, " prcw=");
for (resno = 0; resno < tccp->numresolutions; resno++) {
fprintf(fd, "%d ", tccp->prcw[resno]);
}
fprintf(fd, "\n");
fprintf(fd, " prch=");
for (resno = 0; resno < tccp->numresolutions; resno++) {
fprintf(fd, "%d ", tccp->prch[resno]);
}
fprintf(fd, "\n");
}
fprintf(fd, " }\n");
}
fprintf(fd, " }\n");
}
fprintf(fd, "}\n");
}

View File

@ -1,466 +0,0 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include "opj_config.h"
#include "openjpeg.h"
#include "color.h"
#ifdef HAVE_LIBLCMS2
#include <lcms2.h>
#endif
#ifdef HAVE_LIBLCMS1
#include <lcms.h>
#endif
/*--------------------------------------------------------
Matrix für sYCC, Amendment 1 to IEC 61966-2-1
Y : 0.299 0.587 0.114 :R
Cb: -0.1687 -0.3312 0.5 :G
Cr: 0.5 -0.4187 -0.0812 :B
Inverse:
R: 1 -3.68213e-05 1.40199 :Y
G: 1.00003 -0.344125 -0.714128 :Cb - 2^(prec - 1)
B: 0.999823 1.77204 -8.04142e-06 :Cr - 2^(prec - 1)
-----------------------------------------------------------*/
static void sycc_to_rgb(int offset, int upb, int y, int cb, int cr,
int *out_r, int *out_g, int *out_b)
{
int r, g, b;
cb -= offset; cr -= offset;
r = y + (int)(1.402 * (float)cr);
if(r < 0) r = 0; else if(r > upb) r = upb; *out_r = r;
g = y - (int)(0.344 * (float)cb + 0.714 * (float)cr);
if(g < 0) g = 0; else if(g > upb) g = upb; *out_g = g;
b = y + (int)(1.772 * (float)cb);
if(b < 0) b = 0; else if(b > upb) b = upb; *out_b = b;
}
static void sycc444_to_rgb(opj_image_t *img)
{
int *d0, *d1, *d2, *r, *g, *b;
const int *y, *cb, *cr;
int maxw, maxh, max, i, offset, upb;
i = img->comps[0].prec;
offset = 1<<(i - 1); upb = (1<<i)-1;
maxw = img->comps[0].w; maxh = img->comps[0].h;
max = maxw * maxh;
y = img->comps[0].data;
cb = img->comps[1].data;
cr = img->comps[2].data;
d0 = r = (int*)malloc(sizeof(int) * max);
d1 = g = (int*)malloc(sizeof(int) * max);
d2 = b = (int*)malloc(sizeof(int) * max);
for(i = 0; i < max; ++i)
{
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
++y; ++cb; ++cr; ++r; ++g; ++b;
}
free(img->comps[0].data); img->comps[0].data = d0;
free(img->comps[1].data); img->comps[1].data = d1;
free(img->comps[2].data); img->comps[2].data = d2;
}/* sycc444_to_rgb() */
static void sycc422_to_rgb(opj_image_t *img)
{
int *d0, *d1, *d2, *r, *g, *b;
const int *y, *cb, *cr;
int maxw, maxh, max, offset, upb;
int i, j;
i = img->comps[0].prec;
offset = 1<<(i - 1); upb = (1<<i)-1;
maxw = img->comps[0].w; maxh = img->comps[0].h;
max = maxw * maxh;
y = img->comps[0].data;
cb = img->comps[1].data;
cr = img->comps[2].data;
d0 = r = (int*)malloc(sizeof(int) * max);
d1 = g = (int*)malloc(sizeof(int) * max);
d2 = b = (int*)malloc(sizeof(int) * max);
for(i=0; i < maxh; ++i)
{
for(j=0; j < maxw; j += 2)
{
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
++y; ++r; ++g; ++b;
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
++y; ++r; ++g; ++b; ++cb; ++cr;
}
}
free(img->comps[0].data); img->comps[0].data = d0;
free(img->comps[1].data); img->comps[1].data = d1;
free(img->comps[2].data); img->comps[2].data = d2;
img->comps[1].w = maxw; img->comps[1].h = maxh;
img->comps[2].w = maxw; img->comps[2].h = maxh;
img->comps[1].dx = img->comps[0].dx;
img->comps[2].dx = img->comps[0].dx;
img->comps[1].dy = img->comps[0].dy;
img->comps[2].dy = img->comps[0].dy;
}/* sycc422_to_rgb() */
static void sycc420_to_rgb(opj_image_t *img)
{
int *d0, *d1, *d2, *r, *g, *b, *nr, *ng, *nb;
const int *y, *cb, *cr, *ny;
int maxw, maxh, max, offset, upb;
int i, j;
i = img->comps[0].prec;
offset = 1<<(i - 1); upb = (1<<i)-1;
maxw = img->comps[0].w; maxh = img->comps[0].h;
max = maxw * maxh;
y = img->comps[0].data;
cb = img->comps[1].data;
cr = img->comps[2].data;
d0 = r = (int*)malloc(sizeof(int) * max);
d1 = g = (int*)malloc(sizeof(int) * max);
d2 = b = (int*)malloc(sizeof(int) * max);
for(i=0; i < maxh; i += 2)
{
ny = y + maxw;
nr = r + maxw; ng = g + maxw; nb = b + maxw;
for(j=0; j < maxw; j += 2)
{
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
++y; ++r; ++g; ++b;
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
++y; ++r; ++g; ++b;
sycc_to_rgb(offset, upb, *ny, *cb, *cr, nr, ng, nb);
++ny; ++nr; ++ng; ++nb;
sycc_to_rgb(offset, upb, *ny, *cb, *cr, nr, ng, nb);
++ny; ++nr; ++ng; ++nb; ++cb; ++cr;
}
y += maxw; r += maxw; g += maxw; b += maxw;
}
free(img->comps[0].data); img->comps[0].data = d0;
free(img->comps[1].data); img->comps[1].data = d1;
free(img->comps[2].data); img->comps[2].data = d2;
img->comps[1].w = maxw; img->comps[1].h = maxh;
img->comps[2].w = maxw; img->comps[2].h = maxh;
img->comps[1].dx = img->comps[0].dx;
img->comps[2].dx = img->comps[0].dx;
img->comps[1].dy = img->comps[0].dy;
img->comps[2].dy = img->comps[0].dy;
}/* sycc420_to_rgb() */
void color_sycc_to_rgb(opj_image_t *img)
{
if(img->numcomps < 3)
{
img->color_space = CLRSPC_GRAY;
return;
}
if((img->comps[0].dx == 1)
&& (img->comps[1].dx == 2)
&& (img->comps[2].dx == 2)
&& (img->comps[0].dy == 1)
&& (img->comps[1].dy == 2)
&& (img->comps[2].dy == 2))/* horizontal and vertical sub-sample */
{
sycc420_to_rgb(img);
}
else
if((img->comps[0].dx == 1)
&& (img->comps[1].dx == 2)
&& (img->comps[2].dx == 2)
&& (img->comps[0].dy == 1)
&& (img->comps[1].dy == 1)
&& (img->comps[2].dy == 1))/* horizontal sub-sample only */
{
sycc422_to_rgb(img);
}
else
if((img->comps[0].dx == 1)
&& (img->comps[1].dx == 1)
&& (img->comps[2].dx == 1)
&& (img->comps[0].dy == 1)
&& (img->comps[1].dy == 1)
&& (img->comps[2].dy == 1))/* no sub-sample */
{
sycc444_to_rgb(img);
}
else
{
fprintf(stderr,"%s:%d:color_sycc_to_rgb\n\tCAN NOT CONVERT\n",
__FILE__,__LINE__);
return;
}
img->color_space = CLRSPC_SRGB;
}/* color_sycc_to_rgb() */
#if defined(HAVE_LIBLCMS2) || defined(HAVE_LIBLCMS1)
#ifdef HAVE_LIBLCMS1
/* Bob Friesenhahn proposed:*/
#define cmsSigXYZData icSigXYZData
#define cmsSigLabData icSigLabData
#define cmsSigCmykData icSigCmykData
#define cmsSigYCbCrData icSigYCbCrData
#define cmsSigLuvData icSigLuvData
#define cmsSigGrayData icSigGrayData
#define cmsSigRgbData icSigRgbData
#define cmsUInt32Number DWORD
#define cmsColorSpaceSignature icColorSpaceSignature
#define cmsGetHeaderRenderingIntent cmsTakeRenderingIntent
#endif /* HAVE_LIBLCMS1 */
void color_apply_icc_profile(opj_image_t *image)
{
cmsHPROFILE in_prof, out_prof;
cmsHTRANSFORM transform;
cmsColorSpaceSignature in_space, out_space;
cmsUInt32Number intent, in_type, out_type, nr_samples;
int *r, *g, *b;
int prec, i, max, max_w, max_h;
OPJ_COLOR_SPACE oldspace;
in_prof =
cmsOpenProfileFromMem(image->icc_profile_buf, image->icc_profile_len);
if(in_prof == NULL) return;
in_space = cmsGetPCS(in_prof);
out_space = cmsGetColorSpace(in_prof);
intent = cmsGetHeaderRenderingIntent(in_prof);
max_w = image->comps[0].w; max_h = image->comps[0].h;
prec = image->comps[0].prec;
oldspace = image->color_space;
if(out_space == cmsSigRgbData) /* enumCS 16 */
{
in_type = TYPE_RGB_16;
out_type = TYPE_RGB_16;
out_prof = cmsCreate_sRGBProfile();
image->color_space = CLRSPC_SRGB;
}
else
if(out_space == cmsSigGrayData) /* enumCS 17 */
{
in_type = TYPE_GRAY_8;
out_type = TYPE_RGB_8;
out_prof = cmsCreate_sRGBProfile();
image->color_space = CLRSPC_SRGB;
}
else
if(out_space == cmsSigYCbCrData) /* enumCS 18 */
{
in_type = TYPE_YCbCr_16;
out_type = TYPE_RGB_16;
out_prof = cmsCreate_sRGBProfile();
image->color_space = CLRSPC_SRGB;
}
else
{
#ifdef DEBUG_PROFILE
fprintf(stderr,"%s:%d: color_apply_icc_profile\n\tICC Profile has unknown "
"output colorspace(%#x)(%c%c%c%c)\n\tICC Profile ignored.\n",
__FILE__,__LINE__,out_space,
(out_space>>24) & 0xff,(out_space>>16) & 0xff,
(out_space>>8) & 0xff, out_space & 0xff);
#endif
return;
}
#ifdef DEBUG_PROFILE
fprintf(stderr,"%s:%d:color_apply_icc_profile\n\tchannels(%d) prec(%d) w(%d) h(%d)"
"\n\tprofile: in(%p) out(%p)\n",__FILE__,__LINE__,image->numcomps,prec,
max_w,max_h, (void*)in_prof,(void*)out_prof);
fprintf(stderr,"\trender_intent (%u)\n\t"
"color_space: in(%#x)(%c%c%c%c) out:(%#x)(%c%c%c%c)\n\t"
" type: in(%u) out:(%u)\n",
intent,
in_space,
(in_space>>24) & 0xff,(in_space>>16) & 0xff,
(in_space>>8) & 0xff, in_space & 0xff,
out_space,
(out_space>>24) & 0xff,(out_space>>16) & 0xff,
(out_space>>8) & 0xff, out_space & 0xff,
in_type,out_type
);
#endif /* DEBUG_PROFILE */
transform = cmsCreateTransform(in_prof, in_type,
out_prof, out_type, intent, 0);
#ifdef HAVE_LIBLCMS2
/* Possible for: LCMS_VERSION >= 2000 :*/
cmsCloseProfile(in_prof);
cmsCloseProfile(out_prof);
#endif
if(transform == NULL)
{
#ifdef DEBUG_PROFILE
fprintf(stderr,"%s:%d:color_apply_icc_profile\n\tcmsCreateTransform failed. "
"ICC Profile ignored.\n",__FILE__,__LINE__);
#endif
image->color_space = oldspace;
#ifdef HAVE_LIBLCMS1
cmsCloseProfile(in_prof);
cmsCloseProfile(out_prof);
#endif
return;
}
if(image->numcomps > 2)/* RGB, RGBA */
{
unsigned short *inbuf, *outbuf, *in, *out;
max = max_w * max_h; nr_samples = max * 3 * sizeof(unsigned short);
in = inbuf = (unsigned short*)malloc(nr_samples);
out = outbuf = (unsigned short*)malloc(nr_samples);
r = image->comps[0].data;
g = image->comps[1].data;
b = image->comps[2].data;
for(i = 0; i < max; ++i)
{
*in++ = (unsigned short)*r++;
*in++ = (unsigned short)*g++;
*in++ = (unsigned short)*b++;
}
cmsDoTransform(transform, inbuf, outbuf, max);
r = image->comps[0].data;
g = image->comps[1].data;
b = image->comps[2].data;
for(i = 0; i < max; ++i)
{
*r++ = (int)*out++;
*g++ = (int)*out++;
*b++ = (int)*out++;
}
free(inbuf); free(outbuf);
}
else /* GRAY, GRAYA */
{
unsigned char *in, *inbuf, *out, *outbuf;
max = max_w * max_h; nr_samples = max * 3 * sizeof(unsigned char);
in = inbuf = (unsigned char*)malloc(nr_samples);
out = outbuf = (unsigned char*)malloc(nr_samples);
image->comps = (opj_image_comp_t*)
realloc(image->comps, (image->numcomps+2)*sizeof(opj_image_comp_t));
if(image->numcomps == 2)
image->comps[3] = image->comps[1];
image->comps[1] = image->comps[0];
image->comps[2] = image->comps[0];
image->comps[1].data = (int*)calloc(max, sizeof(int));
image->comps[2].data = (int*)calloc(max, sizeof(int));
image->numcomps += 2;
r = image->comps[0].data;
for(i = 0; i < max; ++i)
{
*in++ = (unsigned char)*r++;
}
cmsDoTransform(transform, inbuf, outbuf, max);
r = image->comps[0].data;
g = image->comps[1].data;
b = image->comps[2].data;
for(i = 0; i < max; ++i)
{
*r++ = (int)*out++; *g++ = (int)*out++; *b++ = (int)*out++;
}
free(inbuf); free(outbuf);
}/* if(image->numcomps */
cmsDeleteTransform(transform);
#ifdef HAVE_LIBLCMS1
cmsCloseProfile(in_prof);
cmsCloseProfile(out_prof);
#endif
}/* color_apply_icc_profile() */
#endif /* HAVE_LIBLCMS2 || HAVE_LIBLCMS1 */

View File

@ -1,120 +0,0 @@
What's New for OpenJPIP
* : fixed
- : removed
! : changed
+ : added
January 26, 2011
! [kaori] unapplied auxtrans_manager to the local mode
December 24, 2011
* [kaori] additional modification for the warning
December 22, 2011
* [kaori] fixed auxtrans_manager to enable MAC
* [kaori] warnings due to disregarding return value are removed
November 30, 2011
+ [kaori] TCP return (http-tcp) implemented
November 16, 2011
* [kaori] fixed Region of Interest option, and memory leak of opj_dec_server
+ [kaori] new feature to target JP2 files from www (libcurl required)
* [kaori] fixed opj_server execusion error (instant terminating) with autotool, cmake still need to be fixed
November 8, 2011
! [kaori] updated main page of doxygen
November 3, 2011
* [kaori] solved memory leak of opj_server
! [kaori] removed redundant defines
November 2, 2011
* [antonin] additional patches for autotools and cmake
October 26, 2011
* [kaori] additional patches for autotool are applied
October 25, 2011
* [kaori] patches for cmake and autotool are applied
* [kaori] fixed client viewer to be compatible with server response header both Content-type and Content-Type
October 20, 2011
+ [added] API style in openJPIP library
! [kaori] rearranged directories, applications are all under util/ directory, currently only 'make -f Makefile.nix' works
October 18, 2011
! [kaori] rearranged opj_server, opj_dec_server directory
October 14, 2011
+ [kaori] enable all progression orders
October 12, 2011
+ [kaori] enable layers requests; restricting the number of codesream quality layers
October 11, 2011
+ [antonin] enable JPT-stream request from client viewer option (credit to kaori)
October 10, 2011
- [antonin] removed obsolete indexer utility (credit to kaori)
+ [antonin] enabled JPP-stream (credit to kaori)
September 16, 2011
+ [kaori] enabled stateless requests from the opj_viewers
Septempber 1, 2011
* [kaori] changed terminating status of opj_server in debug/non-server mode
August 27, 2011
* [antonin] fixed missing include directory in opj_client/opj_dec_server/CMakeLists.txt
August 26, 2011
* [antonin] fixed cmake and autotools files to reflect recent indexer changes in JPIP
! [kaori] indexer using the latest openjpeg library
* [antonin] fixed cmake and autotools files to reflect recent changes in JPIP
! [kaori] fixed Makefile.nix to load openjpeg library from this archive
August 25, 2011
+ [kaori] added tid request support to JPIP client
+ [kaori] added quit JPIP server request
August 24, 2011
+ [kaori] added cachemodel_manager, which had been managed in target_manager previously
+ [kaori] added tid request support to JPIP server
August 16, 2011
* [antonin] fixed cmake support for openjpip
August 12, 2011
+ [antonin] added cmake support to openjpip
July 6, 2011
* [antonin] JPIP : fixed autotools to work with recent name changes
July 5, 2011
! [kaori] changed parameter, file names, message names regarding JPT-stream to JPIP-stream, which handles also JPP-stream
May 26, 2011
! [antonin] changed Makefile to Makefile.nix to avoid having autotools overwrite them.
May 23, 2011
+ [antonin] added autotools for the 'tools' directory
+ [antonin] added autotools as a build method for jpip (credit to Vincent Torri)
May 10, 2011
! [kaori] opj_viewer removed the xml functions (for users without Xersus2)
+ [kaori] renamed opj_viewer to opj_viewer_xerces ( needs Xersus2)
! [kaori] Modification of opj_dec_server to be portable to windows
May 9, 2011
* [kaori] Removal of c99 from the compile option (to be compatible to win platform) and bool definition in libopenjpip/bool.h
May 9, 2011
* [antonin] OpenJPIP: small bug fixes to compile on win platform
May 8, 2011
* [antonin] OpenJPIP: fixed several bugs in opj_server (removal of strsep function, duplication of query string) + some changes to compile opj_server under windows (replacement of strcasecmp(), bzero()).
April 14, 2011
+ [antonin] initial commit of OpenJPIP 1.0, a JPIP client-server architecture based on OpenJPEG (see README file in jpip directory for more details)

View File

@ -1,13 +0,0 @@
# required dep for server:
IF(BUILD_JPIP_SERVER)
FIND_PACKAGE(CURL REQUIRED)
FIND_PACKAGE(FCGI REQUIRED)
FIND_PACKAGE(PTHREAD REQUIRED)
ENDIF(BUILD_JPIP_SERVER)
# JPIP library:
ADD_SUBDIRECTORY(libopenjpip)
# JPIP binaries:
ADD_SUBDIRECTORY(util)

View File

@ -1,3 +0,0 @@
MAINTAINERCLEANFILES = Makefile.in
SUBDIRS = libopenjpip util

File diff suppressed because it is too large Load Diff

View File

@ -1,151 +0,0 @@
MAINTAINERCLEANFILES = Makefile.in
includesdir = $(includedir)/openjpeg-$(MAJOR_NR).$(MINOR_NR)
includes_HEADERS =
lib_LTLIBRARIES =
if WANT_JPIP
lib_LTLIBRARIES += libopenjpip_local.la
endif
if WANT_JPIP_SERVER
lib_LTLIBRARIES += libopenjpip_server.la
endif
JPIP_SRC = \
openjpip.c \
query_parser.c \
channel_manager.c \
session_manager.c \
jpip_parser.c \
boxheader_manager.c \
codestream_manager.c \
imgreg_manager.c \
marker_manager.c \
msgqueue_manager.c \
box_manager.c \
faixbox_manager.c \
index_manager.c \
metadata_manager.c \
placeholder_manager.c \
byte_manager.c \
ihdrbox_manager.c \
manfbox_manager.c \
mhixbox_manager.c \
target_manager.c \
cachemodel_manager.c \
j2kheader_manager.c \
jp2k_encoder.c \
sock_manager.c \
openjpip.h \
bool.h \
boxheader_manager.h \
box_manager.h \
byte_manager.h \
codestream_manager.h \
faixbox_manager.h \
ihdrbox_manager.h \
imgreg_manager.h \
index_manager.h \
manfbox_manager.h \
marker_manager.h \
metadata_manager.h \
mhixbox_manager.h \
msgqueue_manager.h \
placeholder_manager.h \
target_manager.h \
cachemodel_manager.h \
j2kheader_manager.h \
jp2k_encoder.h \
query_parser.h \
channel_manager.h \
session_manager.h \
jpip_parser.h \
jp2k_decoder.h \
sock_manager.h
SERVER_SRC = auxtrans_manager.c \
auxtrans_manager.h
LOCAL_SRC = jp2k_decoder.c \
imgsock_manager.c \
jpipstream_manager.c \
cache_manager.c \
dec_clientmsg_handler.c \
imgsock_manager.h \
jpipstream_manager.h \
cache_manager.h \
dec_clientmsg_handler.h
libopenjpip_server_la_CPPFLAGS = \
-I. \
-I$(top_srcdir)/applications/jpip/libopenjpip \
-I$(top_builddir)/applications/jpip/libopenjpip \
@FCGI_CFLAGS@ \
@LIBCURL_CFLAGS@ \
-DSERVER
libopenjpip_server_la_CFLAGS = @THREAD_CFLAGS@
libopenjpip_server_la_LIBADD = @FCGI_LIBS@ @LIBCURL_LIBS@ @THREAD_LIBS@ -lm
libopenjpip_server_la_LDFLAGS = -no-undefined -version-info @lt_version@
libopenjpip_server_la_SOURCES = $(JPIP_SRC) $(SERVER_SRC)
libopenjpip_local_la_CPPFLAGS = \
-I. \
-I$(top_srcdir)/libopenjpeg \
-I$(top_builddir)/libopenjpeg \
-I$(top_srcdir)/applications/jpip/libopenjpip \
-I$(top_builddir)/applications/jpip/libopenjpip \
@LIBCURL_CFLAGS@
libopenjpip_local_la_CFLAGS =
libopenjpip_local_la_LIBADD = $(top_builddir)/libopenjpeg/libopenjpeg.la -lm
libopenjpip_local_la_LDFLAGS = -no-undefined -version-info @lt_version@
libopenjpip_local_la_SOURCES = $(JPIP_SRC) $(LOCAL_SRC)
install-data-hook:
if WANT_JPIP_SERVER
@echo -e " (LA)\t$(libdir)/libopenjpip_server.la" >> $(top_builddir)/report.txt
if BUILD_SHARED
@( $(call solist_s) ) >> $(top_builddir)/report.txt
endif
if BUILD_STATIC
@echo -e " (A)\t$(base_s)/$(a_s)" >> $(top_builddir)/report.txt
endif
endif
if WANT_JPIP
@echo -e " (LA)\t$(libdir)/libopenjpip_local.la" >> $(top_builddir)/report.txt
if BUILD_SHARED
@( $(call solist_c) ) >> $(top_builddir)/report.txt
endif
if BUILD_STATIC
@echo -e " (A)\t$(base_c)/$(a_c)" >> $(top_builddir)/report.txt
endif
endif
solist_s = $(foreach f, $(dll_s) $(so_s), echo -e ' $(SO_PREFIX)\t$(base_s)/$(f)' ;)
get_tok_s = $(shell grep -E "^$(1)=" libopenjpip_server.la | cut -d "'" -f 2)
base_s = $(call get_tok_s,libdir)
so_s = $(call get_tok_s,library_names)
a_s = $(call get_tok_s,old_library)
solist_c = $(foreach f, $(dll_c) $(so_c), echo -e ' $(SO_PREFIX)\t$(base_c)/$(f)' ;)
get_tok_c = $(shell grep -E "^$(1)=" libopenjpip_local.la | cut -d "'" -f 2)
base_c = $(call get_tok_c,libdir)
so_c = $(call get_tok_c,library_names)
a_c = $(call get_tok_c,old_library)
if HAVE_WIN32
SO_PREFIX = (DLL)
dll_s = $(call get_tok_s,dlname)
dll_c = $(call get_tok_c,dlname)
else
if HAVE_DARWIN
SO_PREFIX = (DY)
dll_s =
dll_c =
else
SO_PREFIX = (SO)
dll_s =
dll_c =
endif
endif

View File

@ -1,29 +0,0 @@
ifdef jpipserver
CFLAGS = -O3 -Wall -m32 -DSERVER
LIBNAME = libopenjpip_server.a
else
J2KINCDIR = ../../../libopenjpeg
CFLAGS = -O3 -Wall -I$(J2KINCDIR)
LIBNAME = libopenjpip_local.a
endif
all: $(LIBNAME)
ifdef jpipserver
$(LIBNAME): openjpip.o target_manager.o byte_manager.o box_manager.o boxheader_manager.o manfbox_manager.o \
mhixbox_manager.o marker_manager.o codestream_manager.o faixbox_manager.o index_manager.o \
msgqueue_manager.o metadata_manager.o placeholder_manager.o ihdrbox_manager.o imgreg_manager.o \
cachemodel_manager.o j2kheader_manager.o jp2k_encoder.o query_parser.o channel_manager.o \
session_manager.o jpip_parser.o sock_manager.o auxtrans_manager.o
ar r $@ $^
else
$(LIBNAME): openjpip.o target_manager.o byte_manager.o box_manager.o boxheader_manager.o manfbox_manager.o \
mhixbox_manager.o marker_manager.o codestream_manager.o faixbox_manager.o index_manager.o \
msgqueue_manager.o metadata_manager.o placeholder_manager.o ihdrbox_manager.o imgreg_manager.o \
cachemodel_manager.o j2kheader_manager.o jp2k_encoder.o query_parser.o channel_manager.o \
session_manager.o jpip_parser.o jp2k_decoder.o imgsock_manager.o jpipstream_manager.o cache_manager.o \
dec_clientmsg_handler.o sock_manager.o
ar r $@ $^
endif
clean:
rm -f $(LIBNAME) *.o *~

View File

@ -1,127 +0,0 @@
# Headers file are located here:
INCLUDE_DIRECTORIES(
${OPENJPEG_SOURCE_DIR}/applications/jpip/libopenjpip
${FCGI_INCLUDE_DIRS}
)
IF(BUILD_JPIP_SERVER)
SET(OPJ_SERVER_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/opj_server.c
)
# Build executable
ADD_EXECUTABLE(opj_server ${OPJ_SERVER_SRCS})
TARGET_LINK_LIBRARIES(opj_server openjpip_server)
SET_PROPERTY(
TARGET opj_server
APPEND PROPERTY
COMPILE_DEFINITIONS SERVER QUIT_SIGNAL="quitJPIP"
)
# On unix you need to link to the math library:
IF(UNIX)
TARGET_LINK_LIBRARIES(opj_server m)
ENDIF(UNIX)
# Install exe
INSTALL(TARGETS opj_server
EXPORT OpenJPEGTargets
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
)
ENDIF(BUILD_JPIP_SERVER)
SET(EXES
opj_dec_server
jpip_to_jp2
jpip_to_j2k
test_index
)
FOREACH(exe ${EXES})
ADD_EXECUTABLE(${exe} ${exe}.c)
TARGET_LINK_LIBRARIES(${exe} openjpip_local)
INSTALL(TARGETS ${exe}
EXPORT OpenJPEGTargets
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
)
ENDFOREACH(exe)
# Build the two java clients:
FIND_PACKAGE(Java 1.5 REQUIRED) # javac, jar
# 1. opj_viewer
# build dep list:
file(GLOB java1_srcs "opj_viewer/src/*.java")
# make sure target javac dir exists:
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/classes1)
# Build java
ADD_CUSTOM_COMMAND(
OUTPUT ${LIBRARY_OUTPUT_PATH}/opj_viewer.jar
COMMAND ${Java_JAVAC_EXECUTABLE}
${java1_srcs} -d ${CMAKE_CURRENT_BINARY_DIR}/classes1
COMMAND ${Java_JAR_EXECUTABLE} cfm ${LIBRARY_OUTPUT_PATH}/opj_viewer.jar
${CMAKE_CURRENT_SOURCE_DIR}/opj_viewer/dist/manifest.txt -C
${CMAKE_CURRENT_BINARY_DIR}/classes1 .
DEPENDS ${java1_srcs}
${CMAKE_CURRENT_SOURCE_DIR}/opj_viewer/dist/manifest.txt
COMMENT "javac *.java; jar cvf -> opj_viewer.jar"
)
# name the target
ADD_CUSTOM_TARGET(OPJViewerJar ALL
DEPENDS ${LIBRARY_OUTPUT_PATH}/opj_viewer.jar
COMMENT "building opj_viewer.jar"
)
# 2. opj_viewer_xerces
# search for package org.apache.xerces.parsers
find_file(APACHE_XERCES_JAR
NAMES xerces-j2.jar xercesImpl.jar
PATHS /usr/share/java/
NO_DEFAULT_PATH
)
mark_as_advanced(APACHE_XERCES_JAR)
if(EXISTS ${APACHE_XERCES_JAR})
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/opj_viewer_xerces/dist/manifest.txt.in
${CMAKE_CURRENT_BINARY_DIR}/opj_viewer_xerces/dist/manifest.txt
@ONLY
)
# build dep list:
file(GLOB java2_srcs "opj_viewer_xerces/src/*.java")
# Need some common files:
list(APPEND java2_srcs
${CMAKE_CURRENT_SOURCE_DIR}/opj_viewer/src/ImageManager.java
${CMAKE_CURRENT_SOURCE_DIR}/opj_viewer/src/ImgdecClient.java
${CMAKE_CURRENT_SOURCE_DIR}/opj_viewer/src/JPIPHttpClient.java
${CMAKE_CURRENT_SOURCE_DIR}/opj_viewer/src/MML.java
${CMAKE_CURRENT_SOURCE_DIR}/opj_viewer/src/PnmImage.java
${CMAKE_CURRENT_SOURCE_DIR}/opj_viewer/src/RegimViewer.java
${CMAKE_CURRENT_SOURCE_DIR}/opj_viewer/src/ResizeListener.java
)
# make sure target javac dir exists:
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/classes2)
# Build java
ADD_CUSTOM_COMMAND(
OUTPUT ${LIBRARY_OUTPUT_PATH}/opj_viewer_xerces.jar
COMMAND ${Java_JAVAC_EXECUTABLE}
-classpath ${APACHE_XERCES_JAR}
${java2_srcs} -d ${CMAKE_CURRENT_BINARY_DIR}/classes2
COMMAND ${Java_JAR_EXECUTABLE} cfm ${LIBRARY_OUTPUT_PATH}/opj_viewer_xerces.jar
${CMAKE_CURRENT_BINARY_DIR}/opj_viewer_xerces/dist/manifest.txt
-C ${CMAKE_CURRENT_BINARY_DIR}/classes2 .
DEPENDS ${java2_srcs}
${CMAKE_CURRENT_SOURCE_DIR}/opj_viewer_xerces/dist/manifest.txt.in
COMMENT "javac *.java; jar cvf -> opj_viewer_xerces.jar"
)
# name the target
ADD_CUSTOM_TARGET(OPJViewerXercesJar ALL
DEPENDS ${LIBRARY_OUTPUT_PATH}/opj_viewer_xerces.jar
COMMENT "building opj_viewer_xerces.jar"
)
endif()

View File

@ -1,75 +0,0 @@
MAINTAINERCLEANFILES = Makefile.in
bin_PROGRAMS =
if WANT_JPIP
bin_PROGRAMS += opj_dec_server test_index jpip_to_j2k jpip_to_jp2
endif
if WANT_JPIP_SERVER
bin_PROGRAMS += opj_server
endif
opj_server_CPPFLAGS = \
@FCGI_CFLAGS@ \
-I. \
-I$(top_srcdir)/applications/jpip/libopenjpip \
-I$(top_builddir)/applications/jpip/libopenjpip \
-DSERVER \
-DQUIT_SIGNAL=\"quitJPIP\"
#
opj_server_LDADD = $(top_builddir)/applications/jpip/libopenjpip/libopenjpip_server.la @FCGI_LIBS@ -lm
#
opj_server_SOURCES = opj_server.c
#-------------
opj_dec_server_CPPFLAGS = \
-I. \
-I$(top_srcdir)/applications/jpip/libopenjpip \
-I$(top_builddir)/applications/jpip/libopenjpip
#
opj_dec_server_CFLAGS =
opj_dec_server_LDADD = $(top_builddir)/applications/jpip/libopenjpip/libopenjpip_local.la
opj_dec_server_SOURCES = opj_dec_server.c
#-------------
jpip_to_jp2_CPPFLAGS = \
-I. \
-I$(top_srcdir)/applications/jpip/libopenjpip \
-I$(top_builddir)/applications/jpip/libopenjpip
#
jpip_to_jp2_CFLAGS =
jpip_to_jp2_LDADD = $(top_builddir)/applications/jpip/libopenjpip/libopenjpip_local.la
jpip_to_jp2_SOURCES = jpip_to_jp2.c
#-------------
jpip_to_j2k_CPPFLAGS = \
-I. \
-I$(top_srcdir)/applications/jpip/libopenjpip \
-I$(top_builddir)/applications/jpip/libopenjpip
#
jpip_to_j2k_CFLAGS =
jpip_to_j2k_LDADD = $(top_builddir)/applications/jpip/libopenjpip/libopenjpip_local.la
jpip_to_j2k_SOURCES = jpip_to_j2k.c
#-------------
test_index_CPPFLAGS = \
-I. \
-I$(top_srcdir)/applications/jpip/libopenjpip \
-I$(top_builddir)/applications/jpip/libopenjpip
#
test_index_CFLAGS =
test_index_LDADD = $(top_builddir)/applications/jpip/libopenjpip/libopenjpip_local.la
test_index_SOURCES = test_index.c
#-------------
install-data-hook:
if WANT_JPIP_SERVER
@echo -e " (B)\t$(bindir)/opj_server$(EXEEXT)" >> $(top_builddir)/report.txt
endif
if WANT_JPIP
@echo -e " (B)\t$(bindir)/opj_dec_server$(EXEEXT)" >> $(top_builddir)/report.txt
@echo -e " (B)\t$(bindir)/jpip_to_jp2$(EXEEXT)" >> $(top_builddir)/report.txt
@echo -e " (B)\t$(bindir)/jpip_to_j2k$(EXEEXT)" >> $(top_builddir)/report.txt
@echo -e " (B)\t$(bindir)/test_index$(EXEEXT)" >> $(top_builddir)/report.txt
endif

View File

@ -1,93 +0,0 @@
# Makefile for the MJ2 codecs of the OpenJPEG library: frames_to_mj2, mj2_to_frames, extract_j2k_from_mj2 and wrap_j2k_in_mj2
SET(common_SRCS ${OPENJPEG_SOURCE_DIR}/applications/common/opj_getopt.c)
# While mj2 executables do not use the API correctly, we do not link with the library but rather compile the sources files.
SET(OPJ_SRCS
${OPENJPEG_SOURCE_DIR}/libopenjpeg/bio.c
${OPENJPEG_SOURCE_DIR}/libopenjpeg/cio.c
${OPENJPEG_SOURCE_DIR}/libopenjpeg/dwt.c
${OPENJPEG_SOURCE_DIR}/libopenjpeg/event.c
${OPENJPEG_SOURCE_DIR}/libopenjpeg/image.c
${OPENJPEG_SOURCE_DIR}/libopenjpeg/j2k.c
${OPENJPEG_SOURCE_DIR}/libopenjpeg/j2k_lib.c
${OPENJPEG_SOURCE_DIR}/libopenjpeg/jp2.c
${OPENJPEG_SOURCE_DIR}/libopenjpeg/jpt.c
${OPENJPEG_SOURCE_DIR}/libopenjpeg/mct.c
${OPENJPEG_SOURCE_DIR}/libopenjpeg/mqc.c
${OPENJPEG_SOURCE_DIR}/libopenjpeg/openjpeg.c
${OPENJPEG_SOURCE_DIR}/libopenjpeg/pi.c
${OPENJPEG_SOURCE_DIR}/libopenjpeg/raw.c
${OPENJPEG_SOURCE_DIR}/libopenjpeg/t1.c
${OPENJPEG_SOURCE_DIR}/libopenjpeg/t2.c
${OPENJPEG_SOURCE_DIR}/libopenjpeg/tcd.c
${OPENJPEG_SOURCE_DIR}/libopenjpeg/tgt.c
${OPENJPEG_SOURCE_DIR}/libopenjpeg/cidx_manager.c
${OPENJPEG_SOURCE_DIR}/libopenjpeg/phix_manager.c
${OPENJPEG_SOURCE_DIR}/libopenjpeg/ppix_manager.c
${OPENJPEG_SOURCE_DIR}/libopenjpeg/thix_manager.c
${OPENJPEG_SOURCE_DIR}/libopenjpeg/tpix_manager.c
)
SET(MJ2_SRCS mj2.c mj2_convert.c)
IF(WIN32)
ADD_DEFINITIONS(-DOPJ_STATIC)
ENDIF(WIN32)
# Headers file are located here:
INCLUDE_DIRECTORIES(
${OPENJPEG_SOURCE_DIR}/libopenjpeg
${OPENJPEG_SOURCE_DIR}/applications/common
${LCMS_INCLUDE_DIRNAME}
)
ADD_EXECUTABLE(frames_to_mj2
frames_to_mj2.c
${common_SRCS}
${OPJ_SRCS}
${MJ2_SRCS}
)
TARGET_LINK_LIBRARIES(frames_to_mj2 ${LCMS_LIBNAME})
IF(UNIX)
TARGET_LINK_LIBRARIES(frames_to_mj2 m)
ENDIF(UNIX)
ADD_EXECUTABLE(mj2_to_frames
mj2_to_frames.c
${common_SRCS}
${OPJ_SRCS}
${MJ2_SRCS}
${OPENJPEG_SOURCE_DIR}/applications/common/color.c
)
TARGET_LINK_LIBRARIES(mj2_to_frames ${LCMS_LIBNAME})
IF(UNIX)
TARGET_LINK_LIBRARIES(mj2_to_frames m)
ENDIF(UNIX)
ADD_EXECUTABLE(extract_j2k_from_mj2
extract_j2k_from_mj2.c
${OPJ_SRCS}
${MJ2_SRCS}
)
TARGET_LINK_LIBRARIES(extract_j2k_from_mj2 ${LCMS_LIBNAME})
IF(UNIX)
TARGET_LINK_LIBRARIES(extract_j2k_from_mj2 m)
ENDIF(UNIX)
ADD_EXECUTABLE(wrap_j2k_in_mj2
wrap_j2k_in_mj2.c
${OPJ_SRCS}
${MJ2_SRCS}
)
TARGET_LINK_LIBRARIES(wrap_j2k_in_mj2 ${LCMS_LIBNAME})
IF(UNIX)
TARGET_LINK_LIBRARIES(wrap_j2k_in_mj2 m)
ENDIF(UNIX)
INSTALL(TARGETS frames_to_mj2 mj2_to_frames extract_j2k_from_mj2 wrap_j2k_in_mj2
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR})

View File

@ -1,110 +0,0 @@
MAINTAINERCLEANFILES = Makefile.in
OPJ_SRC = \
../../libopenjpeg/bio.c \
../../libopenjpeg/cio.c \
../../libopenjpeg/dwt.c \
../../libopenjpeg/event.c \
../../libopenjpeg/image.c \
../../libopenjpeg/j2k.c \
../../libopenjpeg/j2k_lib.c \
../../libopenjpeg/jp2.c \
../../libopenjpeg/jpt.c \
../../libopenjpeg/mct.c \
../../libopenjpeg/mqc.c \
../../libopenjpeg/openjpeg.c \
../../libopenjpeg/pi.c \
../../libopenjpeg/raw.c \
../../libopenjpeg/t1.c \
../../libopenjpeg/t2.c \
../../libopenjpeg/tcd.c \
../../libopenjpeg/tgt.c \
../../libopenjpeg/cidx_manager.c \
../../libopenjpeg/phix_manager.c \
../../libopenjpeg/ppix_manager.c \
../../libopenjpeg/thix_manager.c \
../../libopenjpeg/tpix_manager.c
bin_PROGRAMS = \
frames_to_mj2 \
mj2_to_frames \
extract_j2k_from_mj2 \
wrap_j2k_in_mj2
frames_to_mj2_CPPFLAGS = \
-I. \
-I$(top_srcdir)/applications/common \
-I$(top_builddir)/applications/common \
-I$(top_srcdir)/libopenjpeg \
-I$(top_builddir)/libopenjpeg \
-DOPJ_STATIC
frames_to_mj2_CFLAGS =
frames_to_mj2_LDADD = -lm
frames_to_mj2_SOURCES = \
$(OPJ_SRC) \
../common/opj_getopt.c \
mj2_convert.c \
mj2.c \
frames_to_mj2.c \
mj2.h \
mj2_convert.h
mj2_to_frames_CPPFLAGS = \
-I. \
-I$(top_srcdir)/applications/common \
-I$(top_builddir)/applications/common \
-I$(top_srcdir)/libopenjpeg \
-I$(top_builddir)/libopenjpeg \
@LCMS2_CFLAGS@ \
@LCMS1_CFLAGS@ \
-DOPJ_STATIC
mj2_to_frames_CFLAGS =
mj2_to_frames_LDADD = @LCMS2_LIBS@ @LCMS1_LIBS@ -lm
mj2_to_frames_SOURCES = \
$(OPJ_SRC) \
../common/color.c \
../common/opj_getopt.c \
mj2_convert.c \
mj2.c \
mj2_to_frames.c \
mj2.h \
mj2_convert.h
extract_j2k_from_mj2_CPPFLAGS = \
-I. \
-I$(top_srcdir)/applications/common \
-I$(top_builddir)/applications/common \
-I$(top_srcdir)/libopenjpeg \
-I$(top_builddir)/libopenjpeg \
-DOPJ_STATIC
extract_j2k_from_mj2_CFLAGS =
extract_j2k_from_mj2_LDADD = -lm
extract_j2k_from_mj2_SOURCES = \
$(OPJ_SRC) \
mj2.c \
extract_j2k_from_mj2.c \
mj2.h
wrap_j2k_in_mj2_CPPFLAGS = \
-I. \
-I$(top_srcdir)/applications/common \
-I$(top_builddir)/applications/common \
-I$(top_srcdir)/libopenjpeg \
-I$(top_builddir)/libopenjpeg \
-DOPJ_STATIC
wrap_j2k_in_mj2_CFLAGS =
wrap_j2k_in_mj2_LDADD = -lm
wrap_j2k_in_mj2_SOURCES = \
$(OPJ_SRC) \
mj2.c \
wrap_j2k_in_mj2.c \
mj2.h
EXTRA_DIST = \
CMakeLists.txt
install-data-hook:
@echo -e " (B)\t$(bindir)/frames_to_mj2$(EXEEXT)" >> $(top_builddir)/report.txt
@echo -e " (B)\t$(bindir)/mj2_to_frames$(EXEEXT)" >> $(top_builddir)/report.txt
@echo -e " (B)\t$(bindir)/extract_j2k_from_mj2$(EXEEXT)" >> $(top_builddir)/report.txt
@echo -e " (B)\t$(bindir)/wrap_j2k_in_mj2$(EXEEXT)" >> $(top_builddir)/report.txt

38
appveyor.yml Normal file
View File

@ -0,0 +1,38 @@
version: 2.1.1.{build}
branches:
except:
- coverity_scan
skip_tags: false
clone_depth: 50
environment:
matrix:
- OPJ_CI_ARCH: x86
OPJ_CI_VSCOMNTOOLS: $(VS140COMNTOOLS)
OPJ_CI_INCLUDE_IF_DEPLOY: 1
- OPJ_CI_ARCH: x64
OPJ_CI_VSCOMNTOOLS: $(VS140COMNTOOLS)
OPJ_CI_INCLUDE_IF_DEPLOY: 1
- OPJ_CI_ARCH: x86
OPJ_CI_VSCOMNTOOLS: $(VS100COMNTOOLS)
install:
- cmd: c:\cygwin\bin\bash ./tools/travis-ci/install.sh
build_script:
- cmd: >-
"%OPJ_CI_VSCOMNTOOLS%..\..\VC\vcvarsall.bat" %OPJ_CI_ARCH%
bash ./tools/travis-ci/run.sh
test: off
#before_deploy:
#- cmd: c:\cygwin\bin\bash ./tools/travis-ci/before_deploy.sh
deploy:
#release: openjpeg-$(appveyor_repo_tag_name)
description: 'OpenJPEG $(appveyor_repo_tag_name) has been released. More info [here](https://github.com/uclouvain/openjpeg/blob/$(appveyor_repo_tag_name)/NEWS) and a detailed view [here](https://github.com/uclouvain/openjpeg/blob/$(appveyor_repo_tag_name)/CHANGES).'
provider: GitHub
auth_token:
secure: Huk03f1heCD/HMyA+4ZeVmICdmKn9rPxK5p8/KxzgL+FtJDHlqcllcCrtN9bDxRH # your encrypted token from GitHub
artifact: /.*\.zip/ # upload all zip packages to release assets
draft: false
prerelease: false
on:
appveyor_repo_tag: true # deploy on tag push only
OPJ_CI_INCLUDE_IF_DEPLOY: 1

View File

@ -1,3 +0,0 @@
#!/bin/sh
autoreconf --install --force

View File

@ -8,11 +8,11 @@
# #
#---------------------------------------------------------------------- #----------------------------------------------------------------------
SET(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 1000000) set(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 1000000)
SET(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS 50) set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS 50)
SET(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 2000) set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 2000)
SET(CTEST_CUSTOM_COVERAGE_EXCLUDE set(CTEST_CUSTOM_COVERAGE_EXCLUDE
${CTEST_CUSTOM_COVERAGE_EXCLUDE} ${CTEST_CUSTOM_COVERAGE_EXCLUDE}
# Exclude files from the Testing directories # Exclude files from the Testing directories
@ -22,11 +22,19 @@ SET(CTEST_CUSTOM_COVERAGE_EXCLUDE
".*/thirdparty/.*" ".*/thirdparty/.*"
) )
SET(CTEST_CUSTOM_WARNING_EXCEPTION set(CTEST_CUSTOM_WARNING_EXCEPTION
${CTEST_CUSTOM_WARNING_EXCEPTION} ${CTEST_CUSTOM_WARNING_EXCEPTION}
# Ignore clang's summary warning, assuming prior text has matched some
# other warning expression:
"[0-9,]+ warnings? generated."
# Suppress warning caused by intentional messages about deprecation # Suppress warning caused by intentional messages about deprecation
".*warning,.* is deprecated" ".*warning,.* is deprecated"
# supress warnings caused by 3rd party libs: # java also warns about deprecated API
".*/thirdparty/.*" ".*java.*deprecation"
".*deprecation.*"
# suppress warnings caused by 3rd party libs:
".*thirdparty.*"
"libtiff.*has no symbols"
"libpng.*has no symbols"
) )

View File

@ -0,0 +1,26 @@
# Ensure that an include file is provided by the system
# Add the check about the mandatory status to the check_include_file macro
# provided by cmake
include (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
macro(ensure_file_include INCLUDE_FILENAME VARIABLE_NAME MANDATORY_STATUS)
#message(WARNING "INCLUDE_FILENAME=${INCLUDE_FILENAME} \n"
# "VARIABLE_NAME=${VARIABLE_NAME} \n"
# "MANDATORY_STATUS=${MANDATORY_STATUS}")
CHECK_INCLUDE_FILE(${INCLUDE_FILENAME} ${VARIABLE_NAME})
#message(WARNING "INCLUDE_FILENAME=${INCLUDE_FILENAME} \n"
# "VARIABLE_NAME=${VARIABLE_NAME} \n"
# "VARIABLE_NAME_VALUE=${${VARIABLE_NAME}} \n"
# "MANDATORY_STATUS=${MANDATORY_STATUS}")
if (NOT ${${VARIABLE_NAME}})
if (${MANDATORY_STATUS})
message(FATAL_ERROR "The file ${INCLUDE_FILENAME} is mandatory but not found on your system")
endif()
endif()
endmacro()

16
cmake/FindCPPCHECK.cmake Normal file
View File

@ -0,0 +1,16 @@
# cppcheck
#
# Copyright (c) 2011 Mathieu Malaterre <mathieu.malaterre@gmail.com>
#
# Redistribution and use is allowed according to the terms of the New
# BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
find_program(CPPCHECK_EXECUTABLE
cppcheck
)
mark_as_advanced(
CPPCHECK_EXECUTABLE
)

20
cmake/FindFCGI.cmake Normal file
View File

@ -0,0 +1,20 @@
# Look for the header file.
find_path(FCGI_INCLUDE_DIR NAMES fastcgi.h)
# Look for the library.
find_library(FCGI_LIBRARY NAMES fcgi)
# Handle the QUIETLY and REQUIRED arguments and set FCGI_FOUND to TRUE if all listed variables are TRUE.
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(FCGI DEFAULT_MSG FCGI_LIBRARY FCGI_INCLUDE_DIR)
# Copy the results to the output variables.
if(FCGI_FOUND)
set(FCGI_LIBRARIES ${FCGI_LIBRARY})
set(FCGI_INCLUDE_DIRS ${FCGI_INCLUDE_DIR})
else()
set(FCGI_LIBRARIES)
set(FCGI_INCLUDE_DIRS)
endif()
mark_as_advanced(FCGI_INCLUDE_DIR FCGI_LIBRARY)

12
cmake/FindJPYLYZER.cmake Normal file
View File

@ -0,0 +1,12 @@
#
# this module looks for JPYLYZER
# http://jpylyzer.openpreservation.org
#
find_program(JPYLYZER_EXECUTABLE
jpylyzer
)
mark_as_advanced(
JPYLYZER_EXECUTABLE
)

View File

@ -1,19 +1,24 @@
# #
# this module looks for KAKADu # this module looks for KAKADU
# http://www.kakadusoftware.com/ # http://www.kakadusoftware.com/
# #
# #
# Copyright (c) 2006-2011 Mathieu Malaterre <mathieu.malaterre@gmail.com> # Copyright (c) 2006-2014 Mathieu Malaterre <mathieu.malaterre@gmail.com>
# #
# Redistribution and use is allowed according to the terms of the New # Redistribution and use is allowed according to the terms of the New
# BSD license. # BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file. # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
# #
FIND_PROGRAM(KDU_EXPAND_EXECUTABLE find_program(KDU_EXPAND_EXECUTABLE
kdu_expand kdu_expand
) )
MARK_AS_ADVANCED( find_program(KDU_COMPRESS_EXECUTABLE
KDU_EXPAND_EXECUTABLE kdu_compress
)
mark_as_advanced(
KDU_EXPAND_EXECUTABLE
KDU_COMPRESS_EXECUTABLE
) )

View File

@ -12,20 +12,20 @@
#============================================================================= #=============================================================================
#============================================================================= #=============================================================================
FIND_PATH(LCMS_INCLUDE_DIR lcms.h PATHS /usr/include /usr/local/include /opt/include /opt/local/include) find_path(LCMS_INCLUDE_DIR lcms.h PATHS /usr/include /usr/local/include /opt/include /opt/local/include)
SET(LCMS_NAMES ${LCMS_NAMES} lcms liblcms liblcms_static) set(LCMS_NAMES ${LCMS_NAMES} lcms liblcms liblcms_static)
FIND_LIBRARY(LCMS_LIBRARY NAMES ${LCMS_NAMES} ) find_library(LCMS_LIBRARY NAMES ${LCMS_NAMES} )
MARK_AS_ADVANCED(LCMS_INCLUDE_DIR LCMS_LIBRARY) mark_as_advanced(LCMS_INCLUDE_DIR LCMS_LIBRARY)
# handle the QUIETLY and REQUIRED arguments and set LCMS_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set LCMS_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LCMS DEFAULT_MSG LCMS_LIBRARY LCMS_INCLUDE_DIR) FIND_PACKAGE_HANDLE_STANDARD_ARGS(LCMS DEFAULT_MSG LCMS_LIBRARY LCMS_INCLUDE_DIR)
IF(LCMS_FOUND) if(LCMS_FOUND)
SET( LCMS_INCLUDE_DIRS ${LCMS_INCLUDE_DIR}) set( LCMS_INCLUDE_DIRS ${LCMS_INCLUDE_DIR})
SET( LCMS_LIBRARIES ${LCMS_LIBRARY} ) set( LCMS_LIBRARIES ${LCMS_LIBRARY} )
ENDIF(LCMS_FOUND) endif()

View File

@ -12,20 +12,20 @@
#============================================================================= #=============================================================================
#============================================================================= #=============================================================================
FIND_PATH(LCMS2_INCLUDE_DIR lcms2.h PATHS /usr/include /usr/local/include /opt/include /opt/local/include) find_path(LCMS2_INCLUDE_DIR lcms2.h PATHS /usr/include /usr/local/include /opt/include /opt/local/include)
SET(LCMS2_NAMES ${LCMS2_NAMES} lcms2 liblcms2 liblcms2_static) set(LCMS2_NAMES ${LCMS2_NAMES} lcms2 liblcms2 liblcms2_static)
FIND_LIBRARY(LCMS2_LIBRARY NAMES ${LCMS2_NAMES} ) find_library(LCMS2_LIBRARY NAMES ${LCMS2_NAMES} )
MARK_AS_ADVANCED(LCMS2_INCLUDE_DIR LCMS2_LIBRARY) mark_as_advanced(LCMS2_INCLUDE_DIR LCMS2_LIBRARY)
# handle the QUIETLY and REQUIRED arguments and set LCMS2_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set LCMS2_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LCMS2 DEFAULT_MSG LCMS2_LIBRARY LCMS2_INCLUDE_DIR) FIND_PACKAGE_HANDLE_STANDARD_ARGS(LCMS2 DEFAULT_MSG LCMS2_LIBRARY LCMS2_INCLUDE_DIR)
IF(LCMS2_FOUND) if(LCMS2_FOUND)
SET( LCMS2_INCLUDE_DIRS ${LCMS2_INCLUDE_DIR}) set( LCMS2_INCLUDE_DIRS ${LCMS2_INCLUDE_DIR})
SET( LCMS2_LIBRARIES ${LCMS2_LIBRARY} ) set( LCMS2_LIBRARIES ${LCMS2_LIBRARY} )
ENDIF(LCMS2_FOUND) endif()

View File

@ -7,7 +7,7 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON) set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
endif() endif()
include(${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake) include(${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake)
endif(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake") endif()
set(OPJ_PACKAGE_DESCRIPTION_SUMMARY "OpenJPEG - OpenJPEG a JPEG 2000 implementation.") set(OPJ_PACKAGE_DESCRIPTION_SUMMARY "OpenJPEG - OpenJPEG a JPEG 2000 implementation.")
set(OPJ_PACKAGE_CONTACT "openjpeg users <openjpeg@googlegroups.com>") set(OPJ_PACKAGE_CONTACT "openjpeg users <openjpeg@googlegroups.com>")
@ -28,43 +28,45 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
# Make this explicit here, rather than accepting the CPack default value, # Make this explicit here, rather than accepting the CPack default value,
# so we can refer to it: # so we can refer to it:
SET(CPACK_PACKAGE_NAME "${OPENJPEG_LIBRARY_NAME}") set(CPACK_PACKAGE_NAME "${OPENJPEG_LIBRARY_NAME}")
IF(NOT DEFINED CPACK_SYSTEM_NAME) if(NOT DEFINED CPACK_SYSTEM_NAME)
# make sure package is not Cygwin-unknown, for Cygwin just # make sure package is not Cygwin-unknown, for Cygwin just
# cygwin is good for the system name # cygwin is good for the system name
IF("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") if("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
SET(CPACK_SYSTEM_NAME Cygwin) set(CPACK_SYSTEM_NAME Cygwin)
ELSE("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") else()
SET(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}) set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
ENDIF("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") endif()
ENDIF(NOT DEFINED CPACK_SYSTEM_NAME) endif()
IF(${CPACK_SYSTEM_NAME} MATCHES Windows) if(${CPACK_SYSTEM_NAME} MATCHES Windows)
IF(CMAKE_CL_64) if(CMAKE_CL_64)
SET(CPACK_SYSTEM_NAME win64-x64) set(CPACK_SYSTEM_NAME win64-x64)
ELSE(CMAKE_CL_64) else()
SET(CPACK_SYSTEM_NAME win32-x86) set(CPACK_SYSTEM_NAME win32-x86)
ENDIF(CMAKE_CL_64) endif()
ENDIF(${CPACK_SYSTEM_NAME} MATCHES Windows) endif()
IF(NOT DEFINED CPACK_PACKAGE_FILE_NAME) if(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
# if the CPACK_PACKAGE_FILE_NAME is not defined by the cache # if the CPACK_PACKAGE_FILE_NAME is not defined by the cache
# default to source package - system, on cygwin system is not # default to source package - system, on cygwin system is not
# needed # needed
IF(CYGWIN) if(CYGWIN)
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}") set(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
ELSE(CYGWIN) else()
SET(CPACK_PACKAGE_FILE_NAME set(CPACK_PACKAGE_FILE_NAME
"${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}") "${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}")
ENDIF(CYGWIN) endif()
ENDIF(NOT DEFINED CPACK_PACKAGE_FILE_NAME) endif()
set(CPACK_BUNDLE_NAME "OpenJPEG ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}") set(CPACK_BUNDLE_NAME "OpenJPEG ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")
configure_file(${CMAKE_ROOT}/Templates/AppleInfo.plist if(APPLE)
${CMAKE_CURRENT_BINARY_DIR}/opj.plist) configure_file(${CMAKE_ROOT}/Templates/AppleInfo.plist
SET(CPACK_BUNDLE_PLIST ${CMAKE_CURRENT_BINARY_DIR}/opj.plist)
${CMAKE_CURRENT_BINARY_DIR}/opj.plist) set(CPACK_BUNDLE_PLIST
#include(BundleUtilities) ${CMAKE_CURRENT_BINARY_DIR}/opj.plist)
#include(BundleUtilities)
endif()
include(CPack) include(CPack)
endiF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") endiF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")

View File

@ -6,21 +6,21 @@
# module to load OPENJPEG's settings for an external project. # module to load OPENJPEG's settings for an external project.
@OPENJPEG_CONFIG_INSTALL_ONLY@ @OPENJPEG_CONFIG_INSTALL_ONLY@
# The OPENJPEG version number. # The OPENJPEG version number.
SET(OPENJPEG_MAJOR_VERSION "@OPENJPEG_VERSION_MAJOR@") set(OPENJPEG_MAJOR_VERSION "@OPENJPEG_VERSION_MAJOR@")
SET(OPENJPEG_MINOR_VERSION "@OPENJPEG_VERSION_MINOR@") set(OPENJPEG_MINOR_VERSION "@OPENJPEG_VERSION_MINOR@")
SET(OPENJPEG_BUILD_VERSION "@OPENJPEG_VERSION_BUILD@") set(OPENJPEG_BUILD_VERSION "@OPENJPEG_VERSION_BUILD@")
# The libraries. # The libraries.
SET(OPENJPEG_LIBRARIES "@OPENJPEG_LIBRARIES@") set(OPENJPEG_LIBRARIES "@OPENJPEG_LIBRARY_NAME@")
# The CMake macros dir. # The CMake macros dir.
SET(OPENJPEG_CMAKE_DIR "@OPENJPEG_CMAKE_DIR_CONFIG@") set(OPENJPEG_CMAKE_DIR "@OPENJPEG_INSTALL_PACKAGE_DIR@")
# The configuration options. # The configuration options.
SET(OPENJPEG_BUILD_SHARED_LIBS "@OPENJPEG_BUILD_SHARED_LIBS@") set(OPENJPEG_BUILD_SHARED_LIBS "@BUILD_SHARED_LIBS@")
# The "use" file. # The "use" file.
SET(OPENJPEG_USE_FILE "@OPENJPEG_USE_FILE_CONFIG@") set(OPENJPEG_USE_FILE "@OPENJPEG_USE_FILE_CONFIG@")
get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
if(EXISTS ${SELF_DIR}/OpenJPEGTargets.cmake) if(EXISTS ${SELF_DIR}/OpenJPEGTargets.cmake)
@ -29,20 +29,20 @@ if(EXISTS ${SELF_DIR}/OpenJPEGTargets.cmake)
get_filename_component(OPENJPEG_INCLUDE_ROOT "${SELF_DIR}/../../@OPENJPEG_INSTALL_INCLUDE_DIR@" ABSOLUTE) get_filename_component(OPENJPEG_INCLUDE_ROOT "${SELF_DIR}/../../@OPENJPEG_INSTALL_INCLUDE_DIR@" ABSOLUTE)
set(OPENJPEG_INCLUDE_DIRS ${OPENJPEG_INCLUDE_ROOT}) set(OPENJPEG_INCLUDE_DIRS ${OPENJPEG_INCLUDE_ROOT})
else(EXISTS ${SELF_DIR}/OpenJPEGTargets.cmake) else()
if(EXISTS ${SELF_DIR}/OpenJPEGExports.cmake) if(EXISTS ${SELF_DIR}/OpenJPEGExports.cmake)
# This is a build tree # This is a build tree
SET( OPENJPEG_INCLUDE_DIRS @OPENJPEG_INCLUDE_PATH@) set( OPENJPEG_INCLUDE_DIRS @OPENJPEG_INCLUDE_PATH@)
include(${SELF_DIR}/OpenJPEGExports.cmake) include(${SELF_DIR}/OpenJPEGExports.cmake)
else(EXISTS ${SELF_DIR}/OpenJPEGExports.cmake) else()
message(FATAL_ERROR "ooops") message(FATAL_ERROR "ooops")
endif(EXISTS ${SELF_DIR}/OpenJPEGExports.cmake) endif()
endif(EXISTS ${SELF_DIR}/OpenJPEGTargets.cmake) endif()
set(OPENJPEG_USE_FILE ${SELF_DIR}/UseOPENJPEG.cmake) set(OPENJPEG_USE_FILE ${SELF_DIR}/UseOPENJPEG.cmake)
# Backward compatible part: # Backward compatible part:
SET(OPENJPEG_FOUND TRUE) set(OPENJPEG_FOUND TRUE)

View File

@ -0,0 +1,11 @@
#include <sys/types.h>
/* Cause a compile-time error if off_t is smaller than 64 bits */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[ (LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1 ];
int main(int argc, char **argv)
{
return 0;
}

View File

@ -0,0 +1,23 @@
#cmakedefine _LARGEFILE_SOURCE
#cmakedefine _LARGE_FILES
#cmakedefine _FILE_OFFSET_BITS @_FILE_OFFSET_BITS@
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
/* Cause a compile-time error if off_t is smaller than 64 bits,
* and make sure we have ftello / fseeko.
*/
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[ (LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1 ];
FILE *fp = fopen(argv[0],"r");
off_t offset = ftello( fp );
fseeko( fp, offset, SEEK_CUR );
fclose(fp);
return 0;
}

134
cmake/TestLargeFiles.cmake Normal file
View File

@ -0,0 +1,134 @@
# - Define macro to check large file support
#
# OPJ_TEST_LARGE_FILES(VARIABLE)
#
# VARIABLE will be set to true if off_t is 64 bits, and fseeko/ftello present.
# This macro will also defines the necessary variable enable large file support, for instance
# _LARGE_FILES
# _LARGEFILE_SOURCE
# _FILE_OFFSET_BITS 64
# OPJ_HAVE_FSEEKO
#
# However, it is YOUR job to make sure these defines are set in a #cmakedefine so they
# end up in a config.h file that is included in your source if necessary!
#
# Adapted from Gromacs project (http://www.gromacs.org/)
# by Julien Malik
#
macro(OPJ_TEST_LARGE_FILES VARIABLE)
if(NOT DEFINED ${VARIABLE})
# On most platforms it is probably overkill to first test the flags for 64-bit off_t,
# and then separately fseeko. However, in the future we might have 128-bit filesystems
# (ZFS), so it might be dangerous to indiscriminately set e.g. _FILE_OFFSET_BITS=64.
message(STATUS "Checking for 64-bit off_t")
# First check without any special flags
try_compile(FILE64_OK "${PROJECT_BINARY_DIR}"
"${PROJECT_SOURCE_DIR}/cmake/TestFileOffsetBits.c")
if(FILE64_OK)
message(STATUS "Checking for 64-bit off_t - present")
endif()
if(NOT FILE64_OK)
# Test with _FILE_OFFSET_BITS=64
try_compile(FILE64_OK "${PROJECT_BINARY_DIR}"
"${PROJECT_SOURCE_DIR}/cmake/TestFileOffsetBits.c"
COMPILE_DEFINITIONS "-D_FILE_OFFSET_BITS=64" )
if(FILE64_OK)
message(STATUS "Checking for 64-bit off_t - present with _FILE_OFFSET_BITS=64")
set(_FILE_OFFSET_BITS 64)
endif()
endif()
if(NOT FILE64_OK)
# Test with _LARGE_FILES
try_compile(FILE64_OK "${PROJECT_BINARY_DIR}"
"${PROJECT_SOURCE_DIR}/cmake/TestFileOffsetBits.c"
COMPILE_DEFINITIONS "-D_LARGE_FILES" )
if(FILE64_OK)
message(STATUS "Checking for 64-bit off_t - present with _LARGE_FILES")
set(_LARGE_FILES 1)
endif()
endif()
if(NOT FILE64_OK)
# Test with _LARGEFILE_SOURCE
try_compile(FILE64_OK "${PROJECT_BINARY_DIR}"
"${PROJECT_SOURCE_DIR}/cmake/TestFileOffsetBits.c"
COMPILE_DEFINITIONS "-D_LARGEFILE_SOURCE" )
if(FILE64_OK)
message(STATUS "Checking for 64-bit off_t - present with _LARGEFILE_SOURCE")
set(_LARGEFILE_SOURCE 1)
endif()
endif()
#if(NOT FILE64_OK)
# # now check for Windows stuff
# try_compile(FILE64_OK "${PROJECT_BINARY_DIR}"
# "${PROJECT_SOURCE_DIR}/cmake/TestWindowsFSeek.c")
# if(FILE64_OK)
# message(STATUS "Checking for 64-bit off_t - present with _fseeki64")
# set(HAVE__FSEEKI64 1)
# endif()
#endif()
if(NOT FILE64_OK)
message(STATUS "Checking for 64-bit off_t - not present")
endif()
set(_FILE_OFFSET_BITS ${_FILE_OFFSET_BITS} CACHE INTERNAL "Result of test for needed _FILE_OFFSET_BITS=64")
set(_LARGE_FILES ${_LARGE_FILES} CACHE INTERNAL "Result of test for needed _LARGE_FILES")
set(_LARGEFILE_SOURCE ${_LARGEFILE_SOURCE} CACHE INTERNAL "Result of test for needed _LARGEFILE_SOURCE")
# Set the flags we might have determined to be required above
configure_file("${PROJECT_SOURCE_DIR}/cmake/TestLargeFiles.c.cmake.in"
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestLargeFiles.c")
message(STATUS "Checking for fseeko/ftello")
# Test if ftello/fseeko are available
try_compile(FSEEKO_COMPILE_OK
"${PROJECT_BINARY_DIR}"
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestLargeFiles.c")
if(FSEEKO_COMPILE_OK)
message(STATUS "Checking for fseeko/ftello - present")
endif()
if(NOT FSEEKO_COMPILE_OK)
# glibc 2.2 needs _LARGEFILE_SOURCE for fseeko (but not for 64-bit off_t...)
try_compile(FSEEKO_COMPILE_OK
"${PROJECT_BINARY_DIR}"
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestLargeFiles.c"
COMPILE_DEFINITIONS "-D_LARGEFILE_SOURCE" )
if(FSEEKO_COMPILE_OK)
message(STATUS "Checking for fseeko/ftello - present with _LARGEFILE_SOURCE")
set(_LARGEFILE_SOURCE ${_LARGEFILE_SOURCE} CACHE INTERNAL "Result of test for needed _LARGEFILE_SOURCE")
endif()
endif()
if(FSEEKO_COMPILE_OK)
set(OPJ_HAVE_FSEEKO ON CACHE INTERNAL "Result of test for fseeko/ftello")
else()
message(STATUS "Checking for fseeko/ftello - not found")
set(OPJ_HAVE_FSEEKO OFF CACHE INTERNAL "Result of test for fseeko/ftello")
endif()
if(FILE64_OK AND FSEEKO_COMPILE_OK)
message(STATUS "Large File support - found")
set(${VARIABLE} ON CACHE INTERNAL "Result of test for large file support")
else()
message(STATUS "Large File support - not found")
set(${VARIABLE} OFF CACHE INTERNAL "Result of test for large file support")
endif()
endif()
endmacro()

11
cmake/TestWindowsFSeek.c Normal file
View File

@ -0,0 +1,11 @@
#include <stdio.h>
int main()
{
__int64 off=0;
_fseeki64(NULL, off, SEEK_SET);
return 0;
}

View File

@ -0,0 +1,39 @@
{
<Appears with libpng uses with Ubuntu10.04 (hulk)>
Memcheck:Cond
fun:deflate
obj:/lib/libpng12.so.0.42.0
obj:/lib/libpng12.so.0.42.0
obj:/lib/libpng12.so.0.42.0
fun:png_write_row
fun:imagetopng
fun:main
}
{
<Appears with libpng uses with Ubuntu10.04 (hulk)>
Memcheck:Value8
fun:crc32
obj:/lib/libpng12.so.0.42.0
fun:png_write_chunk
obj:/lib/libpng12.so.0.42.0
obj:/lib/libpng12.so.0.42.0
obj:/lib/libpng12.so.0.42.0
obj:/lib/libpng12.so.0.42.0
fun:png_write_row
fun:imagetopng
fun:main
}
{
<Appears with libpng uses with Ubuntu10.04 (hulk)>
Memcheck:Param
write(buf)
fun:__write_nocancel
fun:_IO_file_write@@GLIBC_2.2.5
fun:_IO_do_write@@GLIBC_2.2.5
fun:_IO_file_close_it@@GLIBC_2.2.5
fun:fclose@@GLIBC_2.2.5
fun:imagetopng
fun:main
}

View File

@ -1,540 +0,0 @@
# According to http://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info :
#
# 1) when bugs are fixed or internal code is changed: increase MICRO
# 2) if API is added, increase MINOR and set MICRO to 0
# 3) if API or ABI is broken (this case should (must) never happen as it's very bad for a library), or a new designed library, increase MAJOR and set MINOR and MICRO to 0
m4_define([OPJ_MAJOR], [1])
m4_define([OPJ_MINOR], [5])
m4_define([OPJ_MICRO], [0])
m4_define([lt_cur], m4_eval(OPJ_MAJOR + OPJ_MINOR))
m4_define([lt_rev], OPJ_MICRO)
m4_define([lt_age], OPJ_MINOR)
AC_PREREQ([2.62])
AC_INIT([OpenJPEG],
[OPJ_MAJOR.OPJ_MINOR.OPJ_MICRO],
[openjpeg@googlegroups.com],
[openjpeg],
[http://www.openjpeg.org])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([opj_config.h])
AC_CANONICAL_SYSTEM
AC_CANONICAL_HOST
AM_INIT_AUTOMAKE([1.11 foreign dist-bzip2 dist-xz dist-zip])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
MAJOR_NR=OPJ_MAJOR
MINOR_NR=OPJ_MINOR
MICRO_NR=OPJ_MICRO
AC_SUBST([MAJOR_NR])
AC_SUBST([MINOR_NR])
AC_SUBST([MICRO_NR])
LT_PREREQ([2.0])
LT_INIT([win32-dll])
lt_version=lt_cur:lt_rev:lt_age
AC_SUBST([lt_version])
### Needed information
have_win32=no
have_darwin="no"
case "$host_os" in
mingw*)
have_win32="yes"
;;
darwin*)
have_darwin="yes"
;;
esac
AM_CONDITIONAL([HAVE_WIN32], [test "x${have_win32}" = "xyes"])
AM_CONDITIONAL([HAVE_DARWIN], [test "x${have_darwin}" = "xyes"])
### Additional options to configure
# debug
AC_ARG_ENABLE([debug],
[AC_HELP_STRING([--enable-debug], [build with debug symbols @<:@default=disabled@:>@])],
[
if test "x${enableval}" = "xyes" ; then
want_debug="yes"
else
want_debug="no"
fi
],
[want_debug="no"])
AC_MSG_CHECKING([whether to build in debug mode])
AC_MSG_RESULT([${want_debug}])
# MJ2
AC_ARG_ENABLE([mj2],
[AC_HELP_STRING([--enable-mj2], [build mj2 binaries @<:@default=disabled@:>@])],
[
if test "x${enableval}" = "xyes" ; then
want_mj2="yes"
else
want_mj2="no"
fi
],
[want_mj2="no"])
AC_MSG_CHECKING([whether to build the MJ2 binaries])
AC_MSG_RESULT([${want_mj2}])
if test "x${want_mj2}" = "xyes" ; then
AC_DEFINE(USE_MJ2, [1], [define to 1 if you use mj2])
fi
AM_CONDITIONAL([WANT_MJ2], [test "x${want_mj2}" = "xyes"])
# JPWL
AC_ARG_ENABLE([jpwl],
[AC_HELP_STRING([--enable-jpwl], [build JPWL library @<:@default=disabled@:>@])],
[
if test "x${enableval}" = "xyes" ; then
want_jpwl="yes"
else
want_jpwl="no"
fi
],
[want_jpwl="no"])
AC_MSG_CHECKING([whether to build the JPWL library])
AC_MSG_RESULT([${want_jpwl}])
AM_CONDITIONAL([WANT_JPWL], [test "x${want_jpwl}" = "xyes"])
# JPIP
AC_ARG_ENABLE([jpip],
[AC_HELP_STRING([--enable-jpip], [build jpip library @<:@default=disabled@:>@])],
[
if test "x${enableval}" = "xyes" ; then
want_jpip="yes"
else
want_jpip="no"
fi
],
[want_jpip="no"])
AC_MSG_CHECKING([whether to build the JPIP library])
AC_MSG_RESULT([${want_jpip}])
AC_ARG_ENABLE([jpip-server],
[AC_HELP_STRING([--enable-jpip-server], [build jpip server @<:@default=disabled@:>@])],
[
if test "x${enableval}" = "xyes" ; then
want_jpip_server="yes"
else
want_jpip_server="no"
fi
],
[want_jpip_server="no"])
AC_MSG_CHECKING([whether to build the JPIP server])
AC_MSG_RESULT([${want_jpip_server}])
### Checks for programs
AC_PROG_CC
# pkg-config
PKG_PROG_PKG_CONFIG
# Check whether pkg-config supports Requires.private
if $PKG_CONFIG --atleast-pkgconfig-version 0.22 ; then
pkgconfig_requires_private="Requires.private"
else
pkgconfig_requires_private="Requires"
fi
AC_SUBST([pkgconfig_requires_private])
AC_SUBST([requirements])
# doxygen
OPJ_CHECK_DOXYGEN
# ln -s
AC_PROG_LN_S
### Checks for libraries
# libpng
have_libpng="no"
AC_ARG_ENABLE([png],
[AC_HELP_STRING([--disable-png], [disable PNG support @<:@default=enabled@:>@])],
[
if test "x${enableval}" = "xyes" ; then
want_png="yes"
else
want_png="no"
fi
],
[want_png="yes"])
AC_MSG_CHECKING([whether to build with PNG support])
AC_MSG_RESULT([${want_png}])
if test "x${want_png}" = "xyes" ; then
PKG_CHECK_MODULES([PNG], [libpng15 zlib],
[have_libpng="yes"],
[
PKG_CHECK_MODULES([PNG], [libpng14 zlib],
[have_libpng="yes"],
[
PKG_CHECK_MODULES([PNG], [libpng12 zlib],
[have_libpng="yes"],
[
PKG_CHECK_MODULES([PNG], [libpng zlib],
[have_libpng="yes"],
[have_libpng="no"])
])
])
])
if ! test "x${have_libpng}" = "xyes" ; then
OPJ_CHECK_LIB([zlib.h],
[z],
[zlibVersion],
[
OPJ_CHECK_LIB([png.h],
[png],
[png_access_version_number],
[
have_libpng="yes"
PNG_CFLAGS="${PNG_CFLAGS} ${Z_CFLAGS}"
PNG_LIBS="${PNG_LIBS} ${Z_LIBS}"
],
[have_libpng="no"])
],
[have_libpng="no"])
fi
if test "x${have_libpng}" = "xno" ; then
AC_MSG_WARN([Can not find a usuable PNG library. Make sure that CPPFLAGS and LDFLAGS are correctly set.])
fi
fi
AC_MSG_CHECKING([whether PNG is available])
AC_MSG_RESULT([${have_libpng}])
if test "x${have_libpng}" = "xyes" ; then
AC_DEFINE(HAVE_LIBPNG, [1], [define to 1 if you have libpng])
fi
AM_CONDITIONAL([with_libpng], [test x${have_libpng} = "xyes"])
# libtiff
have_libtiff="no"
AC_ARG_ENABLE([tiff],
[AC_HELP_STRING([--disable-tiff], [disable TIFF support @<:@default=enabled@:>@])],
[
if test "x${enableval}" = "xyes" ; then
want_tiff="yes"
else
want_tiff="no"
fi
],
[want_tiff="yes"])
AC_MSG_CHECKING([whether to build with TIFF support])
AC_MSG_RESULT([${want_tiff}])
if test "x${want_tiff}" = "xyes" ; then
OPJ_CHECK_LIB(
[tiff.h],
[tiff],
[TIFFOpen],
[have_libtiff="yes"],
[have_libtiff="no"])
if test "x${have_libtiff}" = "xno" ; then
AC_MSG_WARN([Can not find a usuable TIFF library. Make sure that CPPFLAGS and LDFLAGS are correctly set.])
fi
fi
AC_MSG_CHECKING([whether TIFF is available])
AC_MSG_RESULT([${have_libtiff}])
if test "x${have_libtiff}" = "xyes" ; then
AC_DEFINE(HAVE_LIBTIFF, [1], [define to 1 if you have libtiff])
fi
AM_CONDITIONAL([with_libtiff], [test "x${have_libtiff}" = "xyes"])
# libcms2
lcms_output="no"
have_lcms2="no"
AC_ARG_ENABLE([lcms2],
[AC_HELP_STRING([--disable-lcms2], [disable LCMS-2 support @<:@default=enabled@:>@])],
[
if test "x${enableval}" = "xyes" ; then
want_lcms2="yes"
else
want_lcms2="no"
fi
],
[want_lcms2="yes"])
AC_MSG_CHECKING([whether to build with LCMS-2 support])
AC_MSG_RESULT([${want_lcms2}])
if test "x${want_lcms2}" = "xyes" ; then
PKG_CHECK_MODULES([LCMS2], [lcms2],
[have_lcms2="yes"],
[have_lcms2="no"])
fi
AC_MSG_CHECKING([whether LCMS-2 is available])
AC_MSG_RESULT([${have_lcms2}])
if test "x${have_lcms2}" = "xyes" ; then
AC_DEFINE(HAVE_LIBLCMS2, [1], [define to 1 if you have lcms version 2.x])
lcms_output="lcms version 2.x"
fi
# libcms1
AC_ARG_ENABLE([lcms1],
[AC_HELP_STRING([--disable-lcms1], [disable LCMS-1 support @<:@default=enabled@:>@])],
[
if test "x${enableval}" = "xyes" ; then
want_lcms1="yes"
else
want_lcms1="no"
fi
],
[want_lcms1="yes"])
AC_MSG_CHECKING([whether to build with LCMS-1 support])
AC_MSG_RESULT([${want_lcms1}])
if test "x${have_lcms2}" = "xno" ; then
if test "x${want_lcms1}" = "xyes" ; then
PKG_CHECK_MODULES([LCMS1], [lcms1],
[have_lcms1="yes"],
[PKG_CHECK_MODULES([LCMS1], [lcms],
[have_lcms1="yes"],
[have_lcms1="no"])])
fi
AC_MSG_CHECKING([whether LCMS-1 is available])
AC_MSG_RESULT([${have_lcms1}])
if test "x${have_lcms1}" = "xyes" ; then
AC_DEFINE(HAVE_LIBLCMS1, [1], [define to 1 if you have lcms version 1.x])
lcms_output="lcms version 1.x"
fi
fi
# threads
if test "x${want_jpip_server}" = "xyes" ; then
if test "x${have_win32}" = "xno" ; then
SAVE_CFLAGS=${CFLAGS}
CFLAGS="${CFLAGS} -pthread"
SAVE_LIBS=${LIBS}
LIBS="${LIBS} -pthread"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[
#include <pthread.h>
]],
[[
pthread_t id;
id = pthread_self();
]])],
[have_pthread="yes"],
[have_pthread="no"])
CFLAGS=${SAVE_CFLAGS}
LIBS=${SAVE_LIBS}
AC_MSG_CHECKING([whether Pthread library is available])
AC_MSG_RESULT([${have_pthread}])
if ! test "x${have_pthread}" = "xyes" ; then
AC_MSG_WARN([Pthread library not found. OpenJPIP server will not be compiled.])
want_jpip_server="no"
else
THREAD_CFLAGS="-pthread"
THREAD_LIBS="-pthread"
fi
else
THREAD_LIBS="-lws2_32"
fi
fi
AC_ARG_VAR([THREAD_CFLAGS], [compiler flag for the thread library])
AC_SUBST([THREAD_CFLAGS])
AC_ARG_VAR([THREAD_LIBS], [linker flags for thread library])
AC_SUBST([THREAD_LIBS])
# libfcgi
if test "x${want_jpip_server}" = "xyes" ; then
have_fcgi="no"
OPJ_CHECK_LIB(
[fcgi_stdio.h],
[fcgi],
[FCGI_Accept],
[have_fcgi="yes"],
[have_fcgi="no"])
if ! test "x${have_fcgi}" = "xyes" ; then
AC_MSG_WARN([FastCGI library not found. OpenJPIP server will not be compiled.])
want_jpip_server="no"
fi
fi
# libcurl
if test "x${want_jpip_server}" = "xyes" ; then
PKG_CHECK_MODULES([LIBCURL], [libcurl],
[have_libcurl="yes"],
[have_libcurl="no"])
if ! test "x${have_libcurl}" = "xyes" ; then
AC_MSG_WARN([libcurl library not found. OpenJPIP server will not be compiled.])
want_jpip_server="no"
fi
fi
if test "x${want_jpip}" = "xyes" ; then
AC_DEFINE(USE_JPIP, [1], [define to 1 if you use jpip])
fi
AM_CONDITIONAL([WANT_JPIP], [test "x${want_jpip}" = "xyes"])
if test "x${want_jpip_server}" = "xyes" ; then
AC_DEFINE(USE_JPIP_SERVER, [1], [define to 1 if you use jpip server])
fi
AM_CONDITIONAL([WANT_JPIP_SERVER], [test "x${want_jpip_server}" = "xyes"])
AM_CONDITIONAL([WANT_JPIP_CODE], [test "x${want_jpip}" = "xyes" || test "x${want_jpip_server}" = "xyes"])
### Checks for header files
## FIXME: declarations must be fixed in source code. See autoconf manual
AC_HEADER_DIRENT
### Checks for types
### Checks for structures
### Checks for compiler characteristics
AM_PROG_CC_C_O
AC_C_BIGENDIAN
#OPJ_COMPILER_FLAG([-Wall])
#OPJ_COMPILER_FLAG([-Wextra])
#OPJ_COMPILER_FLAG([-Wshadow])
#OPJ_COMPILER_FLAG([-Wpointer-arith])
OPJ_COMPILER_FLAG([-Wno-unused-result])
if test "x${want_debug}" = "xyes" ; then
OPJ_COMPILER_FLAG([-g])
OPJ_COMPILER_FLAG([-O0])
else
OPJ_COMPILER_FLAG([-O3])
fi
### Checks for linker characteristics
### Checks for library functions
### Post configuration
AM_CONDITIONAL([BUILD_SHARED], [test "x${enable_shared}" = "xyes"])
AM_CONDITIONAL([BUILD_STATIC], [test "x${enable_static}" = "xyes"])
AC_CONFIG_FILES([
Makefile
libopenjpeg1.pc
libopenjpeg-jpwl.pc
libopenjpeg/Makefile
libopenjpeg/jpwl/Makefile
applications/Makefile
applications/codec/Makefile
applications/mj2/Makefile
applications/jpip/Makefile
applications/jpip/libopenjpip/Makefile
applications/jpip/util/Makefile
doc/Makefile
])
AC_OUTPUT
### Summary
echo
echo
echo
echo "------------------------------------------------------------------------"
echo "$PACKAGE $VERSION"
echo "------------------------------------------------------------------------"
echo
echo
echo "Configuration Options Summary:"
echo
echo " Debug...............: ${want_debug}"
echo
echo " Optional support:"
echo " libpng............: ${have_libpng}"
echo " libtiff...........: ${have_libtiff}"
echo " libcms............: ${lcms_output}"
echo
echo " Documentation.......: ${opj_have_doxygen}"
echo " Build.............: make doc"
echo
echo " mj2.................: ${want_mj2}"
echo " jpwl................: ${want_jpwl}"
echo " jpip................: ${want_jpip}"
echo " jpip server.........: ${want_jpip_server}"
echo

View File

@ -3,19 +3,50 @@
# to generate the html documentation in the doc/html repository of the build folder. # to generate the html documentation in the doc/html repository of the build folder.
# Try to find the doxygen tool # Try to find the doxygen tool
FIND_PACKAGE(Doxygen) find_package(Doxygen)
IF(DOXYGEN_FOUND) if(DOXYGEN_FOUND)
# Configure the doxygen config file with variable from CMake and move it # Configure the doxygen config file with variable from CMake and move it
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.dox.cmake.in configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.dox.cmake.in
${CMAKE_BINARY_DIR}/doc/Doxyfile-html.dox @ONLY) ${CMAKE_BINARY_DIR}/doc/Doxyfile-html.dox @ONLY)
# Configure the html mainpage file of the doxygen documentation with variable
# from CMake and move it
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/mainpage.dox.in
${CMAKE_BINARY_DIR}/doc/mainpage.dox @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/openjpip.dox.in
${CMAKE_BINARY_DIR}/doc/openjpip.dox @ONLY)
# copy png file to make local (binary tree) documentation valid:
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/jpip_architect.png
${CMAKE_BINARY_DIR}/doc/html/jpip_architect.png COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/jpip_protocol.png
${CMAKE_BINARY_DIR}/doc/html/jpip_protocol.png COPYONLY)
file(GLOB headers
${OPENJPEG_SOURCE_DIR}/src/lib/openjp2/*.h
${OPENJPEG_SOURCE_DIR}/src/lib/openjp2/*.c
${OPENJPEG_SOURCE_DIR}/src/lib/openjpip/*.h
${OPENJPEG_SOURCE_DIR}/src/lib/openjpip/*.c
)
# Generate new target to build the html documentation # Generate new target to build the html documentation
ADD_CUSTOM_TARGET(doc ALL add_custom_command(
${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/doc/Doxyfile-html.dox) OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/html/index.html
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/doc/Doxyfile-html.dox
DEPENDS ${CMAKE_BINARY_DIR}/doc/Doxyfile-html.dox
${CMAKE_BINARY_DIR}/doc/mainpage.dox
${CMAKE_BINARY_DIR}/doc/openjpip.dox
${headers}
)
add_custom_target(doc ALL
DEPENDS ${CMAKE_BINARY_DIR}/doc/html/index.html
COMMENT "Building doxygen documentation"
)
ELSE(DOXYGEN_FOUND) # install HTML documentation (install png files too):
install(DIRECTORY ${CMAKE_BINARY_DIR}/doc/html
MESSAGE(STATUS "Doxygen not found, we cannot generate the documentation") DESTINATION share/doc
PATTERN ".svn" EXCLUDE
ENDIF(DOXYGEN_FOUND) )
else()
message(STATUS "Doxygen not found, we cannot generate the documentation")
endif()

View File

@ -1,290 +0,0 @@
# Doxyfile 1.7.3
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = OpenJPEG
PROJECT_NUMBER =
PROJECT_BRIEF =
PROJECT_LOGO =
OUTPUT_DIRECTORY = .
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF = "The $name class" \
"The $name widget" \
"The $name file" \
is \
provides \
specifies \
contains \
represents \
a \
an \
the
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = NO
STRIP_FROM_PATH = C://
STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = YES
QT_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 8
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
EXTENSION_MAPPING =
BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
IDL_PROPERTY_SUPPORT = YES
DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = YES
TYPEDEF_HIDES_STRUCT = NO
SYMBOL_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
EXTRACT_ALL = YES
EXTRACT_PRIVATE = YES
EXTRACT_STATIC = YES
EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_METHODS = NO
EXTRACT_ANON_NSPACES = NO
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = NO
CASE_SENSE_NAMES = NO
HIDE_SCOPE_NAMES = NO
SHOW_INCLUDE_FILES = YES
FORCE_LOCAL_INCLUDES = NO
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = NO
SORT_MEMBERS_CTORS_1ST = NO
SORT_GROUP_NAMES = NO
SORT_BY_SCOPE_NAME = NO
STRICT_PROTO_MATCHING = NO
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_DIRECTORIES = NO
SHOW_FILES = YES
SHOW_NAMESPACES = YES
FILE_VERSION_FILTER =
LAYOUT_FILE =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = NO
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = ../libopenjpeg \
../libopenjpeg/jpwl
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *.h \
*.c
RECURSIVE = NO
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXCLUDE_SYMBOLS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS = *
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
FILTER_SOURCE_PATTERNS =
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = NO
INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
REFERENCES_LINK_SOURCE = YES
USE_HTAGS = NO
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = NO
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = ./html
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_COLORSTYLE_HUE = 220
HTML_COLORSTYLE_SAT = 100
HTML_COLORSTYLE_GAMMA = 80
HTML_TIMESTAMP = YES
HTML_ALIGN_MEMBERS = YES
HTML_DYNAMIC_SECTIONS = NO
GENERATE_DOCSET = NO
DOCSET_FEEDNAME = "Doxygen generated docs"
DOCSET_BUNDLE_ID = org.doxygen.Project
DOCSET_PUBLISHER_ID = org.doxygen.Publisher
DOCSET_PUBLISHER_NAME = Publisher
GENERATE_HTMLHELP = NO
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
CHM_INDEX_ENCODING =
BINARY_TOC = NO
TOC_EXPAND = NO
GENERATE_QHP = NO
QCH_FILE =
QHP_NAMESPACE = org.doxygen.Project
QHP_VIRTUAL_FOLDER = doc
QHP_CUST_FILTER_NAME =
QHP_CUST_FILTER_ATTRS =
QHP_SECT_FILTER_ATTRS =
QHG_LOCATION =
GENERATE_ECLIPSEHELP = NO
ECLIPSE_DOC_ID = org.doxygen.Project
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO
USE_INLINE_TREES = NO
TREEVIEW_WIDTH = 250
EXT_LINKS_IN_WINDOW = NO
FORMULA_FONTSIZE = 10
FORMULA_TRANSPARENT = YES
USE_MATHJAX = NO
MATHJAX_RELPATH = http://www.mathjax.org/mathjax
SEARCHENGINE = NO
SERVER_BASED_SEARCH = NO
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = NO
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = NO
USE_PDFLATEX = NO
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
LATEX_SOURCE_CODE = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED = USE_JPWL \
USE_JPSEC
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
MSCGEN_PATH =
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = NO
DOT_NUM_THREADS = 0
DOT_FONTNAME = Helvetica
DOT_FONTSIZE = 10
DOT_FONTPATH =
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
GROUP_GRAPHS = YES
UML_LOOK = NO
TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
CALL_GRAPH = NO
CALLER_GRAPH = NO
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
MSCFILE_DIRS =
DOT_GRAPH_MAX_NODES = 50
MAX_DOT_GRAPH_DEPTH = 1000
DOT_TRANSPARENT = NO
DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = YES

View File

@ -1,4 +1,4 @@
# Doxyfile 1.7.3 # Doxyfile 1.7.1
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Project related configuration options # Project related configuration options
@ -6,8 +6,6 @@
DOXYFILE_ENCODING = UTF-8 DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = OpenJPEG PROJECT_NAME = OpenJPEG
PROJECT_NUMBER = @OPENJPEG_VERSION@ PROJECT_NUMBER = @OPENJPEG_VERSION@
PROJECT_BRIEF =
PROJECT_LOGO =
OUTPUT_DIRECTORY = @OPENJPEG_BINARY_DIR@/doc OUTPUT_DIRECTORY = @OPENJPEG_BINARY_DIR@/doc
CREATE_SUBDIRS = NO CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English OUTPUT_LANGUAGE = English
@ -74,7 +72,6 @@ SORT_BRIEF_DOCS = NO
SORT_MEMBERS_CTORS_1ST = NO SORT_MEMBERS_CTORS_1ST = NO
SORT_GROUP_NAMES = NO SORT_GROUP_NAMES = NO
SORT_BY_SCOPE_NAME = NO SORT_BY_SCOPE_NAME = NO
STRICT_PROTO_MATCHING = NO
GENERATE_TODOLIST = YES GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES GENERATE_BUGLIST = YES
@ -100,24 +97,25 @@ WARN_LOGFILE =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the input files # configuration options related to the input files
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
INPUT = @OPENJPEG_SOURCE_DIR@/libopenjpeg \ INPUT = @OPENJPEG_SOURCE_DIR@/src/lib/openjp2 \
@OPENJPEG_SOURCE_DIR@/libopenjpeg/jpwl @OPENJPEG_SOURCE_DIR@/src/lib/openjpip \
@OPENJPEG_BINARY_DIR@/doc
INPUT_ENCODING = UTF-8 INPUT_ENCODING = UTF-8
FILE_PATTERNS = *.h \ FILE_PATTERNS = *.h \
*.c *.c \
RECURSIVE = NO *.dox
RECURSIVE = YES
EXCLUDE = EXCLUDE =
EXCLUDE_SYMLINKS = NO EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS = EXCLUDE_PATTERNS = */.svn/*
EXCLUDE_SYMBOLS = EXCLUDE_SYMBOLS =
EXAMPLE_PATH = EXAMPLE_PATH =
EXAMPLE_PATTERNS = * EXAMPLE_PATTERNS = *
EXAMPLE_RECURSIVE = NO EXAMPLE_RECURSIVE = NO
IMAGE_PATH = IMAGE_PATH = @OPENJPEG_SOURCE_DIR@/doc
INPUT_FILTER = INPUT_FILTER =
FILTER_PATTERNS = FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO FILTER_SOURCE_FILES = NO
FILTER_SOURCE_PATTERNS =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to source browsing # configuration options related to source browsing
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
@ -147,7 +145,7 @@ HTML_STYLESHEET =
HTML_COLORSTYLE_HUE = 220 HTML_COLORSTYLE_HUE = 220
HTML_COLORSTYLE_SAT = 100 HTML_COLORSTYLE_SAT = 100
HTML_COLORSTYLE_GAMMA = 80 HTML_COLORSTYLE_GAMMA = 80
HTML_TIMESTAMP = YES HTML_TIMESTAMP = NO
HTML_ALIGN_MEMBERS = YES HTML_ALIGN_MEMBERS = YES
HTML_DYNAMIC_SECTIONS = NO HTML_DYNAMIC_SECTIONS = NO
GENERATE_DOCSET = NO GENERATE_DOCSET = NO
@ -180,8 +178,6 @@ TREEVIEW_WIDTH = 250
EXT_LINKS_IN_WINDOW = NO EXT_LINKS_IN_WINDOW = NO
FORMULA_FONTSIZE = 10 FORMULA_FONTSIZE = 10
FORMULA_TRANSPARENT = YES FORMULA_TRANSPARENT = YES
USE_MATHJAX = NO
MATHJAX_RELPATH = http://www.mathjax.org/mathjax
SEARCHENGINE = NO SEARCHENGINE = NO
SERVER_BASED_SEARCH = NO SERVER_BASED_SEARCH = NO
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
@ -281,7 +277,6 @@ DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png DOT_IMAGE_FORMAT = png
DOT_PATH = DOT_PATH =
DOTFILE_DIRS = DOTFILE_DIRS =
MSCFILE_DIRS =
DOT_GRAPH_MAX_NODES = 50 DOT_GRAPH_MAX_NODES = 50
MAX_DOT_GRAPH_DEPTH = 1000 MAX_DOT_GRAPH_DEPTH = 1000
DOT_TRANSPARENT = NO DOT_TRANSPARENT = NO

View File

@ -1,72 +0,0 @@
MAINTAINERCLEANFILES = Makefile.in
.PHONY: doc
PACKAGE_DOCNAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)-doc
if OPJ_BUILD_DOC
doc-clean:
rm -rf $(top_srcdir)/doc/html/ $(top_srcdir)/doc/$(PACKAGE_DOCNAME).tar*
doc: all
cd $(top_srcdir)/doc && \
$(opj_doxygen) Doxyfile.dox
rm -rf $(PACKAGE_DOCNAME).tar*
rm -rf $(top_srcdir)/doc/$(PACKAGE_DOCNAME).tar*
mkdir -p $(PACKAGE_DOCNAME)/doc
cp -R $(top_srcdir)/doc/html/ $(PACKAGE_DOCNAME)/doc
tar cf $(PACKAGE_DOCNAME).tar $(PACKAGE_DOCNAME)/
bzip2 -9 $(PACKAGE_DOCNAME).tar
rm -rf $(PACKAGE_DOCNAME)/
if ! test -f $(top_srcdir)/doc/$(PACKAGE_DOCNAME).tar.bz2 ; then \
mv $(PACKAGE_DOCNAME).tar.bz2 $(top_srcdir)/doc; \
fi
clean-local: doc-clean
else
doc:
@echo "Documentation not built. Run ./configure --help"
endif
docsdir = $(docdir)-$(MAJOR_NR).$(MINOR_NR)
docs_DATA = $(top_builddir)/LICENSE $(top_builddir)/CHANGES
dist_man1_MANS = \
man/man1/image_to_j2k.1 \
man/man1/j2k_dump.1 \
man/man1/j2k_to_image.1
dist_man3_MANS = \
man/man3/libopenjpeg.3
install-data-hook:
cd $(DESTDIR)$(man1dir) && \
rm -f jpwl_image_to_j2k.1 && \
$(LN_S) image_to_j2k.1 jpwl_image_to_j2k.1
cd $(DESTDIR)$(man1dir) && \
rm -f jpwl_j2k_to_image.1 && \
$(LN_S) j2k_to_image.1 jpwl_j2k_to_image.1
cd $(DESTDIR)$(man3dir) && \
rm -f jpwl_libopenjpeg.3 && \
$(LN_S) libopenjpeg.3 jpwl_libopenjpeg.3
@echo -e " (MAN)\t$(man1dir)/image_to_j2k.1" >> $(top_builddir)/report.txt
@echo -e " (LN)\t$(man1dir)/jpwl_image_to_j2k.1" >> $(top_builddir)/report.txt
@echo -e " (MAN)\t$(man1dir)/j2k_dump.1" >> $(top_builddir)/report.txt
@echo -e " (MAN)\t$(man1dir)/j2k_to_image.1" >> $(top_builddir)/report.txt
@echo -e " (LN)\t$(man1dir)//jpwl_j2k_to_image.1" >> $(top_builddir)/report.txt
@echo -e " (MAN)\t$(man3dir)/libopenjpeg.3" >> $(top_builddir)/report.txt
@echo -e " (LN)\t$(man3dir)/jpwl_libopenjpeg.3" >> $(top_builddir)/report.txt
uninstall-hook:
rm -f $(DESTDIR)$(man1dir)/jpwl_image_to_j2k.1
rm -f $(DESTDIR)$(man1dir)/jpwl_j2k_to_image.1
rm -f $(DESTDIR)$(man3dir)/jpwl_libopenjpeg.3
EXTRA_DIST = \
CMakeLists.txt \
Doxyfile.dox

View File

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 61 KiB

View File

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

62
doc/mainpage.dox.in Normal file
View File

@ -0,0 +1,62 @@
/*
* $Id$
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2011, Mickael Savinaud, Communications & Systemes <mickael.savinaud@c-s.fr>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/*! \mainpage OpenJPEG v@OPENJPEG_VERSION@ Documentation
*
* \section intro Introduction
* This manual documents the low-level OpenJPEG C API.\n
* The OpenJPEG library is an open-source JPEG 2000 library developed in order to promote the use of JPEG 2000.\n
* This documents is focused on the main part of the library which try to implement Part 1 and Part 2 of the JPEG2000 norm.\n
*
* \section home Home page
*
* The Home Page of the OpenJPEG project can be found at:
*
* http://www.openjpeg.org/
*
* The source code repository is available here:
*
* http://github.com/uclouvain/openjpeg
*
* The OpenJPEG mailing list is located here:
*
* http://groups.google.com/group/openjpeg
*
* The test files repository is available here:
*
* http://github.com/uclouvain/openjpeg-data
*
* \section license License
* This software is released under the BSD license, anybody can use or modify the library, even for commercial applications.\n
* The only restriction is to retain the copyright in the sources or the binaries documentation.\n
* Neither the author, nor the university accept any responsibility for any kind of error or data loss which may occur during usage.
*
* \author OpenJPEG Team
*
*/

View File

@ -29,10 +29,10 @@
.SP .SP
.fi .fi
.. ..
.TH image_to_j2k 1 "Version 1.4.0" "image_to_j2k" "converts to jpeg2000 files" .TH opj_compress 1 "Version 2.1.1" "opj_compress" "converts to jpeg2000 files"
.P .P
.SH NAME .SH NAME
image_to_j2k - opj_compress \-
This program reads in an image of a certain type and converts it to a This program reads in an image of a certain type and converts it to a
jpeg2000 file. It is part of the OpenJPEG library. jpeg2000 file. It is part of the OpenJPEG library.
.SP .SP
@ -43,20 +43,20 @@ Valid output image extensions are
.B .j2k, .jp2 .B .j2k, .jp2
.SH SYNOPSIS .SH SYNOPSIS
.P .P
.B image_to_j2k -i \fRinfile.bmp \fB-o \fRoutfile.j2k .B opj_compress \-i \fRinfile.bmp \fB-o \fRoutfile.j2k
.P .P
.B image_to_j2k -ImgDir \fRdirectory_name \fB-OutFor \fRjp2 .B opj_compress \-ImgDir \fRdirectory_name \fB-OutFor \fRjp2
.P .P
.B image_to_j2k -h \fRPrint a help message and exit. .B opj_compress \-h \fRPrint a help message and exit.
.P .P
.R See JPWL OPTIONS for special options .R See JPWL OPTIONS for special options
.SH OPTIONS .SH OPTIONS
.TP .TP
.B \-\^b " n,n" .B \-\^b " n,n"
(Size of code block (e.g. -b 32,32). Default: 64 x 64) (Size of code block (e.g. \-b 32,32). Default: 64 x 64)
.TP .TP
.B \-\^c " n" .B \-\^c " n"
(Size of precinct (e.g. -c 128,128). Default: 2^15 x 2^15) (Size of precinct (e.g. \-c 128,128). Default: 2^15 x 2^15)
.TP .TP
.B \-\^cinema2K " fps" .B \-\^cinema2K " fps"
Digital Cinema 2K profile compliant codestream. Valid \fBfps\fR values are 24 or 48. Digital Cinema 2K profile compliant codestream. Valid \fBfps\fR values are 24 or 48.
@ -65,7 +65,7 @@ Digital Cinema 2K profile compliant codestream. Valid \fBfps\fR values are 24 or
Digital Cinema 4K profile compliant codestream. Does not need an fps: default is 24 fps. Digital Cinema 4K profile compliant codestream. Does not need an fps: default is 24 fps.
.TP .TP
.B \-\^d " X,Y" .B \-\^d " X,Y"
(Offset of image origin (e.g. -d 150,300)) (Offset of image origin (e.g. \-d 150,300))
.TP .TP
.B \-\^h .B \-\^h
Print a help message and exit. Print a help message and exit.
@ -85,20 +85,20 @@ Progression order. \fBname\fR can be one out of:LRCP, RLCP, RPCL, PCRL, CPRL. De
.B \-\^q " n" .B \-\^q " n"
different psnr for successive layers different psnr for successive layers
.br .br
.B Note: \fR(options -r and -q cannot be used together) .B Note: \fR(options \-r and \-q cannot be used together)
.TP .TP
.B \-\^r " n" .B \-\^r " n"
different compression ratio(s) for successive layers. The rate specified for each quality level is the desired compression factor. different compression ratio(s) for successive layers. The rate specified for each quality level is the desired compression factor.
.br .br
.B Note: \fR(options -r and -q cannot be used together) .B Note: \fR(options \-r and \-q cannot be used together)
.TP .TP
.B \-\^s " X,Y" .B \-\^s " X,Y"
sub-sampling factor (e.g. -s 2,2). Default: No sub-sampling in x or y direction. sub-sampling factor (e.g. \-s 2,2). Default: No sub-sampling in x or y direction.
.br .br
.B Remark: \fRsub-sampling bigger than 2 can produce errors. .B Remark: \fRsub-sampling bigger than 2 can produce errors.
.TP .TP
.B \-\^t " W,H" .B \-\^t " W,H"
(Size of tile (e.g. -t 512,512) ) (Size of tile (e.g. \-t 512,512) )
.TP .TP
.B \-\^x " name" .B \-\^x " name"
(Create index file and fill it. Default: no index file) (Create index file and fill it. Default: no index file)
@ -132,7 +132,7 @@ ERTERM(16)
.br .br
SEGMARK(32) SEGMARK(32)
.br .br
Values can be added: RESTART(4) + RESET(2) + SEGMARK(32) = -M 38 Values can be added: RESTART(4) + RESET(2) + SEGMARK(32) = \-M 38
.TP .TP
.B \-\^OutFor "ext" .B \-\^OutFor "ext"
(extension for output files) (extension for output files)
@ -149,7 +149,7 @@ e.g. \fB-ROI c=0,U=25\fR
(Write SOP marker before each packet. Default: No SOP marker in the codestream.) (Write SOP marker before each packet. Default: No SOP marker in the codestream.)
.TP .TP
.B \-\^T "X,Y" .B \-\^T "X,Y"
(Offset of the origin of the tiles (e.g. -T 100,75) ) (Offset of the origin of the tiles (e.g. \-T 100,75) )
.TP .TP
.B \-\^W .B \-\^W
(see JPWL OPTIONS) (see JPWL OPTIONS)
@ -157,7 +157,7 @@ e.g. \fB-ROI c=0,U=25\fR
.SH JPWL OPTIONS .SH JPWL OPTIONS
Options usable only if the library has been compiled with \fB-DUSE_JPWL\fR Options usable only if the library has been compiled with \fB-DUSE_JPWL\fR
.P .P
.B -W h<tilepart><=type>, s<tilepart><=method>, a=<addr>, z=<size>, g=<range>, p<tilepart:pack><=type> .B \-W h<tilepart><=type>, s<tilepart><=method>, a=<addr>, z=<size>, g=<range>, p<tilepart:pack><=type>
.P .P
.B h\fR selects the header error protection (EPB): \fBtype\fR can be .B h\fR selects the header error protection (EPB): \fBtype\fR can be
[0=none 1,absent=predefined 16=CRC-16 32=CRC-32 37-128=RS] [0=none 1,absent=predefined 16=CRC-16 32=CRC-32 37-128=RS]
@ -176,7 +176,7 @@ Options usable only if the library has been compiled with \fB-DUSE_JPWL\fR
(max. 16 specs) (max. 16 specs)
.P .P
.B s \fRenables sensitivity data insertion (ESD): \fBmethod\fR can be .B s \fRenables sensitivity data insertion (ESD): \fBmethod\fR can be
[-1=NO ESD 0=RELATIVE ERROR 1=MSE 2=MSE REDUCTION 3=PSNR [\-1=NO ESD 0=RELATIVE ERROR 1=MSE 2=MSE REDUCTION 3=PSNR
4=PSNR INCREMENT 5=MAXERR 6=TSE 7=RESERVED] 4=PSNR INCREMENT 5=MAXERR 6=TSE 7=RESERVED]
if \fBtilepart\fR is absent, it is for main header only if \fBtilepart\fR is absent, it is for main header only
if \fBtilepart\fR is present, it applies from that tile if \fBtilepart\fR is present, it applies from that tile
@ -194,18 +194,18 @@ Options usable only if the library has been compiled with \fB-DUSE_JPWL\fR
.P .P
.SH EXAMPLES .SH EXAMPLES
.P .P
.B image_to_j2k -i \fRfile.bmp \fB-o \fRfile.j2k \fB-r \fR20,10,1 (compress 20x, then 10x, then lossless). .B opj_compress \-i \fRfile.bmp \fB-o \fRfile.j2k \fB-r \fR20,10,1 (compress 20x, then 10x, then lossless).
.P .P
.B image_to_j2k -i \fRfile.ppm \fB-o \fRfile.j2k \fB-q \fR30,40,50 .B opj_compress \-i \fRfile.ppm \fB-o \fRfile.j2k \fB-q \fR30,40,50
.P .P
.B image_to_j2k -i \fRfile.pgx \fB-o \fRfile.j2k \fB-POC \fRT1=0,0,1,5,3,CPRL .B opj_compress \-i \fRfile.pgx \fB-o \fRfile.j2k \fB-POC \fRT1=0,0,1,5,3,CPRL
.P .P
.B image_to_j2k -i \fRlena.raw \fB-o \fRlena.j2k \fB-F \fR512,512,3,8,u .B opj_compress \-i \fRlena.raw \fB-o \fRlena.j2k \fB-F \fR512,512,3,8,u
.P .P
.SH AUTHORS .SH AUTHORS
Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
.br .br
Copyright (c) 2002-2007, Professor Benoit Macq Copyright (c) 2002-2014, Professor Benoit Macq
.br .br
Copyright (c) 2001-2003, David Janssens Copyright (c) 2001-2003, David Janssens
.br .br
@ -218,5 +218,5 @@ Copyright (c) 2005, Herve Drolon, FreeImage Team
Copyright (c) 2006-2007, Parvatha Elangovan Copyright (c) 2006-2007, Parvatha Elangovan
.P .P
.SH "SEE ALSO" .SH "SEE ALSO"
j2k_to_image(1) j2k_dump(1) opj_decompress(1) opj_dump(1)

View File

@ -29,10 +29,10 @@
.SP .SP
.fi .fi
.. ..
.TH j2k_to_image 1 "Version 1.4.0" "j2k_to_image" "converts jpeg2000 files" .TH opj_decompress 1 "Version 2.1.1" "opj_decompress" "converts jpeg2000 files"
.P .P
.SH NAME .SH NAME
j2k_to_image - opj_decompress \-
This program reads in a jpeg2000 image and converts it to another This program reads in a jpeg2000 image and converts it to another
image type. It is part of the OpenJPEG library. image type. It is part of the OpenJPEG library.
.SP .SP
@ -43,11 +43,11 @@ Valid output image extensions are
.B .bmp, .pgm, .pgx, .png, .pnm, .ppm, .raw, .tga, .tif \fR. For PNG resp. TIF it needs libpng resp. libtiff . .B .bmp, .pgm, .pgx, .png, .pnm, .ppm, .raw, .tga, .tif \fR. For PNG resp. TIF it needs libpng resp. libtiff .
.SH SYNOPSIS .SH SYNOPSIS
.P .P
.B j2k_to_image -i \fRinfile.j2k \fB-o \fRoutfile.png .B opj_decompress \-i \fRinfile.j2k \fB-o \fRoutfile.png
.P .P
.B j2k_to_image -ImgDir \fRimages/ \fB-OutFor \fRbmp .B opj_decompress \-ImgDir \fRimages/ \fB-OutFor \fRbmp
.P .P
.B j2k_to_image -h \fRPrint help message and exit .B opj_decompress \-h \fRPrint help message and exit
.P .P
.R See JPWL OPTIONS for special options .R See JPWL OPTIONS for special options
.SH OPTIONS .SH OPTIONS
@ -73,9 +73,19 @@ n is the maximum number of quality layers to decode. See LAYERS below)
.B \-\^OutFor "ext" .B \-\^OutFor "ext"
(extension for output files) (extension for output files)
.P .P
.SH JPIP OPTIONS
Options usable only if the library has been compiled with
.B BUILD_JPIP
.TP
.B -jpip
Embed index table box into the output JP2 file (compulsory for JPIP)
.TP
.B -TP R
Partition a tile into tile parts of different resolution levels (compulsory for JPT-stream)
.P
.SH JPWL OPTIONS .SH JPWL OPTIONS
Options usable only if the library has been compiled with Options usable only if the library has been compiled with
.B -DUSE_JPWL .B BUILD_JPWL
.TP .TP
.B -W c\fR[=Nc] (Nc is the number of expected components in the codestream; default:3) .B -W c\fR[=Nc] (Nc is the number of expected components in the codestream; default:3)
.TP .TP
@ -91,9 +101,9 @@ Set the maximum number of quality layers to decode. If there are less quality la
.P .P
'\".SH BUGS '\".SH BUGS
.SH AUTHORS .SH AUTHORS
Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
.br .br
Copyright (c) 2002-2007, Professor Benoit Macq Copyright (c) 2002-2014, Professor Benoit Macq
.br .br
Copyright (c) 2001-2003, David Janssens Copyright (c) 2001-2003, David Janssens
.br .br
@ -106,4 +116,4 @@ Copyright (c) 2005, Herve Drolon, FreeImage Team
Copyright (c) 2006-2007, Parvatha Elangovan Copyright (c) 2006-2007, Parvatha Elangovan
.P .P
.SH "SEE ALSO" .SH "SEE ALSO"
image_to_j2k(1) j2k_dump(1) opj_compress(1) opj_dump(1)

View File

@ -29,10 +29,10 @@
.SP .SP
.fi .fi
.. ..
.TH j2k_dump 1 "Version 1.4.0" "j2k_dump" "dumps jpeg2000 files" .TH opj_dump 1 "Version 2.1.1" "opj_dump" "dumps jpeg2000 files"
.P .P
.SH NAME .SH NAME
j2k_dump - opj_dump \-
This program reads in a jpeg2000 image and dumps the contents to stdout. It is part of the OpenJPEG library. This program reads in a jpeg2000 image and dumps the contents to stdout. It is part of the OpenJPEG library.
.SP .SP
Valid input image extensions are Valid input image extensions are
@ -40,11 +40,11 @@ Valid input image extensions are
.SP .SP
.SH SYNOPSIS .SH SYNOPSIS
.P .P
.B j2k_dump -i \fRinfile.j2k .B opj_dump \-i \fRinfile.j2k
.P .P
.B j2k_dump -ImgDir \fRimages/ \fRDump all files in images/ .B opj_dump \-ImgDir \fRimages/ \fRDump all files in images/
.P .P
.B j2k_dump -h \fRPrint help message and exit .B opj_dump \-h \fRPrint help message and exit
.P .P
.SH OPTIONS .SH OPTIONS
.TP .TP
@ -56,7 +56,7 @@ Valid input image extensions are
.P .P
'\".SH BUGS '\".SH BUGS
.SH AUTHORS .SH AUTHORS
Copyright (c) 20010, Mathieu Malaterre Copyright (c) 2010, Mathieu Malaterre
.P .P
.SH "SEE ALSO" .SH "SEE ALSO"
image_to_j2k(1) j2k_to_image(1) opj_compress(1) opj_decompress(1)

View File

@ -29,10 +29,10 @@
.SP .SP
.fi .fi
.. ..
.TH libopenjpeg 3 "Oct 2010" "Version 1.4.0" "Oct 2010" .TH libopenjp2 3 "Oct 2010" "Version 1.4.0" "Oct 2010"
.P .P
.SH NAME .SH NAME
libopenjpeg - libopenjp2 -
a library for reading and writing JPEG2000 image files. a library for reading and writing JPEG2000 image files.
.SP .SP
.SH SYNOPSIS .SH SYNOPSIS
@ -313,9 +313,9 @@ typedef struct opj_cparameters
'\".SH OPTIONS '\".SH OPTIONS
'\".SH BUGS '\".SH BUGS
.SH AUTHORS .SH AUTHORS
Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
Copyright (c) 2002-2007, Professor Benoit Macq Copyright (c) 2002-2014, Professor Benoit Macq
Copyright (c) 2001-2003, David Janssens Copyright (c) 2001-2003, David Janssens

View File

@ -1,8 +1,8 @@
/* /*
* $Id: mainpage.h 47 2011-02-17 16:57:49Z kaori $ * $Id$
* *
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2011, Professor Benoit Macq * Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2010-2011, Kaori Hagihara * Copyright (c) 2010-2011, Kaori Hagihara
* All rights reserved. * All rights reserved.
* *
@ -28,7 +28,7 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
/*! \mainpage OpenJPIP v2.1 Documentation /*! \page openjpippage OpenJPIP v@OPENJPEG_VERSION@ Documentation
* *
* \section intro Introduction * \section intro Introduction
* This manual documents the low-level OpenJPIP C API.\n * This manual documents the low-level OpenJPIP C API.\n
@ -36,12 +36,11 @@
* ( For more info about JPIP, check the website: http://www.jpeg.org/jpeg2000/j2kpart9.html)\n * ( For more info about JPIP, check the website: http://www.jpeg.org/jpeg2000/j2kpart9.html)\n
* *
* This whole documents covers the following six programs.\n * This whole documents covers the following six programs.\n
* - opj_server.c JPIP server supporting HTTP connection and JPT/JPP-stream * - opj_server.c JPIP server supporting HTTP connection and JPT/JPP-stream
* - opj_dec_server.c Server to decode JPT/JPP-stream and communicate locally with JPIP client, which is coded in java * - opj_dec_server.c Server to decode JPT/JPP-stream and communicate locally with JPIP client, which is coded in java
* - addXMLinJP2.c To Embed metadata into JP2 file * - opj_jpip_addxml.c To Embed metadata into JP2 file
* - jpip_to_jp2.c To Convert JPT/JPP-stream to JP2 * - opj_jpip_transcode.c To Convert JPT/JPP-stream to JP2 or J2K
* - jpip_to_j2k.c To Convert JPT/JPP-stream to J2K * - opj_jpip_test.c To test index code format of a JP2 file
* - test_index.c To test index code format of a JP2 file
* *
* \section license License * \section license License
* This software is released under the BSD license, anybody can use or modify the library, even for commercial applications.\n * This software is released under the BSD license, anybody can use or modify the library, even for commercial applications.\n
@ -65,7 +64,7 @@
* *
* *
* \section sysarchtect System Architecture * \section sysarchtect System Architecture
* JPIP protocol is implimented between the JPIP server program (opj_server) and the JPIP client java program (opj_viewer).\n * JPIP protocol is implemented between the JPIP server program (opj_server) and the JPIP client java program (opj_viewer).\n
* Figure below represents the overview of our system architecture.\n * Figure below represents the overview of our system architecture.\n
* The JPIP server parses JPIP query and sends corresponding JPT/JPP-stream. * The JPIP server parses JPIP query and sends corresponding JPT/JPP-stream.
* The JPIP client viewer is an image viewer with GUI to publish JPIP requests and receive JPT/JPP-stream.\n * The JPIP client viewer is an image viewer with GUI to publish JPIP requests and receive JPT/JPP-stream.\n

View File

@ -1,13 +0,0 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: openjpeg
Description: JPEG2000 Wireless (Part 11 - JPWL) library
URL: http://www.openjpeg.org/
Version: @VERSION@
@pkgconfig_requires_private@: @requirements@
Libs: -L${libdir} -lopenjpeg_JPWL
Libs.private: -lm
Cflags: -I${includedir}

View File

@ -1,64 +0,0 @@
INCLUDE_REGULAR_EXPRESSION("^.*$")
# Defines the source code for the library
SET(OPENJPEG_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/bio.c
${CMAKE_CURRENT_SOURCE_DIR}/cio.c
${CMAKE_CURRENT_SOURCE_DIR}/dwt.c
${CMAKE_CURRENT_SOURCE_DIR}/event.c
${CMAKE_CURRENT_SOURCE_DIR}/image.c
${CMAKE_CURRENT_SOURCE_DIR}/j2k.c
${CMAKE_CURRENT_SOURCE_DIR}/j2k_lib.c
${CMAKE_CURRENT_SOURCE_DIR}/jp2.c
${CMAKE_CURRENT_SOURCE_DIR}/jpt.c
${CMAKE_CURRENT_SOURCE_DIR}/mct.c
${CMAKE_CURRENT_SOURCE_DIR}/mqc.c
${CMAKE_CURRENT_SOURCE_DIR}/openjpeg.c
${CMAKE_CURRENT_SOURCE_DIR}/pi.c
${CMAKE_CURRENT_SOURCE_DIR}/raw.c
${CMAKE_CURRENT_SOURCE_DIR}/t1.c
${CMAKE_CURRENT_SOURCE_DIR}/t2.c
${CMAKE_CURRENT_SOURCE_DIR}/tcd.c
${CMAKE_CURRENT_SOURCE_DIR}/tgt.c
${CMAKE_CURRENT_SOURCE_DIR}/cidx_manager.c
${CMAKE_CURRENT_SOURCE_DIR}/phix_manager.c
${CMAKE_CURRENT_SOURCE_DIR}/ppix_manager.c
${CMAKE_CURRENT_SOURCE_DIR}/thix_manager.c
${CMAKE_CURRENT_SOURCE_DIR}/tpix_manager.c
)
# Build the library
IF(WIN32)
IF(BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DOPJ_EXPORTS)
ELSE(BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DOPJ_STATIC)
ENDIF(BUILD_SHARED_LIBS)
ENDIF(WIN32)
ADD_LIBRARY(${OPENJPEG_LIBRARY_NAME} ${OPENJPEG_SRCS})
IF(UNIX)
TARGET_LINK_LIBRARIES(${OPENJPEG_LIBRARY_NAME} m)
ENDIF(UNIX)
SET_TARGET_PROPERTIES(${OPENJPEG_LIBRARY_NAME} PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES})
# Build the JPWL library ?
IF(BUILD_JPWL)
ADD_SUBDIRECTORY(jpwl)
ENDIF(BUILD_JPWL)
# Install library
INSTALL(TARGETS ${OPENJPEG_LIBRARY_NAME}
EXPORT OpenJPEGTargets
RUNTIME DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
LIBRARY DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries
ARCHIVE DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries
)
# Install includes files
INSTALL(FILES openjpeg.h
DESTINATION ${OPENJPEG_INSTALL_INCLUDE_DIR}/${OPENJPEG_INSTALL_SUBDIR} COMPONENT Headers
)
# install man page of the library
INSTALL(
FILES ${OPENJPEG_SOURCE_DIR}/doc/man/man3/libopenjpeg.3
DESTINATION ${OPENJPEG_INSTALL_MAN_DIR}/man3)

View File

@ -1,111 +0,0 @@
MAINTAINERCLEANFILES = Makefile.in
SUBDIRS = .
if WANT_JPWL
SUBDIRS += jpwl
endif
includesdir = $(includedir)/openjpeg-$(MAJOR_NR).$(MINOR_NR)
includes_HEADERS = openjpeg.h
lib_LTLIBRARIES = libopenjpeg.la
libopenjpeg_la_CPPFLAGS = \
-I. \
-I$(top_srcdir)/libopenjpeg \
-I$(top_builddir)/libopenjpeg
libopenjpeg_la_CFLAGS =
libopenjpeg_la_LIBADD = -lm
libopenjpeg_la_LDFLAGS = -no-undefined -version-info @lt_version@
libopenjpeg_la_SOURCES = \
bio.c \
cio.c \
dwt.c \
event.c \
image.c \
j2k.c \
j2k_lib.c \
jp2.c \
jpt.c \
mct.c \
mqc.c \
openjpeg.c \
pi.c \
raw.c \
t1.c \
t1_generate_luts.c \
t2.c \
tcd.c \
tgt.c \
cidx_manager.c \
phix_manager.c \
ppix_manager.c \
thix_manager.c \
tpix_manager.c \
bio.h \
cio.h \
dwt.h \
event.h \
fix.h \
image.h \
indexbox_manager.h \
int.h \
j2k.h \
j2k_lib.h \
jp2.h \
jpt.h \
mct.h \
mqc.h \
opj_includes.h \
opj_malloc.h \
pi.h \
raw.h \
t1.h \
t1_luts.h \
t2.h \
tcd.h \
tgt.h \
cidx_manager.h
EXTRA_DIST = \
CMakeLists.txt
install-data-hook:
cd $(DESTDIR)$(includedir) && \
rm -f openjpeg.h && \
$(LN_S) openjpeg-$(MAJOR_NR).$(MINOR_NR)/openjpeg.h \
openjpeg.h
@rm -rf $(top_builddir)/report.txt
@echo -e " (LA)\t$(libdir)/libopenjpeg.la" >> $(top_builddir)/report.txt
if BUILD_SHARED
@( $(call solist) ) >> $(top_builddir)/report.txt
endif
if BUILD_STATIC
@echo -e " (A)\t$(base)/$(a)" >> $(top_builddir)/report.txt
endif
@echo -e " (H)\t$(includedir)/openjpeg-$(MAJOR_NR).$(MINOR_NR)/openjpeg.h" >> $(top_builddir)/report.txt
@echo -e " (LN)\t$(includedir)/openjpeg.h" >> $(top_builddir)/report.txt
uninstall-hook:
rm -f $(DESTDIR)$(includedir)/openjpeg.h
solist = $(foreach f, $(dll) $(so), echo -e ' $(SO_PREFIX)\t$(base)/$(f)' ;)
get_tok = $(shell grep -E "^$(1)=" $(lib_LTLIBRARIES) | cut -d "'" -f 2)
base = $(call get_tok,libdir)
so = $(call get_tok,library_names)
a = $(call get_tok,old_library)
if HAVE_WIN32
SO_PREFIX = (DLL)
dll = $(call get_tok,dlname)
else
if HAVE_DARWIN
SO_PREFIX = (DY)
dll =
else
SO_PREFIX = (SO)
dll =
endif
endif

View File

@ -1,213 +0,0 @@
/*
* $Id: cidx_manager.c 897 2011-08-28 21:43:57Z Kaori.Hagihara@gmail.com $
*
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2011, Professor Benoit Macq
* Copyright (c) 2003-2004, Yannick Verschueren
* Copyright (c) 2010-2011, Kaori Hagihara
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <stdlib.h>
#include "opj_includes.h"
/*
* Write CPTR Codestream finder box
*
* @param[in] coff offset of j2k codestream
* @param[in] clen length of j2k codestream
* @param[in] cio file output handle
*/
void write_cptr(int coff, int clen, opj_cio_t *cio);
/*
* Write main header index table (box)
*
* @param[in] coff offset of j2k codestream
* @param[in] cstr_info codestream information
* @param[in] cio file output handle
* @return length of mainmhix box
*/
int write_mainmhix( int coff, opj_codestream_info_t cstr_info, opj_cio_t *cio);
/*
* Check if EPH option is used
*
* @param[in] coff offset of j2k codestream
* @param[in] markers marker information
* @param[in] marknum number of markers
* @param[in] cio file output handle
* @return true if EPH is used
*/
opj_bool check_EPHuse( int coff, opj_marker_info_t *markers, int marknum, opj_cio_t *cio);
int write_cidx( int offset, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t cstr_info, int j2klen)
{
int len, i, lenp;
opj_jp2_box_t *box;
int num_box = 0;
opj_bool EPHused;
(void)image; /* unused ? */
lenp = -1;
box = (opj_jp2_box_t *)opj_calloc( 32, sizeof(opj_jp2_box_t));
for (i=0;i<2;i++){
if(i)
cio_seek( cio, lenp);
lenp = cio_tell( cio);
cio_skip( cio, 4); /* L [at the end] */
cio_write( cio, JPIP_CIDX, 4); /* CIDX */
write_cptr( offset, cstr_info.codestream_size, cio);
write_manf( i, num_box, box, cio);
num_box = 0;
box[num_box].length = write_mainmhix( offset, cstr_info, cio);
box[num_box].type = JPIP_MHIX;
num_box++;
box[num_box].length = write_tpix( offset, cstr_info, j2klen, cio);
box[num_box].type = JPIP_TPIX;
num_box++;
box[num_box].length = write_thix( offset, cstr_info, cio);
box[num_box].type = JPIP_THIX;
num_box++;
EPHused = check_EPHuse( offset, cstr_info.marker, cstr_info.marknum, cio);
box[num_box].length = write_ppix( offset, cstr_info, EPHused, j2klen, cio);
box[num_box].type = JPIP_PPIX;
num_box++;
box[num_box].length = write_phix( offset, cstr_info, EPHused, j2klen, cio);
box[num_box].type = JPIP_PHIX;
num_box++;
len = cio_tell( cio)-lenp;
cio_seek( cio, lenp);
cio_write( cio, len, 4); /* L */
cio_seek( cio, lenp+len);
}
opj_free( box);
return len;
}
void write_cptr(int coff, int clen, opj_cio_t *cio)
{
int len, lenp;
lenp = cio_tell( cio);
cio_skip( cio, 4); /* L [at the end] */
cio_write( cio, JPIP_CPTR, 4); /* T */
cio_write( cio, 0, 2); /* DR A PRECISER !! */
cio_write( cio, 0, 2); /* CONT */
cio_write( cio, coff, 8); /* COFF A PRECISER !! */
cio_write( cio, clen, 8); /* CLEN */
len = cio_tell( cio) - lenp;
cio_seek( cio, lenp);
cio_write( cio, len, 4); /* L */
cio_seek( cio, lenp+len);
}
void write_manf(int second, int v, opj_jp2_box_t *box, opj_cio_t *cio)
{
int len, lenp, i;
lenp = cio_tell( cio);
cio_skip( cio, 4); /* L [at the end] */
cio_write( cio, JPIP_MANF,4); /* T */
if (second){ /* Write only during the second pass */
for( i=0; i<v; i++){
cio_write( cio, box[i].length, 4); /* Box length */
cio_write( cio, box[i].type, 4); /* Box type */
}
}
len = cio_tell( cio) - lenp;
cio_seek( cio, lenp);
cio_write( cio, len, 4); /* L */
cio_seek( cio, lenp+len);
}
int write_mainmhix( int coff, opj_codestream_info_t cstr_info, opj_cio_t *cio)
{
int i;
int len, lenp;
lenp = cio_tell( cio);
cio_skip( cio, 4); /* L [at the end] */
cio_write( cio, JPIP_MHIX, 4); /* MHIX */
cio_write( cio, cstr_info.main_head_end-cstr_info.main_head_start+1, 8); /* TLEN */
for(i = 1; i < cstr_info.marknum; i++){ /* Marker restricted to 1 apparition, skip SOC marker */
cio_write( cio, cstr_info.marker[i].type, 2);
cio_write( cio, 0, 2);
cio_write( cio, cstr_info.marker[i].pos-coff, 8);
cio_write( cio, cstr_info.marker[i].len, 2);
}
len = cio_tell( cio) - lenp;
cio_seek( cio, lenp);
cio_write( cio, len, 4); /* L */
cio_seek( cio, lenp+len);
return len;
}
opj_bool check_EPHuse( int coff, opj_marker_info_t *markers, int marknum, opj_cio_t *cio)
{
opj_bool EPHused = OPJ_FALSE;
int i=0;
int org_pos;
unsigned int Scod;
for(i = 0; i < marknum; i++){
if( markers[i].type == J2K_MS_COD){
org_pos = cio_tell( cio);
cio_seek( cio, coff+markers[i].pos+2);
Scod = cio_read( cio, 1);
if( ((Scod >> 2) & 1))
EPHused = OPJ_TRUE;
cio_seek( cio, org_pos);
break;
}
}
return EPHused;
}

View File

@ -1,32 +0,0 @@
# Makefile for the main JPWL OpenJPEG codecs: JPWL_ j2k_to_image and JPWL_image_to_j2k
ADD_DEFINITIONS(-DUSE_JPWL)
SET(JPWL_SRCS crc.c jpwl.c jpwl_lib.c rs.c)
IF(APPLE)
SET_SOURCE_FILES_PROPERTIES(
rs.c
PROPERTIES
COMPILE_FLAGS -fno-common)
ENDIF(APPLE)
INCLUDE_DIRECTORIES(
${OPENJPEG_SOURCE_DIR}/libopenjpeg
)
# Build the library
IF(WIN32)
IF(BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DOPJ_EXPORTS)
ELSE(BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DOPJ_STATIC)
ENDIF(BUILD_SHARED_LIBS)
ENDIF(WIN32)
ADD_LIBRARY(${OPENJPEG_LIBRARY_NAME}_JPWL ${JPWL_SRCS} ${OPENJPEG_SRCS})
SET_TARGET_PROPERTIES(${OPENJPEG_LIBRARY_NAME}_JPWL
PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES})
# Install library
INSTALL(TARGETS ${OPENJPEG_LIBRARY_NAME}_JPWL
DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries
)

View File

@ -1,77 +0,0 @@
MAINTAINERCLEANFILES = Makefile.in
lib_LTLIBRARIES = libopenjpeg_JPWL.la
OPJ_SRC = \
../bio.c \
../cio.c \
../dwt.c \
../event.c \
../image.c \
../j2k.c \
../j2k_lib.c \
../jp2.c \
../jpt.c \
../mct.c \
../mqc.c \
../openjpeg.c \
../pi.c \
../raw.c \
../t1.c \
../t1_generate_luts.c \
../t2.c \
../tcd.c \
../tgt.c \
../cidx_manager.c \
../phix_manager.c \
../ppix_manager.c \
../thix_manager.c \
../tpix_manager.c
libopenjpeg_JPWL_la_CPPFLAGS = \
-I. \
-I$(top_srcdir)/libopenjpeg \
-I$(top_builddir)/libopenjpeg \
-I$(top_srcdir)/libopenjpeg/jpwl \
-I$(top_builddir)/libopenjpeg/jpwl \
-DUSE_JPWL
libopenjpeg_JPWL_la_CFLAGS =
libopenjpeg_JPWL_la_LIBADD = -lm
libopenjpeg_JPWL_la_LDFLAGS = -no-undefined -version-info @lt_version@
libopenjpeg_JPWL_la_SOURCES = \
$(OPJ_SRC) \
crc.c \
jpwl.c \
jpwl_lib.c \
rs.c \
crc.h \
jpwl.h \
rs.h
install-data-hook:
@echo -e " (LA)\t$(libdir)/libopenjpeg_JPWL.la" >> $(top_builddir)/report.txt
if BUILD_SHARED
@( $(call solist) ) >> $(top_builddir)/report.txt
endif
if BUILD_STATIC
@echo -e " (A)\t$(base)/$(a)" >> $(top_builddir)/report.txt
endif
solist = $(foreach f, $(dll) $(so), echo -e ' $(SO_PREFIX)\t$(base)/$(f)' ;)
get_tok = $(shell grep -E "^$(1)=" $(lib_LTLIBRARIES) | cut -d "'" -f 2)
base = $(call get_tok,libdir)
so = $(call get_tok,library_names)
a = $(call get_tok,old_library)
if HAVE_WIN32
SO_PREFIX = (DLL)
dll = $(call get_tok,dlname)
else
if HAVE_DARWIN
SO_PREFIX = (DY)
dll =
else
SO_PREFIX = (SO)
dll =
endif
endif

File diff suppressed because it is too large Load Diff

View File

@ -1,170 +0,0 @@
/*
* $Id: phix_manager.c 897 2011-08-28 21:43:57Z Kaori.Hagihara@gmail.com $
*
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2011, Professor Benoit Macq
* Copyright (c) 2003-2004, Yannick Verschueren
* Copyright (c) 2010-2011, Kaori Hagihara
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/*! \file
* \brief Modification of jpip.c from 2KAN indexer
*/
#include <stdlib.h>
#include <math.h>
#include "opj_includes.h"
/*
* Write faix box of phix
*
* @param[in] coff offset of j2k codestream
* @param[in] compno component number
* @param[in] cstr_info codestream information
* @param[in] EPHused true if if EPH option used
* @param[in] j2klen length of j2k codestream
* @param[in] cio file output handle
* @return length of faix box
*/
int write_phixfaix( int coff, int compno, opj_codestream_info_t cstr_info, opj_bool EPHused, int j2klen, opj_cio_t *cio);
int write_phix( int coff, opj_codestream_info_t cstr_info, opj_bool EPHused, int j2klen, opj_cio_t *cio)
{
int len, lenp=0, compno, i;
opj_jp2_box_t *box;
box = (opj_jp2_box_t *)opj_calloc( cstr_info.numcomps, sizeof(opj_jp2_box_t));
for( i=0;i<2;i++){
if (i) cio_seek( cio, lenp);
lenp = cio_tell( cio);
cio_skip( cio, 4); /* L [at the end] */
cio_write( cio, JPIP_PHIX, 4); /* PHIX */
write_manf( i, cstr_info.numcomps, box, cio);
for( compno=0; compno<cstr_info.numcomps; compno++){
box[compno].length = write_phixfaix( coff, compno, cstr_info, EPHused, j2klen, cio);
box[compno].type = JPIP_FAIX;
}
len = cio_tell( cio)-lenp;
cio_seek( cio, lenp);
cio_write( cio, len, 4); /* L */
cio_seek( cio, lenp+len);
}
opj_free(box);
return len;
}
int write_phixfaix( int coff, int compno, opj_codestream_info_t cstr_info, opj_bool EPHused, int j2klen, opj_cio_t *cio)
{
int len, lenp, tileno, version, i, nmax, size_of_coding; /* 4 or 8 */
opj_tile_info_t *tile_Idx;
opj_packet_info_t packet;
int resno, precno, layno, num_packet;
int numOfres, numOfprec, numOflayers;
packet.end_ph_pos = packet.start_pos = -1;
(void)EPHused; /* unused ? */
if( j2klen > pow( 2, 32)){
size_of_coding = 8;
version = 1;
}
else{
size_of_coding = 4;
version = 0;
}
lenp = cio_tell( cio);
cio_skip( cio, 4); /* L [at the end] */
cio_write( cio, JPIP_FAIX, 4); /* FAIX */
cio_write( cio, version,1); /* Version 0 = 4 bytes */
nmax = 0;
for( i=0; i<=cstr_info.numdecompos[compno]; i++)
nmax += cstr_info.tile[0].ph[i] * cstr_info.tile[0].pw[i] * cstr_info.numlayers;
cio_write( cio, nmax, size_of_coding); /* NMAX */
cio_write( cio, cstr_info.tw*cstr_info.th, size_of_coding); /* M */
for( tileno=0; tileno<cstr_info.tw*cstr_info.th; tileno++){
tile_Idx = &cstr_info.tile[ tileno];
num_packet = 0;
numOfres = cstr_info.numdecompos[compno] + 1;
for( resno=0; resno<numOfres ; resno++){
numOfprec = tile_Idx->pw[resno]*tile_Idx->ph[resno];
for( precno=0; precno<numOfprec; precno++){
numOflayers = cstr_info.numlayers;
for( layno=0; layno<numOflayers; layno++){
switch ( cstr_info.prog){
case LRCP:
packet = tile_Idx->packet[ ((layno*numOfres+resno)*cstr_info.numcomps+compno)*numOfprec+precno];
break;
case RLCP:
packet = tile_Idx->packet[ ((resno*numOflayers+layno)*cstr_info.numcomps+compno)*numOfprec+precno];
break;
case RPCL:
packet = tile_Idx->packet[ ((resno*numOfprec+precno)*cstr_info.numcomps+compno)*numOflayers+layno];
break;
case PCRL:
packet = tile_Idx->packet[ ((precno*cstr_info.numcomps+compno)*numOfres+resno)*numOflayers + layno];
break;
case CPRL:
packet = tile_Idx->packet[ ((compno*numOfprec+precno)*numOfres+resno)*numOflayers + layno];
break;
default:
fprintf( stderr, "failed to ppix indexing\n");
}
cio_write( cio, packet.start_pos-coff, size_of_coding); /* start position */
cio_write( cio, packet.end_ph_pos-packet.start_pos+1, size_of_coding); /* length */
num_packet++;
}
}
}
/* PADDING */
while( num_packet < nmax){
cio_write( cio, 0, size_of_coding); /* start position */
cio_write( cio, 0, size_of_coding); /* length */
num_packet++;
}
}
len = cio_tell( cio)-lenp;
cio_seek( cio, lenp);
cio_write( cio, len, 4); /* L */
cio_seek( cio, lenp+len);
return len;
}

View File

@ -1,120 +0,0 @@
/*
* $Id: thix_manager.c 897 2011-08-28 21:43:57Z Kaori.Hagihara@gmail.com $
*
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2011, Professor Benoit Macq
* Copyright (c) 2003-2004, Yannick Verschueren
* Copyright (c) 2010-2011, Kaori Hagihara
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/*! \file
* \brief Modification of jpip.c from 2KAN indexer
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "opj_includes.h"
/*
* Write tile-part headers mhix box
*
* @param[in] coff offset of j2k codestream
* @param[in] cstr_info codestream information
* @param[in] tileno tile number
* @param[in] cio file output handle
* @return length of mhix box
*/
int write_tilemhix( int coff, opj_codestream_info_t cstr_info, int tileno, opj_cio_t *cio);
int write_thix( int coff, opj_codestream_info_t cstr_info, opj_cio_t *cio)
{
int len, lenp, i;
int tileno;
opj_jp2_box_t *box;
lenp = 0;
box = (opj_jp2_box_t *)opj_calloc( cstr_info.tw*cstr_info.th, sizeof(opj_jp2_box_t));
for ( i = 0; i < 2 ; i++ ){
if (i)
cio_seek( cio, lenp);
lenp = cio_tell( cio);
cio_skip( cio, 4); /* L [at the end] */
cio_write( cio, JPIP_THIX, 4); /* THIX */
write_manf( i, cstr_info.tw*cstr_info.th, box, cio);
for (tileno = 0; tileno < cstr_info.tw*cstr_info.th; tileno++){
box[tileno].length = write_tilemhix( coff, cstr_info, tileno, cio);
box[tileno].type = JPIP_MHIX;
}
len = cio_tell( cio)-lenp;
cio_seek( cio, lenp);
cio_write( cio, len, 4); /* L */
cio_seek( cio, lenp+len);
}
opj_free(box);
return len;
}
int write_tilemhix( int coff, opj_codestream_info_t cstr_info, int tileno, opj_cio_t *cio)
{
int i;
opj_tile_info_t tile;
opj_tp_info_t tp;
int len, lenp;
opj_marker_info_t *marker;
lenp = cio_tell( cio);
cio_skip( cio, 4); /* L [at the end] */
cio_write( cio, JPIP_MHIX, 4); /* MHIX */
tile = cstr_info.tile[tileno];
tp = tile.tp[0];
cio_write( cio, tp.tp_end_header-tp.tp_start_pos+1, 8); /* TLEN */
marker = cstr_info.tile[tileno].marker;
for( i=0; i<cstr_info.tile[tileno].marknum; i++){ /* Marker restricted to 1 apparition */
cio_write( cio, marker[i].type, 2);
cio_write( cio, 0, 2);
cio_write( cio, marker[i].pos-coff, 8);
cio_write( cio, marker[i].len, 2);
}
/* free( marker);*/
len = cio_tell( cio) - lenp;
cio_seek( cio, lenp);
cio_write( cio, len, 4); /* L */
cio_seek( cio, lenp+len);
return len;
}

View File

@ -1,153 +0,0 @@
/*
* $Id: tpix_manager.c 897 2011-08-28 21:43:57Z Kaori.Hagihara@gmail.com $
*
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2011, Professor Benoit Macq
* Copyright (c) 2003-2004, Yannick Verschueren
* Copyright (c) 2010-2011, Kaori Hagihara
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/*! \file
* \brief Modification of jpip.c from 2KAN indexer
*/
#include <math.h>
#include "opj_includes.h"
#define MAX(a,b) ((a)>(b)?(a):(b))
/*
* Write faix box of tpix
*
* @param[in] coff offset of j2k codestream
* @param[in] compno component number
* @param[in] cstr_info codestream information
* @param[in] j2klen length of j2k codestream
* @param[in] cio file output handle
* @return length of faix box
*/
int write_tpixfaix( int coff, int compno, opj_codestream_info_t cstr_info, int j2klen, opj_cio_t *cio);
int write_tpix( int coff, opj_codestream_info_t cstr_info, int j2klen, opj_cio_t *cio)
{
int len, lenp;
lenp = cio_tell( cio);
cio_skip( cio, 4); /* L [at the end] */
cio_write( cio, JPIP_TPIX, 4); /* TPIX */
write_tpixfaix( coff, 0, cstr_info, j2klen, cio);
len = cio_tell( cio)-lenp;
cio_seek( cio, lenp);
cio_write( cio, len, 4); /* L */
cio_seek( cio, lenp+len);
return len;
}
/*
* Get number of maximum tile parts per tile
*
* @param[in] cstr_info codestream information
* @return number of maximum tile parts per tile
*/
int get_num_max_tile_parts( opj_codestream_info_t cstr_info);
int write_tpixfaix( int coff, int compno, opj_codestream_info_t cstr_info, int j2klen, opj_cio_t *cio)
{
int len, lenp;
int i, j;
int Aux;
int num_max_tile_parts;
int size_of_coding; /* 4 or 8 */
opj_tp_info_t tp;
int version;
num_max_tile_parts = get_num_max_tile_parts( cstr_info);
if( j2klen > pow( 2, 32)){
size_of_coding = 8;
version = num_max_tile_parts == 1 ? 1:3;
}
else{
size_of_coding = 4;
version = num_max_tile_parts == 1 ? 0:2;
}
lenp = cio_tell( cio);
cio_skip( cio, 4); /* L [at the end] */
cio_write( cio, JPIP_FAIX, 4); /* FAIX */
cio_write( cio, version, 1); /* Version 0 = 4 bytes */
cio_write( cio, num_max_tile_parts, size_of_coding); /* NMAX */
cio_write( cio, cstr_info.tw*cstr_info.th, size_of_coding); /* M */
for (i = 0; i < cstr_info.tw*cstr_info.th; i++){
for (j = 0; j < cstr_info.tile[i].num_tps; j++){
tp = cstr_info.tile[i].tp[j];
cio_write( cio, tp.tp_start_pos-coff, size_of_coding); /* start position */
cio_write( cio, tp.tp_end_pos-tp.tp_start_pos+1, size_of_coding); /* length */
if (version & 0x02){
if( cstr_info.tile[i].num_tps == 1 && cstr_info.numdecompos[compno] > 1)
Aux = cstr_info.numdecompos[compno] + 1;
else
Aux = j + 1;
cio_write( cio, Aux,4);
/*cio_write(img.tile[i].tile_parts[j].num_reso_AUX,4);*/ /* Aux_i,j : Auxiliary value */
/* fprintf(stderr,"AUX value %d\n",Aux);*/
}
/*cio_write(0,4);*/
}
/* PADDING */
while (j < num_max_tile_parts){
cio_write( cio, 0, size_of_coding); /* start position */
cio_write( cio, 0, size_of_coding); /* length */
if (version & 0x02)
cio_write( cio, 0,4); /* Aux_i,j : Auxiliary value */
j++;
}
}
len = cio_tell( cio)-lenp;
cio_seek( cio, lenp);
cio_write( cio, len, 4); /* L */
cio_seek( cio, lenp+len);
return len;
}
int get_num_max_tile_parts( opj_codestream_info_t cstr_info)
{
int num_max_tp = 0, i;
for( i=0; i<cstr_info.tw*cstr_info.th; i++)
num_max_tp = MAX( cstr_info.tile[i].num_tps, num_max_tp);
return num_max_tp;
}

View File

@ -1,12 +0,0 @@
prefix=@CMAKE_INSTALL_PREFIX@
bindir=@OPENJPEG_INSTALL_BIN_DIR@
datadir=@OPENJPEG_INSTALL_DATA_DIR@
libdir=@OPENJPEG_INSTALL_LIB_DIR@
includedir=@OPENJPEG_INSTALL_INCLUDE_DIR@
Name: openjpeg
Description: JPEG2000 files library
URL: http://www.openjpeg.org/
Version: @OPENJPEG_VERSION@
Libs: -L${libdir} -lopenjpeg
Cflags: -I${includedir}

View File

@ -1,13 +0,0 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: openjpeg
Description: JPEG2000 library
URL: http://www.openjpeg.org/
Version: @VERSION@
@pkgconfig_requires_private@: @requirements@
Libs: -L${libdir} -lopenjpeg
Libs.private: -lm
Cflags: -I${includedir}

View File

@ -1,128 +0,0 @@
dnl Copyright (C) 2011 Vincent Torri <vtorri at univ-evry dot fr>
dnl That code is public domain and can be freely used or copied.
dnl Macro that check if a library is in a specified directory.
dnl Usage: OPJ_CHECK_LIB_WITH_PREFIX(prefix, header, lib, func [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Call AC_SUBST(THELIB_CFLAGS)
dnl Call AC_SUBST(THELIB_LIBS)
dnl where THELIB is the uppercase value of 'lib'
AC_DEFUN([OPJ_CHECK_LIB_WITH_PREFIX],
[
m4_pushdef([UP], m4_toupper([$3]))
m4_pushdef([DOWN], m4_tolower([$3]))
__opj_prefix=$1
__opj_header=$2
__opj_lib=$3
__opj_func=$4
__opj_have_dep="no"
save_CPPFLAGS=${CPPFLAGS}
save_LDFLAGS=${LDFLAGS}
save_LIBS=${LIBS}
if test "x${__opj_prefix}" = "x" ; then
CPPFLAGS="${CPPFLAGS} $UP[_CFLAGS]"
LDFLAGS="${LDFLAGS} $UP[_LIBS]"
else
CPPFLAGS="${CPPFLAGS} -I${__opj_prefix}/include"
LDFLAGS="${LDFLAGS} -L${__opj_prefix}/lib"
LIBS="${LIBS} -l${__opj_lib}"
fi
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <${__opj_header}>
]],
[[
${__opj_func}();
]])],
[__opj_have_dep="yes"],
[__opj_have_dep="no"])
CPPFLAGS=${save_CPPFLAGS}
LDFLAGS=${save_LDFLAGS}
LIBS=${save_LIBS}
if test "x${__opj_prefix}" = "x" ; then
AC_MSG_CHECKING([whether ]UP[ library is available in standard or predefined directories])
else
AC_MSG_CHECKING([whether ]UP[ library is available in ${__opj_prefix}])
fi
AC_MSG_RESULT([${__opj_have_dep}])
if test "x${__opj_have_dep}" = "xyes" && ! test "x${__opj_prefix}" = "x"; then
if test "x${UP[]_CFLAGS}" = "x" ; then
UP[]_CFLAGS="-I${__opj_prefix}/include"
fi
if test "x${UP[]_LIBS}" = "x" ; then
UP[]_LIBS="-L${__opj_prefix}/lib -l${__opj_lib}"
fi
fi
AS_IF([test "x${__opj_have_dep}" = "xyes"], [$5], [$6])
m4_popdef([UP])
m4_popdef([DOWN])
])
dnl Macro that check if a library is in a set of directories.
dnl Usage: OPJ_CHECK_LIB(header, lib, func [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
AC_DEFUN([OPJ_CHECK_LIB],
[
m4_pushdef([UP], m4_toupper([$2]))
__opj_have_dep="no"
OPJ_CHECK_LIB_WITH_PREFIX([],
[$1],
[$2],
[$3],
[__opj_have_dep="yes"],
[__opj_have_dep="no"])
if ! test "x${__opj_have_dep}" = "xyes" ; then
OPJ_CHECK_LIB_WITH_PREFIX([/usr],
[$1],
[$2],
[$3],
[__opj_have_dep="yes"],
[__opj_have_dep="no"])
fi
if ! test "x${__opj_have_dep}" = "xyes" ; then
OPJ_CHECK_LIB_WITH_PREFIX([/usr/local],
[$1],
[$2],
[$3],
[__opj_have_dep="yes"],
[__opj_have_dep="no"])
fi
if ! test "x${__opj_have_dep}" = "xyes" ; then
OPJ_CHECK_LIB_WITH_PREFIX([/opt/local],
[$1],
[$2],
[$3],
[__opj_have_dep="yes"],
[__opj_have_dep="no"])
fi
AC_ARG_VAR(UP[_CFLAGS], [preprocessor flags for lib$2])
AC_SUBST(UP[_CFLAGS])
AC_ARG_VAR(UP[_LIBS], [linker flags for lib$2])
AC_SUBST(UP[_LIBS])
AS_IF([test "x${__opj_have_dep}" = "xyes"], [$4], [$5])
m4_popdef([UP])
])

View File

@ -1,30 +0,0 @@
dnl Copyright (C) 2010 Vincent Torri <vtorri at univ-evry dot fr>
dnl and Albin Tonnerre <albin dot tonnerre at gmail dot com>
dnl That code is public domain and can be freely used or copied.
dnl Macro that checks if a compiler flag is supported by the compiler.
dnl Usage: OPJ_COMPILER_FLAG(flag)
dnl flag is added to CFLAGS if supported.
AC_DEFUN([OPJ_COMPILER_FLAG],
[
CFLAGS_save="${CFLAGS}"
CFLAGS="${CFLAGS} $1"
AC_LANG_PUSH([C])
AC_MSG_CHECKING([whether the compiler supports $1])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[]])],
[have_flag="yes"],
[have_flag="no"])
AC_MSG_RESULT([${have_flag}])
if test "x${have_flag}" = "xno" ; then
CFLAGS="${CFLAGS_save}"
fi
AC_LANG_POP([C])
])

View File

@ -1,94 +0,0 @@
dnl Copyright (C) 2008 Vincent Torri <vtorri at univ-evry dot fr>
dnl That code is public domain and can be freely used or copied.
dnl Macro that check if doxygen is available or not.
dnl OPJ_CHECK_DOXYGEN([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Test for the doxygen program
dnl Defines opj_doxygen
dnl Defines the automake conditionnal OPJ_BUILD_DOC
dnl
AC_DEFUN([OPJ_CHECK_DOXYGEN],
[
dnl
dnl Disable the build of the documentation
dnl
AC_ARG_ENABLE([doc],
[AC_HELP_STRING(
[--disable-doc],
[Disable documentation build @<:@default=enabled@:>@])],
[
if test "x${enableval}" = "xyes" ; then
opj_enable_doc="yes"
else
opj_enable_doc="no"
fi
],
[opj_enable_doc="yes"])
AC_MSG_CHECKING([whether to build documentation])
AC_MSG_RESULT([${opj_enable_doc}])
if test "x${opj_enable_doc}" = "xyes" ; then
dnl Specify the file name, without path
opj_doxygen="doxygen"
AC_ARG_WITH([doxygen],
[AC_HELP_STRING(
[--with-doxygen=FILE],
[doxygen program to use @<:@default=doxygen@:>@])],
dnl Check the given doxygen program.
[opj_doxygen=${withval}
AC_CHECK_PROG([opj_have_doxygen],
[${opj_doxygen}],
[yes],
[no])
if test "x${opj_have_doxygen}" = "xno" ; then
echo "WARNING:"
echo "The doxygen program you specified:"
echo "${opj_doxygen}"
echo "was not found. Please check the path and make sure "
echo "the program exists and is executable."
AC_MSG_WARN([no doxygen detected. Documentation will not be built])
fi
],
[AC_CHECK_PROG([opj_have_doxygen],
[${opj_doxygen}],
[yes],
[no])
if test "x${opj_have_doxygen}" = "xno" ; then
echo "WARNING:"
echo "The doxygen program was not found in your execute path."
echo "You may have doxygen installed somewhere not covered by your path."
echo ""
echo "If this is the case make sure you have the packages installed, AND"
echo "that the doxygen program is in your execute path (see your"
echo "shell manual page on setting the \$PATH environment variable), OR"
echo "alternatively, specify the program to use with --with-doxygen."
AC_MSG_WARN([no doxygen detected. Documentation will not be built])
fi
])
else
opj_have_doxygen="no"
fi
dnl
dnl Substitution
dnl
AC_SUBST([opj_doxygen])
if ! test "x${opj_have_doxygen}" = "xyes" ; then
opj_enable_doc="no"
fi
AM_CONDITIONAL(OPJ_BUILD_DOC, test "x${opj_have_doxygen}" = "xyes")
AS_IF([test "x${opj_have_doxygen}" = "xyes"], [$1], [$2])
])
dnl End of opj_doxygen.m4

157
m4/pkg.m4
View File

@ -1,157 +0,0 @@
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
# serial 1 (pkg-config-0.24)
#
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
# ----------------------------------
AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
fi
if test -n "$PKG_CONFIG"; then
_pkg_min_version=m4_default([$1], [0.9.0])
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
PKG_CONFIG=""
fi
fi[]dnl
])# PKG_PROG_PKG_CONFIG
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
#
# Check to see whether a particular set of modules exists. Similar
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
#
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
# only at the first occurence in configure.ac, so if the first place
# it's called might be skipped (such as if it is within an "if", you
# have to call PKG_CHECK_EXISTS manually
# --------------------------------------------------------------
AC_DEFUN([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
if test -n "$PKG_CONFIG" && \
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
m4_default([$2], [:])
m4_ifvaln([$3], [else
$3])dnl
fi])
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
# ---------------------------------------------
m4_define([_PKG_CONFIG],
[if test -n "$$1"; then
pkg_cv_[]$1="$$1"
elif test -n "$PKG_CONFIG"; then
PKG_CHECK_EXISTS([$3],
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
[pkg_failed=yes])
else
pkg_failed=untried
fi[]dnl
])# _PKG_CONFIG
# _PKG_SHORT_ERRORS_SUPPORTED
# -----------------------------
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi[]dnl
])# _PKG_SHORT_ERRORS_SUPPORTED
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
# [ACTION-IF-NOT-FOUND])
#
#
# Note that if there is a possibility the first call to
# PKG_CHECK_MODULES might not happen, you should be sure to include an
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
#
#
# --------------------------------------------------------------
AC_DEFUN([PKG_CHECK_MODULES],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
AC_MSG_CHECKING([for $1])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
m4_default([$4], [AC_MSG_ERROR(
[Package requirements ($2) were not met:
$$1_PKG_ERRORS
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
_PKG_TEXT])dnl
])
elif test $pkg_failed = untried; then
AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
_PKG_TEXT
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])dnl
])
else
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
AC_MSG_RESULT([yes])
$3
fi[]dnl
])# PKG_CHECK_MODULES

View File

@ -1,35 +0,0 @@
/* create config.h for CMake */
#define PACKAGE_VERSION "@PACKAGE_VERSION@"
#cmakedefine HAVE_INTTYPES_H
#cmakedefine HAVE_MEMORY_H
#cmakedefine HAVE_STDINT_H
#cmakedefine HAVE_STDLIB_H
#cmakedefine HAVE_STRINGS_H
#cmakedefine HAVE_STRING_H
#cmakedefine HAVE_SYS_STAT_H
#cmakedefine HAVE_SYS_TYPES_H
#cmakedefine HAVE_UNISTD_H
#cmakedefine HAVE_LIBPNG
#cmakedefine HAVE_PNG_H
#cmakedefine HAVE_LIBTIFF
#cmakedefine HAVE_TIFF_H
#cmakedefine HAVE_LIBLCMS1
#cmakedefine HAVE_LIBLCMS2
#cmakedefine HAVE_LCMS1_H
#cmakedefine HAVE_LCMS2_H
/* Byte order. */
/* All compilers that support Mac OS X define either __BIG_ENDIAN__ or
__LITTLE_ENDIAN__ to match the endianness of the architecture being
compiled for. This is not necessarily the same as the architecture of the
machine doing the building. In order to support Universal Binaries on
Mac OS X, we prefer those defines to decide the endianness.
On other platforms we use the result of the TRY_RUN. */
#if !defined(__APPLE__)
#cmakedefine OPJ_BIG_ENDIAN
#elif defined(__BIG_ENDIAN__)
# define OPJ_BIG_ENDIAN
#endif

12
src/CMakeLists.txt Normal file
View File

@ -0,0 +1,12 @@
# required dep for server:
#if(BUILD_JPIP_SERVER)
# find_package(CURL REQUIRED)
# find_package(FCGI REQUIRED)
# find_package(Threads REQUIRED)
# if(NOT CMAKE_USE_PTHREADS_INIT)
# message(FATAL_ERROR "Only pthread are supported")
# endif()
#endif()
#add_subdirectory(lib)
#add_subdirectory(bin)

21
src/bin/CMakeLists.txt Normal file
View File

@ -0,0 +1,21 @@
# source code for openjpeg apps:
add_subdirectory(common)
# Part 1 & 2:
add_subdirectory(jp2)
# optionals components:
if(BUILD_JPWL)
add_subdirectory(jpwl)
endif()
if(BUILD_MJ2)
add_subdirectory(mj2)
endif()
if(BUILD_JPIP)
add_subdirectory(jpip)
endif()
if(BUILD_JP3D)
add_subdirectory(jp3d)
endif()
# wx apps:
add_subdirectory(wx)

View File

@ -0,0 +1,7 @@
#-----------------------------------------------------------------------------
# opj_apps_config.h generation
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/opj_apps_config.h.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/opj_apps_config.h
@ONLY
)

965
src/bin/common/color.c Normal file
View File

@ -0,0 +1,965 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <assert.h>
#include "opj_apps_config.h"
#include "openjpeg.h"
#include "color.h"
#ifdef OPJ_HAVE_LIBLCMS2
#include <lcms2.h>
#endif
#ifdef OPJ_HAVE_LIBLCMS1
#include <lcms.h>
#endif
#ifdef OPJ_USE_LEGACY
#define OPJ_CLRSPC_GRAY CLRSPC_GRAY
#define OPJ_CLRSPC_SRGB CLRSPC_SRGB
#endif
/*--------------------------------------------------------
Matrix for sYCC, Amendment 1 to IEC 61966-2-1
Y : 0.299 0.587 0.114 :R
Cb: -0.1687 -0.3312 0.5 :G
Cr: 0.5 -0.4187 -0.0812 :B
Inverse:
R: 1 -3.68213e-05 1.40199 :Y
G: 1.00003 -0.344125 -0.714128 :Cb - 2^(prec - 1)
B: 0.999823 1.77204 -8.04142e-06 :Cr - 2^(prec - 1)
-----------------------------------------------------------*/
static void sycc_to_rgb(int offset, int upb, int y, int cb, int cr,
int *out_r, int *out_g, int *out_b)
{
int r, g, b;
cb -= offset; cr -= offset;
r = y + (int)(1.402 * (float)cr);
if(r < 0) r = 0; else if(r > upb) r = upb; *out_r = r;
g = y - (int)(0.344 * (float)cb + 0.714 * (float)cr);
if(g < 0) g = 0; else if(g > upb) g = upb; *out_g = g;
b = y + (int)(1.772 * (float)cb);
if(b < 0) b = 0; else if(b > upb) b = upb; *out_b = b;
}
static void sycc444_to_rgb(opj_image_t *img)
{
int *d0, *d1, *d2, *r, *g, *b;
const int *y, *cb, *cr;
size_t maxw, maxh, max, i;
int offset, upb;
upb = (int)img->comps[0].prec;
offset = 1<<(upb - 1); upb = (1<<upb)-1;
maxw = (size_t)img->comps[0].w; maxh = (size_t)img->comps[0].h;
max = maxw * maxh;
y = img->comps[0].data;
cb = img->comps[1].data;
cr = img->comps[2].data;
d0 = r = (int*)malloc(sizeof(int) * max);
d1 = g = (int*)malloc(sizeof(int) * max);
d2 = b = (int*)malloc(sizeof(int) * max);
if(r == NULL || g == NULL || b == NULL) goto fails;
for(i = 0U; i < max; ++i)
{
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
++y; ++cb; ++cr; ++r; ++g; ++b;
}
free(img->comps[0].data); img->comps[0].data = d0;
free(img->comps[1].data); img->comps[1].data = d1;
free(img->comps[2].data); img->comps[2].data = d2;
img->color_space = OPJ_CLRSPC_SRGB;
return;
fails:
free(r);
free(g);
free(b);
}/* sycc444_to_rgb() */
static void sycc422_to_rgb(opj_image_t *img)
{
int *d0, *d1, *d2, *r, *g, *b;
const int *y, *cb, *cr;
size_t maxw, maxh, max, offx, loopmaxw;
int offset, upb;
size_t i;
upb = (int)img->comps[0].prec;
offset = 1<<(upb - 1); upb = (1<<upb)-1;
maxw = (size_t)img->comps[0].w; maxh = (size_t)img->comps[0].h;
max = maxw * maxh;
y = img->comps[0].data;
cb = img->comps[1].data;
cr = img->comps[2].data;
d0 = r = (int*)malloc(sizeof(int) * max);
d1 = g = (int*)malloc(sizeof(int) * max);
d2 = b = (int*)malloc(sizeof(int) * max);
if(r == NULL || g == NULL || b == NULL) goto fails;
/* if img->x0 is odd, then first column shall use Cb/Cr = 0 */
offx = img->x0 & 1U;
loopmaxw = maxw - offx;
for(i=0U; i < maxh; ++i)
{
size_t j;
if (offx > 0U) {
sycc_to_rgb(offset, upb, *y, 0, 0, r, g, b);
++y; ++r; ++g; ++b;
}
for(j=0U; j < (loopmaxw & ~(size_t)1U); j += 2U)
{
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
++y; ++r; ++g; ++b;
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
++y; ++r; ++g; ++b; ++cb; ++cr;
}
if (j < loopmaxw) {
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
++y; ++r; ++g; ++b; ++cb; ++cr;
}
}
free(img->comps[0].data); img->comps[0].data = d0;
free(img->comps[1].data); img->comps[1].data = d1;
free(img->comps[2].data); img->comps[2].data = d2;
img->comps[1].w = img->comps[2].w = img->comps[0].w;
img->comps[1].h = img->comps[2].h = img->comps[0].h;
img->comps[1].dx = img->comps[2].dx = img->comps[0].dx;
img->comps[1].dy = img->comps[2].dy = img->comps[0].dy;
img->color_space = OPJ_CLRSPC_SRGB;
return;
fails:
free(r);
free(g);
free(b);
}/* sycc422_to_rgb() */
static void sycc420_to_rgb(opj_image_t *img)
{
int *d0, *d1, *d2, *r, *g, *b, *nr, *ng, *nb;
const int *y, *cb, *cr, *ny;
size_t maxw, maxh, max, offx, loopmaxw, offy, loopmaxh;
int offset, upb;
size_t i;
upb = (int)img->comps[0].prec;
offset = 1<<(upb - 1); upb = (1<<upb)-1;
maxw = (size_t)img->comps[0].w; maxh = (size_t)img->comps[0].h;
max = maxw * maxh;
y = img->comps[0].data;
cb = img->comps[1].data;
cr = img->comps[2].data;
d0 = r = (int*)malloc(sizeof(int) * max);
d1 = g = (int*)malloc(sizeof(int) * max);
d2 = b = (int*)malloc(sizeof(int) * max);
if (r == NULL || g == NULL || b == NULL) goto fails;
/* if img->x0 is odd, then first column shall use Cb/Cr = 0 */
offx = img->x0 & 1U;
loopmaxw = maxw - offx;
/* if img->y0 is odd, then first line shall use Cb/Cr = 0 */
offy = img->y0 & 1U;
loopmaxh = maxh - offy;
if (offy > 0U) {
size_t j;
for(j=0; j < maxw; ++j)
{
sycc_to_rgb(offset, upb, *y, 0, 0, r, g, b);
++y; ++r; ++g; ++b;
}
}
for(i=0U; i < (loopmaxh & ~(size_t)1U); i += 2U)
{
size_t j;
ny = y + maxw;
nr = r + maxw; ng = g + maxw; nb = b + maxw;
if (offx > 0U) {
sycc_to_rgb(offset, upb, *y, 0, 0, r, g, b);
++y; ++r; ++g; ++b;
sycc_to_rgb(offset, upb, *ny, *cb, *cr, nr, ng, nb);
++ny; ++nr; ++ng; ++nb;
}
for(j=0; j < (loopmaxw & ~(size_t)1U); j += 2U)
{
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
++y; ++r; ++g; ++b;
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
++y; ++r; ++g; ++b;
sycc_to_rgb(offset, upb, *ny, *cb, *cr, nr, ng, nb);
++ny; ++nr; ++ng; ++nb;
sycc_to_rgb(offset, upb, *ny, *cb, *cr, nr, ng, nb);
++ny; ++nr; ++ng; ++nb; ++cb; ++cr;
}
if(j < loopmaxw)
{
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
++y; ++r; ++g; ++b;
sycc_to_rgb(offset, upb, *ny, *cb, *cr, nr, ng, nb);
++ny; ++nr; ++ng; ++nb; ++cb; ++cr;
}
y += maxw; r += maxw; g += maxw; b += maxw;
}
if(i < loopmaxh)
{
size_t j;
for(j=0U; j < (maxw & ~(size_t)1U); j += 2U)
{
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
++y; ++r; ++g; ++b;
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
++y; ++r; ++g; ++b; ++cb; ++cr;
}
if(j < maxw)
{
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
}
}
free(img->comps[0].data); img->comps[0].data = d0;
free(img->comps[1].data); img->comps[1].data = d1;
free(img->comps[2].data); img->comps[2].data = d2;
img->comps[1].w = img->comps[2].w = img->comps[0].w;
img->comps[1].h = img->comps[2].h = img->comps[0].h;
img->comps[1].dx = img->comps[2].dx = img->comps[0].dx;
img->comps[1].dy = img->comps[2].dy = img->comps[0].dy;
img->color_space = OPJ_CLRSPC_SRGB;
return;
fails:
free(r);
free(g);
free(b);
}/* sycc420_to_rgb() */
void color_sycc_to_rgb(opj_image_t *img)
{
if(img->numcomps < 3)
{
img->color_space = OPJ_CLRSPC_GRAY;
return;
}
if((img->comps[0].dx == 1)
&& (img->comps[1].dx == 2)
&& (img->comps[2].dx == 2)
&& (img->comps[0].dy == 1)
&& (img->comps[1].dy == 2)
&& (img->comps[2].dy == 2))/* horizontal and vertical sub-sample */
{
sycc420_to_rgb(img);
}
else
if((img->comps[0].dx == 1)
&& (img->comps[1].dx == 2)
&& (img->comps[2].dx == 2)
&& (img->comps[0].dy == 1)
&& (img->comps[1].dy == 1)
&& (img->comps[2].dy == 1))/* horizontal sub-sample only */
{
sycc422_to_rgb(img);
}
else
if((img->comps[0].dx == 1)
&& (img->comps[1].dx == 1)
&& (img->comps[2].dx == 1)
&& (img->comps[0].dy == 1)
&& (img->comps[1].dy == 1)
&& (img->comps[2].dy == 1))/* no sub-sample */
{
sycc444_to_rgb(img);
}
else
{
fprintf(stderr,"%s:%d:color_sycc_to_rgb\n\tCAN NOT CONVERT\n", __FILE__,__LINE__);
return;
}
}/* color_sycc_to_rgb() */
#if defined(OPJ_HAVE_LIBLCMS2) || defined(OPJ_HAVE_LIBLCMS1)
#ifdef OPJ_HAVE_LIBLCMS1
/* Bob Friesenhahn proposed:*/
#define cmsSigXYZData icSigXYZData
#define cmsSigLabData icSigLabData
#define cmsSigCmykData icSigCmykData
#define cmsSigYCbCrData icSigYCbCrData
#define cmsSigLuvData icSigLuvData
#define cmsSigGrayData icSigGrayData
#define cmsSigRgbData icSigRgbData
#define cmsUInt32Number DWORD
#define cmsColorSpaceSignature icColorSpaceSignature
#define cmsGetHeaderRenderingIntent cmsTakeRenderingIntent
#endif /* OPJ_HAVE_LIBLCMS1 */
/*#define DEBUG_PROFILE*/
void color_apply_icc_profile(opj_image_t *image)
{
cmsHPROFILE in_prof, out_prof;
cmsHTRANSFORM transform;
cmsColorSpaceSignature in_space, out_space;
cmsUInt32Number intent, in_type, out_type;
int *r, *g, *b;
size_t nr_samples, i, max, max_w, max_h;
int prec, ok = 0;
OPJ_COLOR_SPACE new_space;
in_prof = cmsOpenProfileFromMem(image->icc_profile_buf, image->icc_profile_len);
#ifdef DEBUG_PROFILE
FILE *icm = fopen("debug.icm","wb");
fwrite( image->icc_profile_buf,1, image->icc_profile_len,icm);
fclose(icm);
#endif
if(in_prof == NULL) return;
in_space = cmsGetPCS(in_prof);
out_space = cmsGetColorSpace(in_prof);
intent = cmsGetHeaderRenderingIntent(in_prof);
max_w = image->comps[0].w;
max_h = image->comps[0].h;
prec = (int)image->comps[0].prec;
if(out_space == cmsSigRgbData) /* enumCS 16 */
{
if( prec <= 8 )
{
in_type = TYPE_RGB_8;
out_type = TYPE_RGB_8;
}
else
{
in_type = TYPE_RGB_16;
out_type = TYPE_RGB_16;
}
out_prof = cmsCreate_sRGBProfile();
new_space = OPJ_CLRSPC_SRGB;
}
else if(out_space == cmsSigGrayData) /* enumCS 17 */
{
in_type = TYPE_GRAY_8;
out_type = TYPE_RGB_8;
out_prof = cmsCreate_sRGBProfile();
new_space = OPJ_CLRSPC_SRGB;
}
else if(out_space == cmsSigYCbCrData) /* enumCS 18 */
{
in_type = TYPE_YCbCr_16;
out_type = TYPE_RGB_16;
out_prof = cmsCreate_sRGBProfile();
new_space = OPJ_CLRSPC_SRGB;
}
else
{
#ifdef DEBUG_PROFILE
fprintf(stderr,"%s:%d: color_apply_icc_profile\n\tICC Profile has unknown "
"output colorspace(%#x)(%c%c%c%c)\n\tICC Profile ignored.\n",
__FILE__,__LINE__,out_space,
(out_space>>24) & 0xff,(out_space>>16) & 0xff,
(out_space>>8) & 0xff, out_space & 0xff);
#endif
cmsCloseProfile(in_prof);
return;
}
if(out_prof == NULL)
{
cmsCloseProfile(in_prof);
return;
}
#ifdef DEBUG_PROFILE
fprintf(stderr,"%s:%d:color_apply_icc_profile\n\tchannels(%d) prec(%d) w(%d) h(%d)"
"\n\tprofile: in(%p) out(%p)\n",__FILE__,__LINE__,image->numcomps,prec,
max_w,max_h, (void*)in_prof,(void*)out_prof);
fprintf(stderr,"\trender_intent (%u)\n\t"
"color_space: in(%#x)(%c%c%c%c) out:(%#x)(%c%c%c%c)\n\t"
" type: in(%u) out:(%u)\n",
intent,
in_space,
(in_space>>24) & 0xff,(in_space>>16) & 0xff,
(in_space>>8) & 0xff, in_space & 0xff,
out_space,
(out_space>>24) & 0xff,(out_space>>16) & 0xff,
(out_space>>8) & 0xff, out_space & 0xff,
in_type,out_type
);
#else
(void)prec;
(void)in_space;
#endif /* DEBUG_PROFILE */
transform = cmsCreateTransform(in_prof, in_type, out_prof, out_type, intent, 0);
#ifdef OPJ_HAVE_LIBLCMS2
/* Possible for: LCMS_VERSION >= 2000 :*/
cmsCloseProfile(in_prof);
cmsCloseProfile(out_prof);
#endif
if(transform == NULL)
{
#ifdef DEBUG_PROFILE
fprintf(stderr,"%s:%d:color_apply_icc_profile\n\tcmsCreateTransform failed. "
"ICC Profile ignored.\n",__FILE__,__LINE__);
#endif
#ifdef OPJ_HAVE_LIBLCMS1
cmsCloseProfile(in_prof);
cmsCloseProfile(out_prof);
#endif
return;
}
if(image->numcomps > 2)/* RGB, RGBA */
{
if( prec <= 8 )
{
unsigned char *inbuf, *outbuf, *in, *out;
max = max_w * max_h;
nr_samples = (size_t)(max * 3U * sizeof(unsigned char));
in = inbuf = (unsigned char*)malloc(nr_samples);
out = outbuf = (unsigned char*)malloc(nr_samples);
if(inbuf == NULL || outbuf == NULL) goto fails0;
r = image->comps[0].data;
g = image->comps[1].data;
b = image->comps[2].data;
for(i = 0U; i < max; ++i)
{
*in++ = (unsigned char)*r++;
*in++ = (unsigned char)*g++;
*in++ = (unsigned char)*b++;
}
cmsDoTransform(transform, inbuf, outbuf, (cmsUInt32Number)max);
r = image->comps[0].data;
g = image->comps[1].data;
b = image->comps[2].data;
for(i = 0U; i < max; ++i)
{
*r++ = (int)*out++;
*g++ = (int)*out++;
*b++ = (int)*out++;
}
ok = 1;
fails0:
free(inbuf);
free(outbuf);
}
else /* prec > 8 */
{
unsigned short *inbuf, *outbuf, *in, *out;
max = max_w * max_h;
nr_samples = (size_t)(max * 3U * sizeof(unsigned short));
in = inbuf = (unsigned short*)malloc(nr_samples);
out = outbuf = (unsigned short*)malloc(nr_samples);
if(inbuf == NULL || outbuf == NULL) goto fails1;
r = image->comps[0].data;
g = image->comps[1].data;
b = image->comps[2].data;
for(i = 0U ; i < max; ++i)
{
*in++ = (unsigned short)*r++;
*in++ = (unsigned short)*g++;
*in++ = (unsigned short)*b++;
}
cmsDoTransform(transform, inbuf, outbuf, (cmsUInt32Number)max);
r = image->comps[0].data;
g = image->comps[1].data;
b = image->comps[2].data;
for(i = 0; i < max; ++i)
{
*r++ = (int)*out++;
*g++ = (int)*out++;
*b++ = (int)*out++;
}
ok = 1;
fails1:
free(inbuf);
free(outbuf);
}
}
else /* image->numcomps <= 2 : GRAY, GRAYA */
{
if(prec <= 8)
{
unsigned char *in, *inbuf, *out, *outbuf;
opj_image_comp_t *new_comps;
max = max_w * max_h;
nr_samples = (size_t)(max * 3 * sizeof(unsigned char));
in = inbuf = (unsigned char*)malloc(nr_samples);
out = outbuf = (unsigned char*)malloc(nr_samples);
g = (int*)calloc((size_t)max, sizeof(int));
b = (int*)calloc((size_t)max, sizeof(int));
if(inbuf == NULL || outbuf == NULL || g == NULL || b == NULL) goto fails2;
new_comps = (opj_image_comp_t*)realloc(image->comps, (image->numcomps+2)*sizeof(opj_image_comp_t));
if(new_comps == NULL) goto fails2;
image->comps = new_comps;
if(image->numcomps == 2)
image->comps[3] = image->comps[1];
image->comps[1] = image->comps[0];
image->comps[2] = image->comps[0];
image->comps[1].data = g;
image->comps[2].data = b;
image->numcomps += 2;
r = image->comps[0].data;
for(i = 0U; i < max; ++i)
{
*in++ = (unsigned char)*r++;
}
cmsDoTransform(transform, inbuf, outbuf, (cmsUInt32Number)max);
r = image->comps[0].data;
g = image->comps[1].data;
b = image->comps[2].data;
for(i = 0U; i < max; ++i)
{
*r++ = (int)*out++; *g++ = (int)*out++; *b++ = (int)*out++;
}
r = g = b = NULL;
ok = 1;
fails2:
free(inbuf);
free(outbuf);
free(g);
free(b);
}
else /* prec > 8 */
{
unsigned short *in, *inbuf, *out, *outbuf;
opj_image_comp_t *new_comps;
max = max_w * max_h;
nr_samples = (size_t)(max * 3U * sizeof(unsigned short));
in = inbuf = (unsigned short*)malloc(nr_samples);
out = outbuf = (unsigned short*)malloc(nr_samples);
g = (int*)calloc((size_t)max, sizeof(int));
b = (int*)calloc((size_t)max, sizeof(int));
if(inbuf == NULL || outbuf == NULL || g == NULL || b == NULL) goto fails3;
new_comps = (opj_image_comp_t*)realloc(image->comps, (image->numcomps+2)*sizeof(opj_image_comp_t));
if(new_comps == NULL) goto fails3;
image->comps = new_comps;
if(image->numcomps == 2)
image->comps[3] = image->comps[1];
image->comps[1] = image->comps[0];
image->comps[2] = image->comps[0];
image->comps[1].data = g;
image->comps[2].data = b;
image->numcomps += 2;
r = image->comps[0].data;
for(i = 0U; i < max; ++i)
{
*in++ = (unsigned short)*r++;
}
cmsDoTransform(transform, inbuf, outbuf, (cmsUInt32Number)max);
r = image->comps[0].data;
g = image->comps[1].data;
b = image->comps[2].data;
for(i = 0; i < max; ++i)
{
*r++ = (int)*out++; *g++ = (int)*out++; *b++ = (int)*out++;
}
r = g = b = NULL;
ok = 1;
fails3:
free(inbuf);
free(outbuf);
free(g);
free(b);
}
}/* if(image->numcomps > 2) */
cmsDeleteTransform(transform);
#ifdef OPJ_HAVE_LIBLCMS1
cmsCloseProfile(in_prof);
cmsCloseProfile(out_prof);
#endif
if(ok)
{
image->color_space = new_space;
}
}/* color_apply_icc_profile() */
void color_cielab_to_rgb(opj_image_t *image)
{
int *row;
int enumcs, numcomps;
OPJ_COLOR_SPACE new_space;
numcomps = (int)image->numcomps;
if(numcomps != 3)
{
fprintf(stderr,"%s:%d:\n\tnumcomps %d not handled. Quitting.\n",
__FILE__,__LINE__,numcomps);
return;
}
row = (int*)image->icc_profile_buf;
enumcs = row[0];
if(enumcs == 14) /* CIELab */
{
int *L, *a, *b, *red, *green, *blue;
int *src0, *src1, *src2, *dst0, *dst1, *dst2;
double rl, ol, ra, oa, rb, ob, prec0, prec1, prec2;
double minL, maxL, mina, maxa, minb, maxb;
unsigned int default_type;
unsigned int i, max;
cmsHPROFILE in, out;
cmsHTRANSFORM transform;
cmsUInt16Number RGB[3];
cmsCIELab Lab;
in = cmsCreateLab4Profile(NULL);
if(in == NULL){
return;
}
out = cmsCreate_sRGBProfile();
if(out == NULL){
cmsCloseProfile(in);
return;
}
transform = cmsCreateTransform(in, TYPE_Lab_DBL, out, TYPE_RGB_16, INTENT_PERCEPTUAL, 0);
#ifdef OPJ_HAVE_LIBLCMS2
cmsCloseProfile(in);
cmsCloseProfile(out);
#endif
if(transform == NULL)
{
#ifdef OPJ_HAVE_LIBLCMS1
cmsCloseProfile(in);
cmsCloseProfile(out);
#endif
return;
}
new_space = OPJ_CLRSPC_SRGB;
prec0 = (double)image->comps[0].prec;
prec1 = (double)image->comps[1].prec;
prec2 = (double)image->comps[2].prec;
default_type = (unsigned int)row[1];
if(default_type == 0x44454600)/* DEF : default */
{
rl = 100; ra = 170; rb = 200;
ol = 0;
oa = pow(2, prec1 - 1);
ob = pow(2, prec2 - 2) + pow(2, prec2 - 3);
}
else
{
rl = row[2]; ra = row[4]; rb = row[6];
ol = row[3]; oa = row[5]; ob = row[7];
}
L = src0 = image->comps[0].data;
a = src1 = image->comps[1].data;
b = src2 = image->comps[2].data;
max = image->comps[0].w * image->comps[0].h;
red = dst0 = (int*)malloc(max * sizeof(int));
green = dst1 = (int*)malloc(max * sizeof(int));
blue = dst2 = (int*)malloc(max * sizeof(int));
if(red == NULL || green == NULL || blue == NULL) goto fails;
minL = -(rl * ol)/(pow(2, prec0)-1);
maxL = minL + rl;
mina = -(ra * oa)/(pow(2, prec1)-1);
maxa = mina + ra;
minb = -(rb * ob)/(pow(2, prec2)-1);
maxb = minb + rb;
for(i = 0; i < max; ++i)
{
Lab.L = minL + (double)(*L) * (maxL - minL)/(pow(2, prec0)-1); ++L;
Lab.a = mina + (double)(*a) * (maxa - mina)/(pow(2, prec1)-1); ++a;
Lab.b = minb + (double)(*b) * (maxb - minb)/(pow(2, prec2)-1); ++b;
cmsDoTransform(transform, &Lab, RGB, 1);
*red++ = RGB[0];
*green++ = RGB[1];
*blue++ = RGB[2];
}
cmsDeleteTransform(transform);
#ifdef OPJ_HAVE_LIBLCMS1
cmsCloseProfile(in);
cmsCloseProfile(out);
#endif
free(src0); image->comps[0].data = dst0;
free(src1); image->comps[1].data = dst1;
free(src2); image->comps[2].data = dst2;
image->color_space = new_space;
image->comps[0].prec = 16;
image->comps[1].prec = 16;
image->comps[2].prec = 16;
return;
fails:
cmsDeleteTransform(transform);
#ifdef OPJ_HAVE_LIBLCMS1
cmsCloseProfile(in);
cmsCloseProfile(out);
#endif
if(red) free(red);
if(green) free(green);
if(blue) free(blue);
return;
}
fprintf(stderr,"%s:%d:\n\tenumCS %d not handled. Ignoring.\n", __FILE__,__LINE__, enumcs);
}/* color_cielab_to_rgb() */
#endif /* OPJ_HAVE_LIBLCMS2 || OPJ_HAVE_LIBLCMS1 */
void color_cmyk_to_rgb(opj_image_t *image)
{
float C, M, Y, K;
float sC, sM, sY, sK;
unsigned int w, h, max, i;
w = image->comps[0].w;
h = image->comps[0].h;
if (
(image->numcomps < 4)
|| (image->comps[0].dx != image->comps[1].dx) || (image->comps[0].dx != image->comps[2].dx) || (image->comps[0].dx != image->comps[3].dx)
|| (image->comps[0].dy != image->comps[1].dy) || (image->comps[0].dy != image->comps[2].dy) || (image->comps[0].dy != image->comps[3].dy)
) {
fprintf(stderr,"%s:%d:color_cmyk_to_rgb\n\tCAN NOT CONVERT\n", __FILE__,__LINE__);
return;
}
max = w * h;
sC = 1.0F / (float)((1 << image->comps[0].prec) - 1);
sM = 1.0F / (float)((1 << image->comps[1].prec) - 1);
sY = 1.0F / (float)((1 << image->comps[2].prec) - 1);
sK = 1.0F / (float)((1 << image->comps[3].prec) - 1);
for(i = 0; i < max; ++i)
{
/* CMYK values from 0 to 1 */
C = (float)(image->comps[0].data[i]) * sC;
M = (float)(image->comps[1].data[i]) * sM;
Y = (float)(image->comps[2].data[i]) * sY;
K = (float)(image->comps[3].data[i]) * sK;
/* Invert all CMYK values */
C = 1.0F - C;
M = 1.0F - M;
Y = 1.0F - Y;
K = 1.0F - K;
/* CMYK -> RGB : RGB results from 0 to 255 */
image->comps[0].data[i] = (int)(255.0F * C * K); /* R */
image->comps[1].data[i] = (int)(255.0F * M * K); /* G */
image->comps[2].data[i] = (int)(255.0F * Y * K); /* B */
}
free(image->comps[3].data); image->comps[3].data = NULL;
image->comps[0].prec = 8;
image->comps[1].prec = 8;
image->comps[2].prec = 8;
image->numcomps -= 1;
image->color_space = OPJ_CLRSPC_SRGB;
for (i = 3; i < image->numcomps; ++i) {
memcpy(&(image->comps[i]), &(image->comps[i+1]), sizeof(image->comps[i]));
}
}/* color_cmyk_to_rgb() */
/*
* This code has been adopted from sjpx_openjpeg.c of ghostscript
*/
void color_esycc_to_rgb(opj_image_t *image)
{
int y, cb, cr, sign1, sign2, val;
unsigned int w, h, max, i;
int flip_value = (1 << (image->comps[0].prec-1));
int max_value = (1 << image->comps[0].prec) - 1;
if (
(image->numcomps < 3)
|| (image->comps[0].dx != image->comps[1].dx) || (image->comps[0].dx != image->comps[2].dx)
|| (image->comps[0].dy != image->comps[1].dy) || (image->comps[0].dy != image->comps[2].dy)
) {
fprintf(stderr,"%s:%d:color_esycc_to_rgb\n\tCAN NOT CONVERT\n", __FILE__,__LINE__);
return;
}
w = image->comps[0].w;
h = image->comps[0].h;
sign1 = (int)image->comps[1].sgnd;
sign2 = (int)image->comps[2].sgnd;
max = w * h;
for(i = 0; i < max; ++i)
{
y = image->comps[0].data[i]; cb = image->comps[1].data[i]; cr = image->comps[2].data[i];
if( !sign1) cb -= flip_value;
if( !sign2) cr -= flip_value;
val = (int)
((float)y - (float)0.0000368 * (float)cb
+ (float)1.40199 * (float)cr + (float)0.5);
if(val > max_value) val = max_value; else if(val < 0) val = 0;
image->comps[0].data[i] = val;
val = (int)
((float)1.0003 * (float)y - (float)0.344125 * (float)cb
- (float)0.7141128 * (float)cr + (float)0.5);
if(val > max_value) val = max_value; else if(val < 0) val = 0;
image->comps[1].data[i] = val;
val = (int)
((float)0.999823 * (float)y + (float)1.77204 * (float)cb
- (float)0.000008 *(float)cr + (float)0.5);
if(val > max_value) val = max_value; else if(val < 0) val = 0;
image->comps[2].data[i] = val;
}
image->color_space = OPJ_CLRSPC_SRGB;
}/* color_esycc_to_rgb() */

View File

@ -1,9 +1,15 @@
/* /*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium * The copyright in this software is being made available under the 2-clauses
* Copyright (c) 2002-2007, Professor Benoit Macq * BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens * Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren * Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe * Copyright (c) 2003-2007, Francois-Olivier Devaux
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team * Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved. * All rights reserved.
* *
@ -34,5 +40,8 @@
extern void color_sycc_to_rgb(opj_image_t *img); extern void color_sycc_to_rgb(opj_image_t *img);
extern void color_apply_icc_profile(opj_image_t *image); extern void color_apply_icc_profile(opj_image_t *image);
extern void color_cielab_to_rgb(opj_image_t *image);
extern void color_cmyk_to_rgb(opj_image_t *image);
extern void color_esycc_to_rgb(opj_image_t *image);
#endif /* _OPJ_COLOR_H_ */ #endif /* _OPJ_COLOR_H_ */

View File

@ -1,9 +1,15 @@
/* /*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium * The copyright in this software is being made available under the 2-clauses
* Copyright (c) 2002-2007, Professor Benoit Macq * BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens * Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren * Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe * Copyright (c) 2003-2007, Francois-Olivier Devaux
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team * Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved. * All rights reserved.
* *
@ -41,8 +47,9 @@
#define BMP_DFMT 12 #define BMP_DFMT 12
#define YUV_DFMT 13 #define YUV_DFMT 13
#define TIF_DFMT 14 #define TIF_DFMT 14
#define RAW_DFMT 15 #define RAW_DFMT 15 /* MSB / Big Endian */
#define TGA_DFMT 16 #define TGA_DFMT 16
#define PNG_DFMT 17 #define PNG_DFMT 17
#define RAWL_DFMT 18 /* LSB / Little Endian */
#endif /* _OPJ_FORMAT_DEFS_H_ */ #endif /* _OPJ_FORMAT_DEFS_H_ */

View File

@ -0,0 +1,15 @@
#include "opj_config_private.h"
/* create opj_apps_config.h for CMake */
#cmakedefine OPJ_HAVE_LIBPNG @HAVE_LIBPNG@
#cmakedefine OPJ_HAVE_PNG_H @HAVE_PNG_H@
#cmakedefine OPJ_HAVE_LIBTIFF @HAVE_LIBTIFF@
#cmakedefine OPJ_HAVE_TIFF_H @HAVE_TIFF_H@
#cmakedefine OPJ_HAVE_LIBLCMS1
#cmakedefine OPJ_HAVE_LIBLCMS2
#cmakedefine OPJ_HAVE_LCMS1_H
#cmakedefine OPJ_HAVE_LCMS2_H

View File

@ -1,4 +1,9 @@
/* /*
* The copyright in this software is being made available under the 3-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 1987, 1993, 1994 * Copyright (c) 1987, 1993, 1994
* The Regents of the University of California. All rights reserved. * The Regents of the University of California. All rights reserved.
* *
@ -10,11 +15,7 @@
* 2. Redistributions in binary form must reproduce the above copyright * 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software * 3. Neither the name of the University nor the names of its contributors
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
@ -53,7 +54,7 @@ int opj_opterr = 1, /* if error message should be printed */
static char EMSG[]={""}; static char EMSG[]={""};
/* As this class remembers its values from one Java call to the other, reset the values before each use */ /* As this class remembers its values from one Java call to the other, reset the values before each use */
void reset_options_reading(void) { void opj_reset_options_reading(void) {
opj_opterr = 1; opj_opterr = 1;
opj_optind = 1; opj_optind = 1;
} }
@ -65,7 +66,7 @@ void reset_options_reading(void) {
int opj_getopt(int nargc, char *const *nargv, const char *ostr) { int opj_getopt(int nargc, char *const *nargv, const char *ostr) {
# define __progname nargv[0] # define __progname nargv[0]
static char *place = EMSG; /* option letter processing */ static char *place = EMSG; /* option letter processing */
char *oli = NULL; /* option letter list index */ const char *oli = NULL; /* option letter list index */
if (opj_optreset || !*place) { /* update scanning pointer */ if (opj_optreset || !*place) { /* update scanning pointer */
opj_optreset = 0; opj_optreset = 0;
@ -124,7 +125,7 @@ int opj_getopt(int nargc, char *const *nargv, const char *ostr) {
int opj_getopt_long(int argc, char * const argv[], const char *optstring, int opj_getopt_long(int argc, char * const argv[], const char *optstring,
const opj_option_t *longopts, int totlen) { const opj_option_t *longopts, int totlen) {
static int lastidx,lastofs; static int lastidx,lastofs;
char *tmp; const char *tmp;
int i,len; int i,len;
char param = 1; char param = 1;

View File

@ -24,6 +24,6 @@ extern char *opj_optarg;
extern int opj_getopt(int nargc, char *const *nargv, const char *ostr); extern int opj_getopt(int nargc, char *const *nargv, const char *ostr);
extern int opj_getopt_long(int argc, char * const argv[], const char *optstring, extern int opj_getopt_long(int argc, char * const argv[], const char *optstring,
const opj_option_t *longopts, int totlen); const opj_option_t *longopts, int totlen);
extern void reset_options_reading(void); extern void opj_reset_options_reading(void);
#endif /* _GETOPT_H_ */ #endif /* _GETOPT_H_ */

View File

@ -1,9 +1,10 @@
/* /*
* $Id$ * The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
* *
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium * Copyright (c) 2015, Matthieu Darbois
* Copyright (c) 2002-2011, Professor Benoit Macq
* Copyright (c) 2010-2011, Kaori Hagihara
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -28,45 +29,44 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
/*! \file #ifndef OPJ_STRING_H
* \brief jpip_to_jp2 is a program to convert JPT- JPP- stream to JP2 file #define OPJ_STRING_H
*
* \section impinst Implementing instructions
* This program takes two arguments. \n
* -# Input JPT or JPP file
* -# Output JP2 file\n
* % ./jpip_to_jp2 input.jpt output.jp2
* or
* % ./jpip_to_jp2 input.jpp output.jp2
*/
#include <stdio.h> #include <errno.h>
#include "openjpip.h" #include <string.h>
int main(int argc,char *argv[]) /* strnlen is not standard, strlen_s is C11... */
/* keep in mind there still is a buffer read overflow possible */
static size_t opj_strnlen_s(const char *src, size_t max_len)
{ {
jpip_dec_param_t *dec; size_t len;
if( argc < 3){ if (src == NULL) {
fprintf( stderr, "Too few arguments:\n"); return 0U;
fprintf( stderr, " - input jpt or jpp file\n"); }
fprintf( stderr, " - output jp2 file\n"); for (len = 0U; (*src != '\0') && (len < max_len); src++, len++);
return -1; return len;
}
dec = init_jpipdecoder( true);
if(!( fread_jpip( argv[1], dec)))
return -1;
decode_jpip( dec);
if(!(fwrite_jp2k( argv[2], dec)))
return -1;
output_log( true, false, true, dec);
destroy_jpipdecoder( &dec);
return 0;
} }
/* should be equivalent to C11 function except for the handler */
/* keep in mind there still is a buffer read overflow possible */
static int opj_strcpy_s(char* dst, size_t dst_size, const char* src)
{
size_t src_len = 0U;
if ((dst == NULL) || (dst_size == 0U)) {
return EINVAL;
}
if (src == NULL) {
dst[0] = '\0';
return EINVAL;
}
src_len = opj_strnlen_s(src, dst_size);
if (src_len >= dst_size) {
return ERANGE;
}
memcpy(dst, src, src_len);
dst[src_len] = '\0';
return 0;
}
#endif /* OPJ_STRING_H */

View File

@ -0,0 +1,85 @@
# Build the demo app, small examples
# First thing define the common source:
set(common_SRCS
convert.c
convert.h
convertbmp.c
index.c
index.h
${OPENJPEG_SOURCE_DIR}/src/bin/common/color.c
${OPENJPEG_SOURCE_DIR}/src/bin/common/color.h
${OPENJPEG_SOURCE_DIR}/src/bin/common/opj_getopt.c
${OPENJPEG_SOURCE_DIR}/src/bin/common/opj_getopt.h
${OPENJPEG_SOURCE_DIR}/src/bin/common/opj_string.h
)
if(OPJ_HAVE_LIBTIFF)
list(APPEND common_SRCS converttif.c)
endif()
if(OPJ_HAVE_LIBPNG)
list(APPEND common_SRCS convertpng.c)
endif()
# Headers file are located here:
include_directories(
${OPENJPEG_BINARY_DIR}/src/lib/openjp2 # opj_config.h
${OPENJPEG_BINARY_DIR}/src/bin/common # opj_apps_config.h
${OPENJPEG_SOURCE_DIR}/src/lib/openjp2
${OPENJPEG_SOURCE_DIR}/src/bin/common
${LCMS_INCLUDE_DIRNAME}
${Z_INCLUDE_DIRNAME}
${PNG_INCLUDE_DIRNAME}
${TIFF_INCLUDE_DIRNAME}
)
if(WIN32)
if(BUILD_SHARED_LIBS)
add_definitions(-DOPJ_EXPORTS)
else()
add_definitions(-DOPJ_STATIC)
endif()
endif()
# Loop over all executables:
foreach(exe opj_decompress opj_compress opj_dump)
add_executable(${exe} ${exe}.c ${common_SRCS})
target_link_libraries(${exe} ${OPENJPEG_LIBRARY_NAME}
${PNG_LIBNAME} ${TIFF_LIBNAME} ${LCMS_LIBNAME}
)
# To support universal exe:
if(ZLIB_FOUND AND APPLE)
target_link_libraries(${exe} z)
else(ZLIB_FOUND AND APPLE)
target_link_libraries(${exe} ${Z_LIBNAME})
endif()
# On unix you need to link to the math library:
if(UNIX)
target_link_libraries(${exe} m)
IF("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
target_link_libraries(${exe} rt)
endif()
endif()
# Install exe
install(TARGETS ${exe}
EXPORT OpenJPEGTargets
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
)
if(OPJ_USE_DSYMUTIL)
add_custom_command(TARGET ${exe} POST_BUILD
COMMAND "dsymutil" "$<TARGET_FILE:${exe}>"
COMMENT "dsymutil $<TARGET_FILE:${exe}>"
DEPENDS ${exe})
endif()
endforeach()
if(BUILD_DOC)
# Install man pages
install(
FILES ${OPENJPEG_SOURCE_DIR}/doc/man/man1/opj_compress.1
${OPENJPEG_SOURCE_DIR}/doc/man/man1/opj_decompress.1
${OPENJPEG_SOURCE_DIR}/doc/man/man1/opj_dump.1
DESTINATION ${OPENJPEG_INSTALL_MAN_DIR}/man1)
#
endif()

2265
src/bin/jp2/convert.c Normal file

File diff suppressed because it is too large Load Diff

119
src/bin/jp2/convert.h Normal file
View File

@ -0,0 +1,119 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __J2K_CONVERT_H
#define __J2K_CONVERT_H
/**@name RAW component encoding parameters */
/*@{*/
typedef struct raw_comp_cparameters {
/** subsampling in X direction */
int dx;
/** subsampling in Y direction */
int dy;
/*@}*/
} raw_comp_cparameters_t;
/**@name RAW image encoding parameters */
/*@{*/
typedef struct raw_cparameters {
/** width of the raw image */
int rawWidth;
/** height of the raw image */
int rawHeight;
/** number of components of the raw image */
int rawComp;
/** bit depth of the raw image */
int rawBitDepth;
/** signed/unsigned raw image */
OPJ_BOOL rawSigned;
/** raw components parameters */
raw_comp_cparameters_t *rawComps;
/*@}*/
} raw_cparameters_t;
/* Component precision clipping */
void clip_component(opj_image_comp_t* component, OPJ_UINT32 precision);
/* Component precision scaling */
void scale_component(opj_image_comp_t* component, OPJ_UINT32 precision);
/* planar / interleaved conversions */
typedef void (* convert_32s_CXPX)(const OPJ_INT32* pSrc, OPJ_INT32* const* pDst, OPJ_SIZE_T length);
extern const convert_32s_CXPX convert_32s_CXPX_LUT[5];
typedef void (* convert_32s_PXCX)(OPJ_INT32 const* const* pSrc, OPJ_INT32* pDst, OPJ_SIZE_T length, OPJ_INT32 adjust);
extern const convert_32s_PXCX convert_32s_PXCX_LUT[5];
/* bit depth conversions */
typedef void (* convert_XXx32s_C1R)(const OPJ_BYTE* pSrc, OPJ_INT32* pDst, OPJ_SIZE_T length);
extern const convert_XXx32s_C1R convert_XXu32s_C1R_LUT[9]; /* up to 8bpp */
typedef void (* convert_32sXXx_C1R)(const OPJ_INT32* pSrc, OPJ_BYTE* pDst, OPJ_SIZE_T length);
extern const convert_32sXXx_C1R convert_32sXXu_C1R_LUT[9]; /* up to 8bpp */
/* TGA conversion */
opj_image_t* tgatoimage(const char *filename, opj_cparameters_t *parameters);
int imagetotga(opj_image_t * image, const char *outfile);
/* BMP conversion */
opj_image_t* bmptoimage(const char *filename, opj_cparameters_t *parameters);
int imagetobmp(opj_image_t *image, const char *outfile);
/* TIFF conversion*/
opj_image_t* tiftoimage(const char *filename, opj_cparameters_t *parameters);
int imagetotif(opj_image_t *image, const char *outfile);
/**
Load a single image component encoded in PGX file format
@param filename Name of the PGX file to load
@param parameters *List ?*
@return Returns a greyscale image if successful, returns NULL otherwise
*/
opj_image_t* pgxtoimage(const char *filename, opj_cparameters_t *parameters);
int imagetopgx(opj_image_t *image, const char *outfile);
opj_image_t* pnmtoimage(const char *filename, opj_cparameters_t *parameters);
int imagetopnm(opj_image_t *image, const char *outfile, int force_split);
/* RAW conversion */
int imagetoraw(opj_image_t * image, const char *outfile);
int imagetorawl(opj_image_t * image, const char *outfile);
opj_image_t* rawtoimage(const char *filename, opj_cparameters_t *parameters, raw_cparameters_t *raw_cp);
opj_image_t* rawltoimage(const char *filename, opj_cparameters_t *parameters, raw_cparameters_t *raw_cp);
/* PNG conversion*/
extern int imagetopng(opj_image_t *image, const char *write_idf);
extern opj_image_t* pngtoimage(const char *filename, opj_cparameters_t *parameters);
#endif /* __J2K_CONVERT_H */

996
src/bin/jp2/convertbmp.c Normal file
View File

@ -0,0 +1,996 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2006-2007, Parvatha Elangovan
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "opj_apps_config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "openjpeg.h"
#include "convert.h"
typedef struct {
OPJ_UINT16 bfType; /* 'BM' for Bitmap (19776) */
OPJ_UINT32 bfSize; /* Size of the file */
OPJ_UINT16 bfReserved1; /* Reserved : 0 */
OPJ_UINT16 bfReserved2; /* Reserved : 0 */
OPJ_UINT32 bfOffBits; /* Offset */
} OPJ_BITMAPFILEHEADER;
typedef struct {
OPJ_UINT32 biSize; /* Size of the structure in bytes */
OPJ_UINT32 biWidth; /* Width of the image in pixels */
OPJ_UINT32 biHeight; /* Heigth of the image in pixels */
OPJ_UINT16 biPlanes; /* 1 */
OPJ_UINT16 biBitCount; /* Number of color bits by pixels */
OPJ_UINT32 biCompression; /* Type of encoding 0: none 1: RLE8 2: RLE4 */
OPJ_UINT32 biSizeImage; /* Size of the image in bytes */
OPJ_UINT32 biXpelsPerMeter; /* Horizontal (X) resolution in pixels/meter */
OPJ_UINT32 biYpelsPerMeter; /* Vertical (Y) resolution in pixels/meter */
OPJ_UINT32 biClrUsed; /* Number of color used in the image (0: ALL) */
OPJ_UINT32 biClrImportant; /* Number of important color (0: ALL) */
OPJ_UINT32 biRedMask; /* Red channel bit mask */
OPJ_UINT32 biGreenMask; /* Green channel bit mask */
OPJ_UINT32 biBlueMask; /* Blue channel bit mask */
OPJ_UINT32 biAlphaMask; /* Alpha channel bit mask */
OPJ_UINT32 biColorSpaceType; /* Color space type */
OPJ_UINT8 biColorSpaceEP[36]; /* Color space end points */
OPJ_UINT32 biRedGamma; /* Red channel gamma */
OPJ_UINT32 biGreenGamma; /* Green channel gamma */
OPJ_UINT32 biBlueGamma; /* Blue channel gamma */
OPJ_UINT32 biIntent; /* Intent */
OPJ_UINT32 biIccProfileData; /* ICC profile data */
OPJ_UINT32 biIccProfileSize; /* ICC profile size */
OPJ_UINT32 biReserved; /* Reserved */
} OPJ_BITMAPINFOHEADER;
static void opj_applyLUT8u_8u32s_C1R(
OPJ_UINT8 const* pSrc, OPJ_INT32 srcStride,
OPJ_INT32* pDst, OPJ_INT32 dstStride,
OPJ_UINT8 const* pLUT,
OPJ_UINT32 width, OPJ_UINT32 height)
{
OPJ_UINT32 y;
for (y = height; y != 0U; --y) {
OPJ_UINT32 x;
for(x = 0; x < width; x++)
{
pDst[x] = (OPJ_INT32)pLUT[pSrc[x]];
}
pSrc += srcStride;
pDst += dstStride;
}
}
static void opj_applyLUT8u_8u32s_C1P3R(
OPJ_UINT8 const* pSrc, OPJ_INT32 srcStride,
OPJ_INT32* const* pDst, OPJ_INT32 const* pDstStride,
OPJ_UINT8 const* const* pLUT,
OPJ_UINT32 width, OPJ_UINT32 height)
{
OPJ_UINT32 y;
OPJ_INT32* pR = pDst[0];
OPJ_INT32* pG = pDst[1];
OPJ_INT32* pB = pDst[2];
OPJ_UINT8 const* pLUT_R = pLUT[0];
OPJ_UINT8 const* pLUT_G = pLUT[1];
OPJ_UINT8 const* pLUT_B = pLUT[2];
for (y = height; y != 0U; --y) {
OPJ_UINT32 x;
for(x = 0; x < width; x++)
{
OPJ_UINT8 idx = pSrc[x];
pR[x] = (OPJ_INT32)pLUT_R[idx];
pG[x] = (OPJ_INT32)pLUT_G[idx];
pB[x] = (OPJ_INT32)pLUT_B[idx];
}
pSrc += srcStride;
pR += pDstStride[0];
pG += pDstStride[1];
pB += pDstStride[2];
}
}
static void bmp24toimage(const OPJ_UINT8* pData, OPJ_UINT32 stride, opj_image_t* image)
{
int index;
OPJ_UINT32 width, height;
OPJ_UINT32 x, y;
const OPJ_UINT8 *pSrc = NULL;
width = image->comps[0].w;
height = image->comps[0].h;
index = 0;
pSrc = pData + (height - 1U) * stride;
for(y = 0; y < height; y++)
{
for(x = 0; x < width; x++)
{
image->comps[0].data[index] = (OPJ_INT32)pSrc[3*x+2]; /* R */
image->comps[1].data[index] = (OPJ_INT32)pSrc[3*x+1]; /* G */
image->comps[2].data[index] = (OPJ_INT32)pSrc[3*x+0]; /* B */
index++;
}
pSrc -= stride;
}
}
static void bmp_mask_get_shift_and_prec(OPJ_UINT32 mask, OPJ_UINT32* shift, OPJ_UINT32* prec)
{
OPJ_UINT32 l_shift, l_prec;
l_shift = l_prec = 0U;
if (mask != 0U) {
while ((mask & 1U) == 0U) {
mask >>= 1;
l_shift++;
}
while (mask & 1U) {
mask >>= 1;
l_prec++;
}
}
*shift = l_shift; *prec = l_prec;
}
static void bmpmask32toimage(const OPJ_UINT8* pData, OPJ_UINT32 stride, opj_image_t* image, OPJ_UINT32 redMask, OPJ_UINT32 greenMask, OPJ_UINT32 blueMask, OPJ_UINT32 alphaMask)
{
int index;
OPJ_UINT32 width, height;
OPJ_UINT32 x, y;
const OPJ_UINT8 *pSrc = NULL;
OPJ_BOOL hasAlpha;
OPJ_UINT32 redShift, redPrec;
OPJ_UINT32 greenShift, greenPrec;
OPJ_UINT32 blueShift, bluePrec;
OPJ_UINT32 alphaShift, alphaPrec;
width = image->comps[0].w;
height = image->comps[0].h;
hasAlpha = image->numcomps > 3U;
bmp_mask_get_shift_and_prec(redMask, &redShift, &redPrec);
bmp_mask_get_shift_and_prec(greenMask, &greenShift, &greenPrec);
bmp_mask_get_shift_and_prec(blueMask, &blueShift, &bluePrec);
bmp_mask_get_shift_and_prec(alphaMask, &alphaShift, &alphaPrec);
image->comps[0].bpp = redPrec;
image->comps[0].prec = redPrec;
image->comps[1].bpp = greenPrec;
image->comps[1].prec = greenPrec;
image->comps[2].bpp = bluePrec;
image->comps[2].prec = bluePrec;
if (hasAlpha) {
image->comps[3].bpp = alphaPrec;
image->comps[3].prec = alphaPrec;
}
index = 0;
pSrc = pData + (height - 1U) * stride;
for(y = 0; y < height; y++)
{
for(x = 0; x < width; x++)
{
OPJ_UINT32 value = 0U;
value |= ((OPJ_UINT32)pSrc[4*x+0]) << 0;
value |= ((OPJ_UINT32)pSrc[4*x+1]) << 8;
value |= ((OPJ_UINT32)pSrc[4*x+2]) << 16;
value |= ((OPJ_UINT32)pSrc[4*x+3]) << 24;
image->comps[0].data[index] = (OPJ_INT32)((value & redMask) >> redShift); /* R */
image->comps[1].data[index] = (OPJ_INT32)((value & greenMask) >> greenShift); /* G */
image->comps[2].data[index] = (OPJ_INT32)((value & blueMask) >> blueShift); /* B */
if (hasAlpha) {
image->comps[3].data[index] = (OPJ_INT32)((value & alphaMask) >> alphaShift); /* A */
}
index++;
}
pSrc -= stride;
}
}
static void bmpmask16toimage(const OPJ_UINT8* pData, OPJ_UINT32 stride, opj_image_t* image, OPJ_UINT32 redMask, OPJ_UINT32 greenMask, OPJ_UINT32 blueMask, OPJ_UINT32 alphaMask)
{
int index;
OPJ_UINT32 width, height;
OPJ_UINT32 x, y;
const OPJ_UINT8 *pSrc = NULL;
OPJ_BOOL hasAlpha;
OPJ_UINT32 redShift, redPrec;
OPJ_UINT32 greenShift, greenPrec;
OPJ_UINT32 blueShift, bluePrec;
OPJ_UINT32 alphaShift, alphaPrec;
width = image->comps[0].w;
height = image->comps[0].h;
hasAlpha = image->numcomps > 3U;
bmp_mask_get_shift_and_prec(redMask, &redShift, &redPrec);
bmp_mask_get_shift_and_prec(greenMask, &greenShift, &greenPrec);
bmp_mask_get_shift_and_prec(blueMask, &blueShift, &bluePrec);
bmp_mask_get_shift_and_prec(alphaMask, &alphaShift, &alphaPrec);
image->comps[0].bpp = redPrec;
image->comps[0].prec = redPrec;
image->comps[1].bpp = greenPrec;
image->comps[1].prec = greenPrec;
image->comps[2].bpp = bluePrec;
image->comps[2].prec = bluePrec;
if (hasAlpha) {
image->comps[3].bpp = alphaPrec;
image->comps[3].prec = alphaPrec;
}
index = 0;
pSrc = pData + (height - 1U) * stride;
for(y = 0; y < height; y++)
{
for(x = 0; x < width; x++)
{
OPJ_UINT32 value = 0U;
value |= ((OPJ_UINT32)pSrc[2*x+0]) << 0;
value |= ((OPJ_UINT32)pSrc[2*x+1]) << 8;
image->comps[0].data[index] = (OPJ_INT32)((value & redMask) >> redShift); /* R */
image->comps[1].data[index] = (OPJ_INT32)((value & greenMask) >> greenShift); /* G */
image->comps[2].data[index] = (OPJ_INT32)((value & blueMask) >> blueShift); /* B */
if (hasAlpha) {
image->comps[3].data[index] = (OPJ_INT32)((value & alphaMask) >> alphaShift); /* A */
}
index++;
}
pSrc -= stride;
}
}
static opj_image_t* bmp8toimage(const OPJ_UINT8* pData, OPJ_UINT32 stride, opj_image_t* image, OPJ_UINT8 const* const* pLUT)
{
OPJ_UINT32 width, height;
const OPJ_UINT8 *pSrc = NULL;
width = image->comps[0].w;
height = image->comps[0].h;
pSrc = pData + (height - 1U) * stride;
if (image->numcomps == 1U) {
opj_applyLUT8u_8u32s_C1R(pSrc, -(OPJ_INT32)stride, image->comps[0].data, (OPJ_INT32)width, pLUT[0], width, height);
}
else {
OPJ_INT32* pDst[3];
OPJ_INT32 pDstStride[3];
pDst[0] = image->comps[0].data; pDst[1] = image->comps[1].data; pDst[2] = image->comps[2].data;
pDstStride[0] = (OPJ_INT32)width; pDstStride[1] = (OPJ_INT32)width; pDstStride[2] = (OPJ_INT32)width;
opj_applyLUT8u_8u32s_C1P3R(pSrc, -(OPJ_INT32)stride, pDst, pDstStride, pLUT, width, height);
}
return image;
}
static OPJ_BOOL bmp_read_file_header(FILE* IN, OPJ_BITMAPFILEHEADER* header)
{
header->bfType = (OPJ_UINT16)getc(IN);
header->bfType |= (OPJ_UINT16)((OPJ_UINT32)getc(IN) << 8);
if (header->bfType != 19778) {
fprintf(stderr,"Error, not a BMP file!\n");
return OPJ_FALSE;
}
/* FILE HEADER */
/* ------------- */
header->bfSize = (OPJ_UINT32)getc(IN);
header->bfSize |= (OPJ_UINT32)getc(IN) << 8;
header->bfSize |= (OPJ_UINT32)getc(IN) << 16;
header->bfSize |= (OPJ_UINT32)getc(IN) << 24;
header->bfReserved1 = (OPJ_UINT16)getc(IN);
header->bfReserved1 |= (OPJ_UINT16)((OPJ_UINT32)getc(IN) << 8);
header->bfReserved2 = (OPJ_UINT16)getc(IN);
header->bfReserved2 |= (OPJ_UINT16)((OPJ_UINT32)getc(IN) << 8);
header->bfOffBits = (OPJ_UINT32)getc(IN);
header->bfOffBits |= (OPJ_UINT32)getc(IN) << 8;
header->bfOffBits |= (OPJ_UINT32)getc(IN) << 16;
header->bfOffBits |= (OPJ_UINT32)getc(IN) << 24;
return OPJ_TRUE;
}
static OPJ_BOOL bmp_read_info_header(FILE* IN, OPJ_BITMAPINFOHEADER* header)
{
memset(header, 0, sizeof(*header));
/* INFO HEADER */
/* ------------- */
header->biSize = (OPJ_UINT32)getc(IN);
header->biSize |= (OPJ_UINT32)getc(IN) << 8;
header->biSize |= (OPJ_UINT32)getc(IN) << 16;
header->biSize |= (OPJ_UINT32)getc(IN) << 24;
switch (header->biSize) {
case 12U: /* BITMAPCOREHEADER */
case 40U: /* BITMAPINFOHEADER */
case 52U: /* BITMAPV2INFOHEADER */
case 56U: /* BITMAPV3INFOHEADER */
case 108U: /* BITMAPV4HEADER */
case 124U: /* BITMAPV5HEADER */
break;
default:
fprintf(stderr,"Error, unknown BMP header size %d\n", header->biSize);
return OPJ_FALSE;
}
header->biWidth = (OPJ_UINT32)getc(IN);
header->biWidth |= (OPJ_UINT32)getc(IN) << 8;
header->biWidth |= (OPJ_UINT32)getc(IN) << 16;
header->biWidth |= (OPJ_UINT32)getc(IN) << 24;
header->biHeight = (OPJ_UINT32)getc(IN);
header->biHeight |= (OPJ_UINT32)getc(IN) << 8;
header->biHeight |= (OPJ_UINT32)getc(IN) << 16;
header->biHeight |= (OPJ_UINT32)getc(IN) << 24;
header->biPlanes = (OPJ_UINT16)getc(IN);
header->biPlanes |= (OPJ_UINT16)((OPJ_UINT32)getc(IN) << 8);
header->biBitCount = (OPJ_UINT16)getc(IN);
header->biBitCount |= (OPJ_UINT16)((OPJ_UINT32)getc(IN) << 8);
if(header->biSize >= 40U) {
header->biCompression = (OPJ_UINT32)getc(IN);
header->biCompression |= (OPJ_UINT32)getc(IN) << 8;
header->biCompression |= (OPJ_UINT32)getc(IN) << 16;
header->biCompression |= (OPJ_UINT32)getc(IN) << 24;
header->biSizeImage = (OPJ_UINT32)getc(IN);
header->biSizeImage |= (OPJ_UINT32)getc(IN) << 8;
header->biSizeImage |= (OPJ_UINT32)getc(IN) << 16;
header->biSizeImage |= (OPJ_UINT32)getc(IN) << 24;
header->biXpelsPerMeter = (OPJ_UINT32)getc(IN);
header->biXpelsPerMeter |= (OPJ_UINT32)getc(IN) << 8;
header->biXpelsPerMeter |= (OPJ_UINT32)getc(IN) << 16;
header->biXpelsPerMeter |= (OPJ_UINT32)getc(IN) << 24;
header->biYpelsPerMeter = (OPJ_UINT32)getc(IN);
header->biYpelsPerMeter |= (OPJ_UINT32)getc(IN) << 8;
header->biYpelsPerMeter |= (OPJ_UINT32)getc(IN) << 16;
header->biYpelsPerMeter |= (OPJ_UINT32)getc(IN) << 24;
header->biClrUsed = (OPJ_UINT32)getc(IN);
header->biClrUsed |= (OPJ_UINT32)getc(IN) << 8;
header->biClrUsed |= (OPJ_UINT32)getc(IN) << 16;
header->biClrUsed |= (OPJ_UINT32)getc(IN) << 24;
header->biClrImportant = (OPJ_UINT32)getc(IN);
header->biClrImportant |= (OPJ_UINT32)getc(IN) << 8;
header->biClrImportant |= (OPJ_UINT32)getc(IN) << 16;
header->biClrImportant |= (OPJ_UINT32)getc(IN) << 24;
}
if(header->biSize >= 56U) {
header->biRedMask = (OPJ_UINT32)getc(IN);
header->biRedMask |= (OPJ_UINT32)getc(IN) << 8;
header->biRedMask |= (OPJ_UINT32)getc(IN) << 16;
header->biRedMask |= (OPJ_UINT32)getc(IN) << 24;
header->biGreenMask = (OPJ_UINT32)getc(IN);
header->biGreenMask |= (OPJ_UINT32)getc(IN) << 8;
header->biGreenMask |= (OPJ_UINT32)getc(IN) << 16;
header->biGreenMask |= (OPJ_UINT32)getc(IN) << 24;
header->biBlueMask = (OPJ_UINT32)getc(IN);
header->biBlueMask |= (OPJ_UINT32)getc(IN) << 8;
header->biBlueMask |= (OPJ_UINT32)getc(IN) << 16;
header->biBlueMask |= (OPJ_UINT32)getc(IN) << 24;
header->biAlphaMask = (OPJ_UINT32)getc(IN);
header->biAlphaMask |= (OPJ_UINT32)getc(IN) << 8;
header->biAlphaMask |= (OPJ_UINT32)getc(IN) << 16;
header->biAlphaMask |= (OPJ_UINT32)getc(IN) << 24;
}
if(header->biSize >= 108U) {
header->biColorSpaceType = (OPJ_UINT32)getc(IN);
header->biColorSpaceType |= (OPJ_UINT32)getc(IN) << 8;
header->biColorSpaceType |= (OPJ_UINT32)getc(IN) << 16;
header->biColorSpaceType |= (OPJ_UINT32)getc(IN) << 24;
if (fread(&(header->biColorSpaceEP), 1U, sizeof(header->biColorSpaceEP), IN) != sizeof(header->biColorSpaceEP)) {
fprintf(stderr,"Error, can't read BMP header\n");
return OPJ_FALSE;
}
header->biRedGamma = (OPJ_UINT32)getc(IN);
header->biRedGamma |= (OPJ_UINT32)getc(IN) << 8;
header->biRedGamma |= (OPJ_UINT32)getc(IN) << 16;
header->biRedGamma |= (OPJ_UINT32)getc(IN) << 24;
header->biGreenGamma = (OPJ_UINT32)getc(IN);
header->biGreenGamma |= (OPJ_UINT32)getc(IN) << 8;
header->biGreenGamma |= (OPJ_UINT32)getc(IN) << 16;
header->biGreenGamma |= (OPJ_UINT32)getc(IN) << 24;
header->biBlueGamma = (OPJ_UINT32)getc(IN);
header->biBlueGamma |= (OPJ_UINT32)getc(IN) << 8;
header->biBlueGamma |= (OPJ_UINT32)getc(IN) << 16;
header->biBlueGamma |= (OPJ_UINT32)getc(IN) << 24;
}
if(header->biSize >= 124U) {
header->biIntent = (OPJ_UINT32)getc(IN);
header->biIntent |= (OPJ_UINT32)getc(IN) << 8;
header->biIntent |= (OPJ_UINT32)getc(IN) << 16;
header->biIntent |= (OPJ_UINT32)getc(IN) << 24;
header->biIccProfileData = (OPJ_UINT32)getc(IN);
header->biIccProfileData |= (OPJ_UINT32)getc(IN) << 8;
header->biIccProfileData |= (OPJ_UINT32)getc(IN) << 16;
header->biIccProfileData |= (OPJ_UINT32)getc(IN) << 24;
header->biIccProfileSize = (OPJ_UINT32)getc(IN);
header->biIccProfileSize |= (OPJ_UINT32)getc(IN) << 8;
header->biIccProfileSize |= (OPJ_UINT32)getc(IN) << 16;
header->biIccProfileSize |= (OPJ_UINT32)getc(IN) << 24;
header->biReserved = (OPJ_UINT32)getc(IN);
header->biReserved |= (OPJ_UINT32)getc(IN) << 8;
header->biReserved |= (OPJ_UINT32)getc(IN) << 16;
header->biReserved |= (OPJ_UINT32)getc(IN) << 24;
}
return OPJ_TRUE;
}
static OPJ_BOOL bmp_read_raw_data(FILE* IN, OPJ_UINT8* pData, OPJ_UINT32 stride, OPJ_UINT32 width, OPJ_UINT32 height)
{
OPJ_ARG_NOT_USED(width);
if ( fread(pData, sizeof(OPJ_UINT8), stride * height, IN) != (stride * height) )
{
fprintf(stderr, "\nError: fread return a number of element different from the expected.\n");
return OPJ_FALSE;
}
return OPJ_TRUE;
}
static OPJ_BOOL bmp_read_rle8_data(FILE* IN, OPJ_UINT8* pData, OPJ_UINT32 stride, OPJ_UINT32 width, OPJ_UINT32 height)
{
OPJ_UINT32 x, y;
OPJ_UINT8 *pix;
const OPJ_UINT8 *beyond;
beyond = pData + stride * height;
pix = pData;
x = y = 0U;
while (y < height)
{
int c = getc(IN);
if (c) {
int j;
OPJ_UINT8 c1 = (OPJ_UINT8)getc(IN);
for (j = 0; (j < c) && (x < width) && ((OPJ_SIZE_T)pix < (OPJ_SIZE_T)beyond); j++, x++, pix++) {
*pix = c1;
}
}
else {
c = getc(IN);
if (c == 0x00) { /* EOL */
x = 0;
++y;
pix = pData + y * stride + x;
}
else if (c == 0x01) { /* EOP */
break;
}
else if (c == 0x02) { /* MOVE by dxdy */
c = getc(IN);
x += (OPJ_UINT32)c;
c = getc(IN);
y += (OPJ_UINT32)c;
pix = pData + y * stride + x;
}
else /* 03 .. 255 */
{
int j;
for (j = 0; (j < c) && (x < width) && ((OPJ_SIZE_T)pix < (OPJ_SIZE_T)beyond); j++, x++, pix++)
{
OPJ_UINT8 c1 = (OPJ_UINT8)getc(IN);
*pix = c1;
}
if ((OPJ_UINT32)c & 1U) { /* skip padding byte */
getc(IN);
}
}
}
}/* while() */
return OPJ_TRUE;
}
static OPJ_BOOL bmp_read_rle4_data(FILE* IN, OPJ_UINT8* pData, OPJ_UINT32 stride, OPJ_UINT32 width, OPJ_UINT32 height)
{
OPJ_UINT32 x, y;
OPJ_UINT8 *pix;
const OPJ_UINT8 *beyond;
beyond = pData + stride * height;
pix = pData;
x = y = 0U;
while(y < height)
{
int c = getc(IN);
if(c == EOF) break;
if(c) {/* encoded mode */
int j;
OPJ_UINT8 c1 = (OPJ_UINT8)getc(IN);
for (j = 0; (j < c) && (x < width) && ((OPJ_SIZE_T)pix < (OPJ_SIZE_T)beyond); j++, x++, pix++) {
*pix = (OPJ_UINT8)((j&1) ? (c1 & 0x0fU) : ((c1>>4)&0x0fU));
}
}
else { /* absolute mode */
c = getc(IN);
if(c == EOF) break;
if(c == 0x00) { /* EOL */
x = 0; y++; pix = pData + y * stride;
}
else if(c == 0x01) { /* EOP */
break;
}
else if(c == 0x02) { /* MOVE by dxdy */
c = getc(IN); x += (OPJ_UINT32)c;
c = getc(IN); y += (OPJ_UINT32)c;
pix = pData + y * stride + x;
}
else { /* 03 .. 255 : absolute mode */
int j;
OPJ_UINT8 c1 = 0U;
for (j = 0; (j < c) && (x < width) && ((OPJ_SIZE_T)pix < (OPJ_SIZE_T)beyond); j++, x++, pix++) {
if((j&1) == 0) {
c1 = (OPJ_UINT8)getc(IN);
}
*pix = (OPJ_UINT8)((j&1) ? (c1 & 0x0fU) : ((c1>>4)&0x0fU));
}
if(((c&3) == 1) || ((c&3) == 2)) { /* skip padding byte */
getc(IN);
}
}
}
} /* while(y < height) */
return OPJ_TRUE;
}
opj_image_t* bmptoimage(const char *filename, opj_cparameters_t *parameters)
{
opj_image_cmptparm_t cmptparm[4]; /* maximum of 4 components */
OPJ_UINT8 lut_R[256], lut_G[256], lut_B[256];
OPJ_UINT8 const* pLUT[3];
opj_image_t * image = NULL;
FILE *IN;
OPJ_BITMAPFILEHEADER File_h;
OPJ_BITMAPINFOHEADER Info_h;
OPJ_UINT32 i, palette_len, numcmpts = 1U;
OPJ_BOOL l_result = OPJ_FALSE;
OPJ_UINT8* pData = NULL;
OPJ_UINT32 stride;
pLUT[0] = lut_R; pLUT[1] = lut_G; pLUT[2] = lut_B;
IN = fopen(filename, "rb");
if (!IN)
{
fprintf(stderr, "Failed to open %s for reading !!\n", filename);
return NULL;
}
if (!bmp_read_file_header(IN, &File_h)) {
fclose(IN);
return NULL;
}
if (!bmp_read_info_header(IN, &Info_h)) {
fclose(IN);
return NULL;
}
/* Load palette */
if (Info_h.biBitCount <= 8U)
{
memset(&lut_R[0], 0, sizeof(lut_R));
memset(&lut_G[0], 0, sizeof(lut_G));
memset(&lut_B[0], 0, sizeof(lut_B));
palette_len = Info_h.biClrUsed;
if((palette_len == 0U) && (Info_h.biBitCount <= 8U)) {
palette_len = (1U << Info_h.biBitCount);
}
if (palette_len > 256U) {
palette_len = 256U;
}
if (palette_len > 0U) {
OPJ_UINT8 has_color = 0U;
for (i = 0U; i < palette_len; i++) {
lut_B[i] = (OPJ_UINT8)getc(IN);
lut_G[i] = (OPJ_UINT8)getc(IN);
lut_R[i] = (OPJ_UINT8)getc(IN);
(void)getc(IN); /* padding */
has_color |= (lut_B[i] ^ lut_G[i]) | (lut_G[i] ^ lut_R[i]);
}
if(has_color) {
numcmpts = 3U;
}
}
} else {
numcmpts = 3U;
if ((Info_h.biCompression == 3) && (Info_h.biAlphaMask != 0U)) {
numcmpts++;
}
}
if (Info_h.biWidth == 0 || Info_h.biHeight == 0) {
fclose(IN);
return NULL;
}
if (Info_h.biBitCount > (((OPJ_UINT32)-1) - 31) / Info_h.biWidth) {
fclose(IN);
return NULL;
}
stride = ((Info_h.biWidth * Info_h.biBitCount + 31U) / 32U) * 4U; /* rows are aligned on 32bits */
if (Info_h.biBitCount == 4 && Info_h.biCompression == 2) { /* RLE 4 gets decoded as 8 bits data for now... */
if (8 > (((OPJ_UINT32)-1) - 31) / Info_h.biWidth) {
fclose(IN);
return NULL;
}
stride = ((Info_h.biWidth * 8U + 31U) / 32U) * 4U;
}
if (stride > ((OPJ_UINT32)-1) / sizeof(OPJ_UINT8) / Info_h.biHeight) {
fclose(IN);
return NULL;
}
pData = (OPJ_UINT8 *) calloc(1, stride * Info_h.biHeight * sizeof(OPJ_UINT8));
if (pData == NULL) {
fclose(IN);
return NULL;
}
/* Place the cursor at the beginning of the image information */
fseek(IN, 0, SEEK_SET);
fseek(IN, (long)File_h.bfOffBits, SEEK_SET);
switch (Info_h.biCompression) {
case 0:
case 3:
/* read raw data */
l_result = bmp_read_raw_data(IN, pData, stride, Info_h.biWidth, Info_h.biHeight);
break;
case 1:
/* read rle8 data */
l_result = bmp_read_rle8_data(IN, pData, stride, Info_h.biWidth, Info_h.biHeight);
break;
case 2:
/* read rle4 data */
l_result = bmp_read_rle4_data(IN, pData, stride, Info_h.biWidth, Info_h.biHeight);
break;
default:
fprintf(stderr, "Unsupported BMP compression\n");
l_result = OPJ_FALSE;
break;
}
if (!l_result) {
free(pData);
fclose(IN);
return NULL;
}
/* create the image */
memset(&cmptparm[0], 0, sizeof(cmptparm));
for(i = 0; i < 4U; i++)
{
cmptparm[i].prec = 8;
cmptparm[i].bpp = 8;
cmptparm[i].sgnd = 0;
cmptparm[i].dx = (OPJ_UINT32)parameters->subsampling_dx;
cmptparm[i].dy = (OPJ_UINT32)parameters->subsampling_dy;
cmptparm[i].w = Info_h.biWidth;
cmptparm[i].h = Info_h.biHeight;
}
image = opj_image_create(numcmpts, &cmptparm[0], (numcmpts == 1U) ? OPJ_CLRSPC_GRAY : OPJ_CLRSPC_SRGB);
if(!image) {
fclose(IN);
free(pData);
return NULL;
}
if (numcmpts == 4U) {
image->comps[3].alpha = 1;
}
/* set image offset and reference grid */
image->x0 = (OPJ_UINT32)parameters->image_offset_x0;
image->y0 = (OPJ_UINT32)parameters->image_offset_y0;
image->x1 = image->x0 + (Info_h.biWidth - 1U) * (OPJ_UINT32)parameters->subsampling_dx + 1U;
image->y1 = image->y0 + (Info_h.biHeight - 1U) * (OPJ_UINT32)parameters->subsampling_dy + 1U;
/* Read the data */
if (Info_h.biBitCount == 24 && Info_h.biCompression == 0) { /*RGB */
bmp24toimage(pData, stride, image);
}
else if (Info_h.biBitCount == 8 && Info_h.biCompression == 0) { /* RGB 8bpp Indexed */
bmp8toimage(pData, stride, image, pLUT);
}
else if (Info_h.biBitCount == 8 && Info_h.biCompression == 1) { /*RLE8*/
bmp8toimage(pData, stride, image, pLUT);
}
else if (Info_h.biBitCount == 4 && Info_h.biCompression == 2) { /*RLE4*/
bmp8toimage(pData, stride, image, pLUT); /* RLE 4 gets decoded as 8 bits data for now */
}
else if (Info_h.biBitCount == 32 && Info_h.biCompression == 0) { /* RGBX */
bmpmask32toimage(pData, stride, image, 0x00FF0000U, 0x0000FF00U, 0x000000FFU, 0x00000000U);
}
else if (Info_h.biBitCount == 32 && Info_h.biCompression == 3) { /* bitmask */
bmpmask32toimage(pData, stride, image, Info_h.biRedMask, Info_h.biGreenMask, Info_h.biBlueMask, Info_h.biAlphaMask);
}
else if (Info_h.biBitCount == 16 && Info_h.biCompression == 0) { /* RGBX */
bmpmask16toimage(pData, stride, image, 0x7C00U, 0x03E0U, 0x001FU, 0x0000U);
}
else if (Info_h.biBitCount == 16 && Info_h.biCompression == 3) { /* bitmask */
if ((Info_h.biRedMask == 0U) && (Info_h.biGreenMask == 0U) && (Info_h.biBlueMask == 0U)) {
Info_h.biRedMask = 0xF800U;
Info_h.biGreenMask = 0x07E0U;
Info_h.biBlueMask = 0x001FU;
}
bmpmask16toimage(pData, stride, image, Info_h.biRedMask, Info_h.biGreenMask, Info_h.biBlueMask, Info_h.biAlphaMask);
}
else {
opj_image_destroy(image);
image = NULL;
fprintf(stderr, "Other system than 24 bits/pixels or 8 bits (no RLE coding) is not yet implemented [%d]\n", Info_h.biBitCount);
}
free(pData);
fclose(IN);
return image;
}
int imagetobmp(opj_image_t * image, const char *outfile) {
int w, h;
int i, pad;
FILE *fdest = NULL;
int adjustR, adjustG, adjustB;
if (image->comps[0].prec < 8) {
fprintf(stderr, "Unsupported number of components: %d\n", image->comps[0].prec);
return 1;
}
if (image->numcomps >= 3 && image->comps[0].dx == image->comps[1].dx
&& image->comps[1].dx == image->comps[2].dx
&& image->comps[0].dy == image->comps[1].dy
&& image->comps[1].dy == image->comps[2].dy
&& image->comps[0].prec == image->comps[1].prec
&& image->comps[1].prec == image->comps[2].prec) {
/* -->> -->> -->> -->>
24 bits color
<<-- <<-- <<-- <<-- */
fdest = fopen(outfile, "wb");
if (!fdest) {
fprintf(stderr, "ERROR -> failed to open %s for writing\n", outfile);
return 1;
}
w = (int)image->comps[0].w;
h = (int)image->comps[0].h;
fprintf(fdest, "BM");
/* FILE HEADER */
/* ------------- */
fprintf(fdest, "%c%c%c%c",
(OPJ_UINT8) (h * w * 3 + 3 * h * (w % 2) + 54) & 0xff,
(OPJ_UINT8) ((h * w * 3 + 3 * h * (w % 2) + 54) >> 8) & 0xff,
(OPJ_UINT8) ((h * w * 3 + 3 * h * (w % 2) + 54) >> 16) & 0xff,
(OPJ_UINT8) ((h * w * 3 + 3 * h * (w % 2) + 54) >> 24) & 0xff);
fprintf(fdest, "%c%c%c%c", (0) & 0xff, ((0) >> 8) & 0xff, ((0) >> 16) & 0xff, ((0) >> 24) & 0xff);
fprintf(fdest, "%c%c%c%c", (54) & 0xff, ((54) >> 8) & 0xff,((54) >> 16) & 0xff, ((54) >> 24) & 0xff);
/* INFO HEADER */
/* ------------- */
fprintf(fdest, "%c%c%c%c", (40) & 0xff, ((40) >> 8) & 0xff, ((40) >> 16) & 0xff, ((40) >> 24) & 0xff);
fprintf(fdest, "%c%c%c%c", (OPJ_UINT8) ((w) & 0xff),
(OPJ_UINT8) ((w) >> 8) & 0xff,
(OPJ_UINT8) ((w) >> 16) & 0xff,
(OPJ_UINT8) ((w) >> 24) & 0xff);
fprintf(fdest, "%c%c%c%c", (OPJ_UINT8) ((h) & 0xff),
(OPJ_UINT8) ((h) >> 8) & 0xff,
(OPJ_UINT8) ((h) >> 16) & 0xff,
(OPJ_UINT8) ((h) >> 24) & 0xff);
fprintf(fdest, "%c%c", (1) & 0xff, ((1) >> 8) & 0xff);
fprintf(fdest, "%c%c", (24) & 0xff, ((24) >> 8) & 0xff);
fprintf(fdest, "%c%c%c%c", (0) & 0xff, ((0) >> 8) & 0xff, ((0) >> 16) & 0xff, ((0) >> 24) & 0xff);
fprintf(fdest, "%c%c%c%c", (OPJ_UINT8) (3 * h * w + 3 * h * (w % 2)) & 0xff,
(OPJ_UINT8) ((h * w * 3 + 3 * h * (w % 2)) >> 8) & 0xff,
(OPJ_UINT8) ((h * w * 3 + 3 * h * (w % 2)) >> 16) & 0xff,
(OPJ_UINT8) ((h * w * 3 + 3 * h * (w % 2)) >> 24) & 0xff);
fprintf(fdest, "%c%c%c%c", (7834) & 0xff, ((7834) >> 8) & 0xff, ((7834) >> 16) & 0xff, ((7834) >> 24) & 0xff);
fprintf(fdest, "%c%c%c%c", (7834) & 0xff, ((7834) >> 8) & 0xff, ((7834) >> 16) & 0xff, ((7834) >> 24) & 0xff);
fprintf(fdest, "%c%c%c%c", (0) & 0xff, ((0) >> 8) & 0xff, ((0) >> 16) & 0xff, ((0) >> 24) & 0xff);
fprintf(fdest, "%c%c%c%c", (0) & 0xff, ((0) >> 8) & 0xff, ((0) >> 16) & 0xff, ((0) >> 24) & 0xff);
if (image->comps[0].prec > 8) {
adjustR = (int)image->comps[0].prec - 8;
printf("BMP CONVERSION: Truncating component 0 from %d bits to 8 bits\n", image->comps[0].prec);
}
else
adjustR = 0;
if (image->comps[1].prec > 8) {
adjustG = (int)image->comps[1].prec - 8;
printf("BMP CONVERSION: Truncating component 1 from %d bits to 8 bits\n", image->comps[1].prec);
}
else
adjustG = 0;
if (image->comps[2].prec > 8) {
adjustB = (int)image->comps[2].prec - 8;
printf("BMP CONVERSION: Truncating component 2 from %d bits to 8 bits\n", image->comps[2].prec);
}
else
adjustB = 0;
for (i = 0; i < w * h; i++) {
OPJ_UINT8 rc, gc, bc;
int r, g, b;
r = image->comps[0].data[w * h - ((i) / (w) + 1) * w + (i) % (w)];
r += (image->comps[0].sgnd ? 1 << (image->comps[0].prec - 1) : 0);
r = ((r >> adjustR)+((r >> (adjustR-1))%2));
if(r > 255) r = 255; else if(r < 0) r = 0;
rc = (OPJ_UINT8)r;
g = image->comps[1].data[w * h - ((i) / (w) + 1) * w + (i) % (w)];
g += (image->comps[1].sgnd ? 1 << (image->comps[1].prec - 1) : 0);
g = ((g >> adjustG)+((g >> (adjustG-1))%2));
if(g > 255) g = 255; else if(g < 0) g = 0;
gc = (OPJ_UINT8)g;
b = image->comps[2].data[w * h - ((i) / (w) + 1) * w + (i) % (w)];
b += (image->comps[2].sgnd ? 1 << (image->comps[2].prec - 1) : 0);
b = ((b >> adjustB)+((b >> (adjustB-1))%2));
if(b > 255) b = 255; else if(b < 0) b = 0;
bc = (OPJ_UINT8)b;
fprintf(fdest, "%c%c%c", bc, gc, rc);
if ((i + 1) % w == 0) {
for (pad = ((3 * w) % 4) ? (4 - (3 * w) % 4) : 0; pad > 0; pad--) /* ADD */
fprintf(fdest, "%c", 0);
}
}
fclose(fdest);
} else { /* Gray-scale */
/* -->> -->> -->> -->>
8 bits non code (Gray scale)
<<-- <<-- <<-- <<-- */
fdest = fopen(outfile, "wb");
if (!fdest) {
fprintf(stderr, "ERROR -> failed to open %s for writing\n", outfile);
return 1;
}
w = (int)image->comps[0].w;
h = (int)image->comps[0].h;
fprintf(fdest, "BM");
/* FILE HEADER */
/* ------------- */
fprintf(fdest, "%c%c%c%c", (OPJ_UINT8) (h * w + 54 + 1024 + h * (w % 2)) & 0xff,
(OPJ_UINT8) ((h * w + 54 + 1024 + h * (w % 2)) >> 8) & 0xff,
(OPJ_UINT8) ((h * w + 54 + 1024 + h * (w % 2)) >> 16) & 0xff,
(OPJ_UINT8) ((h * w + 54 + 1024 + w * (w % 2)) >> 24) & 0xff);
fprintf(fdest, "%c%c%c%c", (0) & 0xff, ((0) >> 8) & 0xff, ((0) >> 16) & 0xff, ((0) >> 24) & 0xff);
fprintf(fdest, "%c%c%c%c", (54 + 1024) & 0xff, ((54 + 1024) >> 8) & 0xff,
((54 + 1024) >> 16) & 0xff,
((54 + 1024) >> 24) & 0xff);
/* INFO HEADER */
/* ------------- */
fprintf(fdest, "%c%c%c%c", (40) & 0xff, ((40) >> 8) & 0xff, ((40) >> 16) & 0xff, ((40) >> 24) & 0xff);
fprintf(fdest, "%c%c%c%c", (OPJ_UINT8) ((w) & 0xff),
(OPJ_UINT8) ((w) >> 8) & 0xff,
(OPJ_UINT8) ((w) >> 16) & 0xff,
(OPJ_UINT8) ((w) >> 24) & 0xff);
fprintf(fdest, "%c%c%c%c", (OPJ_UINT8) ((h) & 0xff),
(OPJ_UINT8) ((h) >> 8) & 0xff,
(OPJ_UINT8) ((h) >> 16) & 0xff,
(OPJ_UINT8) ((h) >> 24) & 0xff);
fprintf(fdest, "%c%c", (1) & 0xff, ((1) >> 8) & 0xff);
fprintf(fdest, "%c%c", (8) & 0xff, ((8) >> 8) & 0xff);
fprintf(fdest, "%c%c%c%c", (0) & 0xff, ((0) >> 8) & 0xff, ((0) >> 16) & 0xff, ((0) >> 24) & 0xff);
fprintf(fdest, "%c%c%c%c", (OPJ_UINT8) (h * w + h * (w % 2)) & 0xff,
(OPJ_UINT8) ((h * w + h * (w % 2)) >> 8) & 0xff,
(OPJ_UINT8) ((h * w + h * (w % 2)) >> 16) & 0xff,
(OPJ_UINT8) ((h * w + h * (w % 2)) >> 24) & 0xff);
fprintf(fdest, "%c%c%c%c", (7834) & 0xff, ((7834) >> 8) & 0xff, ((7834) >> 16) & 0xff, ((7834) >> 24) & 0xff);
fprintf(fdest, "%c%c%c%c", (7834) & 0xff, ((7834) >> 8) & 0xff, ((7834) >> 16) & 0xff, ((7834) >> 24) & 0xff);
fprintf(fdest, "%c%c%c%c", (256) & 0xff, ((256) >> 8) & 0xff, ((256) >> 16) & 0xff, ((256) >> 24) & 0xff);
fprintf(fdest, "%c%c%c%c", (256) & 0xff, ((256) >> 8) & 0xff, ((256) >> 16) & 0xff, ((256) >> 24) & 0xff);
if (image->comps[0].prec > 8) {
adjustR = (int)image->comps[0].prec - 8;
printf("BMP CONVERSION: Truncating component 0 from %d bits to 8 bits\n", image->comps[0].prec);
}else
adjustR = 0;
for (i = 0; i < 256; i++) {
fprintf(fdest, "%c%c%c%c", i, i, i, 0);
}
for (i = 0; i < w * h; i++) {
int r;
r = image->comps[0].data[w * h - ((i) / (w) + 1) * w + (i) % (w)];
r += (image->comps[0].sgnd ? 1 << (image->comps[0].prec - 1) : 0);
r = ((r >> adjustR)+((r >> (adjustR-1))%2));
if(r > 255) r = 255; else if(r < 0) r = 0;
fprintf(fdest, "%c", (OPJ_UINT8)r);
if ((i + 1) % w == 0) {
for (pad = (w % 4) ? (4 - w % 4) : 0; pad > 0; pad--) /* ADD */
fprintf(fdest, "%c", 0);
}
}
fclose(fdest);
}
return 0;
}

500
src/bin/jp2/convertpng.c Normal file
View File

@ -0,0 +1,500 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2006-2007, Parvatha Elangovan
* Copyright (c) 2015, Matthieu Darbois
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "opj_apps_config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <zlib.h>
#include <png.h>
#include "openjpeg.h"
#include "convert.h"
#define PNG_MAGIC "\x89PNG\x0d\x0a\x1a\x0a"
#define MAGIC_SIZE 8
/* PNG allows bits per sample: 1, 2, 4, 8, 16 */
static void convert_16u32s_C1R(const OPJ_BYTE* pSrc, OPJ_INT32* pDst, OPJ_SIZE_T length)
{
OPJ_SIZE_T i;
for (i = 0; i < length; i++) {
OPJ_INT32 val0 = *pSrc++;
OPJ_INT32 val1 = *pSrc++;
pDst[i] = val0 << 8 | val1;
}
}
opj_image_t *pngtoimage(const char *read_idf, opj_cparameters_t * params)
{
png_structp png = NULL;
png_infop info = NULL;
double gamma;
int bit_depth, interlace_type,compression_type, filter_type;
OPJ_UINT32 i;
png_uint_32 width, height = 0U;
int color_type;
FILE *reader = NULL;
OPJ_BYTE** rows = NULL;
OPJ_INT32* row32s = NULL;
/* j2k: */
opj_image_t *image = NULL;
opj_image_cmptparm_t cmptparm[4];
OPJ_UINT32 nr_comp;
OPJ_BYTE sigbuf[8];
convert_XXx32s_C1R cvtXXTo32s = NULL;
convert_32s_CXPX cvtCxToPx = NULL;
OPJ_INT32* planes[4];
if((reader = fopen(read_idf, "rb")) == NULL)
{
fprintf(stderr,"pngtoimage: can not open %s\n",read_idf);
return NULL;
}
if(fread(sigbuf, 1, MAGIC_SIZE, reader) != MAGIC_SIZE
|| memcmp(sigbuf, PNG_MAGIC, MAGIC_SIZE) != 0)
{
fprintf(stderr,"pngtoimage: %s is no valid PNG file\n",read_idf);
goto fin;
}
if((png = png_create_read_struct(PNG_LIBPNG_VER_STRING,
NULL, NULL, NULL)) == NULL)
goto fin;
if((info = png_create_info_struct(png)) == NULL)
goto fin;
if(setjmp(png_jmpbuf(png)))
goto fin;
png_init_io(png, reader);
png_set_sig_bytes(png, MAGIC_SIZE);
png_read_info(png, info);
if(png_get_IHDR(png, info, &width, &height,
&bit_depth, &color_type, &interlace_type,
&compression_type, &filter_type) == 0)
goto fin;
/* png_set_expand():
* expand paletted images to RGB, expand grayscale images of
* less than 8-bit depth to 8-bit depth, and expand tRNS chunks
* to alpha channels.
*/
if(color_type == PNG_COLOR_TYPE_PALETTE) {
png_set_expand(png);
}
if(png_get_valid(png, info, PNG_INFO_tRNS)) {
png_set_expand(png);
}
/* We might wan't to expand background */
/*
if(png_get_valid(png, info, PNG_INFO_bKGD)) {
png_color_16p bgnd;
png_get_bKGD(png, info, &bgnd);
png_set_background(png, bgnd, PNG_BACKGROUND_GAMMA_FILE, 1, 1.0);
}
*/
if( !png_get_gAMA(png, info, &gamma))
gamma = 1.0;
/* we're not displaying but converting, screen gamma == 1.0 */
png_set_gamma(png, 1.0, gamma);
png_read_update_info(png, info);
color_type = png_get_color_type(png, info);
switch (color_type) {
case PNG_COLOR_TYPE_GRAY:
nr_comp = 1;
break;
case PNG_COLOR_TYPE_GRAY_ALPHA:
nr_comp = 2;
break;
case PNG_COLOR_TYPE_RGB:
nr_comp = 3;
break;
case PNG_COLOR_TYPE_RGB_ALPHA:
nr_comp = 4;
break;
default:
fprintf(stderr,"pngtoimage: colortype %d is not supported\n", color_type);
goto fin;
}
cvtCxToPx = convert_32s_CXPX_LUT[nr_comp];
bit_depth = png_get_bit_depth(png, info);
switch (bit_depth) {
case 1:
case 2:
case 4:
case 8:
cvtXXTo32s = convert_XXu32s_C1R_LUT[bit_depth];
break;
case 16: /* 16 bpp is specific to PNG */
cvtXXTo32s = convert_16u32s_C1R;
break;
default:
fprintf(stderr,"pngtoimage: bit depth %d is not supported\n", bit_depth);
goto fin;
}
rows = (OPJ_BYTE**)calloc(height+1, sizeof(OPJ_BYTE*));
if(rows == NULL){
fprintf(stderr, "pngtoimage: memory out\n");
goto fin;
}
for(i = 0; i < height; ++i){
rows[i] = (OPJ_BYTE*)malloc(png_get_rowbytes(png,info));
if(rows[i] == NULL){
fprintf(stderr,"pngtoimage: memory out\n");
goto fin;
}
}
png_read_image(png, rows);
/* Create image */
memset(cmptparm, 0, sizeof(cmptparm));
for(i = 0; i < nr_comp; ++i)
{
cmptparm[i].prec = (OPJ_UINT32)bit_depth;
/* bits_per_pixel: 8 or 16 */
cmptparm[i].bpp = (OPJ_UINT32)bit_depth;
cmptparm[i].sgnd = 0;
cmptparm[i].dx = (OPJ_UINT32)params->subsampling_dx;
cmptparm[i].dy = (OPJ_UINT32)params->subsampling_dy;
cmptparm[i].w = (OPJ_UINT32)width;
cmptparm[i].h = (OPJ_UINT32)height;
}
image = opj_image_create(nr_comp, &cmptparm[0], (nr_comp > 2U) ? OPJ_CLRSPC_SRGB : OPJ_CLRSPC_GRAY);
if(image == NULL) goto fin;
image->x0 = (OPJ_UINT32)params->image_offset_x0;
image->y0 = (OPJ_UINT32)params->image_offset_y0;
image->x1 = (OPJ_UINT32)(image->x0 + (width - 1) * (OPJ_UINT32)params->subsampling_dx + 1 + image->x0);
image->y1 = (OPJ_UINT32)(image->y0 + (height - 1) * (OPJ_UINT32)params->subsampling_dy + 1 + image->y0);
row32s = (OPJ_INT32 *)malloc((size_t)width * nr_comp * sizeof(OPJ_INT32));
if(row32s == NULL) goto fin;
/* Set alpha channel */
image->comps[nr_comp-1U].alpha = 1U - (nr_comp & 1U);
for(i = 0; i < nr_comp; i++)
{
planes[i] = image->comps[i].data;
}
for(i = 0; i < height; ++i)
{
cvtXXTo32s(rows[i], row32s, (OPJ_SIZE_T)width * nr_comp);
cvtCxToPx(row32s, planes, width);
planes[0] += width;
planes[1] += width;
planes[2] += width;
planes[3] += width;
}
fin:
if(rows)
{
for(i = 0; i < height; ++i)
if(rows[i]) free(rows[i]);
free(rows);
}
if (row32s) {
free(row32s);
}
if(png)
png_destroy_read_struct(&png, &info, NULL);
fclose(reader);
return image;
}/* pngtoimage() */
static void convert_32s16u_C1R(const OPJ_INT32* pSrc, OPJ_BYTE* pDst, OPJ_SIZE_T length)
{
OPJ_SIZE_T i;
for (i = 0; i < length; i++) {
OPJ_UINT32 val = (OPJ_UINT32)pSrc[i];
*pDst++ = (OPJ_BYTE)(val >> 8);
*pDst++ = (OPJ_BYTE)val;
}
}
int imagetopng(opj_image_t * image, const char *write_idf)
{
FILE * volatile writer = NULL;
png_structp png = NULL;
png_infop info = NULL;
png_bytep volatile row_buf = NULL;
int nr_comp, color_type;
volatile int prec;
png_color_8 sig_bit;
OPJ_INT32 const* planes[4];
int i;
OPJ_INT32* volatile buffer32s = NULL;
volatile int fails = 1;
memset(&sig_bit, 0, sizeof(sig_bit));
prec = (int)image->comps[0].prec;
planes[0] = image->comps[0].data;
nr_comp = (int)image->numcomps;
if (nr_comp > 4) {
nr_comp = 4;
}
for (i = 1; i < nr_comp; ++i) {
if (image->comps[0].dx != image->comps[i].dx) {
break;
}
if (image->comps[0].dy != image->comps[i].dy) {
break;
}
if (image->comps[0].prec != image->comps[i].prec) {
break;
}
if (image->comps[0].sgnd != image->comps[i].sgnd) {
break;
}
planes[i] = image->comps[i].data;
}
if (i != nr_comp) {
fprintf(stderr,"imagetopng: All components shall have the same subsampling, same bit depth, same sign.\n");
fprintf(stderr,"\tAborting\n");
return 1;
}
for (i = 0; i < nr_comp; ++i) {
clip_component(&(image->comps[i]), image->comps[0].prec);
}
if(prec > 8 && prec < 16)
{
for (i = 0; i < nr_comp; ++i) {
scale_component(&(image->comps[i]), 16);
}
prec = 16;
}
else if(prec < 8 && nr_comp > 1)/* GRAY_ALPHA, RGB, RGB_ALPHA */
{
for (i = 0; i < nr_comp; ++i) {
scale_component(&(image->comps[i]), 8);
}
prec = 8;
} else if((prec > 1) && (prec < 8) && ((prec == 6) || ((prec & 1)==1))) { /* GRAY with non native precision */
if ((prec == 5) || (prec == 6)) {
prec = 8;
} else {
prec++;
}
for (i = 0; i < nr_comp; ++i) {
scale_component(&(image->comps[i]), (OPJ_UINT32)prec);
}
}
if(prec != 1 && prec != 2 && prec != 4 && prec != 8 && prec != 16)
{
fprintf(stderr,"imagetopng: can not create %s\n\twrong bit_depth %d\n", write_idf, prec);
return fails;
}
writer = fopen(write_idf, "wb");
if(writer == NULL) return fails;
/* Create and initialize the png_struct with the desired error handler
* functions. If you want to use the default stderr and longjump method,
* you can supply NULL for the last three parameters. We also check that
* the library version is compatible with the one used at compile time,
* in case we are using dynamically linked libraries. REQUIRED.
*/
png = png_create_write_struct(PNG_LIBPNG_VER_STRING,
NULL, NULL, NULL);
/*png_voidp user_error_ptr, user_error_fn, user_warning_fn); */
if(png == NULL) goto fin;
/* Allocate/initialize the image information data. REQUIRED
*/
info = png_create_info_struct(png);
if(info == NULL) goto fin;
/* Set error handling. REQUIRED if you are not supplying your own
* error handling functions in the png_create_write_struct() call.
*/
if(setjmp(png_jmpbuf(png))) goto fin;
/* I/O initialization functions is REQUIRED
*/
png_init_io(png, writer);
/* Set the image information here. Width and height are up to 2^31,
* bit_depth is one of 1, 2, 4, 8, or 16, but valid values also depend on
* the color_type selected. color_type is one of PNG_COLOR_TYPE_GRAY,
* PNG_COLOR_TYPE_GRAY_ALPHA, PNG_COLOR_TYPE_PALETTE, PNG_COLOR_TYPE_RGB,
* or PNG_COLOR_TYPE_RGB_ALPHA. interlace is either PNG_INTERLACE_NONE or
* PNG_INTERLACE_ADAM7, and the compression_type and filter_type MUST
* currently be PNG_COMPRESSION_TYPE_BASE and PNG_FILTER_TYPE_BASE.
* REQUIRED
*
* ERRORS:
*
* color_type == PNG_COLOR_TYPE_PALETTE && bit_depth > 8
* color_type == PNG_COLOR_TYPE_RGB && bit_depth < 8
* color_type == PNG_COLOR_TYPE_GRAY_ALPHA && bit_depth < 8
* color_type == PNG_COLOR_TYPE_RGB_ALPHA) && bit_depth < 8
*
*/
png_set_compression_level(png, Z_BEST_COMPRESSION);
if(nr_comp >= 3) /* RGB(A) */
{
color_type = PNG_COLOR_TYPE_RGB;
sig_bit.red = sig_bit.green = sig_bit.blue = (png_byte)prec;
}
else /* GRAY(A) */
{
color_type = PNG_COLOR_TYPE_GRAY;
sig_bit.gray = (png_byte)prec;
}
if((nr_comp & 1) == 0) /* ALPHA */
{
color_type |= PNG_COLOR_MASK_ALPHA;
sig_bit.alpha = (png_byte)prec;
}
png_set_IHDR(png, info, image->comps[0].w, image->comps[0].h, prec, color_type,
PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
png_set_sBIT(png, info, &sig_bit);
/* png_set_gamma(png, 2.2, 1./2.2); */
/* png_set_sRGB(png, info, PNG_sRGB_INTENT_PERCEPTUAL); */
png_write_info(png, info);
/* setup conversion */
{
OPJ_SIZE_T rowStride;
png_size_t png_row_size;
png_row_size = png_get_rowbytes(png, info);
rowStride = ((OPJ_SIZE_T)image->comps[0].w * (OPJ_SIZE_T)nr_comp * (OPJ_SIZE_T)prec + 7U) / 8U;
if (rowStride != (OPJ_SIZE_T)png_row_size) {
fprintf(stderr, "Invalid PNG row size\n");
goto fin;
}
row_buf = (png_bytep)malloc(png_row_size);
if (row_buf == NULL) {
fprintf(stderr, "Can't allocate memory for PNG row\n");
goto fin;
}
buffer32s = (OPJ_INT32*)malloc((OPJ_SIZE_T)image->comps[0].w * (OPJ_SIZE_T)nr_comp * sizeof(OPJ_INT32));
if (buffer32s == NULL) {
fprintf(stderr, "Can't allocate memory for interleaved 32s row\n");
goto fin;
}
}
/* convert */
{
OPJ_SIZE_T width= image->comps[0].w;
OPJ_UINT32 y;
convert_32s_PXCX cvtPxToCx = convert_32s_PXCX_LUT[nr_comp];
convert_32sXXx_C1R cvt32sToPack = NULL;
OPJ_INT32 adjust = image->comps[0].sgnd ? 1 << (prec - 1) : 0;
png_bytep row_buf_cpy = row_buf;
OPJ_INT32* buffer32s_cpy = buffer32s;
switch (prec) {
case 1:
case 2:
case 4:
case 8:
cvt32sToPack = convert_32sXXu_C1R_LUT[prec];
break;
case 16:
cvt32sToPack = convert_32s16u_C1R;
break;
default:
/* never here */
break;
}
for(y = 0; y < image->comps[0].h; ++y)
{
cvtPxToCx(planes, buffer32s_cpy, width, adjust);
cvt32sToPack(buffer32s_cpy, row_buf_cpy, width * (OPJ_SIZE_T)nr_comp);
png_write_row(png, row_buf_cpy);
planes[0] += width;
planes[1] += width;
planes[2] += width;
planes[3] += width;
}
}
png_write_end(png, info);
fails = 0;
fin:
if(png) {
png_destroy_write_struct(&png, &info);
}
if(row_buf) {
free(row_buf);
}
if(buffer32s) {
free(buffer32s);
}
fclose(writer);
if(fails) (void)remove(write_idf); /* ignore return value */
return fails;
}/* imagetopng() */

1457
src/bin/jp2/converttif.c Normal file

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More