00001 #ifndef CORONA_SIMPLE_IMAGE_H 00002 #define CORONA_SIMPLE_IMAGE_H 00003 00004 00005 #include "corona.h" 00006 #include "Types.h" 00007 #include "Utility.h" 00008 00009 00010 namespace corona { 00011 00019 class SimpleImage : public DLLImplementation<Image> { 00020 public: 00021 00035 SimpleImage(int width, 00036 int height, 00037 PixelFormat format, 00038 byte* pixels, 00039 byte* palette = 0, 00040 int palette_size = 0, 00041 PixelFormat palette_format = PF_DONTCARE) { 00042 00043 m_width = width; 00044 m_height = height; 00045 m_format = format; 00046 m_pixels = pixels; 00047 m_palette = palette; 00048 m_palette_size = palette_size; 00049 m_palette_format = palette_format; 00050 } 00051 00055 ~SimpleImage() { 00056 delete[] m_pixels; 00057 delete[] m_palette; 00058 } 00059 00060 int COR_CALL getWidth() { 00061 return m_width; 00062 } 00063 00064 int COR_CALL getHeight() { 00065 return m_height; 00066 } 00067 00068 PixelFormat COR_CALL getFormat() { 00069 return m_format; 00070 } 00071 00072 void* COR_CALL getPixels() { 00073 return m_pixels; 00074 } 00075 00076 void* COR_CALL getPalette() { 00077 return m_palette; 00078 } 00079 00080 int COR_CALL getPaletteSize() { 00081 return m_palette_size; 00082 } 00083 00084 PixelFormat COR_CALL getPaletteFormat() { 00085 return m_palette_format; 00086 } 00087 00088 private: 00089 int m_width; 00090 int m_height; 00091 PixelFormat m_format; 00092 byte* m_pixels; 00093 byte* m_palette; 00094 int m_palette_size; 00095 PixelFormat m_palette_format; 00096 }; 00097 00098 } 00099 00100 00101 #endif