1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _BGFX_COLOR_BCOLORTOOLS_HXX
25 #define _BGFX_COLOR_BCOLORTOOLS_HXX
26 
27 #include <sal/types.h>
28 #include <basegfx/basegfxdllapi.h>
29 
30 //////////////////////////////////////////////////////////////////////////////
31 
32 namespace basegfx
33 {
34     class BColor;
35 
36     namespace tools
37     {
38         /// Transform from RGB to HSL
39         BASEGFX_DLLPUBLIC BColor rgb2hsl(const BColor& rRGBColor);
40         /// Transform from HSL to RGB
41         BASEGFX_DLLPUBLIC BColor hsl2rgb(const BColor& rHSLColor);
42 
43         /// Transform from RGB to HSV
44         BASEGFX_DLLPUBLIC BColor rgb2hsv(const BColor& rRGBColor);
45         /// Transform from HSV to RGB
46         BASEGFX_DLLPUBLIC BColor hsv2rgb(const BColor& rHSVColor);
47 
48         /// Transform from R'G'B' to YIQ (NTSC color model - Y is used in monochrome mode)
49         BASEGFX_DLLPUBLIC BColor rgb2yiq(const BColor& rRGBColor);
50         /// Transform from YIQ to R'G'B' (NTSC color model - Y is used in monochrome mode)
51         BASEGFX_DLLPUBLIC BColor yiq2rgb(const BColor& rYIQColor);
52 
53         /// Transform from R'G'B' to Y'PbPr (the [0,1]x[-.5,.5]x[-.5,.5] equivalent of Y'CbCr (which is scaled into 8bit))
54         BASEGFX_DLLPUBLIC BColor rgb2ypbpr(const BColor& rRGBColor);
55         /// Transform from Y'PbPr (the [0,1]x[-.5,.5]x[-.5,.5] equivalent of Y'CbCr (which is scaled into 8bit)) into R'G'B'
56         BASEGFX_DLLPUBLIC BColor ypbpr2rgb(const BColor& rYPbPrColor);
57 
58         /// Transform from CIE XYZ into Rec. 709 RGB (D65 white point)
59         BASEGFX_DLLPUBLIC BColor ciexyz2rgb( const BColor& rXYZColor );
60         /// Transform from Rec. 709 RGB (D65 white point) into CIE XYZ
61         BASEGFX_DLLPUBLIC BColor rgb2ciexyz( const BColor& rRGBColor );
62 
63 	}
64 } // end of namespace basegfx
65 
66 #endif /* _BGFX_COLOR_BCOLORTOOLS_HXX */
67 
68 //////////////////////////////////////////////////////////////////////////////
69 // eof
70