IDataComponent Interface#
Syntax#
C#
public interface IDataComponent : IDisposable,
IImage
VB
Public Interface IDataComponent
Inherits IDisposable, IImage
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.
![]() |
---|
Any IDataContainer or IDataComponent must be disposed explicitly. |
IDataComponent.ComponentTypeValue Property#
The component type.
Syntax#
C#
ComponentType ComponentTypeValue { get; }
VB
ReadOnly Property ComponentTypeValue As ComponentType
Get
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#
int Height { get; }
VB
ReadOnly Property Height As Integer
Get
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#
bool IsValid { get; }
VB
ReadOnly Property IsValid As Boolean
Get
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#
int OffsetX { get; }
VB
ReadOnly Property OffsetX As Integer
Get
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#
int OffsetY { get; }
VB
ReadOnly Property OffsetY As Integer
Get
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#
ImageOrientation Orientation { get; }
VB
ReadOnly Property Orientation As ImageOrientation
Get
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#
int PaddingX { get; }
VB
ReadOnly Property PaddingX As Integer
Get
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#
Object PixelData { get; }
VB
ReadOnly Property PixelData As Object
Get
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#
IntPtr PixelDataPointer { get; }
VB
ReadOnly Property PixelDataPointer As IntPtr
Get
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#
PixelType PixelTypeValue { get; }
VB
ReadOnly Property PixelTypeValue As PixelType
Get
Property Value#
Type: PixelType
Implements#
Remarks#
![]() |
---|
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#
long Timestamp { get; }
VB
ReadOnly Property Timestamp As Long
Get
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.
![]() |
---|
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#
int Width { get; }
VB
ReadOnly Property Width As Integer
Get
Property Value#
Type: Int32
Implements#
Remarks#
Preconditions: The data component must be valid.
Error Safety: Does not throw exceptions.