sw a11y: clang-format SidebarWinAccessible code
[LibreOffice.git] / slideshow / source / inc / hslcolor.hxx
blobb4fbb610915b483ef106b2c07ad70f21e2f80ecc
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SLIDESHOW_SOURCE_INC_HSLCOLOR_HXX
21 #define INCLUDED_SLIDESHOW_SOURCE_INC_HSLCOLOR_HXX
24 /* Definition of HSLColor class */
26 namespace slideshow::internal
28 class RGBColor;
30 /** HSL color space class.
32 class HSLColor
34 public:
35 HSLColor();
36 HSLColor( double nHue, double nSaturation, double nLuminance );
37 explicit HSLColor( const RGBColor& rColor );
39 /** Hue of the color.
41 @return hue, is in the range [0,360]
43 double getHue() const { return maHSLTriple.mnHue; }
45 /** Saturation of the color.
47 @return saturation, is in the range [0,1]
49 double getSaturation() const { return maHSLTriple.mnSaturation; }
51 /** Luminance of the color.
53 @return luminance, is in the range [0,1]
55 double getLuminance() const { return maHSLTriple.mnLuminance; }
57 struct HSLTriple
59 HSLTriple();
60 HSLTriple( double nHue, double nSaturation, double nLuminance );
62 double mnHue;
63 double mnSaturation;
64 double mnLuminance;
67 private:
68 // default copy/assignment are okay
69 // HSLColor(const HSLColor&);
70 // HSLColor& operator=( const HSLColor& );
72 HSLTriple maHSLTriple;
76 bool operator==( const HSLColor& rLHS, const HSLColor& rRHS );
77 bool operator!=( const HSLColor& rLHS, const HSLColor& rRHS );
78 HSLColor operator+( const HSLColor& rLHS, const HSLColor& rRHS );
79 HSLColor operator*( double nFactor, const HSLColor& rRHS );
81 /** HSL color linear interpolator.
83 @param t
84 As usual, t must be in the [0,1] range
86 @param bCCW
87 When true, hue interpolation happens counter-clockwise
89 HSLColor interpolate( const HSLColor& rFrom, const HSLColor& rTo, double t, bool bCCW );
93 #endif // INCLUDED_SLIDESHOW_SOURCE_INC_HSLCOLOR_HXX
95 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */