00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _COLOR_H
00026 #define _COLOR_H
00027
00028 #ifdef WIN32
00029 #include <windows.h>
00030 #endif
00031 #include "build.h"
00032
00033 namespace ngn
00034 {
00035 namespace core
00036 {
00037
00045 template <class T> class NGN_API Color
00046 {
00047 public:
00048
00049 Color()
00050 {
00051 r = g =b = 1;
00052 };
00053 Color( T red, T green, T blue )
00054 {
00055 r = red;
00056 g = green;
00057 b = blue;
00058 };
00059 Color( const Color& other )
00060 {
00061 r = other.r;
00062 g = other.g;
00063 b = other.b;
00064 };
00065 virtual ~Color()
00066 {
00067
00068 };
00069
00070 bool operator==( const Color& other )
00071 {
00072 if( r != other.r || g !=other.g || b!=other.b )
00073 return false;
00074 else
00075 return true;
00076 };
00077 bool operator!=( const Color& other )
00078 {
00079 if( r != other.r && g !=other.g && b!=other.b )
00080 return true;
00081 else
00082 return false;
00083 };
00084
00085 T r,g,b;
00086
00087 };
00088
00089 typedef Color<float> NGN_API Colorf;
00090 typedef Color<int> NGN_API Colori;
00091
00092
00093 }
00094 }
00095 #endif