Skip to content

Commit b9449f5

Browse files
committed
Tests/LibGfx: Expand JBIG2 TPGRON tests
This adds tests like the ones added in #26436, but for refinement regions and TPGRON. We accidentally get this case right already: The adaptive refinement pixel for template 0 is in the top left corners, and template 1 doesn't have any refinement pixels. See figures 12-15 in the spec. Since the SLTP context for refinement regions has all-white pixels, we don't need the double-xor trick, we can just use the default "or" operator and draw on top of the correct bitmap. If everything works, the or'd bitmap will be all white and won't change the result. No behavior change.
1 parent 0cc8632 commit b9449f5

File tree

5 files changed

+73
-0
lines changed

5 files changed

+73
-0
lines changed
110 Bytes
Binary file not shown.
118 Bytes
Binary file not shown.

Tests/LibGfx/test-inputs/jbig2/json/bitmap-refine-template1-tpgron.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,43 @@
4646
},
4747
{
4848
"segment_number": 3,
49+
"type": "intermediate_generic_region",
50+
"page_association": 1,
51+
"retained": true,
52+
"data": {
53+
"image_data": {
54+
"from_file": "tpgron-ref.bmp",
55+
"repeat_x": 66,
56+
"repeat_y": 33
57+
}
58+
}
59+
},
60+
{
61+
"segment_number": 4,
62+
"type": "generic_refinement_region",
63+
"page_association": 1,
64+
"referred_to_segments": [
65+
{
66+
"segment_number": 3,
67+
"retained": true
68+
}
69+
],
70+
"data": {
71+
"image_data": {
72+
"from_file": "bitmap.bmp",
73+
"crop": {
74+
"width": 198,
75+
"height": 99
76+
}
77+
},
78+
"flags": {
79+
"gr_template": 1,
80+
"use_typical_prediction": true
81+
}
82+
}
83+
},
84+
{
85+
"segment_number": 5,
4986
"type": "end_of_page",
5087
"page_association": 1
5188
}

Tests/LibGfx/test-inputs/jbig2/json/bitmap-refine-tpgron.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,42 @@
4545
},
4646
{
4747
"segment_number": 3,
48+
"type": "intermediate_generic_region",
49+
"page_association": 1,
50+
"retained": true,
51+
"data": {
52+
"image_data": {
53+
"from_file": "tpgron-ref.bmp",
54+
"repeat_x": 66,
55+
"repeat_y": 33
56+
}
57+
}
58+
},
59+
{
60+
"segment_number": 4,
61+
"type": "generic_refinement_region",
62+
"page_association": 1,
63+
"referred_to_segments": [
64+
{
65+
"segment_number": 3,
66+
"retained": true
67+
}
68+
],
69+
"data": {
70+
"image_data": {
71+
"from_file": "bitmap.bmp",
72+
"crop": {
73+
"width": 198,
74+
"height": 99
75+
}
76+
},
77+
"flags": {
78+
"use_typical_prediction": true
79+
}
80+
}
81+
},
82+
{
83+
"segment_number": 5,
4884
"type": "end_of_page",
4985
"page_association": 1
5086
}
174 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)