54 #ifndef __BYTE_IMAGE_H__
55 #define __BYTE_IMAGE_H__
120 CByteImage(
int nImageWidth,
int nImageHeight,
ImageType imageType,
bool bHeaderOnly =
false);
172 void Set(
int nImageWidth,
int nImageHeight,
ImageType imageType,
bool bHeaderOnly =
false);
213 struct myBITMAPFILEHEADER
215 unsigned short bfType;
217 unsigned short bfReserved1;
218 unsigned short bfReserved2;
219 unsigned int bfOffBits;
222 struct myBITMAPINFOHEADER
225 unsigned int biWidth;
227 unsigned short biPlanes;
228 unsigned short biBitCount;
229 unsigned int biCompression;
230 unsigned int biSizeImage;
231 unsigned int biXPelsPerMeter;
232 unsigned int biYPelsPerMeter;
233 unsigned int biClrUsed;
234 unsigned int biClrImportant;
240 bool LoadFromFilePNM(
const char *pFileName);
241 bool SaveToFilePNM(
const char *pFileName)
const;
243 bool LoadFromFileBMP(
const char *pFileName);
244 bool SaveToFileBMP(
const char *pFileName)
const;
ImageType
Enum specifying the supported image types.
bool m_bOwnMemory
Flag signaling if memory is to be freed or not.
void Set(int nImageWidth, int nImageHeight, ImageType imageType, bool bHeaderOnly=false)
Changes size and type of an image.
bool LoadFromFile(const char *pFileName)
Loads an image from a file.
bool SaveToFile(const char *pFileName) const
Saves an image to a file.
~CByteImage()
The destructor.
ImageType type
The type of the image.
int width
The width of the image in pixels.
int height
The height of the image in pixels.
CByteImage()
The default constructor.
unsigned char * pixels
The pointer to the the pixels.
bool IsCompatible(const CByteImage *pImage) const
Checks whether two images are compatible or not.
Data structure for the representation of 8-bit grayscale images and 24-bit RGB (or HSV) color images ...
int bytesPerPixel
The number of bytes used for encoding one pixel.