mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
Tests/JBIG2: Add test cases for custom adaptive template pixels
I manually wrote a bunch of .ini files and ran this script to
produce the files:
#!/bin/bash
set -eu
J=$HOME/Downloads/T-REC-T.88-201808-I\!\!SOFT-ZST-E/Software
J=$J/JBIG2_SampleSoftware-A20180829/source/jbig2
for t in '' template1- template2- template3-; do
for p in '' '-tpgdon'; do
i=${t}customat$p
echo $i.ini
cat $i.ini
$J -i Tests/LibGfx/test-inputs/bmp/bitmap -f bmp -o bitmap-$i \
-F jb2 -ini $i.ini
cp bitmap-$i.jb2 Tests/LibGfx/test-inputs/jbig2/bitmap-$i.jbig2
done
done
The script's output (which shows the .ini file contents) was:
```
% ./make-custom-at.sh
customat.ini
-Gen -Seg 1
-Gen -Param -ATX1 -4
-Gen -Param -ATY1 -5
-Gen -Param -ATX2 6
-Gen -Param -ATY2 -7
-Gen -Param -ATX3 -8
-Gen -Param -ATY3 -9
-Gen -Param -ATX4 10
-Gen -Param -ATY4 -11
ENC Start ===>complete
customat-tpgdon.ini
-Gen -Seg 1
-Gen -Param -ATX1 -4
-Gen -Param -ATY1 -5
-Gen -Param -ATX2 6
-Gen -Param -ATY2 -7
-Gen -Param -ATX3 -8
-Gen -Param -ATY3 -9
-Gen -Param -ATX4 10
-Gen -Param -ATY4 -11
-Gen -Param -TpGDon 1
ENC Start ===>complete
template1-customat.ini
-Gen -Seg 1
-Gen -Param -Template 1
-Gen -Param -ATX1 17
-Gen -Param -ATY1 -2
ENC Start ===>complete
template1-customat-tpgdon.ini
-Gen -Seg 1
-Gen -Param -Template 1
-Gen -Param -ATX1 17
-Gen -Param -ATY1 -2
-Gen -Param -TpGDon 1
ENC Start ===>complete
template2-customat.ini
-Gen -Seg 1
-Gen -Param -Template 2
-Gen -Param -ATX1 17
-Gen -Param -ATY1 -2
ENC Start ===>complete
template2-customat-tpgdon.ini
-Gen -Seg 1
-Gen -Param -Template 2
-Gen -Param -ATX1 17
-Gen -Param -ATY1 -2
-Gen -Param -TpGDon 1
ENC Start ===>complete
template3-customat.ini
-Gen -Seg 1
-Gen -Param -Template 3
-Gen -Param -ATX1 17
-Gen -Param -ATY1 -2
ENC Start ===>complete
template3-customat-tpgdon.ini
-Gen -Seg 1
-Gen -Param -Template 3
-Gen -Param -ATX1 17
-Gen -Param -ATY1 -2
-Gen -Param -TpGDon 1
ENC Start ===>complete
```
This commit is contained in:
@@ -356,13 +356,21 @@ TEST_CASE(test_jbig2_decode)
|
||||
|
||||
Array test_inputs = {
|
||||
TEST_INPUT("jbig2/bitmap.jbig2"sv),
|
||||
TEST_INPUT("jbig2/bitmap-customat.jbig2"sv),
|
||||
TEST_INPUT("jbig2/bitmap-tpgdon.jbig2"sv),
|
||||
TEST_INPUT("jbig2/bitmap-customat-tpgdon.jbig2"sv),
|
||||
TEST_INPUT("jbig2/bitmap-template1.jbig2"sv),
|
||||
TEST_INPUT("jbig2/bitmap-template1-customat.jbig2"sv),
|
||||
TEST_INPUT("jbig2/bitmap-template1-tpgdon.jbig2"sv),
|
||||
TEST_INPUT("jbig2/bitmap-template1-customat-tpgdon.jbig2"sv),
|
||||
TEST_INPUT("jbig2/bitmap-template2.jbig2"sv),
|
||||
TEST_INPUT("jbig2/bitmap-template2-customat.jbig2"sv),
|
||||
TEST_INPUT("jbig2/bitmap-template2-tpgdon.jbig2"sv),
|
||||
TEST_INPUT("jbig2/bitmap-template2-customat-tpgdon.jbig2"sv),
|
||||
TEST_INPUT("jbig2/bitmap-template3.jbig2"sv),
|
||||
TEST_INPUT("jbig2/bitmap-template3-customat.jbig2"sv),
|
||||
TEST_INPUT("jbig2/bitmap-template3-tpgdon.jbig2"sv),
|
||||
TEST_INPUT("jbig2/bitmap-template3-customat-tpgdon.jbig2"sv),
|
||||
TEST_INPUT("jbig2/bitmap-symbol.jbig2"sv),
|
||||
TEST_INPUT("jbig2/bitmap-symbol-textrefine.jbig2"sv),
|
||||
TEST_INPUT("jbig2/bitmap-symbol-symbolrefine.jbig2"sv),
|
||||
|
||||
Reference in New Issue
Block a user