00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef AEDCOLOR_H
00024 #define AEDCOLOR_H
00025
00026 #include "dllmacros.h"
00027 #include <iostream>
00028
00029
00030
00031 class DLLEXPORT aedColor
00032 {
00033 public:
00034 aedColor(Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a)
00035 {
00036 r = _r;
00037 g = _g;
00038 b = _b;
00039 a = _a;
00040 }
00041 aedColor()
00042 {
00043 }
00044 void setR(Uint8 c)
00045 {
00046 r = c;
00047 }
00048 void setG(Uint8 c)
00049 {
00050 g = c;
00051 }
00052 void setB(Uint8 c)
00053 {
00054 b = c;
00055 }
00056 void setA(Uint8 c)
00057 {
00058 a = c;
00059 }
00060 Uint8 getR(void)
00061 {
00062 return r;
00063 }
00064 Uint8 getG(void)
00065 {
00066 return g;
00067 }
00068 Uint8 getB(void)
00069 {
00070 return b;
00071 }
00072 Uint8 getA(void)
00073 {
00074 return a;
00075 }
00076 void dumpAll(void)
00077 {
00078 std::cout << "R: " << (int) r << std::endl;
00079 std::cout << "G: " << (int) g << std::endl;
00080 std::cout << "B: " << (int) b << std::endl;
00081 std::cout << "A: " << (int) a << std::endl;
00082 }
00083 void setAllColors(Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a)
00084 {
00085 r = _r;
00086 g = _g;
00087 b = _b;
00088 a = _a;
00089 }
00090 Uint32 getUint32(SDL_Surface * surface)
00091 {
00092 return SDL_MapRGBA(surface->format, r, g, b, a);
00093 }
00094 operator SDL_Color() const
00095 {
00096 SDL_Color c;
00097 c.r = r;
00098 c.g = g;
00099 c.b = b;
00100 c.unused = a;
00101 return c;
00102 }
00103 private:
00104 Uint8 r, g, b, a;
00105 };
00106
00107 #endif