digiKam
Digikam::ImageCurves Class Reference

Public Types

typedef double CRMatrix[4][4]
 
enum  CurveType { CURVE_SMOOTH = 0 , CURVE_FREE }
 

Public Member Functions

QByteArray channelToBinary (int channel) const
 
void curvesCalculateAllCurves ()
 
void curvesCalculateCurve (int channel)
 
void curvesChannelReset (int channel)
 
float curvesLutFunc (int n_channels, int channel, float value)
 
void curvesLutProcess (uchar *const srcPR, uchar *const destPR, int w, int h)
 
void curvesLutSetup (int nchannels)
 
void curvesReset ()
 Methods to manipulate the curves data. More...
 
void fillFromOtherCurves (ImageCurves *const otherCurves)
 
CurvesContainer getContainer () const
 
CurvesContainer getContainer (int channel) const
 
QPoint getCurvePoint (int channel, int point) const
 
QPolygon getCurvePoints (int channel) const
 
int getCurvePointX (int channel, int point) const
 
int getCurvePointY (int channel, int point) const
 
CurveType getCurveType (int channel) const
 
int getCurveValue (int channel, int bin) const
 
QPolygon getCurveValues (int channel) const
 
 ImageCurves (bool sixteenBit)
 
 ImageCurves (const CurvesContainer &container)
 
 ImageCurves (const ImageCurves &other)
 
bool isCurvePointEnabled (int channel, int point) const
 
bool isDirty () const
 Curves properties. More...
 
bool isLinear () const
 
bool isLinear (int channel) const
 
bool isSixteenBits () const
 
bool loadCurvesFromGimpCurvesFile (const QUrl &fileUrl)
 
ImageCurvesoperator= (const ImageCurves &other)
 
bool saveCurvesToGimpCurvesFile (const QUrl &fileUrl) const
 Methods to save/load the curves values to/from a Gimp curves text file. More...
 
bool setChannelFromBinary (int channel, const QByteArray &array)
 
void setContainer (const CurvesContainer &container)
 NOTE: bits depth must match. More...
 
void setCurvePoint (int channel, int point, const QPoint &val)
 
void setCurvePoints (int channel, const QPolygon &vals)
 
void setCurvePointX (int channel, int point, int x)
 
void setCurvePointY (int channel, int point, int y)
 
void setCurveType (CurveType type)
 
void setCurveType (int channel, CurveType type)
 
void setCurveValue (int channel, int bin, int val)
 Methods to set manually the curves values. More...
 
void setCurveValues (int channel, const QPolygon &vals)
 
void unsetCurvePoint (int channel, int point)
 
 ~ImageCurves ()
 

Static Public Member Functions

static QPoint getDisabledValue ()
 

Static Public Attributes

static const int MULTIPLIER_16BIT = 255
 
static const int NUM_CHANNELS = 5
 
static const int NUM_POINTS = 17
 

Member Typedef Documentation

◆ CRMatrix

typedef double Digikam::ImageCurves::CRMatrix[4][4]

Member Enumeration Documentation

◆ CurveType

Enumerator
CURVE_SMOOTH 

Smooth curve type.

CURVE_FREE 

Freehand curve type.

Constructor & Destructor Documentation

◆ ImageCurves() [1/3]

Digikam::ImageCurves::ImageCurves ( bool  sixteenBit)
explicit

References curvesReset().

◆ ImageCurves() [2/3]

Digikam::ImageCurves::ImageCurves ( const CurvesContainer container)
explicit

◆ ImageCurves() [3/3]

Digikam::ImageCurves::ImageCurves ( const ImageCurves other)

◆ ~ImageCurves()

Digikam::ImageCurves::~ImageCurves ( )

Member Function Documentation

◆ channelToBinary()

QByteArray Digikam::ImageCurves::channelToBinary ( int  channel) const

Writes the given channel to a raw binary representation. Note that 16bit free curves take a lot of memory (~85kB) while all other forms take less than 400 bytes.

Binary format:

Version 1 :16 Type 0,1,2 : 8 Bytes depth 1,2 : 8 reserved :32 count :32

