From c467022db72df2e36c7c6a434c4301b10c555134 Mon Sep 17 00:00:00 2001 From: Mio Date: Sun, 23 Jul 2023 14:18:43 +1000 Subject: [PATCH] [magickd] Add PixelWand color setters --- source/magickd/pixel_wand.d | 116 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 115 insertions(+), 1 deletion(-) diff --git a/source/magickd/pixel_wand.d b/source/magickd/pixel_wand.d index 961223a..6b9a55d 100644 --- a/source/magickd/pixel_wand.d +++ b/source/magickd/pixel_wand.d @@ -25,7 +25,7 @@ module magickd.pixel_wand; import std.string : toStringz; -import graphicsmagick_c.magick.image : Quantum; +import graphicsmagick_c.magick.image : PixelPacket, Quantum; import graphicsmagick_c.wand.pixel_wand; import graphicsmagick_c.wand.pixel_wand : cPixelWand = PixelWand; @@ -147,6 +147,54 @@ package(magickd): } /// + /// Sets the normalized cyan color of the pixel wand. + /// + @property public void cyan(double cyan_) + { + this.setCyan(cyan_); + } + + /// + /// Sets the normalized green color of the pixel wand. + /// + @property public void green(double green_) + { + this.setGreen(green_); + } + + /// + /// Sets the normalized magenta color of the pixel wand. + /// + @property public void magenta(double magenta_) + { + this.setMagenta(magenta_); + } + + /// + /// Sets the normalized opacity of the pixel wand. + /// + @property public void opacity(double opacity_) + { + this.setOpacity(opacity_); + } + + /// + /// Sets the normalized red color of the pixel wand. + /// + @property public void red(double red_) + { + this.setRed(red_); + } + + /// + /// Sets the normalized yellow color of the pixel wand. + /// + @property public void yellow(double yellow_) + { + this.setYellow(yellow_); + } + + /// /// Sets the color of the pixel wand with a string. /// /// ```d @@ -551,6 +599,72 @@ package(magickd): } /// + /// Sets the normalized cyan color of the pixel wand. + /// + public void setCyan(double cyan_) + in { + assert(null !is this.ptr, "Attempting to use a PixelWand that hasn't been created."); + } + do { + PixelSetCyan(this.ptr, cyan_); + } + + /// + /// Sets the normalized green color of the pixel wand. + /// + public void setGreen(double green_) + in { + assert(null !is this.ptr, "Attempting to use a PixelWand that hasn't been created."); + } + do { + PixelSetGreen(this.ptr, green_); + } + + /// + /// Sets the normalized magenta color of the pixel wand. + /// + public void setMagenta(double magenta_) + in { + assert(null !is this.ptr, "Attempting to use a PixelWand that hasn't been created."); + } + do { + PixelSetMagenta(this.ptr, magenta_); + } + + /// + /// Sets the normalized opacity of the pixel wand. + /// + public void setOpacity(double opacity_) + in { + assert(null !is this.ptr, "Attempting to use a PixelWand that hasn't been created."); + } + do { + PixelSetOpacity(this.ptr, opacity_); + } + + /// + /// Sets the normalized red color of the pixel wand. + /// + public void setRed(double red_) + in { + assert(null !is this.ptr, "Attempting to use a PixelWand that hasn't been created."); + } + do { + PixelSetRed(this.ptr, red_); + } + + /// + /// Sets the normalized yellow color of the pixel wand. + /// + public void setYellow(double yellow_) + in { + assert(null !is this.ptr, "Attempting to use a PixelWand that hasn't been created."); + } + do { + PixelSetYellow(this.ptr, yellow_); + } + + /// /// Sets the color of the pixel wand with a string. /// /// ```d -- 2.11.4.GIT