1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
|
/**
* Copyright: Mike Wey 2011
* License: To be determined
* Authors: Mike Wey
*/
module dmagick.Image;
import std.conv;
import std.math;
import std.string;
import core.stdc.string;
import core.sys.posix.sys.types;
import dmagick.Color;
import dmagick.Exception;
import dmagick.Geometry;
import dmagick.Options;
import dmagick.Utils;
import dmagick.c.annotate;
import dmagick.c.attribute;
import dmagick.c.blob;
import dmagick.c.constitute;
import dmagick.c.colormap;
import dmagick.c.colorspace;
import dmagick.c.composite;
import dmagick.c.compress;
import dmagick.c.draw;
import dmagick.c.effect;
import dmagick.c.enhance;
import dmagick.c.exception;
import dmagick.c.geometry;
import dmagick.c.image;
import dmagick.c.layer;
import dmagick.c.magick;
import dmagick.c.magickString;
import dmagick.c.magickType;
import dmagick.c.memory;
import dmagick.c.pixel;
import dmagick.c.profile;
import dmagick.c.quantum;
import dmagick.c.resample;
import dmagick.c.resize;
import dmagick.c.resource;
/**
* The image
*/
class Image
{
alias dmagick.c.image.Image MagickCoreImage;
alias RefCounted!( DestroyImage, MagickCoreImage ) ImageRef;
ImageRef imageRef;
Options options; ///The options for this image.
///
this()
{
options = new Options();
imageRef = ImageRef(AcquireImage(options.imageInfo));
}
this(MagickCoreImage* image)
{
options = new Options();
imageRef = ImageRef(image);
}
/**
* Construct an Image by reading from the file or
* URL specified by filename.
*/
this(string filename)
{
options = new Options();
read(filename);
}
/**
* Construct a blank image with the specified color.
*/
this(Geometry size, Color color)
{
options = new Options();
options.size = size;
//Use read to create a cnavas with the spacified color.
read( "canvas:"~ color.toString() );
}
/**
* Construct an image from an in-memory blob.
* The Blob size, depth and magick format may also be specified.
*
* Some image formats require size to be specified,
* the default depth Imagemagick uses is the Quantum size
* it's compiled with. If it doesn't match the depth of the image
* it may need to be specified.
*
* Imagemagick can usualy detect the image format, when the
* format can't be detected a magick format must be specified.
*/
this(void[] blob)
{
options = new Options();
read(blob);
}
///ditto
this(void[] blob, Geometry size)
{
options = new Options();
read(blob, size);
}
///ditto
this(void[] blob, Geometry size, size_t depth)
{
options = new Options();
read(blob, size, depth);
}
///ditto
this(void[] blob, Geometry size, size_t depth, string magick)
{
options = new Options();
read(blob, size, depth, magick);
}
///ditto
this(void[] blob, Geometry size, string magick)
{
options = new Options();
read(blob, size, magick);
}
/**
* Constructs an image from an array of pixels.
*
* Params:
* width = The number of columns in the image.
* height = The number of rows in the image.
* map = A string describing the expected ordering
* of the pixel array. It can be any combination
* or order of R = red, G = green, B = blue, A = alpha
* , C = cyan, Y = yellow, M = magenta, K = black,
* or I = intensity (for grayscale).
* storage = The pixel Staroage type (CharPixel,
* ShortPixel, IntegerPixel, FloatPixel, or DoublePixel).
* pixels = The pixel data.
*/
this(size_t columns, size_t rows, string map, StorageType storage, void[] pixels)
{
options = new Options();
read(columns, rows, map, storage, pixels);
}
/**
* Adaptively blurs the image by blurring more intensely near
* image edges and less intensely far from edges.
* The adaptiveBlur method blurs the image with a Gaussian operator
* of the given radius and standard deviation (sigma).
* For reasonable results, radius should be larger than sigma.
* Use a radius of 0 and adaptive_blur selects a suitable radius for you.
*
* Params:
* radius = The radius of the Gaussian in pixels,
* not counting the center pixel.
* sigma = The standard deviation of the Laplacian, in pixels.
* channel = If no channels are specified, blurs all the channels.
*/
void adaptiveBlur(double radius = 0, double sigma = 1, ChannelType channel = ChannelType.DefaultChannels)
{
ExceptionInfo* exception = AcquireExceptionInfo();
MagickCoreImage* image =
AdaptiveBlurImageChannel(imageRef, channel, radius, sigma, exception);
DMagickException.throwException(exception);
DestroyExceptionInfo(exception);
imageRef = ImageRef(image);
}
/**
* adaptiveResize uses the special Mesh Interpolation method
* to resize images. Basically adaptiveResize avoids the excessive
* blurring that resize can produce with sharp color changes.
* This works well for slight image size adjustments and in
* particularly for magnification, And especially with images
* with sharp color changes. But when images are enlarged or reduced
* by more than 50% it will start to produce aliasing,
* and Moiré effects in the results.
*/
void adaptiveResize(Geometry size)
{
ssize_t x, y;
size_t width = columns;
size_t height = rows;
ExceptionInfo* exception = AcquireExceptionInfo();
ParseMetaGeometry(toStringz(size.toString), &x, &y, &width, &height);
MagickCoreImage* image =
AdaptiveResizeImage(imageRef, width, height, exception);
DMagickException.throwException(exception);
DestroyExceptionInfo(exception);
imageRef = ImageRef(image);
}
/**
* Returns the TypeMetric class witch provides the information
* regarding font metrics such as ascent, descent, text width,
* text height, and maximum horizontal advance. The units of
* these font metrics are in pixels, and that the metrics are
* dependent on the current Image font (default Ghostscript's
* "Helvetica"), pointsize (default 12 points), and x/y resolution
* (default 72 DPI) settings.
*
* The pixel units may be converted to points (the standard
* resolution-independent measure used by the typesetting industry)
* via the following equation:
* ----------------------------------
* sizePoints = (sizePixels * 72)/resolution
* ----------------------------------
* where resolution is in dots-per-inch (DPI). This means that at the
* default image resolution, there is one pixel per point.
* See_Also:
* $(LINK2 http://freetype.sourceforge.net/freetype2/docs/glyphs/index.html
* FreeType Glyph Conventions) for a detailed description of
* font metrics related issues.
*/
TypeMetric getTypeMetrics(string text)
{
TypeMetric metric;
DrawInfo* drawInfo = options.drawInfo;
copyString(drawInfo.text, text);
GetTypeMetrics(imageRef, drawInfo, &metric);
copyString(drawInfo.text, null);
return metric;
}
/**
* Read an Image by reading from the file or
* URL specified by filename.
*/
void read(string filename)
{
options.filename = filename;
ExceptionInfo* exception = AcquireExceptionInfo();
MagickCoreImage* image = ReadImage(options.imageInfo, exception);
DMagickException.throwException(exception);
DestroyExceptionInfo(exception);
imageRef = ImageRef(image);
}
/**
* Read an Image by reading from the file or
* URL specified by filename with the specified size.
* Usefull for images that don't specify their size.
*/
void read(string filename, Geometry size)
{
options.size = size;
read(filename);
}
/**
* Reads an image from an in-memory blob.
* The Blob size, depth and magick format may also be specified.
*
* Some image formats require size to be specified,
* the default depth Imagemagick uses is the Quantum size
* it's compiled with. If it doesn't match the depth of the image
* it may need to be specified.
*
* Imagemagick can usualy detect the image format, when the
* format can't be detected a magick format must be specified.
*/
void read(void[] blob)
{
ExceptionInfo* exception = AcquireExceptionInfo();
MagickCoreImage* image =
BlobToImage(options.imageInfo, blob.ptr, blob.length, exception);
DMagickException.throwException(exception);
DestroyExceptionInfo(exception);
imageRef = ImageRef(image);
}
///ditto
void read(void[] blob, Geometry size)
{
options.size = size;
read(blob);
}
///ditto
void read(void[] blob, Geometry size, size_t depth)
{
options.size = size;
options.depth = depth;
read(blob);
}
///ditto
void read(void[] blob, Geometry size, size_t depth, string magick)
{
options.size = size;
options.depth = depth;
options.magick = magick;
//Also set the filename to the image format
options.filename = magick ~":";
read(blob);
}
///ditto
void read(void[] blob, Geometry size, string magick)
{
options.size = size;
options.magick = magick;
//Also set the filename to the image format
options.filename = magick ~":";
read(blob);
}
/**
* Reads an image from an array of pixels.
*
* Params:
* width = The number of columns in the image.
* height = The number of rows in the image.
* map = A string describing the expected ordering
* of the pixel array. It can be any combination
* or order of R = red, G = green, B = blue, A = alpha
* , C = cyan, Y = yellow, M = magenta, K = black,
* or I = intensity (for grayscale).
* storage = The pixel Staroage type (CharPixel,
* ShortPixel, IntegerPixel, FloatPixel, or DoublePixel).
* pixels = The pixel data.
*/
void read(size_t width, size_t height, string map, StorageType storage, void[] pixels)
{
ExceptionInfo* exception = AcquireExceptionInfo();
MagickCoreImage* image =
ConstituteImage(width, height, toStringz(map), storage, pixels.ptr, exception);
DMagickException.throwException(exception);
DestroyExceptionInfo(exception);
imageRef = ImageRef(image);
}
void animationDelay(size_t delay)
{
imageRef.delay = delay;
}
size_t annimationDelay() const
{
return imageRef.delay;
}
void animationIterations(size_t iterations)
{
imageRef.iterations = iterations;
}
size_t animationIterations() const
{
return imageRef.iterations;
}
/**
* Set the image background color. The default is "white".
*/
void backgroundColor(string color)
{
backgroundColor = new Color(color);
}
///ditto
void backgroundColor(Color color)
{
options.backgroundColor(color);
imageRef.background_color = color.pixelPacket;
}
///ditto
Color backgroundColor() const
{
return options.backgroundColor;
}
/**
* Set the image border color. The default is "#dfdfdf".
*/
void borderColor(string color)
{
borderColor = new Color(color);
}
///ditto
void borderColor(Color color)
{
options.borderColor = color;
imageRef.border_color = color.pixelPacket;
}
///ditto
Color borderColor() const
{
return options.borderColor;
}
Geometry boundingBox() const
{
ExceptionInfo* exception = AcquireExceptionInfo();
RectangleInfo box = GetImageBoundingBox(imageRef, exception);
DMagickException.throwException(exception);
DestroyExceptionInfo(exception);
return Geometry(box);
}
static void cacheThreshold(size_t threshold)
{
SetMagickResourceLimit(ResourceType.MemoryResource, threshold);
}
//TODO: Is this a property?
void channelDepth(ChannelType channel, size_t depth)
{
SetImageChannelDepth(imageRef, channel, depth);
}
size_t channelDepth(ChannelType channel) const
{
ExceptionInfo* exception = AcquireExceptionInfo();
size_t depth = GetImageChannelDepth(imageRef, channel, exception);
DMagickException.throwException(exception);
DestroyExceptionInfo(exception);
return depth;
}
void chromaticity(ChromaticityInfo chroma)
{
imageRef.chromaticity = chroma;
}
ChromaticityInfo chromaticity() const
{
return imageRef.chromaticity;
}
//TODO: Should setting the classType convert the image.
void classType(ClassType type)
{
imageRef.storage_class = type;
}
ClassType classType() const
{
return imageRef.storage_class;
}
void clipMask(const(Image) image)
{
if ( image is null )
{
SetImageClipMask(imageRef, null);
return;
}
//Throw a chatchable exception when the size differs.
if ( image.columns != columns || image.rows != rows )
throw new ImageException("image size differs");
SetImageClipMask(imageRef, image.imageRef);
}
Image clipMask() const
{
ExceptionInfo* exception = AcquireExceptionInfo();
MagickCoreImage* image = CloneImage(imageRef.clip_mask, 0, 0, true, exception);
DMagickException.throwException(exception);
DestroyExceptionInfo(exception);
return new Image(image);
}
auto colormap()
{
struct Colormap
{
Image img;
this(Image img)
{
this.img = img;
}
Color opIndex(uint index)
{
if ( index >= img.colormapSize )
throw new Exception("Index out of bounds");
return new Color(img.imageRef.colormap[index]);
}
void opIndexAssign(Color value, uint index)
{
if ( index >= img.colormapSize )
throw new Exception("Index out of bounds");
img.imageRef.colormap[index] = value.pixelPacket;
}
void opOpAssign(string op)(Color color) if ( op == "~" )
{
img.colormapSize = img.colormapSize + 1;
this[img.colormapSize] = color;
}
void opOpAssign(string op)(Color[] colors) if ( op == "~" )
{
uint oldSize = img.colormapSize;
img.colormapSize = oldSize + colors.length;
foreach ( i; oldSize..img.colormapSize)
{
this[i] = colors[i];
}
}
uint size()
{
return img.colormapSize;
}
void size(uint s)
{
img.colormapSize = s;
}
}
return Colormap(this);
}
void colormapSize(uint size)
{
if ( size > MaxColormapSize )
throw new OptionException(
"the size of the colormap can't exceed MaxColormapSize");
if ( imageRef.colormap is null )
{
AcquireImageColormap(imageRef, size);
imageRef.colors = 0;
}
else
{
imageRef.colormap = cast(PixelPacket*)
ResizeMagickMemory(imageRef.colormap, size * PixelPacket.sizeof);
}
//Initialize the colors as black.
foreach ( i; imageRef.colors .. size )
{
imageRef.colormap[i].blue = 0;
imageRef.colormap[i].green = 0;
imageRef.colormap[i].red = 0;
imageRef.colormap[i].opacity = 0;
}
imageRef.colors = size;
}
uint colormapSize() const
{
return cast(uint)imageRef.colors;
}
void colorspace(ColorspaceType type)
{
TransformImageColorspace(imageRef, type);
options.colorspace = type;
}
ColorspaceType colorspace() const
{
return imageRef.colorspace;
}
size_t columns() const
{
return imageRef.columns;
}
void compose(CompositeOperator op)
{
imageRef.compose = op;
}
CompositeOperator compose() const
{
return imageRef.compose;
}
void compression(CompressionType type)
{
imageRef.compression = type;
options.compression = type;
}
CompressionType compression() const
{
return imageRef.compression;
}
void density(Geometry value)
{
options.density = value;
imageRef.x_resolution = value.width;
imageRef.y_resolution = ( value.width != 0 ) ? value.width : value.height;
}
Geometry density() const
{
ssize_t width = cast(ssize_t)rndtol(imageRef.x_resolution);
ssize_t height = cast(ssize_t)rndtol(imageRef.y_resolution);
return Geometry(width, height);
}
void depth(size_t value)
{
if ( value > MagickQuantumDepth)
value = MagickQuantumDepth;
imageRef.depth = value;
options.depth = value;
}
size_t depth() const
{
return imageRef.depth;
}
string directory() const
{
return to!(string)(imageRef.directory);
}
void endian(EndianType type)
{
imageRef.endian = type;
options.endian = type;
}
EndianType endian() const
{
return imageRef.endian;
}
void exifProfile(void[] blob)
{
StringInfo* profile = AcquireStringInfo(blob.length);
SetStringInfoDatum(profile, cast(ubyte*)blob.ptr);
SetImageProfile(imageRef, "exif", profile);
DestroyStringInfo(profile);
}
void[] exifProfile() const
{
const(StringInfo)* profile = GetImageProfile(imageRef, "exif");
if ( profile is null )
return null;
return GetStringInfoDatum(profile)[0 .. GetStringInfoLength(profile)];
}
void filename(string str)
{
copyString(imageRef.filename, str);
options.filename = str;
}
string filename() const
{
return options.filename;
}
MagickSizeType fileSize() const
{
return GetBlobSize(imageRef);
}
void filter(FilterTypes type)
{
imageRef.filter = type;
}
FilterTypes filter() const
{
return imageRef.filter;
}
string format() const
{
ExceptionInfo* exception = AcquireExceptionInfo();
const(MagickInfo)* info = GetMagickInfo(imageRef.magick.ptr, exception);
DMagickException.throwException(exception);
DestroyExceptionInfo(exception);
return to!(string)( info.description );
}
/**
* Colors within this distance are considered equal.
* A number of algorithms search for a target color.
* By default the color must be exact. Use this option to match
* colors that are close to the target color in RGB space.
*/
void fuzz(double f)
{
options.fuzz = f;
imageRef.fuzz = f;
}
///ditto
double fuzz() const
{
return options.fuzz;
}
/**
* GammaImage() gamma-corrects a particular image channel.
* The same image viewed on different devices will have perceptual
* differences in the way the image's intensities are represented
* on the screen. Specify individual gamma levels for the red,
* green, and blue channels, or adjust all three with the gamma
* parameter. Values typically range from 0.8 to 2.3.
*
* You can also reduce the influence of a particular channel
* with a gamma value of 0.
*/
void gamma(double value)
{
GammaImageChannel(imageRef,
( ChannelType.RedChannel | ChannelType.GreenChannel | ChannelType.BlueChannel ),
value);
}
///ditto
void gamma(double red, double green, double blue)
{
GammaImageChannel(imageRef, ChannelType.RedChannel, red);
GammaImageChannel(imageRef, ChannelType.GreenChannel, green);
GammaImageChannel(imageRef, ChannelType.BlueChannel, blue);
}
/**
* Gamma level of the image. The same color image displayed on
* two different workstations may look different due to differences
* in the display monitor. Use gamma correction to adjust for this
* color difference.
*/
double gamma() const
{
return imageRef.gamma;
}
void geometry(string str)
{
copyString(imageRef.geometry, str);
}
///ditto
void geometry(Geometry value)
{
geometry(value.toString());
}
///ditto
Geometry geometry() const
{
return Geometry( to!(string)(imageRef.geometry) );
}
void gifDisposeMethod(DisposeType type)
{
imageRef.dispose = type;
}
DisposeType gifDisposeMethod() const
{
return imageRef.dispose;
}
void iccColorProfile(void[] blob)
{
//TODO: implement profile function.
throw new Exception("void iccColorProfile(void[] blob) not implemented");
//profile("icm", blob)
}
void[] iccColorProfile() const
{
const(StringInfo)* profile = GetImageProfile(imageRef, "icm");
if ( profile is null )
return null;
return GetStringInfoDatum(profile)[0 .. GetStringInfoLength(profile)];
}
/**
* Specify the _type of interlacing scheme for raw image formats
* such as RGB or YUV. NoInterlace means do not _interlace,
* LineInterlace uses scanline interlacing, and PlaneInterlace
* uses plane interlacing. PartitionInterlace is like PlaneInterlace
* except the different planes are saved to individual files
* (e.g. image.R, image.G, and image.B). Use LineInterlace or
* PlaneInterlace to create an interlaced GIF or
* progressive JPEG image. The default is NoInterlace.
*/
void interlace(InterlaceType type)
{
imageRef.interlace = type;
options.interlace = type;
}
///ditto
InterlaceType interlace() const
{
return imageRef.interlace;
}
void iptcProfile(void[] blob)
{
//TODO: implement profile function.
throw new Exception("void iccColorProfile(void[] blob) not implemented");
//profile("iptc", blob)
}
void[] iptcProfile() const
{
const(StringInfo)* profile = GetImageProfile(imageRef, "iptc");
if ( profile is null )
return null;
return GetStringInfoDatum(profile)[0 .. GetStringInfoLength(profile)];
}
/**
* Image format (e.g. "GIF")
*/
void magick(string str)
{
copyString(imageRef.magick, str);
options.magick = str;
}
///ditto
string magick() const
{
if ( imageRef.magick !is null )
return imageRef.magick[0 .. strlen(imageRef.magick.ptr)].idup;
return options.magick;
}
void matte(bool flag)
{
// If the image has a matte channel, and it's
// not desired set the matte channel to fully opaque.
if ( !flag && imageRef.matte )
SetImageOpacity(imageRef, OpaqueOpacity);
imageRef.matte = flag;
}
bool matte() const
{
return imageRef.matte;
}
/**
* Set the image transparent color. The default is "#bdbdbd".
*/
void matteColor(string color)
{
matteColor = new Color(color);
}
///ditto
void matteColor(Color color)
{
imageRef.matte_color = color.pixelPacket;
options.matteColor = color.pixelPacket;
}
///ditto
Color matteColor() const
{
return new Color(imageRef.matte_color);
}
double meanErrorPerPixel() const
{
return imageRef.error.mean_error_per_pixel;
}
void modulusDepth(size_t depth)
{
SetImageDepth(imageRef, depth);
options.depth = depth;
}
size_t modulusDepth() const
{
ExceptionInfo* exception = AcquireExceptionInfo();
size_t depth = GetImageDepth(imageRef, exception);
DMagickException.throwException(exception);
DestroyExceptionInfo(exception);
return depth;
}
Geometry montageGeometry() const
{
return Geometry( to!(string)(imageRef.geometry) );
}
size_t rows() const
{
return imageRef.rows;
}
//Image properties - set via SetImageProterties
//Should we implement these as actual properties?
//attribute
//comment
//label
}
|