template<typename _channel_type_, typename traits>
class KisHSVCurveAdjustment< _channel_type_, traits >
Definition at line 638 of file kis_hsv_adjustment.cpp.
template<typename _channel_type_ , typename traits >
Get the parameter id for a parameter name
Reimplemented from KoColorTransformation.
Definition at line 657 of file kis_hsv_adjustment.cpp.
658 {
659 if (name == "curve") {
661 } else if (name == "channel") {
663 } else if (name == "driverChannel") {
665 } else if (name == "relative") {
667 } else if (name == "lumaRed") {
669 } else if (name == "lumaGreen") {
671 } else if (name == "lumaBlue") {
673 }
674 return -1;
675 }
References KisHSVCurveAdjustment< _channel_type_, traits >::PAR_CHANNEL, KisHSVCurveAdjustment< _channel_type_, traits >::PAR_CURVE, KisHSVCurveAdjustment< _channel_type_, traits >::PAR_DRIVER_CHANNEL, KisHSVCurveAdjustment< _channel_type_, traits >::PAR_LUMA_B, KisHSVCurveAdjustment< _channel_type_, traits >::PAR_LUMA_G, KisHSVCurveAdjustment< _channel_type_, traits >::PAR_LUMA_R, and KisHSVCurveAdjustment< _channel_type_, traits >::PAR_RELATIVE.
template<typename _channel_type_ , typename traits >
curve: adjustment curve as QVector<quin16> channel: which channel to adjust. See KisHSVCurve::ColorChannel. driverChannel: which channel to use as source for adjustments. relative: false: use curve for direct lookup. true: add adjustment to original. In this mode, the curve range is mapped to -1.0 to 1.0 luma Red/Green/Blue: Used for luma calculations.
Reimplemented from KoColorTransformation.
Definition at line 686 of file kis_hsv_adjustment.cpp.
687 {
688 switch(id)
689 {
692 break;
695 int channel = parameter.toInt();
697
700 } else {
702 }
703 } break;
706 break;
709 break;
712 break;
715 break;
716 default:
718 }
719 }
#define KIS_ASSERT_RECOVER_RETURN(cond)
#define KIS_ASSERT_RECOVER_NOOP(cond)
References KisHSVCurve::ChannelCount, KIS_ASSERT_RECOVER_NOOP, KIS_ASSERT_RECOVER_RETURN, KisHSVCurveAdjustment< _channel_type_, traits >::m_channel, KisHSVCurveAdjustment< _channel_type_, traits >::m_curve, KisHSVCurveAdjustment< _channel_type_, traits >::m_driverChannel, KisHSVCurveAdjustment< _channel_type_, traits >::m_lumaBlue, KisHSVCurveAdjustment< _channel_type_, traits >::m_lumaGreen, KisHSVCurveAdjustment< _channel_type_, traits >::m_lumaRed, KisHSVCurveAdjustment< _channel_type_, traits >::m_relative, KisHSVCurveAdjustment< _channel_type_, traits >::PAR_CHANNEL, KisHSVCurveAdjustment< _channel_type_, traits >::PAR_CURVE, KisHSVCurveAdjustment< _channel_type_, traits >::PAR_DRIVER_CHANNEL, KisHSVCurveAdjustment< _channel_type_, traits >::PAR_LUMA_B, KisHSVCurveAdjustment< _channel_type_, traits >::PAR_LUMA_G, KisHSVCurveAdjustment< _channel_type_, traits >::PAR_LUMA_R, and KisHSVCurveAdjustment< _channel_type_, traits >::PAR_RELATIVE.
template<typename _channel_type_ , typename traits >
This function apply the transformation on a given number of pixels.
- Parameters
-
| src | a pointer to the source pixels |
| dst | a pointer to the destination pixels |
| nPixels | the number of pixels |
This function may or may not be thread safe. You need to create one KoColorTransformation per thread.
Implements KoColorTransformation.
Definition at line 722 of file kis_hsv_adjustment.cpp.
723 {
727
729
731
732
736 float &
r = component[traits::red_pos];
737 float &g = component[traits::green_pos];
738 float &
b = component[traits::blue_pos];
740
741 while (nPixels > 0) {
746
748
749
751
753
755
756 adjustment = 2.0f * adjustment - 1.0f;
757
760 g += adjustment;
762 } else {
764 }
765 } else {
767 r =
b = g = adjustment;
768 } else {
770 }
771 }
772
774 if (h > 360)
h -= 360;
776
779 }
780
781 clamp< _channel_type_ >(&r, &g, &b);
783
788
789 --nPixels;
791 ++dst;
792 }
793 }
void RGBToHSV(float r, float g, float b, float *h, float *s, float *v)
void HSVToRGB(float h, float s, float v, float *r, float *g, float *b)
const float SCALE_FROM_16BIT
float lookupComponent(float x, float max) const
#define SCALE_FROM_FLOAT(v)
#define SCALE_TO_FLOAT(v)
References KisHSVCurve::AllColors, KisHSVCurve::Alpha, KisHSVCurve::ChannelCount, FLOAT_CLAMP, HSVToRGB(), KisHSVCurve::Hue, KisHSVCurveAdjustment< _channel_type_, traits >::lookupComponent(), KisHSVCurveAdjustment< _channel_type_, traits >::m_channel, KisHSVCurveAdjustment< _channel_type_, traits >::m_curve, KisHSVCurveAdjustment< _channel_type_, traits >::m_driverChannel, KisHSVCurveAdjustment< _channel_type_, traits >::m_relative, RGBToHSV(), KisHSVCurve::Saturation, KisHSVCurveAdjustment< _channel_type_, traits >::SCALE_FROM_16BIT, SCALE_FROM_FLOAT, SCALE_TO_FLOAT, v, and KisHSVCurve::Value.