summaryrefslogtreecommitdiff
path: root/dmagick/Color.d
diff options
context:
space:
mode:
authorMike Wey2011-02-20 23:44:14 +0100
committerMike Wey2011-02-20 23:44:14 +0100
commit0bbb355681ad7a9dc3be943152d68e90e4ff0974 (patch)
tree7e465d4fc69769b8900d04d5cdb79b0d17518645 /dmagick/Color.d
parentefd789405e397e0d3d3a3055b80b3350be7444e1 (diff)
Add more documentation to Color.d
Diffstat (limited to 'dmagick/Color.d')
-rw-r--r--dmagick/Color.d30
1 files changed, 28 insertions, 2 deletions
diff --git a/dmagick/Color.d b/dmagick/Color.d
index 19b1a94..7c50595 100644
--- a/dmagick/Color.d
+++ b/dmagick/Color.d
@@ -97,60 +97,87 @@ class Color
return format("#%04X%04X%04X%04X", pixelPacket.red, pixelPacket.green, pixelPacket.blue, pixelPacket.opacity);
}
+ /**
+ * The value for red in the range [0 .. QuantumRange]
+ */
void redQuantum(Quantum red)
{
pixelPacket.red = red;
}
+ ///ditto
Quantum redQuantum()
{
return pixelPacket.red;
}
+ /**
+ * The value for green in the range [0 .. QuantumRange]
+ */
void greenQuantum(Quantum green)
{
pixelPacket.green = green;
}
+ ///ditto
Quantum greenQuantum()
{
return pixelPacket.green;
}
+ /**
+ * The value for blue in the range [0 .. QuantumRange]
+ */
void blueQuantum(Quantum blue)
{
pixelPacket.blue = blue;
}
+ ///ditto
Quantum blueQuantum()
{
return pixelPacket.blue;
}
+ /**
+ * The opacity as a byte. [0 .. 255]
+ */
void opacityByte(ubyte opacity)
{
pixelPacket.opacity = ScaleCharToQuantum(opacity);
}
+ ///ditto
ubyte opacityByte()
{
return ScaleQuantumToChar(pixelPacket.opacity);
}
+ /**
+ * The value for opacity in the range [0 .. QuantumRange]
+ */
void opacityQuantum(Quantum opacity)
{
pixelPacket.opacity = opacity;
}
+ ///ditto
Quantum opacityQuantum()
{
return pixelPacket.opacity;
}
+ /**
+ * The value for opacity as a double in the range [0.0 .. 1.0]
+ */
void opacity(double opacity)
{
pixelPacket.opacity = scaleDoubleToQuantum(opacity);
}
+ ///ditto
double opacity()
{
return scaleQuantumToDouble(pixelPacket.opacity);
}
+ /**
+ * The intensity of this color.
+ */
double intensity()
{
//The Constants used here are derived from BT.709 Which standardizes HDTV
@@ -172,12 +199,11 @@ class Color
*/
string name()
{
- char* pattern;
size_t numberOfColors;
const(ColorInfo)** colorList;
+ const(char)* pattern = toStringz("*");
ExceptionInfo* exception = AcquireExceptionInfo();
- copyString(pattern, "*");
colorList = GetColorInfoList(pattern, &numberOfColors, exception);
DMagickException.throwException(exception);