ladybird/Tests/LibGfx
Nico Weber 1570751d64 Tests/LibGfx: Add a jbig2 file using refinement in the symbol segment
This adds a test for the code added in #23710.

I created this file using `jbig2` (see below for details), but as
usual it required a bunch of changes to it to make it actually produce
spec-compliant output. See the PR adding this image for my local diff.

I created the test image file by running this shell script with
`jbig2` tweaked as described above:

    #!/bin/bash

    set -eu

    S=Tests/LibGfx/test-inputs/bmp/bitmap.bmp

    # See make-symbol-jbig.sh (the script in #23659) for the general
    # setup and some comments. See also make-symbol-textrefine.sh (in
    # #23713).
    #
    # `-Ref` takes 5 arguments:
    # 1. The symbol ID of this symbol (like after a `-Simple`)
    # 2. A bmp file that the base symbol gets refined to
    # 3. The ID of the base symbol
    # 4. dx, dy
    cat << EOF > jbig2-symbol-symbolrefine.ini
    -sym -Seg 1
    -sym -file -numClass -HeightClass 3 -WidthClass 1
    -sym -file -numSymbol 3
    -sym -file -Height 250
    -sym -file -Width 120 -Simple 0 mouth-1bpp.bmp
    -sym -file -EndOfHeightClass
    -sym -file -Height 100
    -sym -file -Width 100 -Simple 1 nose-1bpp.bmp
    -sym -file -EndOfHeightClass
    -sym -file -Height 30
    -sym -file -Width 30 -Simple 2 top_eye-1bpp.bmp
    -sym -file -EndOfHeightClass
    -sym -Param -Huff_DH 0
    -sym -Param -Huff_DW 0

    -sym -Seg 2
    -sym -file -numClass -HeightClass 1 -WidthClass 1
    -sym -file -numSymbol 1
    -sym -file -Height 30
    -sym -file -Width 30 -Ref 3 bottom_eye-1bpp.bmp 2 0 0
    -sym -file -EndOfHeightClass
    -sym -Param -Huff_DH 0
    -sym -Param -Huff_DW 0
    -sym -Param -RefTemplate 1

    -txt -Seg 3
    -txt -Param -numInst 4
        -ID 2 108 50 -ID 3 265 60 -ID 1 100 135 -ID 0 70 232
    -txt -Param -RefCorner 1
    -txt -Param -Xlocation 0
    -txt -Param -Ylocation 0
    -txt -Param -W 399
    -txt -Param -H 400
    EOF

    J=$HOME/Downloads/T-REC-T.88-201808-I\!\!SOFT-ZST-E/Software
    J=$J/JBIG2_SampleSoftware-A20180829/source/jbig2

    $J -i "${S%.bmp}" -f bmp -o symbol-symbolrefine -F jb2 \
        -ini jbig2-symbol-symbolrefine.ini
2024-03-27 11:20:08 -04:00
..
test-inputs Tests/LibGfx: Add a jbig2 file using refinement in the symbol segment 2024-03-27 11:20:08 -04:00
BenchmarkGfxPainter.cpp Tests: Propagate errors with TRY_OR_FAIL() where possible 2024-02-14 17:46:06 -05:00
BenchmarkJPEGLoader.cpp Tests: Move jpg test images into jpg/ subfolder 2023-06-19 06:42:00 -04:00
CMakeLists.txt LibGfx: Fix off-by-some in Painter::draw_scaled_bitmap_with_transform() 2024-01-10 09:38:13 +01:00
TestDeltaE.cpp LibGfx: Add DeltaE() function 2023-04-30 05:57:20 +02:00
TestFontHandling.cpp LibGfx: Allow extracting paths from fonts and add Gfx::Path::text() 2023-11-05 02:46:46 +01:00
TestGfxBitmap.cpp LibGfx: Fix serializing Gfx::Bitmaps 2023-10-15 20:34:29 +02:00
TestICCProfile.cpp LibGfx/ICC: Implement conversion between different connection spaces 2023-12-04 08:02:36 +00:00
TestImageDecoder.cpp Tests/LibGfx: Add a jbig2 file using refinement in the symbol segment 2024-03-27 11:20:08 -04:00
TestPainter.cpp Tests: Remove logspam from TestPainter 2024-03-14 10:56:13 -04:00
TestParseISOBMFF.cpp LibGfx: Add initial ISO BMFF parsing and a utility to print file info 2023-07-27 12:02:37 +01:00
TestRect.cpp LibGfx: Add Rect::unite_{horizontally,vertically}() 2023-07-13 05:09:08 +02:00
TestScalingFunctions.cpp LibGfx+Everywhere: Change Gfx::Rect to be endpoint exclusive 2023-05-23 12:35:42 +02:00
TestWOFF.cpp LibGfx/WOFF: Ensure header totalSfntSize matches expected value 2023-10-24 07:29:09 +02:00
TestWOFF2.cpp LibGfx/WOFF2: Ensure numTables is within expected range 2023-10-26 08:39:26 +02:00