LibreOffice Module slideshow (master) 1
rgbcolor.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_RGBCOLOR_HXX
21#define INCLUDED_SLIDESHOW_SOURCE_INC_RGBCOLOR_HXX
22
23#include <cppcanvas/color.hxx>
24
25
26/* Definition of RGBColor class */
27
28namespace slideshow::internal
29 {
30 class HSLColor;
31
35 {
36 public:
37 RGBColor();
38 explicit RGBColor( ::cppcanvas::IntSRGBA nRGBColor );
39 RGBColor( double nRed, double nGreen, double nBlue );
40 explicit RGBColor( const HSLColor& rColor );
41
44 double getRed() const { return maRGBTriple.mnRed; }
45
48 double getGreen() const { return maRGBTriple.mnGreen; }
49
52 double getBlue() const { return maRGBTriple.mnBlue; }
53
57
58 struct RGBTriple
59 {
60 RGBTriple();
61 RGBTriple( double nRed, double nGreen, double nBlue );
62
63 double mnRed;
64 double mnGreen;
65 double mnBlue;
66 };
67
68 private:
69 // default copy/assignment are okay
70 // RGBColor(const RGBColor&);
71 // RGBColor& operator=( const RGBColor& );
72
74 };
75
76 bool operator==( const RGBColor& rLHS, const RGBColor& rRHS );
77 bool operator!=( const RGBColor& rLHS, const RGBColor& rRHS );
78 RGBColor operator+( const RGBColor& rLHS, const RGBColor& rRHS );
79 RGBColor operator*( const RGBColor& rLHS, const RGBColor& rRHS );
80 RGBColor operator*( double nFactor, const RGBColor& rRHS );
81
82
88 RGBColor interpolate( const RGBColor& rFrom, const RGBColor& rTo, double t );
89}
90
91#endif // INCLUDED_SLIDESHOW_SOURCE_INC_RGBCOLOR_HXX
92
93/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
HSL color space class.
Definition: hslcolor.hxx:33
RGB color space class.
Definition: rgbcolor.hxx:35
::cppcanvas::IntSRGBA getIntegerColor() const
Create an integer sRGBA color.
Definition: color.cxx:299
double getRed() const
Get the RGB red value.
Definition: rgbcolor.hxx:44
double getGreen() const
Get the RGB green value.
Definition: rgbcolor.hxx:48
double getBlue() const
Get the RGB blue value.
Definition: rgbcolor.hxx:52
sal_uInt32 IntSRGBA
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