summaryrefslogtreecommitdiff
path: root/tests/nonregression
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2017-09-19 16:52:07 +0200
committerEven Rouault <even.rouault@spatialys.com>2017-09-19 17:06:19 +0200
commit7e2b6bebff12eab8bdc17fc9af017e8c11652f4f (patch)
tree1f1456a4b3962862d3ab581e7b1b080919c53d34 /tests/nonregression
parentce199f42e77f972d6ee782b63492f6d861891053 (diff)
Add capability to decode only a subset of all components of an image.
This adds a opj_set_decoded_components(opj_codec_t *p_codec, OPJ_UINT32 numcomps, const OPJ_UINT32* comps_indices) function, and equivalent "opj_decompress -c compno[,compno]*" option. When specified, neither the MCT transform nor JP2 channel transformations will be applied. Tests added for various combinations of whole image vs tiled-based decoding, full or reduced resolution, use of decode area or not.
Diffstat (limited to 'tests/nonregression')
-rw-r--r--tests/nonregression/md5refs.txt6
-rw-r--r--tests/nonregression/test_suite.ctest.in18
2 files changed, 24 insertions, 0 deletions
diff --git a/tests/nonregression/md5refs.txt b/tests/nonregression/md5refs.txt
index e95a10f0..6076538b 100644
--- a/tests/nonregression/md5refs.txt
+++ b/tests/nonregression/md5refs.txt
@@ -310,3 +310,9 @@ d1bb7f93f4c0eb984b2e9c54e544b7e9 broken.jpc_1.pgx
b704ad4c0cfefffd78c20a54f5541265 dwt_interleave_h.gsr105.jp2_d_1_1_33_33_0.pgx
9d7fe43cd7a50b7bbaf712926ee11980 dwt_interleave_h.gsr105.jp2_d_1_1_33_33_1.pgx
0960b580f991ff10f693b24aa41ad58b dwt_interleave_h.gsr105.jp2_d_1_1_33_33_2.pgx
+fa7382fd8b2e788b28b807e200dd95b9 file1.jp2-c0.tif
+ed79b7fe443955cdefba2b039ddc846a file1.jp2-c0_1_2.tif
+ac8f6ab3acc9c692ed7c41bd62a0e1e8 file1.jp2-c0-r1.tif
+fbfcf662b6f7549574b2885490fbcf12 file1.jp2-c0-d10_20_30_40.tif
+fa7382fd8b2e788b28b807e200dd95b9 file1.jp2-c0-t0.tif
+ac8f6ab3acc9c692ed7c41bd62a0e1e8 file1.jp2-c0-t0-r1.tif
diff --git a/tests/nonregression/test_suite.ctest.in b/tests/nonregression/test_suite.ctest.in
index 718d0599..31ae777b 100644
--- a/tests/nonregression/test_suite.ctest.in
+++ b/tests/nonregression/test_suite.ctest.in
@@ -605,3 +605,21 @@ opj_decompress -i @INPUT_NR_PATH@/issue979.j2k -o @TEMP_PATH@/issue979.j2k.pgx
# https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3115
opj_decompress -i @INPUT_NR_PATH@/dwt_interleave_h.gsr105.jp2 -o @TEMP_PATH@/dwt_interleave_h.gsr105.jp2_d_1_1_33_33.pgx -d 1,1,33,33
+
+# partial component decoding with opj_decode(): one component
+opj_decompress -i @INPUT_CONF_PATH@/file1.jp2 -o @TEMP_PATH@/file1.jp2-c0.tif -c 0
+# partial component decoding with opj_decode(): 3 components without MCT
+opj_decompress -i @INPUT_CONF_PATH@/file1.jp2 -o @TEMP_PATH@/file1.jp2-c0_1_2.tif -c 0,1,2
+# partial component decoding with opj_decode() and opj_set_decode_area()
+opj_decompress -i @INPUT_CONF_PATH@/file1.jp2 -o @TEMP_PATH@/file1.jp2-c0-d10_20_30_40.tif -c 0 -d 10,20,30,40
+# partial component decoding with opj_decode() and reduced resolution
+opj_decompress -i @INPUT_CONF_PATH@/file1.jp2 -o @TEMP_PATH@/file1.jp2-c0-r1.tif -c 0 -r 1
+# partial component decoding with opj_get_decoded_tile()
+opj_decompress -i @INPUT_CONF_PATH@/file1.jp2 -o @TEMP_PATH@/file1.jp2-c0-t0.tif -c 0 -t 0
+# partial component decoding with opj_get_decoded_tile() and reduced resolution
+opj_decompress -i @INPUT_CONF_PATH@/file1.jp2 -o @TEMP_PATH@/file1.jp2-c0-t0-r1.tif -c 0 -t 0 -r 1
+
+# try to map the same component several times
+!opj_decompress -i @INPUT_CONF_PATH@/file1.jp2 -o @TEMP_PATH@/file1.jp2-c0_0.tif -c 0,0
+# try to map an invalid component
+!opj_decompress -i @INPUT_CONF_PATH@/file1.jp2 -o @TEMP_PATH@/file1.jp2-c10.tif -c 10