imageΒΆ

module daffodil.image

Exposes the Image class, which provides basic storage, access and conversion of images.

class Image(V) if (isColorValue!V)

Generic Image class for a given pixel format. Holds a two dimensional array of pixels in a specified format, allowing generic transformations and manipulations using other interfaces.

alias Value = V

Storage type for each value in a channel.

MetaData meta

The metadata of the image.

this(size_t width, size_t height, size_t channelCount, const ColorSpace* colorSpace, MetaData meta = null)

Create an empty Image given a width and a height. Pixels default to init

this(R)(R range, MetaData meta = null) if (isImageRange!(R, PixelData))

Create a Image from a given image range, color space and optional metadata.

this(const Image other)

Create a image from data copied off another image.

@property auto width() const
@property auto height() const
@property auto size() const
auto opDollar(size_t pos)() const

Get the width and height of the Image.

@property auto channelCount() const

Get the number of channels in the image.

auto opIndex(size_t x, size_t y) const
void opIndexAssign(const Pixel!Value color, size_t x, size_t y)
void opIndexAssign(real[] values, size_t x, size_t y)

Get a pixel of the given pixel format at a location on the image.

auto newColor() const

Create a new color within the color space of the image.

Image dup() const

Return a copy of the image.

string toString() const
@property auto range() const

Return a image range for the image.