D bindings to the GraphicsMagick library.
Revisão | a3ae2d3a64d93622e9d3c3ff5643f4e14084e954 (tree) |
---|---|
Hora | 2023-07-22 15:00:52 |
Autor | Mio <stigma@disr...> |
Commiter | Mio |
[magickd] Add MagickWand getPrevious/Next Image
@@ -28,6 +28,7 @@ import core.stdc.stdlib : free; | ||
28 | 28 | |
29 | 29 | import std.string : fromStringz, toStringz; |
30 | 30 | |
31 | +import graphicsmagick_c.magick.api : MagickTrue; | |
31 | 32 | import graphicsmagick_c.magick.error : ExceptionType; |
32 | 33 | import graphicsmagick_c.wand.magick_wand; |
33 | 34 | import graphicsmagick_c.wand.magick_wand : cMagickWand = MagickWand; |
@@ -283,6 +284,41 @@ package(magickd): | ||
283 | 284 | } |
284 | 285 | |
285 | 286 | /// |
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 | + /// | |
286 | 322 | /// Similar to readImage, except the only valid information returned is |
287 | 323 | /// the image width, height, size, and format. |
288 | 324 | /// |
@@ -299,6 +335,17 @@ package(magickd): | ||
299 | 335 | } |
300 | 336 | |
301 | 337 | /// |
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 | + /// | |
302 | 349 | /// Read an image or an image sequence |
303 | 350 | /// |
304 | 351 | public void readImage(string filename) |