Image.this

Construct an image by given size, format and bit depth information.

  1. this(in Image copy, bool deepCopy = false)
  2. this(size_t width, size_t height, ImageFormat format = ImageFormat.IF_RGB, BitDepth depth = BitDepth.BD_8, ubyte[] data = null)
    class Image
    @safe pure nothrow
    this
    in { assert (width > 0 && height > 0); assert (depth != BitDepth.BD_UNASSIGNED && format != ImageFormat.IF_UNASSIGNED); if (data !is null) { assert (data.length == width * height * imageFormatChannelCount[cast(size_t)format] * (cast(size_t)depth / 8)); } }

Parameters

width
Type: size_t

width of a newly created image.

height
Type: size_t

height of a newly created image.

format

format of a newly created image.

depth
Type: BitDepth

bit depth of a newly created image.

data
Type: ubyte[]

potential data of an image, pre-allocated. If not a null, data array has to be of correct size = width*height*channels*depth, where channels are defined by the format, and depth is counded in bytes.

Meta