Image.h
Go to the documentation of this file.00001 00012 #ifndef __Image_H__ 00013 #define __Image_H__ 00014 00015 // Includes 00016 #include "Array.h" 00017 00018 // Forward declares 00019 class Asset; 00020 class Filename; 00021 class Bitmap; 00022 00023 // Image 00024 class Image 00025 { 00026 public: 00027 enum Orientation 00028 { 00029 Rotate_0, 00030 Rotate_90, 00031 Rotate_180, 00032 Rotate_270, 00033 Mirror_X, 00034 Mirror_Y, 00035 Orientations_Count 00036 }; 00037 00038 Image(); 00039 Image(const Asset& asset, Orientation orientation = Rotate_0); 00040 Image(const Asset& asset, int celCount, Orientation orientation = Rotate_0); 00041 Image(int width, int height); 00042 Image(int width, int height, int celCount); 00043 Image(const Image& image); 00044 Image(const Bitmap& bitmap); 00045 00046 ~Image(); 00047 00048 const Image& operator=(const Image& image); 00049 00050 00051 void SetOrientation(Orientation orientation); 00052 00053 int GetWidth() const; 00054 00055 int GetHeight() const; 00056 00057 00058 unsigned int GetPixel(int x, int y) const; 00059 00060 unsigned int GetPixel(int cel, int x, int y) const; 00061 00062 void SetPixel(int x, int y, unsigned int color); 00063 00064 void SetPixel(int cel, int x, int y, unsigned int color); 00065 00066 int GetCelCount() const; 00067 00068 float GetCelDelay(int cel) const; 00069 00070 void AdjustBrightness(float redMultiplier, float greenMultiplier, float blueMultiplier); 00071 00072 unsigned int* GetPointer() const; 00073 00074 template <class ImageFormat> void Save(const Filename& filename) 00075 { 00076 ImageFormat::Save(filename, width_,height_,data_); 00077 } 00078 private: 00079 int width_; 00080 int height_; 00081 unsigned int* data_; 00082 int celCount_; 00083 Array<float> celDelay_; 00084 Orientation orientation_; 00085 }; 00086 00087 00088 #endif /* __Image_H__ */ 00089
Reproduction/republishing of any material on this site without permission is strictly prohibited.
