29 lines
343 B
C
29 lines
343 B
C
#ifndef IMAGE
|
|
#define IMAGE
|
|
|
|
#include <cstddef>
|
|
|
|
struct Image
|
|
{
|
|
int depth;
|
|
int width;
|
|
int height;
|
|
void* pixels;
|
|
|
|
Image() : pixels(NULL) {}
|
|
|
|
~Image()
|
|
{
|
|
if(pixels != NULL)
|
|
delete[] (char*)pixels;
|
|
}
|
|
|
|
void allocate(int size)
|
|
{
|
|
pixels = new char[size];
|
|
}
|
|
};
|
|
|
|
#endif // IMAGE
|
|
|