Pleora Technologies Inc. eBUS SDK v6.2.8.5877 API



IPvMultiPartContainerWriter Class Referenceabstract

Interface used to write to a multi-part container. More...

Public Member Functions

virtual void Reset ()=0
 Resets the multi-part container index to empty - no parts.
 
virtual PvResult AddImagePart (PvMultiPartDataType aDataType, uint32_t aWidth, uint32_t aMaxHeight, PvPixelType aPixelType, uint32_t aOffsetX=0, uint32_t aOffsetY=0, uint16_t aPaddingX=0)=0
 Adds an image part to the index of a multi-part container. More...
 
virtual PvResult AddJPEGPart (PvMultiPartDataType aDataType, uint32_t aMaxLength, uint8_t aFlag, uint64_t aTimestampTickFrequency, uint32_t aDataFormat)=0
 Adds a JPEG part to the index of a multi-part container. More...
 
virtual PvResult AddChunkPart (uint32_t aMaxLength, uint32_t aChunkLayoutID)=0
 Adds a chunk data part to the index of a multi-part container. More...
 
virtual PvResult SetPartIDs (uint32_t aIndex, uint32_t aSourceID, uint32_t aDataPurposeID, uint32_t aRegionID)=0
 Sets the source, data purpose and region IDs of a part. More...
 
virtual PvResult SetPartZoneInfo (uint32_t aIndex, uint8_t aAdditionalZones, uint32_t aZoneDirectionMask)=0
 Sets the zone info of a part. More...
 
virtual PvResult AllocAllParts ()=0
 Allocates memory for all parts defined by the part index of the multi-part container. More...
 
virtual PvResult AllocPart (uint32_t aIndex)=0
 Allocates memory for one of the parts as defined by the index of the part. More...
 
virtual PvResult AttachPart (uint32_t aIndex, uint8_t *aBuffer, uint64_t aLength)=0
 Attaches a part to an external memory buffer. More...
 
virtual PvResult SetPartFinalLength (uint32_t aIndex, uint32_t aLength)=0
 Sets the final length of a part. More...
 
virtual PvResult SetPartFinalImageHeight (uint32_t aIndex, uint32_t aHeight)=0
 Sets the final height of an image part. More...
 
virtual PvResult Validate ()=0
 Validates the part index and allocated/attached part memory. More...
 
- Public Member Functions inherited from IPvMultiPartContainerReader
virtual uint32_t GetPartCount ()=0
 Part count of the multi-part container. More...
 
virtual const IPvMultiPartSectionGetPart (uint32_t aIndex) const =0
 Indexed part (section) const accessor. More...
 
virtual IPvMultiPartSectionGetPart (uint32_t aIndex)=0
 Indexed part (section) accessor. More...
 
virtual const IPvMultiPartSectionoperator[] (uint32_t aIndex) const =0
 Indexed part (section) const accessor. More...
 
virtual IPvMultiPartSectionoperator[] (uint32_t aIndex)=0
 Indexed part (section) accessor. More...
 

Detailed Description

Interface used to write to a multi-part container.

This interface is used to create a multi-part PvBuffer than can be transmitted using PvSoftDeviceGEV. A multi-part buffer would typically be prepared for transmission by:

Adding parts with this interface only creates the part definition in the part index of the container. Memory then needs to be allocated or attached for all parts. Make sure to call Validate after defining the parts and allocating or attaching memory to make sure the multi-part container is properly setup.

You can either have no data chunk part of one chunk part and that part needs to be the last part. Use The IPvChunkData interface to the section to define the chunk data and confirm the chunk length using SetPartFinalLength to confirm the chunk data length.

See SoftGEVDeviceMultiPart C++ eBUS SDK sample for more information.

GigE Vision restricts the maximum part count to 10. This limitation comes from the part index size in the context of the maximum GVSP header size.

Member Function Documentation

◆ AddChunkPart()

PvResult IPvMultiPartContainerWriter::AddChunkPart ( uint32_t  aMaxLength,
uint32_t  aChunkLayoutID 
)
pure virtual

Adds a chunk data part to the index of a multi-part container.

The chunk data section is always last in a multi-part container. There can only be one chunk data section for a multi-part container. A chunk data section can contain one or more chunks.

Parameters
[in]aMaxLengthMaximum length for chunk data.
[in]aChunkLayoutIDChunk layoud ID for the chunk data.
Returns
Includes:

◆ AddImagePart()

PvResult IPvMultiPartContainerWriter::AddImagePart ( PvMultiPartDataType  aDataType,
uint32_t  aWidth,
uint32_t  aMaxHeight,
PvPixelType  aPixelType,
uint32_t  aOffsetX = 0,
uint32_t  aOffsetY = 0,
uint16_t  aPaddingX = 0 
)
pure virtual

Adds an image part to the index of a multi-part container.

Calling this method only defines a new image in the multi-part container index. Memory needs to be allocated or attached using the AllocAllParts, AllocPart or AttachPart methods.

The height is initially defined as maximum height. It is possible to later call SetPartFinalImageHeight to confirm the effective height of the image, as long as the confirmed height is less or equal to the maximum height defined here. This allows linescan-like scenario where the final height of the image is not known when the image part is defined and its memory allocated or attached.

Parameters
[in]aDataTypeImage data type. Must be between PvMultiPart2DImage and PvMultiPartConfidenceMap, inclusive.
[in]aWidthWidth of the image, in pixels.
[in]aMaxHeightHeight of the image, in pixels.
[in]aPixelTypePixel type of the image.
[in]aOffsetXOffset X of the image, in pixels.
[in]aOffsetYOffset Y of the image, in pixels.
[in]aPaddingXPadding X of the image, in bytes.
Returns
Includes:

◆ AddJPEGPart()

