diff options
author | Omar Emara <mail@OmarEmara.dev> | 2022-09-09 14:15:01 +0300 |
---|---|---|
committer | Omar Emara <mail@OmarEmara.dev> | 2022-09-09 14:15:01 +0300 |
commit | ac66a819c14265ee3e0f48e4cb54b6c10b7fb064 (patch) | |
tree | 327467ab316792461f11ecf242a58466596dfccc /source/blender/blenlib/BLI_float3x3.hh | |
parent | 77a4bb02cc99bfd581c6bb9e35ca3fe53389915e (diff) |
Realtime Compositor: Implement pixelate node
This patch implements the pixelate node for the realtime compositor.
Differential Revision: https://developer.blender.org/D15662
Reviewed By: Clement Foucault
Diffstat (limited to 'source/blender/blenlib/BLI_float3x3.hh')
-rw-r--r-- | source/blender/blenlib/BLI_float3x3.hh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_float3x3.hh b/source/blender/blenlib/BLI_float3x3.hh index 6a9e7dd04f0..178973c155d 100644 --- a/source/blender/blenlib/BLI_float3x3.hh +++ b/source/blender/blenlib/BLI_float3x3.hh @@ -63,6 +63,15 @@ struct float3x3 { return result; } + static float3x3 from_scale(const float2 scale) + { + float3x3 result = zero(); + result.values[0][0] = scale.x; + result.values[1][1] = scale.y; + result.values[2][2] = 1.0f; + return result; + } + static float3x3 from_translation_rotation_scale(const float2 translation, float rotation, const float2 scale) @@ -190,6 +199,13 @@ struct float3x3 { return result; } + float2 scale_2d() const + { + float2 scale; + mat3_to_size_2d(scale, values); + return scale; + } + friend bool operator==(const float3x3 &a, const float3x3 &b) { return equals_m3m3(a.values, b.values); |