|
1 | 1 | # Using InspireFace in Rockchip NPU |
2 | 2 |
|
3 | | -TODO |
| 3 | +## How to Use the SDK |
| 4 | + |
| 5 | +InspireFace-SDK already supports Rockchip's RKNPU and RGA technologies. Most of the basic interfaces of all InspireFace libraries are consistent with no differences, so you can refer to C/C++ and other related usage cases to quickly get started with the RK device-optimized version. |
| 6 | + |
| 7 | +## API Differences |
| 8 | + |
| 9 | +We provide several dedicated APIs for the RK version: |
| 10 | + |
| 11 | +### RGA Related |
| 12 | + |
| 13 | +RKRGA is an image processing acceleration engine provided by RK devices, which can provide acceleration for 2D image transformation processing using hardware advantages. We provide a series of interfaces for configuring RGA. |
| 14 | + |
| 15 | +```c |
| 16 | +/** |
| 17 | + * @brief Check whether RGA is enabled during compilation |
| 18 | + * @param status Pointer to the status variable that will be returned. |
| 19 | + * @return HResult indicating the success or failure of the operation. |
| 20 | + * */ |
| 21 | +HYPER_CAPI_EXPORT extern HResult HFQueryExpansiveHardwareRGACompileOption(HPInt32 enable); |
| 22 | + |
| 23 | +/** |
| 24 | + * @brief Set the rockchip dma heap path |
| 25 | + * By default, we have already configured the DMA Heap address used by RGA on RK devices. |
| 26 | + * If you wish to customize this address, you can modify it through this API. |
| 27 | + * @param path The path to the rockchip dma heap |
| 28 | + * @return HResult indicating the success or failure of the operation. |
| 29 | + * */ |
| 30 | +HYPER_CAPI_EXPORT extern HResult HFSetExpansiveHardwareRockchipDmaHeapPath(HPath path); |
| 31 | + |
| 32 | +/** |
| 33 | + * @brief Query the rockchip dma heap path |
| 34 | + * @param path Pointer to a pre-allocated character array that will store the returned path. |
| 35 | + * The array should be at least 256 bytes in size. |
| 36 | + * @return HResult indicating the success or failure of the operation. |
| 37 | + * */ |
| 38 | +HYPER_CAPI_EXPORT extern HResult HFQueryExpansiveHardwareRockchipDmaHeapPath(HString path); |
| 39 | + |
| 40 | +/** |
| 41 | + * @brief Enum for image processing backend. |
| 42 | + */ |
| 43 | +typedef enum HFImageProcessingBackend { |
| 44 | + HF_IMAGE_PROCESSING_CPU = 0, ///< CPU backend(Default) |
| 45 | + HF_IMAGE_PROCESSING_RGA = 1, ///< Rockchip RGA backend(Hardware support is mandatory) |
| 46 | +} HFImageProcessingBackend; |
| 47 | + |
| 48 | +/** |
| 49 | + * @brief Switch the image processing backend, must be called before HFCreateInspireFaceSession. |
| 50 | + * @param backend The image processing backend to be set. |
| 51 | + * @return HResult indicating the success or failure of the operation. |
| 52 | + * */ |
| 53 | +HYPER_CAPI_EXPORT extern HResult HFSwitchImageProcessingBackend(HFImageProcessingBackend backend); |
| 54 | + |
| 55 | +/** |
| 56 | + * @brief Set the image process aligned width, must be called before HFCreateInspireFaceSession. |
| 57 | + * @param width The image process aligned width to be set. |
| 58 | + * @return HResult indicating the success or failure of the operation. |
| 59 | + * */ |
| 60 | +HYPER_CAPI_EXPORT extern HResult HFSetImageProcessAlignedWidth(HInt32 width); |
| 61 | +``` |
| 62 | +
|
0 commit comments