hbVPStitch

typedef struct hbVPPoint { uint32_t x; uint32_t y; } hbVPPoint;

A data structure describing the position of a point. hbVPStitch needs to prepare hbVPPoint describing the position of the src source map on the target map for the execution of the stitch task before the creation of the task is performed on it.

  • Member

    Member NameDescription
    xCoordinate x of the upper left corner.
    yCoordinate y of the upper left corner.
int32_t hbVPCreateAlphaBlendLut(hbVPAlphaBlendLut *alphaBlendLut, uint8_t **alphaDatas, hbVPRoi const *alphaBlendRegions, int32_t alphaBlendRegionNum);

The API for calling the alpha-blend lut table for creating a Stitch.

  • Parameter
    • [out] alphaBlendLut Handle pointing to lut table information with stitch alpha-blend lut table information, the parameter must point to nullptr.
    • [in] alphaDatas Memory for the lut table, passed in by the user.
    • [in] alphaBlendRegions Area coordinates for alpha-blend are needed in the dst layer. A single roi is supported to the maximum width of 2000 and the maximum height of 2000.
    • [in] alphaBlendRegionNum The number of regions that need to be alpha-blended in the dst layer.
  • Return Value
    • Return 0 means the API was successfully executed, otherwise the execution failed.
Note
  1. The alpha-blend lut table is a coefficient that operates on each pixel, and by configuring the lut table, arbitrary blending effects can be realized for two pictures;
  2. The alpha value in the alpha-blend lut table will be assigned to the specified src map according to the order in which src is given into it. src order is: src0, src1; then the alpha value in the blend-reg region belongs to src0 and (255-alpha) belongs to src1; as follows:
int32_t hbVPReleaseAlphaBlendLut(hbVPAlphaBlendLut alphaBlendLut);

The API for calling to release Stitch's alpha-blend lut table.

  • Parameter
    • [in] alphaBlendLut A handle to the lut table information.
  • Return Value
    • Return 0 means the API was successfully executed, otherwise the execution failed.
int32_t hbVPStitch(hbUCPTaskHandle_t *taskHandle, hbVPImage *dstImg, hbVPImage const *srcImgs, hbVPPoint const *dstPoses, int32_t srcImgCount, hbVPAlphaBlendLut alphaBlendLut);

The API for calling to Stitch.

Note
  1. In the operator, the position of the source graph on the target graph is only needed to provide the x and y coordinates, and the values of w and h will be obtained from the src.
  2. Call once hbVPStitch interface can not achieve the results of the overlapping region of the fusion of the three maps (for example, you want to overlap the region to achieve the effect of src0 20%, src1 30%, src2 50% splicing), you need to execute the hbVPStitch interface many times.
  3. Stitch interface, the call supports maximum four input src maps at a time, internally it will first stitch the src maps to the specified region.
  4. If the stitched image is in nv12 format, the x and y coordinates specified by the dstPoses parameter, as well as the width and height of the stitched image, must be even numbers.
  • Parameter
    • [out] taskHandle Task handles are responsible for the interaction of the operator with the UCP architecture.
    • [out] dstImg Output picture.
    • [in] srcImgs Input picture array.
    • [in] dstPoses An array of coordinates of the input picture on the output picture starting point, the number and order of the points need to be the same as the input picture.
    • [in] srcImgCount The number of input pictures.
    • [in] alphaBlendLut The lut table information used for splicing.
  • Return Value
    • Return 0 means the API was successfully executed, otherwise the execution failed.
  • Description of interface limitations
    • dstImg: type supports U8C1, format supports Y and nv12. dst picture's width supports 4096 at maximum, 16 at minimum; height supports 2160 at maximum, 2 at minimum. width needs to be 16 bytes aligned.
    • srcImgs: type supports U8C1, format supports Y and nv12, and the type and format need to be the same as the output picture, support the maximum four input picturessrc. The width of the image supports the maximum of 2000 and the minimum of 16; the height of the image supports the maximum of 2000 and the minimum of 2. The width needs to be aligned by 16 bytes.
  • Instructions for use

When using less than or equal to two src graphs to do stitching:

  1. pipline process (src0—copy,src1-copy).

1). First, it will paste src0 onto the dst layer.

2). Then paste src1 onto the dst layer.

3). Since the overlapping regions do not need to be blended, the overlapping regions are covered by the region of src1 in pipline order.

image

  1. pipline process (src0—copy,src1-copy ,src0-src1-blend).

1). First, it will paste src0 onto the dst layer.

2). Then paste src1 onto the dst layer.

3). Since there are overlapping areas and the overlapping areas require a blend operation, overwrite the overlapped area as the result of blending the area specified by src0 and src1.

image

When using greater than two src graphs to do stitching:

  1. pipline process (src0—copy, src1-copy, src2-copy, src0-src1-blend).

1). First, it will paste src0 onto the dst layer.。

2). Next, paste src1 onto the dst layer.

3). Then paste src2 onto the dst layer.

4). Finally, since there are overlapping regions and the overlapping regions need to perform a blend operation to overwrite the overlapping regions as the result of blending the regions specified by src0 and src1.

image

  1. pipline process (src0—copy,src1-copy,src2-copy,src0-src1-blend,src0-src2-blend).
Note

Call once the interface does not support, because the stitch is according to the pipline process order refresh mechanism, can not be done at once pipline to complete the fusion of the three map results show ( for example, if you want to overlap the region to achieve the effect of src0 20%, src1 30%, src2 50% splicing). There are internal judgment mechanisms that will intercept and report errors for the above scenarios.

Correct approach (split into two pipline executions):

pipline0 process (src0—copy,src1-copy, src0-src1-blend).

1). First, it will paste src0 onto the dst layer.

2). Next, paste src1 onto the dst layer.

3). Finally, since there are overlapping regions and the overlapping regions need to perform a blend operation to overwrite the overlapping regions as the result of blending the regions specified by src0 and src1.

image

pipline1 process (src3-copy,src2-copy,src3-src2-blend).

1). First, it will paste src3 onto the dst layer.。

2). Next, paste src2 onto the dst layer.

3). src3 and src2 have overlapping areas, and the overlapping areas need to perform a blend operation to overwrite the overlapping areas as the result of blending the specified areas of src3 and src2.

image