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
//! Binding of pixel_wand, Wand pixel access interfaces.
//!
//! <http://www.graphicsmagick.org/wand/pixel_wand.html>

use crate::{
    types::*,
    utils::{assert_initialized, MagickCString},
};
use graphicsmagick_sys::*;
use null_terminated_str::IntoNullTerminatedString;
use std::{
    os::raw::{c_double, c_ulong},
    ptr::NonNull,
};

/// Wrapper of `graphicsmagick_sys::PixelWand`.
#[derive(Debug)]
#[repr(transparent)]
pub struct PixelWand {
    wand: NonNull<graphicsmagick_sys::PixelWand>,
}

impl PixelWand {
    pub fn new() -> Self {
        assert_initialized();

        let wand = NonNull::new(unsafe { NewPixelWand() }).expect("NewPixelWand return NULL");

        PixelWand { wand }
    }

    /// # Safety
    ///
    ///  * `wand` - must points to either NULL, or a valid allocation.
    #[inline]
    pub unsafe fn from_wand(wand: *mut graphicsmagick_sys::PixelWand) -> Option<PixelWand> {
        NonNull::new(wand).map(|wand| PixelWand { wand })
    }

    #[inline]
    pub fn wand(&self) -> *const graphicsmagick_sys::PixelWand {
        self.wand.as_ptr() as *const _
    }

    #[inline]
    pub fn wand_mut(&mut self) -> *mut graphicsmagick_sys::PixelWand {
        self.wand.as_ptr()
    }
}

impl Drop for PixelWand {
    fn drop(&mut self) {
        unsafe {
            DestroyPixelWand(self.wand.as_ptr());
        }
    }
}

impl Clone for PixelWand {
    fn clone(&self) -> Self {
        PixelWand {
            wand: NonNull::new(unsafe { ClonePixelWand(self.wand.as_ptr()) })
                .expect("ClonePixelWand returns NULL"),
        }
    }
}

impl Default for PixelWand {
    fn default() -> Self {
        Self::new()
    }
}

