contrastcolor.h

Go to the documentation of this file.
00001 //  Copyright (c) 2001-2006 by Autodesk, Inc.
00002 //
00003 //  By using this code, you are agreeing to the terms and conditions of
00004 //  the License Agreement included in the documentation for this code.
00005 //
00006 //  AUTODESK MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AS TO THE CORRECTNESS
00007 //  OF THIS CODE OR ANY DERIVATIVE WORKS WHICH INCORPORATE IT. AUTODESK
00008 //  PROVIDES THE CODE ON AN "AS-IS" BASIS AND EXPLICITLY DISCLAIMS ANY
00009 //  LIABILITY, INCLUDING CONSEQUENTIAL AND INCIDENTAL DAMAGES FOR ERRORS,
00010 //  OMISSIONS, AND OTHER PROBLEMS IN THE CODE.
00011 //
00012 //  Use, duplication, or disclosure by the U.S. Government is subject to
00013 //  restrictions set forth in FAR 52.227-19 (Commercial Computer Software
00014 //  Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) (Rights in Technical
00015 //  Data and Computer Software), as applicable.
00016 //
00017 
00018 
00019 
00020 
00021 #if !defined CONTRAST_COLOR_HEADER
00022 #define CONTRAST_COLOR_HEADER
00023 
00027 
00028 #include "whiptk/whipcore.h"
00029 
00030 
00041 
00042 class WHIPTK_API WT_Contrast_Color : public WT_Attribute
00043 {
00044     friend class WT_Class_Factory;
00045         friend class WT_W2D_Class_Factory;
00046         friend class WT_Rendition;
00047         friend class WT_Opcode;
00048 
00049 
00050 public:
00052 
00053     WT_Contrast_Color()
00054         :m_color(0,0,0,0)
00055     {}
00057     WT_Contrast_Color(WT_RGBA32 color)
00058         :m_color(color)
00059     {}
00060     
00062     WT_Contrast_Color(
00063         int red, 
00064         int green, 
00065         int blue, 
00066         int alpha = 255) 
00067         :m_color(red,green,blue,alpha)
00068     {}
00069 
00071         WT_Contrast_Color(const WT_Contrast_Color& color)
00072         {
00073                 *this = color;
00074         }
00075 
00076         virtual ~WT_Contrast_Color()
00077         {}
00078 public:
00079     
00080     // returns the background color
00081     inline WT_RGBA32 const& color() const { return m_color;}
00082     inline WT_RGBA32 &      color()       { return m_color;}
00083     inline WT_Contrast_Color const& operator=( WT_RGBA32 const &oColor ) { m_color = oColor; return *this; }
00084 
00086     inline void set(
00087         int red, 
00088         int green, 
00089         int blue, 
00090         int alpha
00091         )
00092     {   set(WT_RGBA32(red,green,blue,alpha)); }
00093 
00095     inline void set(
00096         int red, 
00097         int green, 
00098         int blue 
00099         )
00100     {   set(WT_RGBA32(red,green,blue,0xFF)); }
00101 
00103     inline void set(
00104         WT_RGBA32 color 
00105         )
00106     {   
00107         m_color = color;
00108     }
00109     
00111 
00113     WT_ID            object_id() const;
00114     WT_Result        materialize(WT_Opcode const & opcode, WT_File & file);
00115     WT_Result        process(WT_File & file);
00116     WT_Result        skip_operand(WT_Opcode const & opcode, WT_File & file);
00117     WT_Result        serialize (WT_File & file) const;
00118     WT_Result        sync (WT_File & file) const;
00119     WT_Boolean       operator== (WT_Attribute const & attrib) const;
00121     
00123 
00124     WT_Boolean operator== (WT_Contrast_Color const & color) const;
00126     WT_Boolean operator!= (WT_Contrast_Color const & color) const;
00128     
00130 
00132     static WT_Result default_process(
00133         WT_Contrast_Color & item, 
00134         WT_File & file 
00135         );
00136 private:
00137     // Data members
00138     WT_RGBA32 m_color;
00139 };
00140 
00142 
00143 #endif // CONTRAST_COLOR_HEADER

Generated on Tue Jan 6 22:41:12 2009 for Autodesk DWF Whip 2D Toolkit by  doxygen 1.4.5