IDataComponent Interface#
Syntax#
C#
VB
The IDataComponent type exposes the following members.
Properties#
Name | Description | |
---|---|---|
ComponentTypeValue | The component type. | |
Height | The height of the image in pixels, i.e., the number of image rows. | |
IsValid | Indicates if the component is valid. | |
OffsetX | The number of image columns from the origin. | |
OffsetY | The number of image rows from the origin. | |
Orientation | The vertical orientation of the pixel data stored in memory. | |
PaddingX | The number of data bytes added to the end of each row. | |
PixelData | The pixel data buffer.The type of the object containing the buffer depends on the class implementing this interface. The pixel data buffer is provided as an array of a type appropriate for the respective pixel type, e.g., UInt16 for Mono16 or Byte for Mono8. The pixel data is copied when the PixelData function is called. Use PixelDataPointer to access the pixel data buffer without creating a copy. | |
PixelDataPointer | The pointer to the pixel data buffer. The pointer is provided without computational overhead. Use PixelData to access the pixel data buffer like an array. | |
PixelTypeValue | The pixel type. | |
Timestamp | Indicates when the image was taken. | |
Width | The width of the image in pixels, i.e., the number of image columns. |
Extension Methods#
Name | Description | |
---|---|---|
ComputeStride | Computes the stride of the image in bytes. Returns null if the stride cannot be computed. (Defined by IImageExtensions.) | |
Display | Uses the ImageWindow method DisplayImage(Int32, IImage) to display the image. (Defined by IImageExtensions.) |
Remarks#
Some cameras can return complex grab results consisting of multiple components. For example, Basler blaze cameras return a data stream that is composed of range, intensity, and confidence components. To access the individual components, you can use the IDataContainer class.
Each component in the container can be used to access the actual data, e.g., the range values, and its metadata. Before accessing the data, check the IsValid property. The position and the size can be retrieved with OffsetX/ OffsetY and Width/ Height. To get access to the pixel data, call PixelData or PixelDataPointer.
Note |
---|
Any IDataContainer or IDataComponent must be disposed explicitly. |
IDataComponent.ComponentTypeValue Property#
The component type.
Syntax#
C#
VB
Property Value#
Type: ComponentType
Remarks#
Preconditions: The data component must be valid.
Error Safety: Does not throw exceptions.
IDataComponent.Height Property#
The height of the image in pixels, i.e., the number of image rows.
Syntax#
C#
VB
Property Value#
Type: Int32
Implements#
Remarks#
Preconditions: The data component must be valid.
Error Safety: Does not throw exceptions.
IDataComponent.IsValid Property#
Indicates if the component is valid.
Syntax#
C#
VB
Return Value#
Type: Boolean
Returns true if the component is valid.
Implements#
Remarks#
Error Safety: Does not throw exceptions.
IDataComponent.OffsetX Property#
The number of image columns from the origin.
Syntax#
C#
VB
Property Value#
Type: Int32
Remarks#
Preconditions: The data component must be valid.
Error Safety: Does not throw exceptions.
IDataComponent.OffsetY Property#
The number of image rows from the origin.
Syntax#
C#
VB
Property Value#
Type: Int32
Remarks#
Preconditions: The data component must be valid.
Error Safety: Does not throw exceptions.
IDataComponent.Orientation Property#
The vertical orientation of the pixel data stored in memory.
Syntax#
C#
VB
Property Value#
Type: ImageOrientation
Implements#
Remarks#
Preconditions: The data component must be valid.
Error Safety: Does not throw exceptions.
IDataComponent.PaddingX Property#
The number of data bytes added to the end of each row.
Syntax#
C#
VB
Property Value#
Type: Int32
Implements#
Remarks#
Preconditions: The data component must be valid.
Error Safety: Does not throw exceptions.
IDataComponent.PixelData Property#
The pixel data buffer.The type of the object containing the buffer depends on the class implementing this interface. The pixel data buffer is provided as an array of a type appropriate for the respective pixel type, e.g., UInt16 for Mono16 or Byte for Mono8. The pixel data is copied when the PixelData function is called. Use PixelDataPointer to access the pixel data buffer without creating a copy.
Syntax#
C#
VB
Property Value#
Type: Object
Implements#
Remarks#
Preconditions: The data component must be valid.
Error Safety: Does not throw exceptions.
IDataComponent.PixelDataPointer Property#
The pointer to the pixel data buffer. The pointer is provided without computational overhead. Use PixelData to access the pixel data buffer like an array.
Syntax#
C#
VB
Property Value#
Type: IntPtr
Implements#
Remarks#
Preconditions: The data component must be valid.
Error Safety: Does not throw exceptions.
IDataComponent.PixelTypeValue Property#
The pixel type.
Syntax#
C#
VB
Property Value#
Type: PixelType
Implements#
Remarks#
Note |
---|
Not all components contain pixel data. Only components of type ComponentType_Intensity, ComponentType_Range, and ComponentType_Confidence return a valid pixel type |
Error Safety: Does not throw exceptions.
IDataComponent.Timestamp Property#
Indicates when the image was taken.
Syntax#
C#
VB
Property Value#
Type: Int64
Remarks#
Returns the camera-specific time the data was created on the camera or 0 if the time is not available.
Note |
---|
Timestamp generation is available only on some camera models. |
Error Safety: Does not throw exceptions.
IDataComponent.Width Property#
The width of the image in pixels, i.e., the number of image columns.
Syntax#
C#
VB
Property Value#
Type: Int32
Implements#
Remarks#
Preconditions: The data component must be valid.
Error Safety: Does not throw exceptions.