Files
libreoffice/slideshow/source/inc/rgbcolor.hxx
Noel Grandin f775249547 remove cppcanvas Color class
which actually does nothing useful. Looks like it was originally
intended to be used to implement color profiles, but since nothing
has happened on that front since it was created, safe to say it never
will. Probably not the right place in the graphics stack to do it
anyhow.

Change-Id: I36990db4036e3b4b2b75261fc430028562a6dbd9
Reviewed-on: https://gerrit.libreoffice.org/43240
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-09 21:05:09 +02:00

97 lines
3.0 KiB
C++

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_SLIDESHOW_SOURCE_INC_RGBCOLOR_HXX
#define INCLUDED_SLIDESHOW_SOURCE_INC_RGBCOLOR_HXX
#include <cppcanvas/color.hxx>
/* Definition of RGBColor class */
namespace slideshow
{
namespace internal
{
class HSLColor;
/** RGB color space class.
*/
class RGBColor
{
public:
RGBColor();
explicit RGBColor( ::cppcanvas::IntSRGBA nRGBColor );
RGBColor( double nRed, double nGreen, double nBlue );
explicit RGBColor( const HSLColor& rColor );
/** Get the RGB red value.
*/
double getRed() const { return maRGBTriple.mnRed; }
/** Get the RGB green value.
*/
double getGreen() const { return maRGBTriple.mnGreen; }
/** Get the RGB blue value.
*/
double getBlue() const { return maRGBTriple.mnBlue; }
/** Create an integer sRGBA color.
*/
::cppcanvas::IntSRGBA getIntegerColor() const;
struct RGBTriple
{
RGBTriple();
RGBTriple( double nRed, double nGreen, double nBlue );
double mnRed;
double mnGreen;
double mnBlue;
};
private:
// default copy/assignment are okay
// RGBColor(const RGBColor&);
// RGBColor& operator=( const RGBColor& );
RGBTriple maRGBTriple;
};
bool operator==( const RGBColor& rLHS, const RGBColor& rRHS );
bool operator!=( const RGBColor& rLHS, const RGBColor& rRHS );
RGBColor operator+( const RGBColor& rLHS, const RGBColor& rRHS );
RGBColor operator*( const RGBColor& rLHS, const RGBColor& rRHS );
RGBColor operator*( double nFactor, const RGBColor& rRHS );
/** RGB color linear interpolator.
@param t
As usual, t must be in the [0,1] range
*/
RGBColor interpolate( const RGBColor& rFrom, const RGBColor& rTo, double t );
}
}
#endif // INCLUDED_SLIDESHOW_SOURCE_INC_RGBCOLOR_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */