Update ooo320-m1
[ooovba.git] / slideshow / source / inc / rgbcolor.hxx
blob78cdce65bc8d44242bfecccb5f5d6f7ec277112f
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: rgbcolor.hxx,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef INCLUDED_SLIDESHOW_RGBCOLOR_HXX
32 #define INCLUDED_SLIDESHOW_RGBCOLOR_HXX
34 #include <cppcanvas/color.hxx>
37 /* Definition of RGBColor class */
39 namespace slideshow
41 namespace internal
43 class HSLColor;
45 /** RGB color space class.
47 class RGBColor
49 public:
50 RGBColor();
51 explicit RGBColor( ::cppcanvas::Color::IntSRGBA nRGBColor );
52 RGBColor( double nRed, double nGreen, double nBlue );
53 explicit RGBColor( const HSLColor& rColor );
55 /** Hue of the color.
57 @return hue, is in the range [0,360]
59 double getHue() const;
61 /** Saturation of the color.
63 @return saturation, is in the range [0,1]
65 double getSaturation() const;
67 /** Luminance of the color.
69 @return luminance, is in the range [0,1]
71 double getLuminance() const;
73 /** Get the RGB red value.
75 double getRed() const;
77 /** Get the RGB green value.
79 double getGreen() const;
81 /** Get the RGB blue value.
83 double getBlue() const;
85 /** Create an HSL color object.
87 HSLColor getHSLColor() const;
89 /** Create an integer sRGBA color.
91 ::cppcanvas::Color::IntSRGBA getIntegerColor() const;
93 struct RGBTriple
95 RGBTriple();
96 RGBTriple( double nRed, double nGreen, double nBlue );
98 double mnRed;
99 double mnGreen;
100 double mnBlue;
103 private:
104 // default copy/assignment are okay
105 // RGBColor(const RGBColor&);
106 // RGBColor& operator=( const RGBColor& );
108 RGBTriple maRGBTriple;
111 RGBColor operator+( const RGBColor& rLHS, const RGBColor& rRHS );
112 RGBColor operator*( const RGBColor& rLHS, const RGBColor& rRHS );
113 RGBColor operator*( double nFactor, const RGBColor& rRHS );
116 /** RGB color linear interpolator.
118 @param t
119 As usual, t must be in the [0,1] range
121 RGBColor interpolate( const RGBColor& rFrom, const RGBColor& rTo, double t );
125 #endif /* INCLUDED_SLIDESHOW_RGBCOLOR_HXX */