Crazy Eddies GUI System: CEGUIColourRect.h Source File

Crazy Eddies GUI System 0.7.6

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

CEGUIColourRect.h

    00001 /***********************************************************************
    00002         filename:       CEGUIColourRect.h
    00003         created:        8/3/2004
    00004         author:         Paul D Turner
    00005
    00006         purpose:        Defines class representing colours for four corners of a
    00007                                 rectangle
    00008 *************************************************************************/
    00009 /***************************************************************************
    00010  *   Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
    00011  *
    00012  *   Permission is hereby granted, free of charge, to any person obtaining
    00013  *   a copy of this software and associated documentation files (the
    00014  *   "Software"), to deal in the Software without restriction, including
    00015  *   without limitation the rights to use, copy, modify, merge, publish,
    00016  *   distribute, sublicense, and/or sell copies of the Software, and to
    00017  *   permit persons to whom the Software is furnished to do so, subject to
    00018  *   the following conditions:
    00019  *
    00020  *   The above copyright notice and this permission notice shall be
    00021  *   included in all copies or substantial portions of the Software.
    00022  *
    00023  *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    00024  *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    00025  *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
    00026  *   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
    00027  *   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
    00028  *   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
    00029  *   OTHER DEALINGS IN THE SOFTWARE.
    00030  ***************************************************************************/
    00031 #ifndef _CEGUIColourRect_h_
    00032 #define _CEGUIColourRect_h_
    00033
    00034 #include "CEGUIBase.h"
    00035 #include "CEGUIcolour.h"
    00036
    00037 // Start of CEGUI namespace section
    00038 namespace CEGUI
    00039 {
    00044 class CEGUIEXPORT ColourRect
    00045 {
    00046 public:
    00051         ColourRect(void);
    00052
    00053
    00058         ColourRect(const colour& col);
    00059
    00060
    00065         ColourRect(const colour& top_left, const colour& top_right, const colour& bottom_left, const colour& bottom_right);
    00066
    00067
    00078         void    setAlpha(float alpha);
    00079
    00080
    00091         void    setTopAlpha(float alpha);
    00092
    00093
    00104         void    setBottomAlpha(float alpha);
    00105
    00106
    00117         void    setLeftAlpha(float alpha);
    00118
    00119
    00130         void    setRightAlpha(float alpha);
    00131
    00132
    00140         bool    isMonochromatic() const;
    00141
    00142
    00159         ColourRect getSubRectangle( float left, float right, float top, float bottom ) const;
    00160
    00173         colour getColourAtPoint( float x, float y ) const;
    00174
    00175
    00183         void    setColours(const colour& col);
    00184
    00185
    00193         void    modulateAlpha(float alpha);
    00194
    00199     ColourRect& operator*=(const ColourRect& other);
    00200
    00201         inline ColourRect operator*(const float val) const
    00202     {
    00203         return ColourRect(
    00204             d_top_left * val,
    00205             d_top_right * val,
    00206             d_bottom_left * val,
    00207             d_bottom_right * val
    00208         );
    00209     }
    00210
    00211         inline ColourRect operator+(const ColourRect& val) const
    00212     {
    00213         return ColourRect(
    00214             d_top_left + val.d_top_left,
    00215             d_top_right + val.d_top_right,
    00216             d_bottom_left + val.d_bottom_left,
    00217             d_bottom_right + val.d_bottom_right
    00218         );
    00219     }
    00220
    00221
    00222         colour  d_top_left, d_top_right, d_bottom_left, d_bottom_right;         //<! ColourRect component colours
    00223 };
    00224
    00225 } // End of  CEGUI namespace section
    00226
    00227
    00228 #endif  // end of guard _CEGUIColourRect_h_