LibreOffice Module slideshow (master) 1
hslcolor.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#ifndef INCLUDED_SLIDESHOW_SOURCE_INC_HSLCOLOR_HXX
21#define INCLUDED_SLIDESHOW_SOURCE_INC_HSLCOLOR_HXX
22
23
24/* Definition of HSLColor class */
25
26namespace slideshow::internal
27 {
28 class RGBColor;
29
33 {
34 public:
35 HSLColor();
36 HSLColor( double nHue, double nSaturation, double nLuminance );
37 explicit HSLColor( const RGBColor& rColor );
38
43 double getHue() const { return maHSLTriple.mnHue; }
44
49 double getSaturation() const { return maHSLTriple.mnSaturation; }
50
55 double getLuminance() const { return maHSLTriple.mnLuminance; }
56
57 struct HSLTriple
58 {
59 HSLTriple();
60 HSLTriple( double nHue, double nSaturation, double nLuminance );
61
62 double mnHue;
65 };
66
67 private:
68 // default copy/assignment are okay
69 // HSLColor(const HSLColor&);
70 // HSLColor& operator=( const HSLColor& );
71
73
74 };
75
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 );
80
89 HSLColor interpolate( const HSLColor& rFrom, const HSLColor& rTo, double t, bool bCCW );
90
91}
92
93#endif // INCLUDED_SLIDESHOW_SOURCE_INC_HSLCOLOR_HXX
94
95/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
HSL color space class.
Definition: hslcolor.hxx:33
double getHue() const
Hue of the color.
Definition: hslcolor.hxx:43
double getLuminance() const
Luminance of the color.
Definition: hslcolor.hxx:55
double getSaturation() const
Saturation of the color.
Definition: hslcolor.hxx:49
RGB color space class.
Definition: rgbcolor.hxx:35
bool operator==(const HSLColor &rLHS, const HSLColor &rRHS)
Definition: color.cxx:189
HSLColor operator+(const HSLColor &rLHS, const HSLColor &rRHS)
Definition: color.cxx:201
bool operator!=(const HSLColor &rLHS, const HSLColor &rRHS)
Definition: color.cxx:196
HSLColor operator*(double nFactor, const HSLColor &rRHS)
Definition: color.cxx:208
HSLColor interpolate(const HSLColor &rFrom, const HSLColor &rTo, double t, bool bCCW)
HSL color linear interpolator.
Definition: color.cxx:215