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.7 2004/03/22 15:04:53 mju Exp $
00007  *
00008  * $Log: anyrastv.h_v $
00009  * Revision 1.7  2004/03/22 15:04:53  mju
00010  * Include string.h for memset decl.
00011  *
00012  * Revision 1.6  2003/09/15 13:49:56  fileserver!dwilliss
00013  * Doxygen
00014  *
00015  * Revision 1.5  2003/08/27 21:30:55  scowan
00016  * Added new celltype null value usage.
00017  *
00018  * Revision 1.4  2002/01/09 22:11:39  scowan
00019  * Added constructors and other meothds.
00020  *
00021  * Revision 1.3  2000/10/19 17:45:33  scowan
00022  * Checked in for vacation.
00023  *
00024  * Revision 1.2  1999/05/07  21:15:11  mju
00025  * Header restruct.
00026  *
00027  * Revision 1.1  1999/04/28  21:24:10  mju
00028  * Initial revision
00029  *
00030  * \endif
00031 **/
00032 
00033 #ifndef  INC_MI32_ANYRASTV_H
00034 #define  INC_MI32_ANYRASTV_H
00035 
00036 #ifndef  INC_STRING_H
00037 #include <string.h>     // Includes defn for memset()
00038 #define  INC_STRING_H
00039 #endif
00040 
00041 #ifndef  INC_MI32_COMPLEX_H
00042 #include <mi32/complex.h>
00043 #endif
00044 
00045 union ANYRASTVALUE {
00046    UINT8 ubyte;            //!<  all unsigned rasters <= 8 bit 
00047    INT8 byte;              //!<  signed 8 bit raster 
00048    UINT16 uint2;
00049    INT16 int2;
00050    UINT32 uint4;
00051    INT32 int4;
00052    FLOAT float4;
00053    DOUBLE float8;
00054    UINT8 RGB[3];
00055    UINT8 BGR[3];
00056    UINT8 CMYK[4];
00057    UINT8 KCMY[4];
00058    UINT8 RGBA[4];
00059    UINT8 ARGB[4];
00060    FCOMPLEXRI comp4;       //!<  Complex number values 
00061    DCOMPLEXRI comp8;
00062    FCOMPLEXMP comp4mp;
00063    DCOMPLEXMP comp8mp;
00064    UINT8 space[32];        //!<  For future expansion, 256/8 
00065    
00066    ANYRASTVALUE (
00067       ) {
00068       memset(this, 0, sizeof(*this));
00069       }
00070       
00071    ANYRASTVALUE (
00072       const ANYRASTVALUE& rhs
00073       ) {
00074       memcpy(this, &rhs, sizeof(*this));
00075       }
00076       
00077    ANYRASTVALUE& operator= (
00078       const ANYRASTVALUE& rhs
00079       ) {
00080       if (this != &rhs) memcpy(this, &rhs, sizeof(*this));
00081       return (*this);
00082       }
00083       
00084    bool operator== (
00085       const ANYRASTVALUE& rhs
00086       ) {
00087       return (memcmp(this, &rhs, sizeof(ANYRASTVALUE)) == 0);
00088       }
00089       
00090    bool operator!= (
00091       const ANYRASTVALUE& rhs
00092       ) {
00093       return (memcmp(this, &rhs, sizeof(ANYRASTVALUE)) != 0);
00094       }
00095       
00096    void Clear (
00097       ) {
00098       memset(this, 0, sizeof(*this));
00099       return;
00100       }
00101       
00102    };
00103 
00104 #endif   //!<  INC_MI32_ANYRASTV_H 

Generated on Tue Dec 14 13:18:19 2004 for TNTsdk by  doxygen 1.3.8-20040913