Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/compositor/operations/COM_ScaleOperation.h')
-rw-r--r--source/blender/compositor/operations/COM_ScaleOperation.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/compositor/operations/COM_ScaleOperation.h b/source/blender/compositor/operations/COM_ScaleOperation.h
index 62a2cabc8e6..65762d1ce62 100644
--- a/source/blender/compositor/operations/COM_ScaleOperation.h
+++ b/source/blender/compositor/operations/COM_ScaleOperation.h
@@ -46,6 +46,9 @@ class BaseScaleOperation : public MultiThreadedOperation {
};
class ScaleOperation : public BaseScaleOperation {
+ public:
+ static constexpr float MIN_SCALE = 0.0001f;
+
protected:
SocketReader *m_inputOperation;
SocketReader *m_inputXOperation;
@@ -57,6 +60,12 @@ class ScaleOperation : public BaseScaleOperation {
ScaleOperation();
ScaleOperation(DataType data_type);
+ static float scale_coord(const float coord, const float center, const float relative_scale)
+ {
+ return center + (coord - center) / MAX2(relative_scale, MIN_SCALE);
+ }
+ static void scale_area(rcti &rect, float center_x, float center_y, float scale_x, float scale_y);
+
void init_data() override;
void initExecution() override;
void deinitExecution() override;