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:
authorYiming Wu <xp8110@outlook.com>2022-06-29 17:54:29 +0300
committerYiming Wu <xp8110@outlook.com>2022-06-29 17:54:29 +0300
commit6dd8ceef2a21f64cbb61a96560c50c162f9dae39 (patch)
treedff82af871b36d7df37213cdcc2a94dfd1ca70b2 /source/blender/blenlib
parent2ac5b55289d361de7fccc9be188b98df358ab932 (diff)
LineArt: Shadow and related functionalities.
This patch includes the full shadow functionality for LineArt: - Light contour and cast shadow lines. - Lit/shaded region selection. - Enclosed light/shadow shape calculation. - Silhouette/anti-silhouette selection. - Intersection priority based on shadow edge identifier. Reviewed By: Sebastian Parborg (zeddb) Differential Revision: https://developer.blender.org/D15109
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/BLI_math_vector.h4
-rw-r--r--source/blender/blenlib/intern/math_vector_inline.c21
2 files changed, 25 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h
index f3283371a3c..0b178064a4c 100644
--- a/source/blender/blenlib/BLI_math_vector.h
+++ b/source/blender/blenlib/BLI_math_vector.h
@@ -40,6 +40,10 @@ MINLINE void swap_v2_v2(float a[2], float b[2]);
MINLINE void swap_v3_v3(float a[3], float b[3]);
MINLINE void swap_v4_v4(float a[4], float b[4]);
+MINLINE void swap_v2_v2_db(double a[2], double b[2]);
+MINLINE void swap_v3_v3_db(double a[3], double b[3]);
+MINLINE void swap_v4_v4_db(double a[4], double b[4]);
+
/* unsigned char */
MINLINE void copy_v2_v2_uchar(unsigned char r[2], const unsigned char a[2]);
diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c
index 3e9443dddb0..27c17a90f5f 100644
--- a/source/blender/blenlib/intern/math_vector_inline.c
+++ b/source/blender/blenlib/intern/math_vector_inline.c
@@ -316,6 +316,27 @@ MINLINE void swap_v4_v4(float a[4], float b[4])
SWAP(float, a[3], b[3]);
}
+MINLINE void swap_v2_v2_db(double a[2], double b[2])
+{
+ SWAP(double, a[0], b[0]);
+ SWAP(double, a[1], b[1]);
+}
+
+MINLINE void swap_v3_v3_db(double a[3], double b[3])
+{
+ SWAP(double, a[0], b[0]);
+ SWAP(double, a[1], b[1]);
+ SWAP(double, a[2], b[2]);
+}
+
+MINLINE void swap_v4_v4_db(double a[4], double b[4])
+{
+ SWAP(double, a[0], b[0]);
+ SWAP(double, a[1], b[1]);
+ SWAP(double, a[2], b[2]);
+ SWAP(double, a[3], b[3]);
+}
+
/* float args -> vec */
MINLINE void copy_v2_fl2(float v[2], float x, float y)