• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

D bindings to the GraphicsMagick library.


Commit MetaInfo

Revisióna3ae2d3a64d93622e9d3c3ff5643f4e14084e954 (tree)
Tiempo2023-07-22 15:00:52
AutorMio <stigma@disr...>
CommiterMio

Log Message

[magickd] Add MagickWand getPrevious/Next Image

Cambiar Resumen

Diferencia incremental

--- a/source/magickd/magick_wand.d
+++ b/source/magickd/magick_wand.d
@@ -28,6 +28,7 @@ import core.stdc.stdlib : free;
2828
2929 import std.string : fromStringz, toStringz;
3030
31+import graphicsmagick_c.magick.api : MagickTrue;
3132 import graphicsmagick_c.magick.error : ExceptionType;
3233 import graphicsmagick_c.wand.magick_wand;
3334 import graphicsmagick_c.wand.magick_wand : cMagickWand = MagickWand;
@@ -283,6 +284,41 @@ package(magickd):
283284 }
284285
285286 ///
287+ /// Returns `true` if the wand has more images when traversing the list
288+ /// in a forward direction.
289+ ///
290+ public bool hasNextImage() nothrow
291+ in {
292+ assert(null !is this.ptr, "Attempting to use a MagickWand that hasn't been created.");
293+ }
294+ do {
295+ return MagickHasNextImage(this.ptr) == MagickTrue ? true : false;
296+ }
297+
298+ ///
299+ /// Returns `true` if the wand has more images when traversing the list
300+ /// in the reverse direction.
301+ ///
302+ public bool hasPreviousImage() nothrow
303+ in {
304+ assert(null !is this.ptr, "Attempting to use a MagickWand that hasn't been created.");
305+ }
306+ do {
307+ return MagickHasPreviousImage(this.ptr) == MagickTrue ? true : false;
308+ }
309+
310+ ///
311+ /// Associate the next image in the image list with a MagickWand.
312+ ///
313+ public void nextImage()
314+ in {
315+ assert(null !is this.ptr, "Attempting to use a MagickWand that hasn't been created.");
316+ }
317+ do {
318+ MagickNextImage(this.ptr);
319+ }
320+
321+ ///
286322 /// Similar to readImage, except the only valid information returned is
287323 /// the image width, height, size, and format.
288324 ///
@@ -299,6 +335,17 @@ package(magickd):
299335 }
300336
301337 ///
338+ /// Selects the previous image associated with a magick wand.
339+ ///
340+ public void previousImage()
341+ in {
342+ assert(null !is this.ptr, "Attempting to use a MagickWand that hasn't been created.");
343+ }
344+ do {
345+ MagickPreviousImage(this.ptr);
346+ }
347+
348+ ///
302349 /// Read an image or an image sequence
303350 ///
304351 public void readImage(string filename)