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 using namespace std;
00029
00030 class DLLEXPORT aedColor
00031 {
00032 public:
00033 aedColor(Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a)
00034 {
00035 r = _r;
00036 g = _g;
00037 b = _b;
00038 a = _a;
00039 }
00040 aedColor()
00041 {
00042 }
00043 void setR(Uint8 c)
00044 {
00045 r = c;
00046 }
00047 void setG(Uint8 c)
00048 {
00049 g = c;
00050 }
00051 void setB(Uint8 c)
00052 {
00053 b = c;
00054 }
00055 void setA(Uint8 c)
00056 {
00057 a = c;
00058 }
00059 Uint8 getR(void)
00060 {
00061 return r;
00062 }
00063 Uint8 getG(void)
00064 {
00065 return g;
00066 }
00067 Uint8 getB(void)
00068 {
00069 return b;
00070 }
00071 Uint8 getA(void)
00072 {
00073 return a;
00074 }
00075 void dumpAll(void)
00076 {
00077 cout << "R: " << (int) r << endl;
00078 cout << "G: " << (int) g << endl;
00079 cout << "B: " << (int) b << endl;
00080 cout << "A: " << (int) a << endl;
00081 }
00082 void setAllColors(Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a)
00083 {
00084 r = _r;
00085 g = _g;
00086 b = _b;
00087 a = _a;
00088 }
00089 Uint32 getUint32(SDL_Surface * surface)
00090 {
00091 return SDL_MapRGBA(surface->format, r, g, b, a);
00092 }
00093 operator SDL_Color() const
00094 {
00095 SDL_Color c;
00096 c.r = r;
00097 c.g = g;
00098 c.b = b;
00099 c.unused = a;
00100 return c;
00101 }
00102 private:
00103 Uint8 r, g, b, a;
00104 };
00105
00106 #endif