Sample Image List (Sil.dll) 14.1
SIL Data Import and Export

Exported functions for SIL data handling. More...

Typedefs

typedef cvbbool_t(* pfTransformSilData) (void *pPrivate, TSILDATA DataIn, TSILDATA &DataOut)
 
typedef void * TSILDATA
 

Enumerations

enum  TSilDataType { SDT_Undefined = -1 , SDT_ImageData = 0 , SDT_FloatData = 1 }
 

Functions

cvbval_t SilCompareData (TSILDATA DataA, TSILDATA DataB)
 Compares two SIL data objects for equality. More...
 
TSILDATA SilCreateImageData (IMG SourceImage, cvbdim_t nPosX, cvbdim_t nPosY, cvbdim_t nWidth, cvbdim_t nHeight)
 Creates a SIL image data object. More...
 
TSILDATA SilCreateVectorData (const float *pData, size_t nDimension)
 Creates a SIL vector data object using the input array. More...
 
cvbres_t SilGetFloatVectorData (TSILDATA Handle, float *pTarget, size_t &TargetSize)
 Copies the vector data from the TSILDATA object. More...
 
cvbres_t SilGetImageData (TSILDATA Handle, IMG &Image)
 Get the image handle of the SIL image data. More...
 
cvbbool_t SilVerifyDataCompatibility (TSILDATA Data, TSILDATATYPE DataType)
 Verifies if a datum is compatible with a data type descriptor. More...
 

Detailed Description

Exported functions for SIL data handling.

Author
VGi
Since
1.0.0 First version. (VGi, 22.04.2009)

Typedef Documentation

◆ pfTransformSilData

typedef cvbbool_t(* pfTransformSilData) (void *pPrivate, TSILDATA DataIn, TSILDATA &DataOut)

SIL data transformation callback.

Parameters
[in]pPrivatePrivate data pointer.
[in]DataInData to be transformed.
[out]DataOutTransformed data.
Returns
TRUE if the transformation succeeded, FALSE otherwise (FALSE will usually stop the iteration).

◆ TSILDATA

typedef void* TSILDATA

Handle to a SIL data entry.

Enumeration Type Documentation

◆ TSilDataType

The possible types of data entries for the SIL.

Enumerator
SDT_Undefined 

Indicates cases where the state is undefined.

SDT_ImageData 

The SIL data consists of regular CVB images.

SDT_FloatData 

The SIL data consists of floating point arrays.

Function Documentation

◆ SilCompareData()

cvbval_t SilCompareData ( TSILDATA  DataA,
TSILDATA  DataB 
)

Compares two SIL data objects for equality.

Parameters
[in]DataAlabel to be compared
[in]DataBlabel to be compared
Returns
  • 0: the two objects match (are identical)
  • 1: rhs describes a data type other than *this
  • -1: rhs describes a datum with different content

◆ SilCreateImageData()

TSILDATA SilCreateImageData ( IMG  SourceImage,
cvbdim_t  nPosX,
cvbdim_t  nPosY,
cvbdim_t  nWidth,
cvbdim_t  nHeight 
)

Creates a SIL image data object.

The data object is created from the entire input image SourceImage by extracting a rectangle of size nWidth x nHeight (using pixel coordinates) with the top/left of the extraction area located at nPosX / nPosY.

This data object can then be used for creating/adding new entries to a TSIL using SilAddItem. Note that the object needs to be disposed of after use by calling ReleaseObject on it.

See also
SilGetImageData, SilGetDataIndex, SilGetData, SilGetDataReference, SilGetNumLabelReferences, SilGetLabelReference, SilGetMaskData, SilSetMaskData, IsSilData, SilCompareData, SilVerifyDataCompatibility
Parameters
[in]SourceImageinput image from which to extract
[in]nPosXposition at which to extract
[in]nPosYposition at which to extract
[in]nWidthsize to extract
[in]nHeightsize to extract
Returns
TSILDATA object handle or NULL

◆ SilCreateVectorData()

TSILDATA SilCreateVectorData ( const float *  pData,
size_t  nDimension 
)

Creates a SIL vector data object using the input array.

This data object can then be used for creating/adding new entries to a TSIL using SilAddItem. Note that the object needs to be disposed of after use by calling ReleaseObject on it.

See also
SilGetFloatVectorData, SilGetFloatVectorDataDim, SilGetDataIndex, SilGetData, SilGetDataReference, SilGetNumLabelReferences, SilGetLabelReference, SilGetMaskData, SilSetMaskData, IsSilData, SilCompareData, SilVerifyDataCompatibility
Parameters
[in]pDatalocation from where to copy the data
[in]nDimensionamount of data (# of float) to be copied
Returns
data object if creation succeeded, NULL otherwise

◆ SilGetFloatVectorData()

cvbres_t SilGetFloatVectorData ( TSILDATA  Handle,
float *  pTarget,
size_t &  TargetSize 
)

Copies the vector data from the TSILDATA object.

The data will be copied to the location pointed to by pTarget. pTarget must be big enough to hold the whole label vector (verify with SilGetFloatVectorDataDim if necessary).

If Handle does not refer to a float vector data object, an error will be returned.

Parameters
[in]HandleInput data object Handle.
[in]pTargetBuffer to which the label vector should be copied.
[in,out]TargetSizeInput: size of the buffer pointed to by szTarget, output: number of floats copied. Buffer size are/must be given in # of elements, not in bytes!
Returns
HRESULT (<0: failure)

◆ SilGetImageData()

cvbres_t SilGetImageData ( TSILDATA  Handle,
IMG &  Image 
)

Get the image handle of the SIL image data.

The returned image's reference count will not be modified by handle retrieval, so if the caller intends to use the handle for a longer period of time he/she should call ShareObject on the image handle to ensure proper lifetime handling.

If the Handle does not refer to an image data entry, an error will be returned.

Parameters
[in]HandleInput data object Handle
[out]Imagehandle to the encapsulated image data
Returns
HRESULT (<0: failure)

◆ SilVerifyDataCompatibility()

cvbbool_t SilVerifyDataCompatibility ( TSILDATA  Data,
TSILDATATYPE  DataType 
)

Verifies if a datum is compatible with a data type descriptor.

Parameters
[in]DataData object to be verified.
[in]DataTypeData type descriptor object.
Returns
TRUE if Data is compatible with DataType, else FALSE