4#ifndef CHROMALIGHTNESSDIAGRAM_P_H
5#define CHROMALIGHTNESSDIAGRAM_P_H
10#include "asyncimageprovider.h"
11#include "chromalightnessimageparameters.h"
12#include "constpropagatingrawpointer.h"
13#include "genericcolor.h"
19#include <qsharedpointer.h>
26class ChromaLightnessDiagram;
33class ChromaLightnessDiagramPrivate final
36 explicit ChromaLightnessDiagramPrivate(ChromaLightnessDiagram *backLink);
41 ~ChromaLightnessDiagramPrivate() noexcept = default;
45 AsyncImageProvider<ChromaLightnessImageParameters> m_chromaLightnessImage;
47 ChromaLightnessImageParameters m_chromaLightnessImageParameters;
50 GenericColor m_currentColorCielchD50;
67 bool m_isMouseEventActive = false;
72 [[nodiscard]]
QSize calculateImageSizePhysical() const;
73 [[nodiscard]]
int defaultBorderPhysical() const;
84 [[nodiscard]] static constexpr T distanceFromRange(const T &low, const T &x, const T &high)
93 std::numeric_limits<T>::has_quiet_NaN
94 || std::numeric_limits<T>::has_signaling_NaN
96 if (std::isnan(low) || std::isnan(x) || std::isnan(high)) {
97 return std::numeric_limits<T>::quiet_NaN();
102 [[nodiscard]] GenericColor fromWidgetPixelPositionToCielchD50(
const QPoint widgetPixelPosition)
const;
103 [[nodiscard]]
bool isWidgetPixelPositionInGamut(
const QPoint widgetPixelPosition)
const;
104 [[nodiscard]]
int leftBorderPhysical()
const;
105 [[nodiscard]] GenericColor nearestInGamutCielchD50ByAdjustingChromaLightness(
const double chroma,
const double lightness);
106 [[nodiscard]] std::optional<QPoint> nearestInGamutPixelPosition(
const QPoint originalPixelPosition);
107 [[nodiscard]]
static std::optional<QPoint>
108 nearestNeighborSearch(
const QPoint point,
const QRect searchRectangle,
const std::function<
bool(
const QPoint)> &doesPointExist);
109 void setCurrentColorFromWidgetPixelPosition(
const QPoint widgetPixelPosition);
112 Q_DISABLE_COPY(ChromaLightnessDiagramPrivate)
116 ConstPropagatingRawPointer<ChromaLightnessDiagram> q_pointer;
The namespace of this library.