PvResult IPvMultiPartContainerWriter::AddJPEGPart ( PvMultiPartDataType  aDataType,
uint32_t  aMaxLength,
uint8_t  aFlag,
uint64_t  aTimestampTickFrequency,
uint32_t  aDataFormat 
)
pure virtual

Adds a JPEG part to the index of a multi-part container.

Calling this method only defines a new JPEG image in the multi-part container index. Memory needs to be allocated or attached using the AllocAllParts, AllocPart or AttachPart methods.

The length is initially defined as maximum length, in bytes. It is possible to later call SetPartFinalLength to confirm the effective length of the compressed image, as long as the confirmed length is less or equal to the maximum length defined here. This allows reserving memory for the worse-case compression scenario and defining the real compressed image length when putting the part together before transmission.

Parameters
[in]aDataTypeMulti-part data type. Either PvMultiPartJPEGImage or PvMultiPartJPEG2000Image.
[in]aMaxLengthMaximum length for the compressed image. Defined here as worse-case compression, exact size later confirmed with SetPartFinalLength.
[in]aFlagJPEG flags.
[in]aTimestampTickFrequencyTimestamp tick frequency. Can be used with JPEG2000 to turn buffer timestamp into real time units.
[in]aDataFormatJPEG data format.
Returns
Includes:

◆ AllocAllParts()

PvResult IPvMultiPartContainerWriter::AllocAllParts ( )
pure virtual

Allocates memory for all parts defined by the part index of the multi-part container.

With this method all parts are allocated as a single contiguous memory buffer.

Memory is allocated based on each parts definition: image size is inferred from width, max height, pixel format and padding X. JPEG from the maximum length. Chunk from the maximum chunk length.

If memory was allocated for all parts or individual parts, it is freed before being re-allocated. If memory was attached for any part, it is simply detached.

Returns
Includes:

◆ AllocPart()

PvResult IPvMultiPartContainerWriter::AllocPart ( uint32_t  aIndex)
pure virtual

Allocates memory for one of the parts as defined by the index of the part.

If memory has been previously allocated for all parts, new memory for this part alone is allocated and used instead. Unused memory for the part is still reserved in the contiguous buffer.

Memory is allocated based on each parts definition: image size is inferred from width, max height, pixel format and padding X. JPEG from the maximum length. Chunk from the maximum chunk length.

Parameters
aIndex[in] Zero-based index of the part.
Returns
Includes:

◆ AttachPart()

PvResult IPvMultiPartContainerWriter::AttachPart ( uint32_t  aIndex,
uint8_t *  aBuffer,
uint64_t  aLength 
)
pure virtual

Attaches a part to an external memory buffer.

If memory has been previously allocated for all parts, new memory for this part alone is attached and used instead. Unused memory for the part is still reserved in the contiguous buffer.

Parameters
aIndex[in] Zero-based index of the part.
aBuffer[in] Pointer to the external memory buffer.
aLength[in] Length of the external memory buffer to attach.
Returns
Includes:

◆ SetPartFinalImageHeight()

PvResult IPvMultiPartContainerWriter::SetPartFinalImageHeight ( uint32_t  aIndex,
uint32_t  aHeight 
)
pure virtual

Sets the final height of an image part.

Used to confirm final height of image parts. If this method is not called, the image height is assumed to be the full maximum image height as defined in AddImagePart.

See AddImagePart for more information.

Parameters
aIndex[in] Zero-based index of the part.
aHeight[in] Final height of the part.
Returns
Includes:

◆ SetPartFinalLength()

PvResult IPvMultiPartContainerWriter::SetPartFinalLength ( uint32_t  aIndex,
uint32_t  aLength 
)
pure virtual

Sets the final length of a part.

Used to confirm final length of JPEG and chunk data parts. If this method is not called, the part length is assumed to be the full maximum part length as defined in AddJPEGPart or AddChunkPart.

See AddJPEGPart and AddChunkPart for more information.

Parameters
aIndex[in] Zero-based index of the part.
aLength[in] aLength Final length of the part.
Returns
Includes:

◆ SetPartIDs()

PvResult IPvMultiPartContainerWriter::SetPartIDs ( uint32_t  aIndex,
uint32_t  aSourceID,
uint32_t  aDataPurposeID,
uint32_t  aRegionID 
)
pure virtual

Sets the source, data purpose and region IDs of a part.

See IPvMultiPartSection for more information about these IDs.

If this method is not called after adding a part to the multi-part container index, all IDs are zero.

Parameters
aIndex[in] Zero-based index of the part.
aSourceID[in] Source ID to assign to the part
aDataPurposeID[in] Data purpose ID to assign to the part.
aRegionID[in] Region ID to assign to the part.
Returns
Includes:

◆ SetPartZoneInfo()

PvResult IPvMultiPartContainerWriter::SetPartZoneInfo ( uint32_t  aIndex,
uint8_t  aAdditionalZones,
uint32_t  aZoneDirectionMask 
)
pure virtual

Sets the zone info of a part.

See IPvMultiPartSection for more information about zone info.

If this method is not called after adding a part to the multi-part container index, the number of additional zones and direction mask are both set to zero.

Parameters
aIndex[in] Zero-based index of the part.
aAdditionalZones[in] Number of additional zones for this part.
aZoneDirectionMask[in] Zone direction of for all zones of this part.
Returns
Includes:

◆ Validate()

PvResult IPvMultiPartContainerWriter::Validate ( )
pure virtual

Validates the part index and allocated/attached part memory.

This method goes through all parts defined in the part index of this container and makes sure that enough memory is allocated or attached to each individual part. It can also fail if not part has been defined.

Returns
Includes:

The documentation for this class was generated from the following files:

Copyright (c) 2002-2021 Pleora Technologies Inc.
www.pleora.com