Commit ab4eef8c authored by Robert Sprowson's avatar Robert Sprowson

Add WBMP reading ability

From reading WAP WAE 1.1 spec, tested with some sample images from the internet.
Test image added to 'tests' directory for reference.

Version 1.44. Tagged as 'ChangeFSI-1_44'
parent 30964e0b
......@@ -65,6 +65,7 @@ Kodak RGB images, 24 bits per pixel
BTPC 4.1 images
Portable network graphics 1, 2, 4, 8, 16, 24, 48 bits per pixel
interlaced or non interlaced image ordering
Wireless application protocol bitmaps
Output formats
......@@ -681,11 +682,21 @@ Portable network graphics
Some chunks are for information only (such as the various supplementary text
and date stamp information).
Wireless application protocol bitmaps
Recognised by file type F8F and first two bytes of file are 0
TypeField 0 (monochrome) and FixHeaderField 0 (no extentions) are the
only type of WBMP defined in the WAP WAE Specification version 1.1
These uncompressed images originate from mobile telephone services for
handsets with black and white displays
Table summarising the formats
RISC OS 1, 2, 4 and 8 bit per pixel sprites [file type FF9]
and 15 and 24 (32 bits) sprites [file type FF9]
and 15 and 24 (32 bits) sprites
ArVis 15 bit HIP.+LOP. sprites [file type FF9 named HIP.]
Watford digitiser pictures 512x256y64g [file type DFA]
and triple red, green, blue seperations [directory of r,g,b DFA]
......@@ -693,7 +704,7 @@ ProArtisan compressed pictures 640x256y256c [file type DE2]
JPEG "JFIF" file [JFIF in file]
Kodak PhotoCD images [file type BE8 OR named /PCD]
TimeStep satellite image 800x800y256g [file type 7A0]
PC TGA images [name ends in TGA or VDA]
PC TGA images [name ends in /TGA OR /VDA]
MTV 24 bit pic. images [named pic.]
QRT 24 bit .raw images [named .raw]
ZSoft .PCX files [10,1-5,1 in file OR named pcx. OR /PCX]
......@@ -719,10 +730,10 @@ Sun 'pixrect' Raster Files [&956AA659 in file]
GEM IMG. images [0,8,0,1 in file OR named img. OR /IMG]
Apollo GPR 16 colour image [0,1,0,1 in file]
RIX Softworks ColoRIX 8 bit per pixel files [RIX3 in file]
TechnoI video digitiser [T-I in file (or filetype CBE)]
TIFF pictures [II* or MM* in file (or filetype FF0)]
TechnoI video digitiser [T-I in file (OR file type CBE)]
TIFF pictures [II* OR MM* in file (OR file type FF0)]
UNIX rle format [&CC52 in file]
Portable bit map [P1,P2,P3,P4,P5 or P6 at start of file]
Portable bit map [P1,P2,P3,P4,P5 OR P6 at start of file]
ChangeFSI packed portable bitmap [P15 at start of file]
PocketBook I and II PIC format [PIC at start of file]
Electronic Art's IFF ILBM pictures [FORM ILBM in file]
......@@ -736,3 +747,5 @@ Alpiar 48 bit per pixel [ALPIAR16 at start of file]
Kodak RGB images, 24 bits per pixel [named /RGB]
BTPC file [bptc at start of file]
Portable network graphics [8 byte signature at start of file]
Wireless application protocol bitmap [0,0 in file AND (file type F8F
OR named /WBMP)]
/* (1.43)
/* (1.44)
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
#define Module_MajorVersion_CMHG 1.43
#define Module_MajorVersion_CMHG 1.44
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 08 Jan 2014
#define Module_MajorVersion "1.43"
#define Module_Version 143
#define Module_MajorVersion "1.44"
#define Module_Version 144
#define Module_MinorVersion ""
#define Module_Date "08 Jan 2014"
......@@ -18,6 +18,6 @@
#define Module_ComponentName "ChangeFSI"
#define Module_ComponentPath "mixed/RiscOS/Sources/Apps/ChangeFSI"
#define Module_FullVersion "1.43"
#define Module_HelpVersion "1.43 (08 Jan 2014)"
#define Module_LibraryVersionInfo "1:43"
#define Module_FullVersion "1.44"
#define Module_HelpVersion "1.44 (08 Jan 2014)"
#define Module_LibraryVersionInfo "1:44"
......@@ -1789,6 +1789,7 @@ DEF FNChangeFSI(A$,spritearea%,workspace%,worklimit%,oksave%,okinfo%,RETURN ram%
IF flag=-1 IF LEFT$(S$,8)="ALPIAR12" flag=3900:colourindex=4095
IF flag=-1 IF LEFT$(S$,8)="ALPIAR16" flag=3905:colourindex=65535
IF flag=-1 IF LEFT$(S$,8)=CHR$&89+"PNG"+CHR$13+CHR$10+CHR$26+CHR$10 flag=4000
IF flag=-1 IF LEFT$(S$,2)=CHR$0+CHR$0 AND (ftype=&F8F OR FNuc(RIGHT$(s$,5))="/WBMP") THEN flag=4100
IF flag=-1 THEN
IF MID$(S$,7,4)="JFIF" OR LEFT$(S$,3)=CHR$&FF+CHR$&D8+CHR$&FF OR ftype=&C85 THEN
REM Read the cache size variable
......@@ -4178,6 +4179,21 @@ DEF FNChangeFSI(A$,spritearea%,workspace%,worklimit%,oksave%,okinfo%,RETURN ram%
IF (PNGcol%=0 OR PNGcol%=4) THEN s$+=" greyscale" ELSE s$+=" colour"
info$=s$+" PNG, "+ STR$sx%+" by "+ STR$sy%+" pixels, "+FNbits(quant%)
WHEN 4100
REM Wireless application protocol bitmap
sx%=0:REPEAT:A%=BGET#c%:sx%=(sx%<<7) OR (A% AND &7F):UNTIL (A% AND &80) = 0:REM Stored as uintvar
sy%=0:REPEAT:A%=BGET#c%:sy%=(sy%<<7) OR (A% AND &7F):UNTIL (A% AND &80) = 0:REM Stored as uintvar
info$="Wireless BMP, "+ STR$sx%+" by "+ STR$sy%+" pixels, 1 bit per pixel"
IF info% PRINT info$
SYS "Hourglass_On"
......@@ -10601,6 +10617,8 @@ DEF PROCrewind
CALL (png%+0),st%(0):REM Prime the helper
WHEN 4100
IF cache% THEN
IF flag=3600 THEN
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment