The PNG module supplies a shared interface to the PNG library. Due to the work of many developers, including Acorn, the PNG library is quite generic and can produce its output or read its input in a number of ways.
In general the SWI interface is exactly the same as that of the PNG library. When there is time this will be documented more formally, but the general principles are :
png_uint_32 png_get_gAMA (png_structp png_ptr, png_infop info_ptr, double *file_gamma) ;
R0 = 2 (reason code for get_gAMA) R1 = pointer to png structure returned from create_read_struct R2 = pointer to png information structure returned from png_create_info_struct
R0 = returned value (0 if no gAMA chunk, non-0 if gAMA chunk present) R1 = gamma value * &10000
The cHRM (chromaticity) chunk is not currently supported. The implementation is such that this cannot work the way that the SWI interface is currently designed.
Firstly, you should read the documentation supplied with PNGLib. This will provide you with most of the necessary information. More information, together with a development kit, is available on request.
This documentation is copyright 3QD Developments Ltd 2013 and may not be reproduced or published in any form without the copyright holders permission. RISC OS is subject to continuous development and improvement as such all information is reproduced by 3QD Developments Ltd in good faith and is believed to be correct at the time of publication E&OE. 3QD Developments Ltd cannot accept any liability for any loss or damage arising from the use of any information provided as part of the RISC OS Documentation.
HTML document version 1.03 3rd November 2015