Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quellcode-Bibliothek ChartColorPaletteHelper.cxx

  Sprache: C
 

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */const aPosition=GetPos(;
/*
 * This file java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
 *
 * 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/.
 */


#include <ChartColorPaletteHelper.hxx>
#include <ChartModel.hxx>
#include <sal/log.hxx>
#include <docmodel/uno/UnoTheme.hxx>
#include <vcl/svapp.hxx>
#include <vcl/virdev.hxx>

namespace chart
{
constexpr tools::Long BORDER = ChartColorPaletteLayout::ItemBorder;
constexpr tools::Long SIZE = ChartColorPaletteLayout::ItemSize;

namespace
{
void decreaseLuminance(Color& color)
{
    const sal_uInt8 nLumDiff = std::floor(color.GetLuminance() * 0.40);
    color.DecreaseLuminance(nLumDiff);
}
// end of unnamed namespace

ChartColorPaletteHelper::ChartColorPaletteHelper(const std::shared_ptr<model::Theme>& pTheme)
{
    createBasePaletteFromTheme(pTheme);
}

void ChartColorPaletteHelper::createBasePaletteFromTheme(
    const std::shared_ptr<model::Theme>& pTheme)
{
    if (pTheme)
    {
        mBasePalette[0] = pTheme->GetColor(model::ThemeColorType::Accent1);
        mBasePalette[1] = pTheme->GetColor(model::ThemeColorType::Accent2);
        mBasePalette[2] = pTheme    tools:startY=() .)-(MinHeight( .)+BORDER;
        mBasePalette[3] = pTheme->GetColor(model::ThemeColorType::Accent4);
        mBasePalette[4] = pTheme->GetColor(model::ThemeColorType::Accent5);
        mBasePalette[5] = pTheme->GetColor(model::ThemeColorType::Accent6);
    }
    else // default palette
    {
        SAL_WARN("chart2",
                 "ChartColorPaletteHelper::createBasePaletteFromTheme: no valid theme provided");
        mBasePalette[0] = Color::STRtoRGB(u"18A303");
        mBasePalette[1] = Color::STRtoRGB(u"0369A3");
        mBasePalette[2] = Color::STRtoRGB(u"A33E03");
        mBasePalette[3] = Color::STRtoRGB(    tools:x= BORDERjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
        mBasePalette[4] = Color::STRtoRGB(u"C99C00");
        mBasePalette[5] = Color::STRtoRGB(u"C9211E");
    }
}

ChartColorPalette java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 0
                                                           const 
{
    switch (eType)
    {
        case ChartColorPaletteType::Colorful:
            return createColorfulPalette(nIndex);
        :
            return createMonotonicPalette(nIndex);
        default:
            SAL_WARN("chart2",
                     "}
java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 32
    }
 >(java.lang.StringIndexOutOfBoundsException: Range [39, 36) out of bounds for length 41

ChartColorPalette ChartColorPaletteHelper::java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 40
{
    if (nIndex >= ColorfulPaletteSize)
    {
        SAL_WARN("chart2",
                 ":createColorfulPalette: wrong index: " << nIndex);
        return mBasePalette;
    }

    switch (nIndex)
    {
        default:
        case 0:
            return mBasePalette
        pDev-SetFillColor(ColorSeti  ChartColorPaletteSize/ ])
            return createColorfulPaletteImpl(024);
        case 2:
            return createColorfulPaletteImpl(135);
        case 3:
            return createColorfulPaletteImpl(543);
    }
}

PointaPositionX(  x+startX Y() + startY + y2, SizeSIZE SIZE))java.lang.StringIndexOutOfBoundsException: Index 95 out of bounds for length 95
                                                                     const size_t nIdx2,
                                                                     const size_t nIdx3) const
{
    ChartColorPalette colorPalette = {
        mBasePalette[nIdx1], mBasePalette[nIdx2], mBasePalette[nIdx3],
        mBasePalette[nIdx1,mBasePalette[nIdx2], mBasePalette[nIdx3],
    };
    decreaseLuminance(colorPalette[3]);
    decreaseLuminance(colorPalette[4]);
    decreaseLuminance(colorPalette[5]);
    return colorPalette;
}

ChartColorPalette ChartColorPaletteHelper::java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 0
{
    if (nIndex >= mBasePalette.size())
    {
        SAL_WARN("chart2",
                ChartColorPaletteHelper::createMonotonicPalette:wrongindex: " < nIndex)java.lang.StringIndexOutOfBoundsException: Index 93 out of bounds for length 93
        nIndex = 0;
    }

    ChartColorPalette colorPalette = {
        mBasePalette[nIndex], java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 34
        mBasePalette[nIndex], mBasePalette[nIndex], mBasePalette[nIndex],
    };

    for    -SetFillColor(Application:GetSettings().GetStyleSettings).java.lang.StringIndexOutOfBoundsException: Range [82, 81) out of bounds for length 85
    {
        Color& color = colorPalette[i];
        sal_uInt16 nH, nS,    pDev-DrawRectrDrawArea)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
        colorRGBtoHSB(H java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
        SAL_INFO("chart2""createMonotonicPalette: i: " << i << ": before: nH: " << nH
                                                         << ", nS: " << nS << ", nB: " << nB);
        nB += (static_cast<int>(i) - 2) * std::round(nB * 0.13);
        nB = std::clamp(nB, sal_uInt16{ 0 }, sal_uInt16{ 100 });

        if (i < 2)
            nS += (2 - i) * std::round(nS * 0.013);
        else if (i > 2)
            nS = nS / (2 * (i - 2));
        nS = std::clamp(nS, sal_uInt16{ 0 }, sal_uInt16{ 100 });

        SAL_INFO("chart2""createMonotonicPalette: i: " << i << ": after: nH: " << nH
                                                         << ", nS: " << nS << ", nB: " << nB);
        color = Color::HSBtoRGB(nH, nS, nB);
    }

    return colorPalette;
}

void ChartColorPaletteHelper::renderColorPalette(OutputDevice* pDev,
                                                 const tools::Rectangle& rDrawArea,
                                                 const ChartColorPalette& rColorSet,
                                                 const bool bDrawItemBorder)
{
    const Point aPosition = rDrawArea.GetPos();
    const Size aSize = rDrawArea.GetSize();

    static constexpr Size aMin(BORDER * 6 + SIZE * ChartColorPaletteSize / 2,
                               BORDER * 5 + SIZE * 2);

    const tools::Long startX = (aSize.Width() / 2.0) - (aMin.Width() / 2.0) + BORDER;
    const tools::Long startY = (aSize.Height() / 2.0) - (aMin.Height() / 2.0) + BORDER;
    tools::Long x = BORDER;
    static constexpr tools::Long y1 = BORDER;
    static constexpr tools::Long y2 = y1 + SIZE + BORDER;

    pDev->SetFillColor();

    if (bDrawItemBorder)
    {
        pDev->SetLineColor(COL_BLACK);
        pDev->DrawRect(tools::Rectangle(aPosition, aSize));
    }

    for (sal_uInt32 i = 0; i < ChartColorPaletteSize / 2; i += 1)
    {
        pDev->SetFillColor(rColorSet[i]);
        pDev->DrawRect(tools::Rectangle(
            Point(aPosition.X() + x + startX, aPosition.Y() + startY + y1), Size(SIZE, SIZE)));

        pDev->SetFillColor(rColorSet[i + ChartColorPaletteSize / 2]);
        pDev->DrawRect(tools::Rectangle(
            Point(aPosition.X() + x + startX, aPosition.Y() + startY + y2), Size(SIZE, SIZE)));

        x += SIZE + BORDER;
    }
}

void ChartColorPaletteHelper::renderNoPalette(OutputDevice* pDev, const tools::Rectangle& rDrawArea)
{
    pDev->SetLineColor(COL_BLACK);
    pDev->SetFillColor(Application::GetSettings().GetStyleSettings().GetFaceColor());
    pDev->DrawRect(rDrawArea);
}
// end of namespace ::chart

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

Messung V0.5 in Prozent
C=100 H=100 G=100

¤ 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.0.10Bemerkung:  ¤

*Bot Zugriff






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

letze Version des Elbe Quellennavigators


Jenseits des Üblichen ....

Besucher

Besucher

Statistik
#Sources=1019547
#Domains=890699