Path: blob/master/libmupen64plus/mupen64plus-video-rice/src/COLOR.h
2 views
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *1* Mupen64plus - COLOR.h *2* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *3* Copyright (C) 2002 Rice1964 *4* *5* This program is free software; you can redistribute it and/or modify *6* it under the terms of the GNU General Public License as published by *7* the Free Software Foundation; either version 2 of the License, or *8* (at your option) any later version. *9* *10* This program is distributed in the hope that it will be useful, *11* but WITHOUT ANY WARRANTY; without even the implied warranty of *12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *13* GNU General Public License for more details. *14* *15* You should have received a copy of the GNU General Public License *16* along with this program; if not, write to the *17* Free Software Foundation, Inc., *18* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *19* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */2021#ifndef XCOLOR_H22#define XCOLOR_H2324typedef struct _COLORVALUE25{26float r;27float g;28float b;29float a;30} COLORVALUE;313233typedef struct XCOLOR {34float r, g, b, a;35#ifdef __cplusplus36public:37XCOLOR()38{39}4041XCOLOR( unsigned int argb );42XCOLOR( const float * );43XCOLOR( const COLORVALUE& );44XCOLOR( float r, float g, float b, float a );4546// casting47operator unsigned int () const;4849operator float* ();50operator const float* () const;5152operator COLORVALUE* ();53operator const COLORVALUE* () const;5455operator COLORVALUE& ();56operator const COLORVALUE& () const;5758// assignment operators59XCOLOR& operator += ( const XCOLOR& );60XCOLOR& operator -= ( const XCOLOR& );61XCOLOR& operator *= ( float );62XCOLOR& operator /= ( float );6364// unary operators65XCOLOR operator + () const;66XCOLOR operator - () const;6768// binary operators69XCOLOR operator + ( const XCOLOR& ) const;70XCOLOR operator - ( const XCOLOR& ) const;71XCOLOR operator * ( float ) const;72XCOLOR operator / ( float ) const;7374friend XCOLOR operator * (float, const XCOLOR& );7576bool operator == ( const XCOLOR& ) const;77bool operator != ( const XCOLOR& ) const;7879#endif //__cplusplus80} XCOLOR;8182#endif83848586