Add palette and odd-sized PNG unit tests. Fix loading interlaced PNGs < 8x8 in size.

db4
Philip Searle 2010-11-13 23:52:13 +00:00
parent a22f5611de
commit e83cc32b14
90 changed files with 65 additions and 8 deletions

View File

@ -13,18 +13,62 @@ IN: images.png.tests
"basi0g08.png" decode-test
"basi0g16.png" decode-test
"basi2c08.png" decode-test
"basi3p01.png" decode-test
"basi3p02.png" decode-test
"basi3p04.png" decode-test
"basi3p08.png" decode-test
"basn0g01.png" decode-test
"basn0g02.png" decode-test
"basn0g04.png" decode-test
"basn0g08.png" decode-test
"basn0g16.png" decode-test
"basn2c08.png" decode-test
"basn3p01.png" decode-test
"basn3p02.png" decode-test
"basn3p04.png" decode-test
"basn3p08.png" decode-test
"basn6a08.png" decode-test
"f00n2c08.png" decode-test
"f01n2c08.png" decode-test
"f02n2c08.png" decode-test
"f03n2c08.png" decode-test
"f04n2c08.png" decode-test
"s01i3p01.png" decode-test
"s01n3p01.png" decode-test
"s02i3p01.png" decode-test
"s02n3p01.png" decode-test
"s03i3p01.png" decode-test
"s03n3p01.png" decode-test
"s04i3p01.png" decode-test
"s04n3p01.png" decode-test
"s05i3p02.png" decode-test
"s05n3p02.png" decode-test
"s06i3p02.png" decode-test
"s06n3p02.png" decode-test
"s07i3p02.png" decode-test
"s07n3p02.png" decode-test
"s08i3p02.png" decode-test
"s08n3p02.png" decode-test
"s09i3p02.png" decode-test
"s32n3p04.png" decode-test
"s32i3p04.png" decode-test
"s33n3p04.png" decode-test
"s33i3p04.png" decode-test
"s34n3p04.png" decode-test
"s34i3p04.png" decode-test
"s35n3p04.png" decode-test
"s35i3p04.png" decode-test
"s36n3p04.png" decode-test
"s36i3p04.png" decode-test
"s37n3p04.png" decode-test
"s37i3p04.png" decode-test
"s38n3p04.png" decode-test
"s38i3p04.png" decode-test
"s39n3p04.png" decode-test
"s39i3p04.png" decode-test
"s40n3p04.png" decode-test
"s40i3p04.png" decode-test
"s07n3p02.png" decode-test
"z00n2c08.png" decode-test
"z03n2c08.png" decode-test
"z06n2c08.png" decode-test

View File

@ -170,22 +170,35 @@ ERROR: bad-filter n ;
byte-array bs:<msb0-bit-reader> :> bs
loading-png width>> :> width
loading-png height>> :> height
bs loading-png width height read-scanlines ;
: adam7-subimage-height ( png-height pass -- subimage-height )
[ starting-row nth + ] keep
row-increment nth /i ;
:: adam7-subimage-height ( png-height pass -- subimage-height )
pass starting-row nth png-height >= [
0
] [
png-height 1 -
pass block-height nth +
pass row-increment nth /i
] if ;
: adam7-subimage-width ( png-width pass -- subimage-width )
[ starting-col nth + ] keep
col-increment nth /i ;
:: adam7-subimage-width ( png-width pass -- subimage-width )
pass starting-col nth png-width >= [
0
] [
png-width 1 -
pass block-width nth +
pass col-increment nth /i
] if ;
:: read-adam7-subimage ( bit-reader loading-png pass -- lines )
loading-png height>> pass adam7-subimage-height :> height
loading-png width>> pass adam7-subimage-width :> width
bit-reader loading-png width height read-scanlines ;
height width * zero? [
B{ } clone
] [
bit-reader loading-png width height read-scanlines
] if ;
:: reverse-interlace-adam7 ( byte-array loading-png -- byte-array )
byte-array bs:<msb0-bit-reader> :> bs

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 385 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 399 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 356 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 393 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 420 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 B