dcv.core.image

Module implements Image utility class, and basic API for image manipulation.

Image class encapsulates image properties with minimal functionality. It is primarily designed to be used as I/O unit. For any image processing needs, image data can be sliced to mir.ndslice.slice.Slice.

Members

Classes

Image
class Image

Image abstraction type.

Enums

BitDepth
enum BitDepth

Bit depth of a pixel in an image.

ImageFormat
enum ImageFormat

Image (pixel) format.

Functions

asImage
Image asImage(Slice!(kind, packs, T*) slice, ImageFormat format)

Convert a ndslice object to an Image, with defined image format.

asImage
Image asImage(Slice!(kind, packs, T*) slice)

Convert ndslice object into an image, with default format setup, regarding to slice dimension.

Examples

1 Image image = new Image(32, 32, ImageFormat.IF_MONO, BitDepth.BD_32);
2 
3 Slice!(Contiguous, [3], float*) slice = image.sliced!float; // slice image data, considering the data is of float type.
4 
5 assert(image.height == slice.length!0 && image.width == slice.length!1);
6 assert(image.channels == 1);
7 
8 image = slice.asImage(ImageFormat.IF_MONO); // create the image back from sliced data.

Meta

Authors

Relja Ljubobratovic

License

$(LINK3 http://www.boost.org/LICENSE_1_0.txt, Boost Software License - Version 1.0).