Skip to content

IDataComponent Interface#

Provides methods for accessing a single data component.

Syntax#

C#

public interface IDataComponent : IDisposable, 
    IImage

VB

Public Interface IDataComponent
    Inherits IDisposable, IImage

The IDataComponent type exposes the following members.

Properties#

NameDescription
Public propertyComponentTypeValue The component type.
Public propertyHeight The height of the image in pixels, i.e., the number of image rows.
Public propertyIsValid Indicates if the component is valid.
Public propertyOffsetX The number of image columns from the origin.
Public propertyOffsetY The number of image rows from the origin.
Public propertyOrientation The vertical orientation of the pixel data stored in memory.
Public propertyPaddingX The number of data bytes added to the end of each row.
Public propertyPixelData 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.
Public propertyPixelDataPointer 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.
Public propertyPixelTypeValue The pixel type.
Public propertyTimestamp Indicates when the image was taken.
Public propertyWidth The width of the image in pixels, i.e., the number of image columns.
 

Extension Methods#

NameDescription
Public Extension MethodComputeStride Computes the stride of the image in bytes. Returns null if the stride cannot be computed. (Defined by IImageExtensions.)
Public Extension MethodDisplay 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 Note
Any IDataContainer or IDataComponent must be disposed explicitly.
  Thread Safety : This class is not thread-safe. If you access the same instance from multiple threads, you must make sure to synchronize the access accordingly.

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#

IImage.Height

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#

IImage.IsValid

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#

IImage.Orientation

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#

IImage.PaddingX

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#

IImage.PixelData

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#

IImage.PixelDataPointer

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#

IImage.PixelTypeValue

Remarks#

Note Note
Not all components contain pixel data. Only components of type ComponentType_Intensity, ComponentType_Range, and ComponentType_Confidence return a valid pixel type
  Preconditions: The data component must be valid.

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.

Note Note
Timestamp generation is available only on some camera models.
  Preconditions: The data component must be valid.

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#

IImage.Width

Remarks#

Preconditions: The data component must be valid.

Error Safety: Does not throw exceptions.