1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
13 #include <docmodel/dllapi.h>
15 #include <o3tl/hash_combine.hxx>
19 /** Color transformation type */
20 enum class TransformationType
53 /** Definition of a color transformation.
55 * This just defines how a color should be transformed (changed). The
56 * type defines what kind of transformation should occur and the value
57 * defines by how much.
59 struct DOCMODEL_DLLPUBLIC Transformation
61 TransformationType meType
= TransformationType::Undefined
;
63 sal_Int16 mnValue
= 0; /// percentage value -10000 to +10000
65 bool operator==(const Transformation
& rTransformation
) const
67 return meType
== rTransformation
.meType
&& mnValue
== rTransformation
.mnValue
;
70 std::size_t getHash() const
73 o3tl::hash_combine(seed
, meType
);
74 o3tl::hash_combine(seed
, mnValue
);
79 } // end of namespace model
83 template <> struct hash
<model::Transformation
>
85 std::size_t operator()(model::Transformation
const& rTransformation
) const
87 return rTransformation
.getHash();
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */