summaryrefslogtreecommitdiff
path: root/dmagick/c
diff options
context:
space:
mode:
Diffstat (limited to 'dmagick/c')
-rw-r--r--dmagick/c/quantum.d7
1 files changed, 7 insertions, 0 deletions
diff --git a/dmagick/c/quantum.d b/dmagick/c/quantum.d
index bd774af..4186c11 100644
--- a/dmagick/c/quantum.d
+++ b/dmagick/c/quantum.d
@@ -78,6 +78,13 @@ extern(C)
return(cast(ubyte) (((quantum+128UL)-((quantum+128UL) >> 8)) >> 8));
}
+ static pure nothrow Quantum ScaleCharToQuantum(ubyte value)
+ {
+ enum Quantum factor = QuantumRange/255;
+
+ return cast(Quantum)(factor*value);
+ }
+
MagickBooleanType SetQuantumDepth(const(Image)*, QuantumInfo*, const size_t);
MagickBooleanType SetQuantumFormat(const(Image)*, QuantumInfo*, const QuantumFormatType);
MagickBooleanType SetQuantumPad(const(Image)*, QuantumInfo*, const size_t);