Krita Source Code Documentation
Loading...
Searching...
No Matches
KisAutoLevels.cpp File Reference
#include <cmath>
#include <kis_histogram.h>
#include "KisAutoLevels.h"

Go to the source code of this file.

Namespaces

namespace  KisAutoLevels
 This namespace contains functions to compute the levels adjustment parameters automatically from a histogram.
 

Functions

QVector< KisLevelsCurveKisAutoLevels::adjustMonochromaticContrast (ChannelHistogram lightnessHistogram, QVector< ChannelHistogram > &channelsHistograms, qreal shadowsClipping, qreal highlightsClipping, qreal maximumInputBlackAndWhiteOffset, MidtonesAdjustmentMethod midtonesAdjustmentMethod, qreal midtonesAdjustmentAmount, const QVector< qreal > &outputBlackPoints, const QVector< qreal > &outputWhitePoints, const QVector< qreal > &outputMidtones)
 Creates a KisLevelsCurve for every channel in "channelsHistograms". Computes the input black and white points from the intensity histogram. Computes the gamma from each channels histogram and "outputMidtones" if the method is not "None". The output black and white points are computed from "outputBlackPoints" and "outputWhitePoints".
 
QVector< KisLevelsCurveKisAutoLevels::adjustPerChannelContrast (QVector< ChannelHistogram > &channelsHistograms, qreal shadowsClipping, qreal highlightsClipping, qreal maximumInputBlackAndWhiteOffset, MidtonesAdjustmentMethod midtonesAdjustmentMethod, qreal midtonesAdjustmentAmount, const QVector< qreal > &outputBlackPoints, const QVector< qreal > &outputWhitePoints, const QVector< qreal > &outputMidtones)
 Creates a KisLevelsCurve for every channel in "channelsHistograms". Computes the input black and white points from each channels histogram separately. Computes the gamma from each channels histogram and "outputMidtones" if the method is not "None". The output black and white points are computed from "outputBlackPoints" and "outputWhitePoints".
 
QPair< KoColor, KoColorKisAutoLevels::getDarkestAndWhitestColors (const KisPaintDeviceSP device, qreal shadowsClipping, qreal highlightsClipping)
 Finds the darkest and whitest colors in the device having into account the clipping.
 
qreal KisAutoLevels::getGamma (qreal blackPoint, qreal whitePoint, qreal inputIntensity, qreal outputIntensity)
 Computes a gamma value that "moves" the input midpoint towards the output midpoint.
 
QPair< qreal, qreal > KisAutoLevels::getInputBlackAndWhitePoints (ChannelHistogram histogram, qreal shadowsClipping, qreal highlightsClipping)
 Takes a reference histogram (luma, lightness) and computes the black and white points to maximize the contrast having into account the clipping.
 
QPair< qreal, qreal > KisAutoLevels::getMeanAndMedian (ChannelHistogram histogram, qreal begin, qreal end)