Group CImage¶
The functions in this section provide access to information and functionality of images. This includes creation, destruction, and saving as well as a wealth of information including things like width, height, stride, and timestamp.
Public Functions¶
| Type | Name |
|---|---|
| spinImageCalculateStatistics (spinImage hImage, const spinImageStatistics hStatistics) |
|
| spinImageCheckCRC (spinImage hImage, bool8_t * pbCheckCRC) |
|
| spinImageCreate (spinImage hSrcImage, spinImage * phDestImage) |
|
| spinImageCreateEmpty (spinImage * phImage) |
|
| spinImageCreateEx (spinImage * phImage, size_t width, size_t height, size_t offsetX, size_t offsetY, spinPixelFormatEnums pixelFormat, void * pData) |
|
| spinImageCreateEx2 (spinImage * phImage, size_t width, size_t height, size_t offsetX, size_t offsetY, spinPixelFormatEnums pixelFormat, void * pData, spinTLPayloadType dataPayloadType, size_t dataSize) |
|
| spinImageDeepCopy (spinImage hSrcImage, spinImage hDestImage) |
|
| spinImageDestroy (spinImage hImage) |
|
| spinImageGetBitsPerPixel (spinImage hImage, size_t * pBitsPerPixel) |
|
| spinImageGetBufferSize (spinImage hImage, size_t * pSize) |
|
| spinImageGetChunkLayoutID (spinImage hImage, uint64_t * pId) |
|
| spinImageGetColorProcessing (spinImage hImage, spinColorProcessingAlgorithm * pAlgorithm) |
|
| spinImageGetData (spinImage hImage, void ** ppData) |
|
| spinImageGetFrameID (spinImage hImage, uint64_t * pFrameID) |
|
| spinImageGetHeight (spinImage hImage, size_t * pHeight) |
|
| spinImageGetID (spinImage hImage, uint64_t * pId) |
|
| spinImageGetOffsetX (spinImage hImage, size_t * pOffsetX) |
|
| spinImageGetOffsetY (spinImage hImage, size_t * pOffsetY) |
|
| spinImageGetPaddingX (spinImage hImage, size_t * pPaddingX) |
|
| spinImageGetPaddingY (spinImage hImage, size_t * pPaddingY) |
|
| spinImageGetPayloadType (spinImage hImage, size_t * pPayloadType) |
|
| spinImageGetPixelFormat (spinImage hImage, spinPixelFormatEnums * pPixelFormat) |
|
| spinImageGetPixelFormatName (spinImage hImage, char * pBuf, size_t * pBufLen) |
|
| spinImageGetPrivateData (spinImage hImage, void ** ppData) |
|
| spinImageGetSize (spinImage hImage, size_t * pImageSize) |
|
| spinImageGetStatus (spinImage hImage, spinImageStatus * pStatus) |
|
| spinImageGetStatusDescription (spinImageStatus status, char * pBuf, size_t * pBufLen) |
|
| spinImageGetStride (spinImage hImage, size_t * pStride) |
|
| spinImageGetTLPayloadType (spinImage hImage, spinTLPayloadType * pPayloadType) |
|
| spinImageGetTLPixelFormat (spinImage hImage, uint64_t * pPixelFormat) |
|
| spinImageGetTLPixelFormatNamespace (spinImage hImage, spinTLPixelFormatNamespace * pPixelFormatNamespace) |
|
| spinImageGetTimeStamp (spinImage hImage, uint64_t * pTimeStamp) |
|
| spinImageGetValidPayloadSize (spinImage hImage, size_t * pSize) |
|
| spinImageGetWidth (spinImage hImage, size_t * pWidth) |
|
| spinImageHasCRC (spinImage hImage, bool8_t * pbHasCRC) |
|
| spinImageIsIncomplete (spinImage hImage, bool8_t * pbIsIncomplete) |
|
| spinImageLoad (spinImage * phImage, const char * fileName) |
|
| spinImageRelease (spinImage hImage) |
|
| spinImageReset (spinImage hImage, size_t width, size_t height, size_t offsetX, size_t offsetY, spinPixelFormatEnums pixelFormat) |
|
| spinImageResetEx (spinImage hImage, size_t width, size_t height, size_t offsetX, size_t offsetY, spinPixelFormatEnums pixelFormat, void * pData) |
|
| spinImageSave (spinImage hImage, const char * pFilename, spinImageFileFormat format) |
|
| spinImageSaveBmp (spinImage hImage, const char * pFilename, const spinBMPOption * pOption) |
|
| spinImageSaveFromExt (spinImage hImage, const char * pFilename) |
|
| spinImageSaveJpeg (spinImage hImage, const char * pFilename, const spinJPEGOption * pOption) |
|
| spinImageSaveJpg2 (spinImage hImage, const char * pFilename, const spinJPG2Option * pOption) |
|
| spinImageSavePgm (spinImage hImage, const char * pFilename, const spinPGMOption * pOption) |
|
| spinImageSavePng (spinImage hImage, const char * pFilename, const spinPNGOption * pOption) |
|
| spinImageSavePpm (spinImage hImage, const char * pFilename, const spinPPMOption * pOption) |
|
| spinImageSaveTiff (spinImage hImage, const char * pFilename, const spinTIFFOption * pOption) |
Public Functions Documentation¶
function spinImageCalculateStatistics¶
Calculates the image statistics of an image
See also: spinError
Parameters:
hImageThe image to be savedhStatisticsThe image statistics context in which the calculated statistics are returned
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageCheckCRC¶
Checks whether the CRC of an image is correct
See also: spinError
Parameters:
hImageThe image to be savedpbCheckCRCThe boolean pointer to return whether the image CRC passes
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageCreate¶
Creates an image from another; images created this way must be destroyed
See also: spinError
Parameters:
hSrcImageThe image to be copiedphDestImageThe image handle pointer of the image to be created
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageCreateEmpty¶
Creates an empty image; images created this way must be destroyed
See also: spinError
Parameters:
phImageThe image handle pointer in which the empty image is returned
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageCreateEx¶
spinImageCreateEx (
spinImage * phImage,
size_t width,
size_t height,
size_t offsetX,
size_t offsetY,
spinPixelFormatEnums pixelFormat,
void * pData
)
Creates an image with some set properties; images created this way must be destroyed
See also: spinError
Parameters:
phImageThe image handle pointer in which the image is returnedwidthThe width to setheightThe height to setoffsetXThe offset along the X axis to setoffsetYThe offset along the Y axis to setpixelFormatThe pixel format to setpDataThe image data to set; can be set to null
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageCreateEx2¶
spinImageCreateEx2 (
spinImage * phImage,
size_t width,
size_t height,
size_t offsetX,
size_t offsetY,
spinPixelFormatEnums pixelFormat,
void * pData,
spinTLPayloadType dataPayloadType,
size_t dataSize
)
Creates an image with some set properties; images created this way must be destroyed
See also: spinError
See also: spinImageGetTLPayloadType
Parameters:
phImageThe image handle pointer in which the image is returnedwidthThe width to setheightThe height to setoffsetXThe offset along the X axis to setoffsetYThe offset along the Y axis to setpixelFormatThe pixel format to setpDataThe image data to set; can be set to nulldataPayloadTypeThe payload type of the data. This value can be retrieved from an existing image by using the spinImageGetTLPayloadType() function call.dataSizeThe size of the provided data in bytes
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageDeepCopy¶
Creates a deep copy of an image (the destination image must be created as an empty image prior to the deep copy)
See also: spinError
Parameters:
hSrcImageThe image to be copiedhDestImageThe image handle in which the image is copied
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageDestroy¶
Destroys an image
See also: spinError
Parameters:
hImageThe image to destroy
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageGetBitsPerPixel¶
Retrieves the number of bits per pixel of an image
See also: spinError
Parameters:
hImageThe image to be savedpBitsPerPixelThe unsigned integer pointer in which the number of bits per pixel is returned
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageGetBufferSize¶
Retrieves the buffer size of an image
See also: spinError
Parameters:
hImageThe image of image data buffer to retrievepSizeThe unsigned integer pointer in which the size of the image data if returned
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageGetChunkLayoutID¶
Retrieves the chunk layout ID of an image
See also: spinError
Parameters:
hImageThe image to be savedpIdThe unsigned integer pointer in which the chunk layout ID is returned
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageGetColorProcessing¶
Retrieves the color processing algorithm of a specific image
See also: spinError
Parameters:
hImageThe image of the color processing algorithm to retrievepAlgorithmThe color processing algorithm pointer in which the color processing algorithm is returned
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageGetData¶
Retrieves the image data of an image
See also: spinError
Parameters:
hImageThe image of the image data to retrieveppDataThe pointer to the void pointer in which the image data is retrieved
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageGetFrameID¶
Retrieves the frame ID of an image
See also: spinError
Parameters:
hImageThe image of the frame ID to retrievepFrameIDThe unsigned integer pointer in which the frame ID is returned
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageGetHeight¶
Retrieves the height of an image
See also: spinError
Parameters:
hImageThe image of the height to retrievepHeightThe unsigned integer pointer in which the height is returned
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageGetID¶
Retrieves the ID of an image
See also: spinError
Parameters:
hImageThe image of the ID to retrievepIdThe unsigned integer pointer in which the ID is returned
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageGetOffsetX¶
Retrieves the offset of an image along its X axis
See also: spinError
Parameters:
hImageThe image of the offset along the X axis to retrievepOffsetXThe unsigned integer pointer in which the offset along the X axis is returned
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageGetOffsetY¶
Retrieves the offset of an image along its Y axis
See also: spinError
Parameters:
hImageThe image of the offset along the Y axis to retrievepOffsetYThe unsigned integer pointer in which the offset along the Y axis is returned
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageGetPaddingX¶
Retrieves the padding of an image along its X axis
See also: spinError
Parameters:
hImageThe image of the padding along the X axis to retrievepPaddingXThe unsigned integer pointer in which the padding along the X axis is returned
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageGetPaddingY¶
Retrieves the padding of an image along its Y axis
See also: spinError
Parameters:
hImageThe image of the padding along the Y axis to retrievepPaddingYThe unsigned integer pointer in which the padding along the Y axis is returned
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageGetPayloadType¶
Retrieves the payload type of an image (as an enum, spinPayloadTypeInfoIds)
See also: spinError
See also: spinPayloadTypeInfoIds
Parameters:
hImageThe image of the payload type to retrievepPayloadTypeThe payload type enum pointer in which the payload type is returned
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageGetPixelFormat¶
Retrieves the pixel format of an image (as an enum, spinPixelFormatEnums)
See also: spinError
See also: spinPixelFormatEnums
Parameters:
hImageThe image of the pixel format to retrievepPixelFormatThe pixel format enum pointer in which the pixel format is returned
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageGetPixelFormatName¶
Retrieves the pixel format of an image (as a symbolic)
See also: spinError
Parameters:
hImageThe image of the pixel format to retrievepBufThe c-string character buffer in which the pixel format symbolic is returnedpBufLenThe unsigned integer pointer in which the length of the c-string is returned; the input value is the maximum length
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageGetPrivateData¶
Retrieves the private data of an image
See also: spinError
Parameters:
hImageThe image of the private image data to retrieveppDataThe pointer to the void pointer in which the private image data is retrieved
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageGetSize¶
Retrieves the size of an image
See also: spinError
Parameters:
hImageThe image to be savedpImageSizeThe unsigned integer pointer in which the size of the image is returned
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageGetStatus¶
Retrieves the image status of an image
See also: spinError
Parameters:
hImageThe image to be savedpStatusThe status enum pointer in which the image status is returned
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageGetStatusDescription¶
Retrieves the description of image status
See also: spinError
Parameters:
statusThe status enumpBufThe c-string character buffer in which the explanation of image status enum is returnedpBufLenThe unsigned integer pointer in which the length of the c-string is returned; the input value is the maximum length; if pBuf is NULL, minimum length of string buffer is returned
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageGetStride¶
Retrieves the stride of an image
See also: spinError
Parameters:
hImageThe image to be savedpStrideThe unsigned integer pointer in which the stride is returned
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageGetTLPayloadType¶
Retrieves the transport layer payload type of an image (as an enum, spinPayloadTypeInfoIds)
See also: spinError
See also: spinPayloadTypeInfoIds
Parameters:
hImageThe image of the TL payload type to retrievepPayloadTypeThe payload type enum pointer in which the TL payload type is returned
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageGetTLPixelFormat¶
Retrieves the transport layer pixel format of an image (as an unsigned integer)
See also: spinError
Parameters:
hImageThe image of the TL pixel format to retrievepPixelFormatThe unsigned integer pointer in which the TL pixel format is returned
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageGetTLPixelFormatNamespace¶
spinImageGetTLPixelFormatNamespace (
spinImage hImage,
spinTLPixelFormatNamespace * pPixelFormatNamespace
)
Retrieves the transport layer pixel format namespace of an image (as an enum, spinPixelFormatNamespaceID)
See also: spinError
See also: spinPixelFormatNamespaceID
Parameters:
hImageThe image of the TL pixel format namespace to retrievepPixelFormatNamespaceThe pixel format namespace pointer in which the pixel format namespace is returned
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageGetTimeStamp¶
Retrieves the timestamp of an image
See also: spinError
Parameters:
hImageThe image of the timestamp to retrievepTimeStampThe unsigned integer pointer om which the timestamp is returned
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageGetValidPayloadSize¶
Retrieves the valid payload size of an image
See also: spinError
Parameters:
hImageThe image of the payload size to retrievepSizeThe unsigned integer pointer in which the size of the valid payload is returned
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageGetWidth¶
Retrieves the width of an image
See also: spinError
Parameters:
hImageThe image of the width to retrievepWidthThe unsigned integer pointer in which the width is returned
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageHasCRC¶
Checks whether an image has CRC
See also: spinError
Parameters:
hImageThe image to be savedpbHasCRCThe boolean pointer to return whether the image has CRC available
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageIsIncomplete¶
Checks whether an image is incomplete
See also: spinError
Parameters:
hImageThe image to checkpbIsIncompleteThe boolean pointer to return whether or not the image is incomplete
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageLoad¶
Creates an image object from file.
See also: spinError
Parameters:
phImageThe image handle pointer in which the image is returnedfileNameName of the file to load an image object from.
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageRelease¶
Releases an image
See also: spinError
Parameters:
hImageThe image to be saved
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageReset¶
spinImageReset (
spinImage hImage,
size_t width,
size_t height,
size_t offsetX,
size_t offsetY,
spinPixelFormatEnums pixelFormat
)
Resets an image with some set properties
See also: spinError
Parameters:
hImageThe image to be resetwidthThe width to be reset toheightThe height to be reset tooffsetXThe offset to be reset to along the X axisoffsetYThe offset to be reset to along the Y axispixelFormatThe pixel format to be reset to
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageResetEx¶
spinImageResetEx (
spinImage hImage,
size_t width,
size_t height,
size_t offsetX,
size_t offsetY,
spinPixelFormatEnums pixelFormat,
void * pData
)
Resets an image with some set properties and image data
See also: spinError
Parameters:
hImageThe image to resetwidthThe width to be reset toheightThe height to be reset tooffsetXThe offset to be reset to along the X axisoffsetYThe offset to be reset to along the Y axispixelFormatThe pixel format to be reset topDataThe image data to reset to
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageSave¶
Saves an image using a specified file format (using an enum, spinImageFileFormat)
See also: spinError
See also: spinImageFileFormat
Parameters:
hImageThe image to be savedpFilenameThe filename to use to save the image (with or without the appropriate file extension) @Param format The file format to use to save the image
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageSaveBmp¶
Saves an image as a BMP image
See also: spinError
Parameters:
hImageThe image to be savedpFilenameThe filename to use to save the image (with or without the appropriate file extension)pOptionThe image options related to saving as BMP; includes whether to save as indexed 8-bit
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageSaveFromExt¶
Saves an image using a specified file format (using the extension of the filename)
See also: spinError
Parameters:
hImageThe image to be savedpFilenameThe filename to use to save the image (with or without the appropriate file extension)
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageSaveJpeg¶
Saves an image as a JPEG image
See also: spinError
Parameters:
hImageThe image to be savedpFilenameThe filename to use to save the image (with or without the appropriate file extension)pOptionThe image options related to saving as JPEG; includes quality and whether to save as progressive
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageSaveJpg2¶
Saves an image as a JPEG 2000 image
See also: spinError
Parameters:
hImageThe image to be savedpFilenameThe filename to use to save the image (with or without the appropriate file extension)pOptionThe image options related to saving as JPEG 2000; includes quality
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageSavePgm¶
Saves an image as an PGM image
See also: spinError
Parameters:
hImageThe image to be savedpFilenameThe filename to use to save the image (with or without the appropriate file extension)pOptionThe image options related to saving as PGM; includes whether to save as binary
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageSavePng¶
Saves an image as a PNG image
See also: spinError
Parameters:
hImageThe image to be savedpFilenameThe filename to use to save the image (with or without the appropriate file extension)pOptionThe image options related to saving as PNG; includes compression level and whether to save as interlaced
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageSavePpm¶
Saves an image as a PPM image
See also: spinError
Parameters:
hImageThe image to be savedpFilenameThe filename to use to save the image (with or without the appropriate file extension)pOptionThe image options related to saving as PPM; includes whether to save as binary
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
function spinImageSaveTiff¶
Saves an image as a TIFF image
See also: spinError
Parameters:
hImageThe image to be savedpFilenameThe filename to use to save the image (with or without the appropriate file extension)pOptionThe image options related to saving as TIFF; includes compression method
Returns:
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error