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:
authorJeroen Bakker <jeroen@blender.org>2021-12-15 13:09:31 +0300
committerJeroen Bakker <jeroen@blender.org>2021-12-15 13:09:31 +0300
commit723fb163436b2d5f1fbe835f84ba018307c30a0e (patch)
treebc8a9898f30c3432e8a3db8a7343b51484fa2559 /source/blender/imbuf/IMB_imbuf.h
parent67b657f07c96c5782ebf603ab36af607168d7acb (diff)
Images: 1,2,3 channel support for transform function.
Added support for 1, 2, 3 float channel source images. Destination images must still be 4 channels.
Diffstat (limited to 'source/blender/imbuf/IMB_imbuf.h')
-rw-r--r--source/blender/imbuf/IMB_imbuf.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/imbuf/IMB_imbuf.h b/source/blender/imbuf/IMB_imbuf.h
index f71eef66a62..a0236b8ec4d 100644
--- a/source/blender/imbuf/IMB_imbuf.h
+++ b/source/blender/imbuf/IMB_imbuf.h
@@ -908,6 +908,25 @@ typedef enum eIMBTransformMode {
IMB_TRANSFORM_MODE_WRAP_REPEAT = 2,
} eIMBTransformMode;
+/**
+ * \brief Transform source image buffer onto destination image buffer using a transform matrix.
+ *
+ * \param src Image buffer to read from.
+ * \param dst Image buffer to write to. rect or rect_float must already be initialized.
+ * - dst buffer must be a 4 channel buffers.
+ * - Only one data type buffer will be used (rect_float has priority over rect)
+ * \param mode Cropping/Wrap repeat effect to apply during transformation.
+ * \param filter Interpolation to use during sampling.
+ * \param transform_matrix Transformation matrix to use.
+ * The given matrix should transform between dst texel space to src texel space.
+ * One unit is one texel.
+ * \param src_crop cropping region how to crop the source buffer. Should only be passed when mode
+ * is set to IMB_TRANSFORM_MODE_CROP_SRC. For any other mode this should be empty.
+ *
+ * During transformation no data/color conversion will happens.
+ * When transforming between float images the number of channels of the source buffer may be
+ * between 1 and 4. When source buffer has one channel the data will be read as a grey scale value.
+ */
void IMB_transform(const struct ImBuf *src,
struct ImBuf *dst,
const eIMBTransformMode mode,