Image.asType

Convert image data type to given type.

Creates new image with data typed as given value type. If this image's data type is the same as given type, deep copy of this image is returned.

class Image
inout
asType
(
T
)
(
)
in { assert (_data); static assert (is(T == ubyte) || is(T == ushort) || is(T == float), "Given type is invalid - only ubyte (8) ushort(16) or float(32) are supported"); }

Parameters

T

(template parameter) value type to which image's data is converted.

Return Value

Type: auto

Copy of this image with casted data to given type. If given type is same as current data of this image, deep copy is returned.

Meta