resonance 1.0.1
Loading...
Searching...
No Matches
abmpfile.h
Go to the documentation of this file.
1#pragma once
2
3#include "rndartt/agfxfile.h"
4
5class APalette;
6
23class ABmpFile : public AGfxFile {
24public:
32 explicit ABmpFile(FILE *pFile) : AGfxFile(pFile) {
33 }
34
48 virtual int StartRead();
49
63 virtual int ReadFrame(ABitmap &image, int *pbEnd);
64
79 virtual int Write(const ABitmap &bitmap);
80
81private:
89 APalette *ReadPalette();
90
99 int ReadBitsFromFile(ABitmap *pImage);
100
109 int ReadBitmapNotCompressed(ABitmap *pImage);
110
122 int ReadBitmapCompressed(ABitmap *pImage);
123
124 int mPixelOffset; // +0x18 File offset of the pixels.
125 int mPaletteOffset; // +0x1c File offset of the colour table.
126 int mCompression; // +0x20 Zero for uncompressed rows.
127 unsigned short mBitCount; // +0x24 Bits per pixel.
128 int mWidth; // +0x28
129 int mHeight; // +0x2c Always positive.
130 int mRowStep; // +0x30 -1 for a bottom-up file, 1 for a top-down one.
131 int mColorCount; // +0x34 Colour table entries, zero above eight bits per pixel.
132 int mImageRead; // +0x38 Set once ReadFrame() has returned the image.
133};
134
145void Convert24To32InPlace(unsigned char *pPixels, int nCount);
void Convert24To32InPlace(unsigned char *pPixels, int nCount)
Widen a row of three-byte pixels to four bytes in place, with full alpha.
Description of a pixel rectangle, its layout, and its palette.
Definition abitmap.h:95
virtual int ReadFrame(ABitmap &image, int *pbEnd)
Slot 3.
virtual int Write(const ABitmap &bitmap)
Slot 5.
virtual int StartRead()
Slot 1.
ABmpFile(FILE *pFile)
Construct over an open file.
Definition abmpfile.h:32
AGfxFile(FILE *pFile)
Construct over an open file.
Definition agfxfile.h:74
A 256 entry colour table an ABitmap points at.
Definition apalette.h:31