Krita Source Code Documentation
Loading...
Searching...
No Matches
ContrastOp Struct Reference

Public Member Functions

 ContrastOp (qreal contrast)
 
int operator() (int iValue)
 

Static Public Attributes

static const bool supportsCaching = false
 

Private Attributes

qreal m_contrast
 

Detailed Description

Definition at line 96 of file kis_ls_bevel_emboss_filter.cpp.

Constructor & Destructor Documentation

◆ ContrastOp()

ContrastOp::ContrastOp ( qreal contrast)
inline

Definition at line 99 of file kis_ls_bevel_emboss_filter.cpp.

100 : m_contrast(contrast)
101 {
102 }

Member Function Documentation

◆ operator()()

int ContrastOp::operator() ( int iValue)
inline

Definition at line 104 of file kis_ls_bevel_emboss_filter.cpp.

104 {
105 qreal value = qreal(iValue - 127) / 127.0;
106
107 qreal slant = std::tan ((m_contrast + 1) * M_PI_4);
108 value = (value - 0.5) * slant + 0.5;
109
110 return qRound(value * 255.0);
111 }
float value(const T *src, size_t ch)

References m_contrast, and value().

Member Data Documentation

◆ m_contrast

qreal ContrastOp::m_contrast
private

Definition at line 114 of file kis_ls_bevel_emboss_filter.cpp.

◆ supportsCaching

const bool ContrastOp::supportsCaching = false
static

Definition at line 97 of file kis_ls_bevel_emboss_filter.cpp.


The documentation for this struct was generated from the following file: