Rename BlendMode.overwrite to BlendMode.replace

This commit is contained in:
Elias Batek 2024-05-06 01:06:18 +02:00
parent 9d0c6e1d0c
commit 511ec3ed6d
1 changed files with 3 additions and 3 deletions

View File

@ -365,7 +365,7 @@ public void alphaBlend(ref Pixel pxTarget, const Pixel pxSource) @trusted {
enum BlendMode { enum BlendMode {
none = 0, none = 0,
overwrite = none, replace = none,
normal = 1, normal = 1,
alpha = normal, alpha = normal,
@ -385,7 +385,7 @@ enum blendNormal = BlendMode.normal;
/++ /++
Blends pixel `source` into pixel `target`. Blends pixel `source` into pixel `target`.
+/ +/
void blendPixel(BlendMode mode)(ref Pixel target, const Pixel source) if (mode == BlendMode.overwrite) { void blendPixel(BlendMode mode)(ref Pixel target, const Pixel source) if (mode == BlendMode.replace) {
target = source; target = source;
} }
@ -425,7 +425,7 @@ void blendPixel(BlendMode mode)(ref Pixel target, const Pixel source) if (mode =
+/ +/
void blendPixels(BlendMode mode)(scope Pixel[] target, scope const Pixel[] source) @trusted void blendPixels(BlendMode mode)(scope Pixel[] target, scope const Pixel[] source) @trusted
in (source.length == target.length) { in (source.length == target.length) {
static if (mode == BlendMode.overwrite) { static if (mode == BlendMode.replace) {
target.ptr[0 .. target.length] = source.ptr[0 .. target.length]; target.ptr[0 .. target.length] = source.ptr[0 .. target.length];
} else { } else {
// better error message in case its not implemented // better error message in case its not implemented