impl PixelWand {
    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelgetblack>
    ///
    /// PixelGetBlack() returns the normalized black color of the pixel wand.
    ///
    pub fn get_black(&self) -> c_double {
        unsafe { PixelGetBlack(self.wand.as_ptr()) }
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelgetblackquantum>
    ///
    /// PixelGetBlackQuantum() returns the black color of the pixel wand.  The
    ///
    /// color is in the range of [0..MaxRGB]
    ///
    pub fn get_black_quantum(&self) -> Quantum {
        unsafe { PixelGetBlackQuantum(self.wand.as_ptr()) }
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelgetblue>
    ///
    /// PixelGetBlue(const) returns the normalized blue color of the pixel wand.
    ///
    pub fn get_blue(&self) -> c_double {
        unsafe { PixelGetBlue(self.wand.as_ptr()) }
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelgetbluequantum>
    ///
    /// PixelGetBlueQuantum(const ) returns the blue color of the pixel wand.  The
    ///
    /// color is in the range of [0..MaxRGB]
    ///
    pub fn get_blue_quantum(&self) -> Quantum {
        unsafe { PixelGetBlueQuantum(self.wand.as_ptr()) }
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelgetcolorasstring>
    ///
    /// PixelGetColorAsString() gets the color of the pixel wand.
    ///
    pub fn get_color_as_string(&mut self) -> MagickCString {
        unsafe { MagickCString::new(PixelGetColorAsString(self.wand.as_ptr())) }
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelgetcolorcount>
    ///
    /// PixelGetColorCount() returns the color count associated with this color.
    ///
    pub fn get_color_count(&self) -> c_ulong {
        unsafe { PixelGetColorCount(self.wand.as_ptr()) }
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelgetcyan>
    ///
    /// PixelGetCyan() returns the normalized cyan color of the pixel wand.
    ///
    pub fn get_cyan(&self) -> c_double {
        unsafe { PixelGetCyan(self.wand.as_ptr()) }
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelgetcyanquantum>
    ///
    /// PixelGetCyanQuantum() returns the cyan color of the pixel wand.  The color
    ///
    /// is in the range of [0..MaxRGB]
    ///
    pub fn get_cyan_quantum(&self) -> Quantum {
        unsafe { PixelGetCyanQuantum(self.wand.as_ptr()) }
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelgetgreen>
    ///
    /// PixelGetGreen(const ) returns the normalized green color of the pixel wand.
    ///
    pub fn get_green(&self) -> c_double {
        unsafe { PixelGetGreen(self.wand.as_ptr()) }
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelgetgreenquantum>
    ///
    /// PixelGetGreenQuantum(const ) returns the green color of the pixel wand.  The
    ///
    /// color is in the range of [0..MaxRGB]
    ///
    pub fn get_green_quantum(&self) -> Quantum {
        unsafe { PixelGetGreenQuantum(self.wand.as_ptr()) }
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelgetmagenta>
    ///
    /// PixelGetMagenta() returns the normalized magenta color of the pixel wand.
    ///
    pub fn get_magenta(&self) -> c_double {
        unsafe { PixelGetMagenta(self.wand.as_ptr()) }
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelgetmagentaquantum>
    ///
    /// PixelGetMagentaQuantum() returns the magenta color of the pixel wand.  The
    ///
    /// color is in the range of [0..MaxRGB]
    ///
    pub fn get_magenta_quantum(&self) -> Quantum {
        unsafe { PixelGetMagentaQuantum(self.wand.as_ptr()) }
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelgetopacity>
    ///
    /// PixelGetOpacity(const ) returns the normalized opacity color of the pixel
    ///
    /// wand.
    ///
    pub fn get_opacity(&self) -> c_double {
        unsafe { PixelGetOpacity(self.wand.as_ptr()) }
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelgetopacityquantum>
    ///
    /// PixelGetOpacityQuantum(const ) returns the opacity color of the pixel wand.
    ///
    /// The color is in the range of [0..MaxRGB]
    ///
    pub fn get_opacity_quantum(&self) -> Quantum {
        unsafe { PixelGetOpacityQuantum(self.wand.as_ptr()) }
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelgetred>
    ///
    /// PixelGetRed(const ) returns the normalized red color of the pixel wand.
    ///
    pub fn get_red(&self) -> c_double {
        unsafe { PixelGetRed(self.wand.as_ptr()) }
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelgetredquantum>
    ///
    /// PixelGetRedQuantum(const ) returns the red color of the pixel wand.  The
    ///
    /// color is in the range of [0..MaxRGB]
    ///
    pub fn get_red_quantum(&self) -> Quantum {
        unsafe { PixelGetRedQuantum(self.wand.as_ptr()) }
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelgetyellow>
    ///
    /// PixelGetYellow() returns the normalized yellow color of the pixel wand.
    ///
    pub fn get_yellow(&self) -> c_double {
        unsafe { PixelGetYellow(self.wand.as_ptr()) }
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelgetyellowquantum>
    ///
    /// PixelGetYellowQuantum() returns the yellow color of the pixel wand.  The
    ///
    /// color is in the range of [0..MaxRGB]
    ///
    pub fn get_yellow_quantum(&self) -> Quantum {
        unsafe { PixelGetYellowQuantum(self.wand.as_ptr()) }
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelsetblack>
    ///
    /// PixelSetBlack() sets the normalized black color of the pixel wand.
    ///
    pub fn set_black(&mut self, black: c_double) -> &mut Self {
        unsafe { PixelSetBlack(self.wand.as_ptr(), black) };
        self
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelsetblackquantum>
    ///
    /// PixelSetBlackQuantum() sets the black color of the pixel wand.  The color
    ///
    /// must be in the range of [0..MaxRGB]
    ///
    pub fn set_black_quantum(&mut self, black: Quantum) -> &mut Self {
        unsafe { PixelSetBlackQuantum(self.wand.as_ptr(), black) };
        self
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelsetblue>
    ///
    /// PixelSetBlue() sets the normalized blue color of the pixel wand.
    ///
    pub fn set_blue(&mut self, blue: c_double) -> &mut Self {
        unsafe { PixelSetBlue(self.wand.as_ptr(), blue) };
        self
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelsetbluequantum>
    ///
    /// PixelSetBlueQuantum() sets the blue color of the pixel wand.  The color must
    ///
    /// be in the range of [0..MaxRGB]
    ///
    pub fn set_blue_quantum(&mut self, blue: Quantum) -> &mut Self {
        unsafe { PixelSetBlueQuantum(self.wand.as_ptr(), blue) };
        self
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelsetcolor>
    ///
    /// PixelSetColor() sets the color of the pixel wand with a string (e.g.
    ///
    /// &quot;blue&quot;, &quot;#0000ff&quot;, &quot;rgb(0,0,255)&quot;, etc.).
    ///
    pub fn set_color<'a>(&mut self, color: impl IntoNullTerminatedString<'a>) -> &mut Self {
        let color = color.into_null_terminated_string();
        unsafe { PixelSetColor(self.wand.as_ptr(), color.as_ptr()) };
        self
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelsetcolorcount>
    ///
    /// PixelSetColorCount() sets the color count of the pixel wand.
    ///
    pub fn set_color_count(&mut self, count: c_ulong) -> &mut Self {
        unsafe { PixelSetColorCount(self.wand.as_ptr(), count) };
        self
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelsetcyan>
    ///
    /// PixelSetCyan() sets the normalized cyan color of the pixel wand.
    ///
    pub fn set_cyan(&mut self, cyan: c_double) -> &mut Self {
        unsafe { PixelSetCyan(self.wand.as_ptr(), cyan) };
        self
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelsetcyanquantum>
    ///
    /// PixelSetCyanQuantum() sets the cyan color of the pixel wand.  The color must
    ///
    /// be in the range of [0..MaxRGB]
    ///
    pub fn set_cyan_quantum(&mut self, cyan: Quantum) -> &mut Self {
        unsafe { PixelSetCyanQuantum(self.wand.as_ptr(), cyan) };
        self
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelsetgreen>
    ///
    /// PixelSetGreen() sets the normalized green color of the pixel wand.
    ///
    pub fn set_green(&mut self, green: c_double) -> &mut Self {
        unsafe { PixelSetGreen(self.wand.as_ptr(), green) };
        self
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelsetgreenquantum>
    ///
    /// PixelSetGreenQuantum() sets the green color of the pixel wand.  The color must
    ///
    /// be in the range of [0..MaxRGB]
    ///
    pub fn set_green_quantum(&mut self, green: Quantum) -> &mut Self {
        unsafe { PixelSetGreenQuantum(self.wand.as_ptr(), green) };
        self
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelsetmagenta>
    ///
    /// PixelSetMagenta() sets the normalized magenta color of the pixel wand.
    ///
    pub fn set_magenta(&mut self, magenta: c_double) -> &mut Self {
        unsafe { PixelSetMagenta(self.wand.as_ptr(), magenta) };
        self
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelsetmagentaquantum>
    ///
    /// PixelSetMagentaQuantum() sets the magenta color of the pixel wand.  The
    ///
    /// color must be in the range of [0..MaxRGB]
    ///
    pub fn set_magenta_quantum(&mut self, magenta: Quantum) -> &mut Self {
        unsafe { PixelSetMagentaQuantum(self.wand.as_ptr(), magenta) };
        self
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelsetopacity>
    ///
    /// PixelSetOpacity() sets the normalized opacity color of the pixel wand.
    ///
    pub fn set_opacity(&mut self, opacity: c_double) -> &mut Self {
        unsafe { PixelSetOpacity(self.wand.as_ptr(), opacity) };
        self
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelsetopacityquantum>
    ///
    /// PixelSetOpacityQuantum() sets the opacity color of the pixel wand.  The
    ///
    /// color must be in the range of [0..MaxRGB]
    ///
    pub fn set_opacity_quantum(&mut self, opacity: Quantum) -> &mut Self {
        unsafe { PixelSetOpacityQuantum(self.wand.as_ptr(), opacity) };
        self
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelsetquantumcolor>
    ///
    /// PixelSetQuantumColor() sets the color of the pixel wand.
    ///
    pub fn set_quantum_color(&mut self, color: &mut PixelPacket) -> &mut Self {
        unsafe { PixelSetQuantumColor(self.wand.as_ptr(), color as *mut PixelPacket) };
        self
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelsetred>
    ///
    /// PixelSetRed() sets the normalized red color of the pixel wand.
    ///
    pub fn set_red(&mut self, red: c_double) -> &mut Self {
        unsafe { PixelSetRed(self.wand.as_ptr(), red) };
        self
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelsetredquantum>
    ///
    /// PixelSetRedQuantum() sets the red color of the pixel wand.  The color must
    ///
    /// be in the range of [0..MaxRGB]
    ///
    pub fn set_red_quantum(&mut self, red: Quantum) -> &mut Self {
        unsafe { PixelSetRedQuantum(self.wand.as_ptr(), red) };
        self
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelsetyellow>
    ///
    /// PixelSetYellow() sets the normalized yellow color of the pixel wand.
    ///
    pub fn set_yellow(&mut self, yellow: c_double) -> &mut Self {
        unsafe { PixelSetYellow(self.wand.as_ptr(), yellow) };
        self
    }

    /// <http://www.graphicsmagick.org/wand/pixel_wand.html#pixelsetyellowquantum>
    ///
    /// PixelSetYellowQuantum() sets the yellow color of the pixel wand.  The color
    ///
    /// must be in the range of [0..MaxRGB]
    ///
    pub fn set_yellow_quantum(&mut self, yellow: Quantum) -> &mut Self {
        unsafe { PixelSetYellowQuantum(self.wand.as_ptr(), yellow) };
        self
    }
}

#[cfg(test)]
mod tests {
    use crate::{initialize, types::PixelPacket, wand::PixelWand};

    fn new_pixel_wand() -> PixelWand {
        initialize();
        PixelWand::new()
    }

    #[test]
    fn test_pixel_wand_get_black() {
        let pw = new_pixel_wand();
        pw.get_black();
    }

    #[test]
    fn test_pixel_wand_get_black_quantum() {
        let pw = new_pixel_wand();
        pw.get_black_quantum();
    }

    #[test]
    fn test_pixel_wand_get_blue() {
        let pw = new_pixel_wand();
        pw.get_blue();
    }

    #[test]
    fn test_pixel_wand_get_blue_quantum() {
        let pw = new_pixel_wand();
        pw.get_blue_quantum();
    }

    #[test]
    fn test_pixel_wand_get_color_as_string() {
        let mut pw = new_pixel_wand();
        pw.get_color_as_string().to_str().unwrap();
    }

    #[test]
    fn test_pixel_wand_get_color_count() {
        let pw = new_pixel_wand();
        pw.get_color_count();
    }

    #[test]
    fn test_pixel_wand_get_cyan() {
        let pw = new_pixel_wand();
        pw.get_cyan();
    }

    #[test]
    fn test_pixel_wand_get_cyan_quantum() {
        let pw = new_pixel_wand();
        pw.get_cyan_quantum();
    }

    #[test]
    fn test_pixel_wand_get_green() {
        let pw = new_pixel_wand();
        pw.get_green();
    }

    #[test]
    fn test_pixel_wand_get_green_quantum() {
        let pw = new_pixel_wand();
        pw.get_green_quantum();
    }

    #[test]
    fn test_pixel_wand_get_magenta() {
        let pw = new_pixel_wand();
        pw.get_magenta();
    }

    #[test]
    fn test_pixel_wand_get_magenta_quantum() {
        let pw = new_pixel_wand();
        pw.get_magenta_quantum();
    }

    #[test]
    fn test_pixel_wand_get_opacity() {
        let pw = new_pixel_wand();
        pw.get_opacity();
    }

    #[test]
    fn test_pixel_wand_get_opacity_quantum() {
        let pw = new_pixel_wand();
        pw.get_opacity_quantum();
    }

    #[test]
    fn test_pixel_wand_get_red() {
        let pw = new_pixel_wand();
        pw.get_red();
    }

    #[test]
    fn test_pixel_wand_get_red_quantum() {
        let pw = new_pixel_wand();
        pw.get_red_quantum();
    }

    #[test]
    fn test_pixel_wand_get_yellow() {
        let pw = new_pixel_wand();
        pw.get_yellow();
    }

    #[test]
    fn test_pixel_wand_get_yellow_quantum() {
        let pw = new_pixel_wand();
        pw.get_yellow_quantum();
    }

    #[test]
    fn test_pixel_wand_set_black() {
        let mut pw = new_pixel_wand();
        pw.set_black(0.);
    }

    #[test]
    fn test_pixel_wand_set_black_quantum() {
        let mut pw = new_pixel_wand();
        pw.set_black_quantum(0);
    }

    #[test]
    fn test_pixel_wand_set_blue() {
        let mut pw = new_pixel_wand();
        pw.set_blue(0.);
    }

    #[test]
    fn test_pixel_wand_set_blue_quantum() {
        let mut pw = new_pixel_wand();
        pw.set_blue_quantum(0);
    }

    #[test]
    fn test_pixel_wand_set_color() {
        let mut pw = new_pixel_wand();
        pw.set_color("");
    }

    #[test]
    fn test_pixel_wand_set_color_count() {
        let mut pw = new_pixel_wand();
        pw.set_color_count(0);
    }

    #[test]
    fn test_pixel_wand_set_cyan() {
        let mut pw = new_pixel_wand();
        pw.set_cyan(0.);
    }

    #[test]
    fn test_pixel_wand_set_cyan_quantum() {
        let mut pw = new_pixel_wand();
        pw.set_cyan_quantum(0);
    }

    #[test]
    fn test_pixel_wand_set_green() {
        let mut pw = new_pixel_wand();
        pw.set_green(0.);
    }

    #[test]
    fn test_pixel_wand_set_green_quantum() {
        let mut pw = new_pixel_wand();
        pw.set_green_quantum(0);
    }

    #[test]
    fn test_pixel_wand_set_magenta() {
        let mut pw = new_pixel_wand();
        pw.set_magenta(0.);
    }

    #[test]
    fn test_pixel_wand_set_magenta_quantum() {
        let mut pw = new_pixel_wand();
        pw.set_magenta_quantum(0);
    }

    #[test]
    fn test_pixel_wand_set_opacity() {
        let mut pw = new_pixel_wand();
        pw.set_opacity(0.);
    }

    #[test]
    fn test_pixel_wand_set_opacity_quantum() {
        let mut pw = new_pixel_wand();
        pw.set_opacity_quantum(0);
    }

    #[test]
    fn test_pixel_wand_set_quantum_color() {
        let mut pw = new_pixel_wand();
        pw.set_quantum_color(&mut PixelPacket {
            blue: 0,
            green: 0,
            red: 0,
            opacity: 0,
        });
    }

    #[test]
    fn test_pixel_wand_set_red() {
        let mut pw = new_pixel_wand();
        pw.set_red(0.);
    }

    #[test]
    fn test_pixel_wand_set_red_quantum() {
        let mut pw = new_pixel_wand();
        pw.set_red_quantum(0);
    }

    #[test]
    fn test_pixel_wand_set_yellow() {
        let mut pw = new_pixel_wand();
        pw.set_yellow(0.);
    }

    #[test]
    fn test_pixel_wand_set_yellow_quantum() {
        let mut pw = new_pixel_wand();
        pw.set_yellow_quantum(0);
    }
}