Krita Source Code Documentation
Loading...
Searching...
No Matches
KisAutoLevels.h File Reference
#include <QVector>
#include <KoColor.h>
#include <kis_paint_device.h>
#include <KisLevelsCurve.h>
#include <kritaimage_export.h>

Go to the source code of this file.

Classes

struct  KisAutoLevels::ChannelHistogram
 Convenience class that associates a KisHistogram and a channel index. This is useful because setting a channel on the histogram mutates it. This way the functions can change the histogram channel by looking at the "channel" field. More...
 

Namespaces

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

Enumerations

enum  KisAutoLevels::MidtonesAdjustmentMethod { KisAutoLevels::MidtonesAdjustmentMethod_None , KisAutoLevels::MidtonesAdjustmentMethod_UseMedian , KisAutoLevels::MidtonesAdjustmentMethod_UseMean }
 The different methods to enhance the mid tones. More...
 
enum  KisAutoLevels::ShadowsAndHighlightsAdjustmentMethod { KisAutoLevels::ShadowsAndHighlightsAdjustmentMethod_MonochromaticContrast , KisAutoLevels::ShadowsAndHighlightsAdjustmentMethod_PerChannelContrast }
 The different methods to enhance the contrast. More...
 

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.