Entry
R0 = pointer to pathname of JPEG file, control character terminated
R1 = x coordinate at which to plot
R2 = y coordinate at which to plot
R3 = pointer to scale factors : 0 => no scaling
R4 = flags:
bit 0 set => dither output when plotting 24 bit JPEG at 16bpp or below
bit 1 set => dithering (if any) is full error diffused whenplotting at 8bpp
all other bits reserved (must be zero)
Exit
R0 - R4 preserved
This SWI decompresses, scales, and plots on the screen a JPEG image held in a file.
The functionality of this call for JPEGs is similar to that of OS_SpriteOp 52 (Put sprite scaled) for sprites. The scale factors and the coordinates have exactly the same meaning, and the scaling algorithms used are the same in both calls. However, this call only supports a direct plot (ie plot action 0 of OS_SpriteOp 52).
The file is loaded into memory for the duration of the call, but is not cached. This call therefore uses as much memory as loading the file into a buffer yourself and the calling JPEG_PlotScaled, and gives you no control over whether the image remains cached. Futhermore, although the mechanism exists to pass this call on to the printer drivers, they do not support it. We therefore strongly recommend that you use JPEG_PlotScaled in preference to this call.
As well as the memory to hold the file, the SpriteExtend module may claim extra workspace in a dynamic area to store tables etc. It keeps these cached until either it is asked to plot a different JPEG, or the user decreases the dynamic area's size. This speeds up successive replots of the same JPEG. You can find how much extra workspace SpriteExtend will require - if any - by first calling JPEG_Info or JPEG_FileInfo. You can hence ensure there is sufficient free memory before making this call: enough both to hold the file, and to provide any extra workspace required.
This call returns an error if it cannot claim sufficient memory to plot the JPEG image, or if the image appears incomplete or corrupt in some way.
This call is only available from RISC OS 3.6 onwards.
|
|
|