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

This structure represents an optional limited range of values that be handled by KisScalarKeyframeChannel. More...

#include <kis_scalar_keyframe_channel.h>

Public Member Functions

qreal clamp (qreal value)
 
 ScalarKeyframeLimits (qreal x, qreal y)
 

Public Attributes

qreal lower
 
qreal upper
 

Detailed Description

This structure represents an optional limited range of values that be handled by KisScalarKeyframeChannel.

Definition at line 15 of file kis_scalar_keyframe_channel.h.

Constructor & Destructor Documentation

◆ ScalarKeyframeLimits()

ScalarKeyframeLimits::ScalarKeyframeLimits ( qreal x,
qreal y )
inline

Definition at line 19 of file kis_scalar_keyframe_channel.h.

19 {
20 KIS_ASSERT(x != y);
21
22 // Supports (high, low) or (low, high) assignment.
23 lower = x < y ? x : y;
24 upper = x > y ? x : y;
25 }
#define KIS_ASSERT(cond)
Definition kis_assert.h:33

References KIS_ASSERT, lower, and upper.

Member Function Documentation

◆ clamp()

qreal ScalarKeyframeLimits::clamp ( qreal value)
inline

Clamp input value within limits.

Definition at line 28 of file kis_scalar_keyframe_channel.h.

28 {
29 value = value < lower ? lower : value;
30 value = value > upper ? upper : value;
31 return value;
32 }
float value(const T *src, size_t ch)

References lower, upper, and value().

Member Data Documentation

◆ lower

qreal ScalarKeyframeLimits::lower

Definition at line 16 of file kis_scalar_keyframe_channel.h.

◆ upper

qreal ScalarKeyframeLimits::upper

Definition at line 17 of file kis_scalar_keyframe_channel.h.


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