* Removed unused MakeBlendColor().
* At least 15 bit mode is broken, and should probably be removed. * Cleanup - do we really need this class? git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16247 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,87 +1,58 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) 2001-2002, Haiku, Inc.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the "Software"),
|
||||
// to deal in the Software without restriction, including without limitation
|
||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
// and/or sell copies of the Software, and to permit persons to whom the
|
||||
// Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// File Name: RGBColor.h
|
||||
// Author: DarkWyrm <[email protected]>
|
||||
// Description: Color encapsulation class for the app_server
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
#ifndef RGBCOLOR_H_
|
||||
#define RGBCOLOR_H_
|
||||
/*
|
||||
* Copyright 2001-2006, Haiku.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* DarkWyrm <[email protected]>
|
||||
*/
|
||||
#ifndef RGB_COLOR_H
|
||||
#define RGB_COLOR_H
|
||||
|
||||
|
||||
#include <GraphicsDefs.h>
|
||||
|
||||
/*!
|
||||
\class RGBColor RGBColor.h
|
||||
\brief A color class to encapsulate color space ugliness in the app_server
|
||||
|
||||
RGBColors can be used to perform tasks much more difficult using rgb_colors. This
|
||||
class is limited to the app_server because of the access to the system palette for
|
||||
looking up the 32-bit value to each color index.
|
||||
*/
|
||||
|
||||
class RGBColor
|
||||
{
|
||||
public:
|
||||
RGBColor(uint8 r, uint8 g, uint8 b, uint8 a=255);
|
||||
RGBColor(int r, int g, int b, int a=255);
|
||||
RGBColor(const rgb_color &col);
|
||||
RGBColor(uint16 col);
|
||||
RGBColor(uint8 col);
|
||||
RGBColor(const RGBColor &col);
|
||||
RGBColor();
|
||||
|
||||
void PrintToStream() const;
|
||||
|
||||
uint8 GetColor8() const;
|
||||
uint16 GetColor15() const;
|
||||
uint16 GetColor16() const;
|
||||
rgb_color GetColor32() const;
|
||||
|
||||
void SetColor(uint8 r, uint8 g, uint8 b, uint8 a=255);
|
||||
void SetColor(int r, int g, int b, int a=255);
|
||||
void SetColor(uint16 color16);
|
||||
void SetColor(uint8 color8);
|
||||
void SetColor(const rgb_color &color);
|
||||
void SetColor(const RGBColor &col);
|
||||
|
||||
RGBColor MakeBlendColor(const RGBColor &color, const float &position);
|
||||
|
||||
const RGBColor & operator=(const RGBColor &col);
|
||||
const RGBColor & operator=(const rgb_color &col);
|
||||
bool operator==(const rgb_color &col) const;
|
||||
bool operator==(const RGBColor &col) const;
|
||||
class RGBColor {
|
||||
public:
|
||||
RGBColor(uint8 r, uint8 g, uint8 b, uint8 a=255);
|
||||
RGBColor(int r, int g, int b, int a=255);
|
||||
RGBColor(const rgb_color &col);
|
||||
RGBColor(uint16 col);
|
||||
RGBColor(uint8 col);
|
||||
RGBColor(const RGBColor &col);
|
||||
RGBColor();
|
||||
|
||||
bool IsTransparentMagic() const;
|
||||
uint8 GetColor8() const;
|
||||
uint16 GetColor15() const;
|
||||
uint16 GetColor16() const;
|
||||
rgb_color GetColor32() const;
|
||||
|
||||
protected:
|
||||
rgb_color color32;
|
||||
void SetColor(uint8 r, uint8 g, uint8 b, uint8 a=255);
|
||||
void SetColor(int r, int g, int b, int a=255);
|
||||
void SetColor(uint16 color16);
|
||||
void SetColor(uint8 color8);
|
||||
void SetColor(const rgb_color &color);
|
||||
void SetColor(const RGBColor &col);
|
||||
|
||||
// caching
|
||||
mutable uint16 color16;
|
||||
mutable uint16 color15;
|
||||
mutable uint8 color8;
|
||||
mutable bool update8;
|
||||
mutable bool update15;
|
||||
mutable bool update16;
|
||||
const RGBColor & operator=(const RGBColor &col);
|
||||
const RGBColor & operator=(const rgb_color &col);
|
||||
bool operator==(const rgb_color &col) const;
|
||||
bool operator==(const RGBColor &col) const;
|
||||
|
||||
bool IsTransparentMagic() const;
|
||||
|
||||
void PrintToStream() const;
|
||||
|
||||
protected:
|
||||
rgb_color fColor32;
|
||||
|
||||
// caching
|
||||
mutable uint16 fColor16;
|
||||
mutable uint16 fColor15;
|
||||
mutable uint8 fColor8;
|
||||
mutable bool fUpdate8;
|
||||
mutable bool fUpdate15;
|
||||
mutable bool fUpdate16;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif // RGB_COLOR_H
|
||||
|
||||
Reference in New Issue
Block a user