Type 0 (linear curve): Type 1 (smooth curve): for (0...count) point.x :32 point.y :32 Type 2 (free curve): for (0...count) if (Bytes depth == 1) value : 8 else if (Bytes depth == 2) value :16

In Big Endian byte order. Data then converted to base64.

References CURVE_SMOOTH, isLinear(), isSixteenBits(), NUM_CHANNELS, and NUM_POINTS.

Referenced by Digikam::CurvesContainer::writeToFilterAction().

◆ curvesCalculateAllCurves()

void Digikam::ImageCurves::curvesCalculateAllCurves ( )

◆ curvesCalculateCurve()

void Digikam::ImageCurves::curvesCalculateCurve ( int  channel)

◆ curvesChannelReset()

void Digikam::ImageCurves::curvesChannelReset ( int  channel)

◆ curvesLutFunc()

float Digikam::ImageCurves::curvesLutFunc ( int  n_channels,
int  channel,
float  value 
)

References value.

Referenced by curvesLutSetup().

◆ curvesLutProcess()

void Digikam::ImageCurves::curvesLutProcess ( uchar *const  srcPR,
uchar *const  destPR,
int  w,
int  h 
)

References isSixteenBits().

◆ curvesLutSetup()

void Digikam::ImageCurves::curvesLutSetup ( int  nchannels)

◆ curvesReset()

void Digikam::ImageCurves::curvesReset ( )

Methods to manipulate the curves data.

References CURVE_SMOOTH, curvesChannelReset(), NUM_CHANNELS, and setCurveType().

Referenced by fillFromOtherCurves(), ImageCurves(), and loadCurvesFromGimpCurvesFile().

◆ fillFromOtherCurves()

void Digikam::ImageCurves::fillFromOtherCurves ( ImageCurves *const  otherCurves)

Fills this curves with the data supplied by another curves object. This ensures that 8 and 16 bit curves are properly converted.

Parameters
otherCurvesother curves object to adapt config from

References CURVE_FREE, CURVE_SMOOTH, curvesCalculateAllCurves(), curvesReset(), getCurvePoint(), getCurveType(), getCurveValue(), isSixteenBits(), MULTIPLIER_16BIT, NUM_CHANNELS, NUM_POINTS, setCurvePoint(), setCurveType(), and setCurveValue().

Referenced by setCurveValues(), Digikam::CurvesWidget::updateData(), and Digikam::CurvesContainer::writeToFilterAction().

◆ getContainer() [1/2]

CurvesContainer Digikam::ImageCurves::getContainer ( ) const

◆ getContainer() [2/2]

CurvesContainer Digikam::ImageCurves::getContainer ( int  channel) const

Returns a container containing the values of this Curves object for the given channel, and linear values for all other channels.

References CURVE_FREE, getCurvePoints(), getCurveType(), getCurveValues(), isLinear(), isSixteenBits(), and Digikam::CurvesContainer::values.

◆ getCurvePoint()

QPoint Digikam::ImageCurves::getCurvePoint ( int  channel,
int  point 
) const

◆ getCurvePoints()

QPolygon Digikam::ImageCurves::getCurvePoints ( int  channel) const

References getCurvePoint(), NUM_CHANNELS, and NUM_POINTS.

Referenced by getContainer().

◆ getCurvePointX()

int Digikam::ImageCurves::getCurvePointX ( int  channel,
int  point 
) const

References NUM_CHANNELS, and NUM_POINTS.

◆ getCurvePointY()

int Digikam::ImageCurves::getCurvePointY ( int  channel,
int  point 
) const

References NUM_CHANNELS, and NUM_POINTS.

◆ getCurveType()

ImageCurves::CurveType Digikam::ImageCurves::getCurveType ( int  channel) const

References CURVE_SMOOTH, and NUM_CHANNELS.

Referenced by fillFromOtherCurves(), and getContainer().

◆ getCurveValue()

int Digikam::ImageCurves::getCurveValue ( int  channel,
int  bin 
) const

◆ getCurveValues()

QPolygon Digikam::ImageCurves::getCurveValues ( int  channel) const

