Rotate
Function Usage
Image rotating API of the tensor class, which is used to rotate an image to a specified angle. Asynchronous calling is supported.
Only Atlas inference product and Atlas 800I A2 inference product support this API.
The following conditions must be met:
- The input and output tensors must be on the device or DVPP side, and the parameters (stream and data memory) must be on the same device.
- For synchronization, the device where the data memory is located must be the same as the initialized device.
- The input and output parameters match the tensors types.
Prototype
1 | APP_ERROR Rotate(const Tensor &src, Tensor &dst, const RotateAngle angle, AscendStream& stream = AscendStream::DefaultStream()); |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
src |
Input |
Tensor class, input tensor, which cannot be empty. The input can be HWC (three-dimensional) or HW (two-dimensional).
|
dst |
Output |
Tensor class, rotation result. An empty tensor can be passed.
|
angle |
Input |
RotateAngle enumeration class. It specifies the clockwise rotation angle: 90 degrees, 180 degrees, or 270 degrees (ROTATE_90, ROTATE_180, and ROTATE_270). |
stream |
Input |
AscendStream type. The default value is AscendStream::DefaultStream(). When the parameter value is the default value, the API calling is a synchronous operation. In other cases, the API calling is an asynchronous operation. |
Response Parameters
Data Structure |
Description |
|---|---|
APP_ERROR |
For details about the returned error codes, see APP_ERROR Description. |