mi32/anyrastv.h

Go to the documentation of this file.
00001 /**
00002  * \file anyrastv.h <mi32/anyrastv.h>
00003  * \brief ANYRASTVALUE definitions
00004  *
00005  * \if NODOC
00006  * $Id: anyrastv.h_v 1.8 2005/07/14 20:35:10 mju Exp $
00007  *
00008  * $Log: anyrastv.h_v $
00009  * Revision 1.8  2005/07/14 20:35:10  mju
00010  * Include memory hdr for memset.
00011  *
00012  * Revision 1.7  2004/03/22 15:04:53  mju
00013  * Include string.h for memset decl.
00014  *
00015  * Revision 1.6  2003/09/15 13:49:56  fileserver!dwilliss
00016  * Doxygen
00017  *
00018  * Revision 1.5  2003/08/27 21:30:55  scowan
00019  * Added new celltype null value usage.
00020  *
00021  * Revision 1.4  2002/01/09 22:11:39  scowan
00022  * Added constructors and other meothds.
00023  *
00024  * Revision 1.3  2000/10/19 17:45:33  scowan
00025  * Checked in for vacation.
00026  *
00027  * Revision 1.2  1999/05/07  21:15:11  mju
00028  * Header restruct.
00029  *
00030  * Revision 1.1  1999/04/28  21:24:10  mju
00031  * Initial revision
00032  *
00033  * \endif
00034 **/
00035 
00036 #ifndef  INC_MI32_ANYRASTV_H
00037 #define  INC_MI32_ANYRASTV_H
00038 
00039 #ifndef  INC_MEMORY_H
00040 #include <memory.h>     // Includes defn for memset()
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;            //!<  all unsigned rasters <= 8 bit 
00050    INT8 byte;              //!<  signed 8 bit raster 
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;       //!<  Complex number values 
00064    DCOMPLEXRI comp8;
00065    FCOMPLEXMP comp4mp;
00066    DCOMPLEXMP comp8mp;
00067    UINT8 space[32];        //!<  For future expansion, 256/8 
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   //!<  INC_MI32_ANYRASTV_H 

Generated on Thu Apr 26 04:44:52 2007 for TNTsdk by  doxygen 1.5.2