WrappedImage Constructor (IntPtr, Int32, Int32, Int32, PixelDataType, Int32, Int32, Int32, Int32, Int32)

CVB.Net Documentation
Wraps, without copying, the given pixel buffer in a Image.

Namespace:  Stemmer.Cvb
Assembly:  Stemmer.Cvb (in Stemmer.Cvb.dll) Version: 14.0.0.0
Syntax

public WrappedImage(
	IntPtr buffer,
	int bufferSize,
	int width,
	int height,
	PixelDataType dataType,
	int bitDepth,
	int pixelStride,
	int lineStride,
	int planeStride,
	params int[] planeOrder
)

Parameters

buffer
Type: SystemIntPtr
Pointer to the start of the pixel buffer.
bufferSize
Type: SystemInt32
Size of the buffer in bytes.
width
Type: SystemInt32
Width of the image in pixels.
height
Type: SystemInt32
Height of the image in pixels.
dataType
Type: Stemmer.CvbPixelDataType
Pixel data type.
bitDepth
Type: SystemInt32
Bits per pixel per plane.
pixelStride
Type: SystemInt32
Distance in bytes between two neighbouring pixels of the same plane, i.e. 1 for normal Mono8 images.
lineStride
Type: SystemInt32
Distance in bytes between two neighbouring lines of the same plane, i.e. width + optional padding for Mono8 images.
planeStride
Type: SystemInt32
Distance in bytes between two neighbouring infos, i.e. 1 for an interleaved RGB8 image.
planeOrder
Type: SystemInt32
Defines the mapping between the buffer plane layout and the logical CVB infos (R/G/B by default), i.e. (0,1,2) for an RGB8 image and (2,1,0) for a BGR8 image.

Return Value

Type: 
Newly created image handle.
Exceptions

ExceptionCondition
ArgumentOutOfRangeExceptionWhen the dataType, bitDepth combination is invalid.
Remarks

The number of planes is deduced from the length of the planeOrder array.

This method does not add memory pressure as the memory is managed elsewhere.

See Also

Reference