diff options
| author | Mike Wey | 2011-09-19 23:01:35 +0200 |
|---|---|---|
| committer | Mike Wey | 2011-09-19 23:01:35 +0200 |
| commit | 6af7568675e3fce883a1d08878dfef7f4e412053 (patch) | |
| tree | 78fe6bc0c1dec6d5c5958e94a61a0352f3bc930f /dmagick/Color.d | |
| parent | 6e186769980be473eb17e8f3abc28a56432041cd (diff) | |
Reuse the Color in Pixels.opApply, Creating a new color every time considerably slows down the loop.
Diffstat (limited to 'dmagick/Color.d')
| -rw-r--r-- | dmagick/Color.d | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/dmagick/Color.d b/dmagick/Color.d index 94b6906..7223d81 100644 --- a/dmagick/Color.d +++ b/dmagick/Color.d @@ -79,11 +79,19 @@ class Color this.packet = packet; } - PixelPacket pixelPacket() + package PixelPacket pixelPacket() const { return *packet; } + package void pixelPacket(PixelPacket packet) + { + this.packet.red = packet.red; + this.packet.green = packet.green; + this.packet.blue = packet.blue; + this.packet.opacity = packet.opacity; + } + override bool opEquals(Object obj) { Color color = cast(Color)obj; |
