00001
00036 #ifndef INC_MI32_ANYRASTV_H
00037 #define INC_MI32_ANYRASTV_H
00038
00039 #ifndef INC_MEMORY_H
00040 #include <memory.h>
00041 #define INC_MEMORY_H
00042 #endif
00043
00044 #ifndef INC_MI32_COMPLEX_H
00045 #include <mi32/complex.h>
00046 #endif
00047
00048 union ANYRASTVALUE {
00049 UINT8 ubyte;
00050 INT8 byte;
00051 UINT16 uint2;
00052 INT16 int2;
00053 UINT32 uint4;
00054 INT32 int4;
00055 FLOAT float4;
00056 DOUBLE float8;
00057 UINT8 RGB[3];
00058 UINT8 BGR[3];
00059 UINT8 CMYK[4];
00060 UINT8 KCMY[4];
00061 UINT8 RGBA[4];
00062 UINT8 ARGB[4];
00063 FCOMPLEXRI comp4;
00064 DCOMPLEXRI comp8;
00065 FCOMPLEXMP comp4mp;
00066 DCOMPLEXMP comp8mp;
00067 UINT8 space[32];
00068
00069 ANYRASTVALUE (
00070 ) {
00071 memset(this, 0, sizeof(*this));
00072 }
00073
00074 ANYRASTVALUE (
00075 const ANYRASTVALUE& rhs
00076 ) {
00077 memcpy(this, &rhs, sizeof(*this));
00078 }
00079
00080 ANYRASTVALUE& operator= (
00081 const ANYRASTVALUE& rhs
00082 ) {
00083 if (this != &rhs) memcpy(this, &rhs, sizeof(*this));
00084 return (*this);
00085 }
00086
00087 bool operator== (
00088 const ANYRASTVALUE& rhs
00089 ) {
00090 return (memcmp(this, &rhs, sizeof(ANYRASTVALUE)) == 0);
00091 }
00092
00093 bool operator!= (
00094 const ANYRASTVALUE& rhs
00095 ) {
00096 return (memcmp(this, &rhs, sizeof(ANYRASTVALUE)) != 0);
00097 }
00098
00099 void Clear (
00100 ) {
00101 memset(this, 0, sizeof(*this));
00102 return;
00103 }
00104
00105 };
00106
00107 #endif