Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/LibreOffice/include/docmodel/color/   (Office von Apache Version 25.8.3.2©)  Datei vom 5.10.2025 mit Größe 1 kB image not shown  

Quelle  Transformation.hxx   Sprache: 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/.
 *
 */


#pragma once

#include <docmodel/dllapi.h>
#include <o3tl/hash_combine.hxx>

namespace model
{
/** Color transformation type */
enum class TransformationType
{
    Undefined,
    Red,
    RedMod,
    RedOff,
    Green,
    GreenMod,
    GreenOff,
    Blue,
    BlueMod,
    BlueOff,
    Alpha,
    AlphaMod,
    AlphaOff,
    Hue,
    HueMod,
    HueOff,
    Sat,
    SatMod,
    SatOff,
    Lum,
    LumMod,
    LumOff,
    Shade,
    Tint,
    Gray,
    Comp,
    Inv,
    Gamma,
    InvGamma
};

/** Definition of a color transformation.
 *
 * This just defines how a color should be transformed (changed). The
 * type defines what kind of transformation should occur and the value
 * defines by how much.
 */

struct DOCMODEL_DLLPUBLIC Transformation
{
    TransformationType meType = TransformationType::Undefined;

    sal_Int16 mnValue = 0; /// percentage value -10000 to +10000

    bool operator==(const Transformation& rTransformation) const
    {
        return meType == rTransformation.meType && mnValue == rTransformation.mnValue;
    }

    std::size_t getHash() const
    {
        std::size_t seed = 0;
        o3tl::hash_combine(seed, meType);
        o3tl::hash_combine(seed, mnValue);
        return seed;
    }
};

// end of namespace model

namespace std
{
template <> struct hash<model::Transformation>
{
    std::size_t operator()(model::Transformation const& rTransformation) const
    {
        return rTransformation.getHash();
    }
};
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Messung V0.5
C=94 H=95 G=94

¤ Dauer der Verarbeitung: 0.4 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.