References getCurveValue(), and NUM_CHANNELS.

Referenced by getContainer().

◆ getDisabledValue()

QPoint Digikam::ImageCurves::getDisabledValue ( )
static

◆ isCurvePointEnabled()

bool Digikam::ImageCurves::isCurvePointEnabled ( int  channel,
int  point 
) const

References NUM_CHANNELS, and NUM_POINTS.

◆ isDirty()

bool Digikam::ImageCurves::isDirty ( ) const

Curves properties.

◆ isLinear() [1/2]

bool Digikam::ImageCurves::isLinear ( ) const

References NUM_CHANNELS.

Referenced by channelToBinary(), and getContainer().

◆ isLinear() [2/2]

bool Digikam::ImageCurves::isLinear ( int  channel) const

Returns true if the curve is linear for the given channel, or all channels.

References CURVE_FREE, NUM_CHANNELS, and NUM_POINTS.

Referenced by Digikam::CurvesContainer::writeToFilterAction().

◆ isSixteenBits()

◆ loadCurvesFromGimpCurvesFile()

bool Digikam::ImageCurves::loadCurvesFromGimpCurvesFile ( const QUrl &  fileUrl)

◆ operator=()

ImageCurves & Digikam::ImageCurves::operator= ( const ImageCurves other)

◆ saveCurvesToGimpCurvesFile()

bool Digikam::ImageCurves::saveCurvesToGimpCurvesFile ( const QUrl &  fileUrl) const

Methods to save/load the curves values to/from a Gimp curves text file.

References CLAMP, CURVE_FREE, isSixteenBits(), MULTIPLIER_16BIT, NUM_CHANNELS, and NUM_POINTS.

◆ setChannelFromBinary()

bool Digikam::ImageCurves::setChannelFromBinary ( int  channel,
const QByteArray &  array 
)

Set the channel from the given raw binary representation. The data is checked for validity, only on valid data true is returned. Note that the bytes depth (isSixteenBits()) of the encoded representation must match the depth of this curves object.

References CURVE_FREE, CURVE_SMOOTH, curvesChannelReset(), isSixteenBits(), NUM_CHANNELS, NUM_POINTS, setCurvePoints(), and setCurveType().

Referenced by Digikam::CurvesContainer::fromFilterAction().

◆ setContainer()

void Digikam::ImageCurves::setContainer ( const CurvesContainer container)

◆ setCurvePoint()

void Digikam::ImageCurves::setCurvePoint ( int  channel,
int  point,
const QPoint &  val 
)

◆ setCurvePoints()

void Digikam::ImageCurves::setCurvePoints ( int  channel,
const QPolygon &  vals 
)

◆ setCurvePointX()

void Digikam::ImageCurves::setCurvePointX ( int  channel,
int  point,
int  x 
)

References NUM_CHANNELS, and NUM_POINTS.

◆ setCurvePointY()

void Digikam::ImageCurves::setCurvePointY ( int  channel,
int  point,
int  y 
)

References NUM_CHANNELS, and NUM_POINTS.

◆ setCurveType() [1/2]

void Digikam::ImageCurves::setCurveType ( ImageCurves::CurveType  type)

References NUM_CHANNELS, and setCurveType().

◆ setCurveType() [2/2]

◆ setCurveValue()

void Digikam::ImageCurves::setCurveValue ( int  channel,
int  bin,
int  val 
)

Methods to set manually the curves values.

References NUM_CHANNELS.

Referenced by fillFromOtherCurves(), and setCurveValues().

◆ setCurveValues()

void Digikam::ImageCurves::setCurveValues ( int  channel,
const QPolygon &  vals 
)

◆ unsetCurvePoint()

void Digikam::ImageCurves::unsetCurvePoint ( int  channel,
int  point 
)

References NUM_CHANNELS, and NUM_POINTS.

Member Data Documentation

◆ MULTIPLIER_16BIT

const int Digikam::ImageCurves::MULTIPLIER_16BIT = 255
static

◆ NUM_CHANNELS

◆ NUM_POINTS


The documentation for this class was generated from the following files: