ae.utils.graphics.color

Color type and operations.

Members

Aliases

BGR
alias BGR = Color!(ubyte, "b", "g", "r")
Undocumented in source.
BGRA
alias BGRA = Color!(ubyte, "b", "g", "r", "a")
Undocumented in source.
BGRX
alias BGRX = Color!(ubyte, "b", "g", "r", "x")
Undocumented in source.
ExpandChannelType
alias ExpandChannelType(COLOR, int BYTES) = ChangeChannelType!(COLOR, ExpandNumericType!(ChannelType!COLOR, BYTES * 8))
Undocumented in source.
L16
alias L16 = Color!(ushort, "l")
Undocumented in source.
L8
alias L8 = Color!(ubyte, "l")
Undocumented in source.
LA
alias LA = Color!(ubyte, "l", "a")
Undocumented in source.
LA16
alias LA16 = Color!(ushort, "l", "a")
Undocumented in source.
OneBitStorageBE
alias OneBitStorageBE = BitStorageUnit!(bool, 1, ubyte, true)

8 monochrome bits packed into a byte, in the usual big-endian order.

OneBitStorageLE
alias OneBitStorageLE = BitStorageUnit!(bool, 1, ubyte, false)

As above, but in little-endian order.

PlainStorageUnit
alias PlainStorageUnit(Color) = Color[1]

Color storage unit for as-is storage.

RGB
alias RGB = Color!(ubyte, "r", "g", "b")
Undocumented in source.
RGB16
alias RGB16 = Color!(ushort, "r", "g", "b")
Undocumented in source.
RGBA
alias RGBA = Color!(ubyte, "r", "g", "b", "a")
Undocumented in source.
RGBA16
alias RGBA16 = Color!(ushort, "r", "g", "b", "a")
Undocumented in source.
RGBX
alias RGBX = Color!(ubyte, "r", "g", "b", "x")
Undocumented in source.
RGBX16
alias RGBX16 = Color!(ushort, "r", "g", "b", "x")
Undocumented in source.
RGBd
alias RGBd = Color!(double, "r", "g", "b")
Undocumented in source.
RGBf
alias RGBf = Color!(float, "r", "g", "b")
Undocumented in source.
S16
alias S16 = Color!(short, "l")
Undocumented in source.
S8
alias S8 = Color!(byte, "l")
Undocumented in source.
StorageColor
alias StorageColor(StorageType) = typeof(StorageType.init[0])

Get the color value of a storage unit type.

Functions

blend
T blend(T f, T b, T a)
Undocumented in source. Be warned that the author may not have intended to support it.
solidStorageUnit
StorageType solidStorageUnit(StorageColor!StorageType color)
Undocumented in source. Be warned that the author may not have intended to support it.

Structs

BitStorageUnit
struct BitStorageUnit(ValueType, size_t valueBits, StorageType, bool bigEndian)

Color storage unit description for packed bit colors (1-bit, 2-bit, 4-bit etc.)

Color
struct Color(FieldTuple...)

Instantiates to a color type. FieldTuple is the color specifier, as parsed by the FieldList template from ae.utils.meta. By convention, each field's name indicates its purpose: - x: padding - a: alpha - l: lightness (or grey, for monochrome images) - others (r, g, b, etc.): color information

Gradient
struct Gradient(Value, Color)

Calculate an interpolated color on a gradient with multiple points

Templates

ChangeChannelType
template ChangeChannelType(COLOR, T)

Resolves to a Color instance with a different ChannelType.

ChannelType
template ChannelType(T)

Obtains the type of each channel for homogenous colors.

ExpandIntegerType
template ExpandIntegerType(T, size_t bits)

Wrapper around ExpandNumericType to only expand numeric types.

Variables

isStorageColorLValue
enum bool isStorageColorLValue(StorageType);

True when we can take the address of an individual color within a storage unit.

storageColorBits
enum size_t storageColorBits(StorageType);

The number of bits that one individual color takes up.

Meta

License

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Authors

Vladimir Panteleev <vladimir@thecybershadow.net>