digiKam
|
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) |
ImageCurves & | operator= (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 |
typedef double Digikam::ImageCurves::CRMatrix[4][4] |
|
explicit |
References curvesReset().
|
explicit |
References curvesReset(), setContainer(), and Digikam::CurvesContainer::sixteenBit.
Digikam::ImageCurves::ImageCurves | ( | const ImageCurves & | other | ) |
Digikam::ImageCurves::~ImageCurves | ( | ) |
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().
void Digikam::ImageCurves::curvesCalculateAllCurves | ( | ) |
References curvesCalculateCurve(), and NUM_CHANNELS.
Referenced by curvesLutSetup(), fillFromOtherCurves(), and loadCurvesFromGimpCurvesFile().
void Digikam::ImageCurves::curvesCalculateCurve | ( | int | channel | ) |
References CURVE_FREE, CURVE_SMOOTH, and NUM_POINTS.
Referenced by curvesCalculateAllCurves(), Digikam::CurvesWidget::restoreCurve(), and setCurveValues().
void Digikam::ImageCurves::curvesChannelReset | ( | int | channel | ) |
References NUM_POINTS.
Referenced by curvesReset(), setChannelFromBinary(), setCurvePoints(), and setCurveValues().
float Digikam::ImageCurves::curvesLutFunc | ( | int | n_channels, |
int | channel, | ||
float | value | ||
) |
References value.
Referenced by curvesLutSetup().
void Digikam::ImageCurves::curvesLutProcess | ( | uchar *const | srcPR, |
uchar *const | destPR, | ||
int | w, | ||
int | h | ||
) |
References isSixteenBits().
void Digikam::ImageCurves::curvesLutSetup | ( | int | nchannels | ) |
References CLAMP, curvesCalculateAllCurves(), and curvesLutFunc().
void Digikam::ImageCurves::curvesReset | ( | ) |
Methods to manipulate the curves data.
References CURVE_SMOOTH, curvesChannelReset(), NUM_CHANNELS, and setCurveType().
Referenced by fillFromOtherCurves(), ImageCurves(), and loadCurvesFromGimpCurvesFile().
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.
otherCurves | other 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().
CurvesContainer Digikam::ImageCurves::getContainer | ( | ) | const |
Returns a container with the settings for all channels of this Curves object
References Digikam::ColorChannels, CURVE_FREE, CURVE_SMOOTH, getCurvePoints(), getCurveType(), getCurveValues(), Digikam::CurvesContainer::initialize(), isLinear(), isSixteenBits(), and Digikam::CurvesContainer::values.
Referenced by Digikam::CurvesContainer::fromFilterAction().
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.
QPoint Digikam::ImageCurves::getCurvePoint | ( | int | channel, |
int | point | ||
) | const |
References getDisabledValue(), NUM_CHANNELS, and NUM_POINTS.
Referenced by fillFromOtherCurves(), getCurvePoints(), and Digikam::CurvesWidget::saveCurve().
QPolygon Digikam::ImageCurves::getCurvePoints | ( | int | channel | ) | const |
References getCurvePoint(), NUM_CHANNELS, and NUM_POINTS.
Referenced by getContainer().
int Digikam::ImageCurves::getCurvePointX | ( | int | channel, |
int | point | ||
) | const |
References NUM_CHANNELS, and NUM_POINTS.
int Digikam::ImageCurves::getCurvePointY | ( | int | channel, |
int | point | ||
) | const |
References NUM_CHANNELS, and NUM_POINTS.
ImageCurves::CurveType Digikam::ImageCurves::getCurveType | ( | int | channel | ) | const |
References CURVE_SMOOTH, and NUM_CHANNELS.
Referenced by fillFromOtherCurves(), and getContainer().
int Digikam::ImageCurves::getCurveValue | ( | int | channel, |
int | bin | ||
) | const |
References NUM_CHANNELS.
Referenced by fillFromOtherCurves(), getCurveValues(), and setCurveValues().
QPolygon Digikam::ImageCurves::getCurveValues | ( | int | channel | ) | const |
References getCurveValue(), and NUM_CHANNELS.
Referenced by getContainer().
|
static |
bool Digikam::ImageCurves::isCurvePointEnabled | ( | int | channel, |
int | point | ||
) | const |
References NUM_CHANNELS, and NUM_POINTS.
bool Digikam::ImageCurves::isDirty | ( | ) | const |
Curves properties.
bool Digikam::ImageCurves::isLinear | ( | ) | const |
References NUM_CHANNELS.
Referenced by channelToBinary(), and getContainer().
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().
bool Digikam::ImageCurves::isSixteenBits | ( | ) | const |
bool Digikam::ImageCurves::loadCurvesFromGimpCurvesFile | ( | const QUrl & | fileUrl | ) |
References CURVE_SMOOTH, curvesCalculateAllCurves(), curvesReset(), isSixteenBits(), MULTIPLIER_16BIT, NUM_CHANNELS, NUM_POINTS, and value.
ImageCurves & Digikam::ImageCurves::operator= | ( | const ImageCurves & | other | ) |
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.
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().
void Digikam::ImageCurves::setContainer | ( | const CurvesContainer & | container | ) |
NOTE: bits depth must match.
References Digikam::ColorChannels, CURVE_FREE, CURVE_SMOOTH, Digikam::CurvesContainer::curvesType, setCurvePoints(), setCurveType(), setCurveValues(), and Digikam::CurvesContainer::values.
Referenced by ImageCurves().
void Digikam::ImageCurves::setCurvePoint | ( | int | channel, |
int | point, | ||
const QPoint & | val | ||
) |
References NUM_CHANNELS, and NUM_POINTS.
Referenced by fillFromOtherCurves(), Digikam::CurvesWidget::restoreCurve(), setCurvePoints(), and setCurveValues().
void Digikam::ImageCurves::setCurvePoints | ( | int | channel, |
const QPolygon & | vals | ||
) |
References curvesChannelReset(), NUM_CHANNELS, NUM_POINTS, and setCurvePoint().
Referenced by setChannelFromBinary(), and setContainer().
void Digikam::ImageCurves::setCurvePointX | ( | int | channel, |
int | point, | ||
int | x | ||
) |
References NUM_CHANNELS, and NUM_POINTS.
void Digikam::ImageCurves::setCurvePointY | ( | int | channel, |
int | point, | ||
int | y | ||
) |
References NUM_CHANNELS, and NUM_POINTS.
void Digikam::ImageCurves::setCurveType | ( | ImageCurves::CurveType | type | ) |
References NUM_CHANNELS, and setCurveType().
void Digikam::ImageCurves::setCurveType | ( | int | channel, |
CurveType | type | ||
) |
References CURVE_FREE, CURVE_SMOOTH, and NUM_CHANNELS.
Referenced by curvesReset(), fillFromOtherCurves(), Digikam::CurvesWidget::restoreCurve(), setChannelFromBinary(), setContainer(), setCurveType(), and Digikam::CurvesWidget::updateData().
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().
void Digikam::ImageCurves::setCurveValues | ( | int | channel, |
const QPolygon & | vals | ||
) |
References CLAMP, curvesCalculateCurve(), curvesChannelReset(), fillFromOtherCurves(), getCurveValue(), NUM_CHANNELS, setCurvePoint(), and setCurveValue().
Referenced by setContainer().
void Digikam::ImageCurves::unsetCurvePoint | ( | int | channel, |
int | point | ||
) |
References NUM_CHANNELS, and NUM_POINTS.
|
static |
Curve points have to multiplied with this value for 16 bit images.
Referenced by fillFromOtherCurves(), loadCurvesFromGimpCurvesFile(), Digikam::BWSepiaSettings::loadSettings(), Digikam::CurvesWidget::restoreCurve(), Digikam::BWSepiaSettings::saveAsSettings(), Digikam::CurvesWidget::saveCurve(), and saveCurvesToGimpCurvesFile().
|
static |
Number of channels in a curve.
Referenced by channelToBinary(), curvesCalculateAllCurves(), curvesReset(), fillFromOtherCurves(), getCurvePoint(), getCurvePoints(), getCurvePointX(), getCurvePointY(), getCurveType(), getCurveValue(), getCurveValues(), isCurvePointEnabled(), isLinear(), loadCurvesFromGimpCurvesFile(), Digikam::CurvesBox::resetChannels(), Digikam::CurvesWidget::restoreCurve(), Digikam::CurvesWidget::saveCurve(), saveCurvesToGimpCurvesFile(), setChannelFromBinary(), setCurvePoint(), setCurvePoints(), setCurvePointX(), setCurvePointY(), setCurveType(), setCurveValue(), setCurveValues(), and unsetCurvePoint().
|
static |
The max number of points contained in a curve.
Referenced by channelToBinary(), curvesCalculateCurve(), curvesChannelReset(), fillFromOtherCurves(), getCurvePoint(), getCurvePoints(), getCurvePointX(), getCurvePointY(), Digikam::CurvesContainer::initialize(), isCurvePointEnabled(), isLinear(), loadCurvesFromGimpCurvesFile(), Digikam::BWSepiaSettings::loadSettings(), Digikam::CurvesWidget::mousePressEvent(), Digikam::CurvesWidget::restoreCurve(), Digikam::BWSepiaSettings::saveAsSettings(), Digikam::CurvesWidget::saveCurve(), saveCurvesToGimpCurvesFile(), setChannelFromBinary(), setCurvePoint(), setCurvePoints(), setCurvePointX(), setCurvePointY(), and unsetCurvePoint().