#ifndef __PNG_H__ #define __PNG_H__ #define PNGHEADER "\x89PNG\r\n\x1A\n" #define PNGHEADERSIZE 8 typedef struct ChunkHeader { LongWord length; byte type[4]; } ChunkHeader; typedef struct IHDR { ChunkHeader chunk; LongWord width; LongWord height; byte bitDepth; byte colorType; byte compressMethod; byte filterMethod; byte interlaceMethod; LongWord crc; } IHDR; typedef struct IEND { ChunkHeader chunk; LongWord crc; } IEND; typedef struct PngColor { byte r; byte g; byte b; } PngColor; extern pascal long PngCrc(long crc, const char *data, int length); int writeIHDR(Word fd, Word height, Word width); int writeIEND(Word fd); int writeTEXT(int fd, const char *key, const char *value); int writePLTE(int fd, PngColor *p, word count); int writeIDAT(int fd, void *data, longword size); #endif