Skip to content

几何算子

几何变换操作。

resize

cpp
GpuImage resize(const GpuImage& input, int width, int height);

使用双线性插值缩放图像。

rotate

cpp
GpuImage rotate(const GpuImage& input, float angle);

按指定角度(度)旋转图像。

flipHorizontal

cpp
GpuImage flipHorizontal(const GpuImage& input);

水平翻转图像。

flipVertical

cpp
GpuImage flipVertical(const GpuImage& input);

垂直翻转图像。

affine

cpp
GpuImage affine(const GpuImage& input, const float matrix[6]);

应用仿射变换。

参数:

  • matrix: 2×3 变换矩阵(行优先)

性能

操作4K 图像加速比
缩放 2×0.6 ms30.5×
旋转0.5 ms28.0×
翻转0.1 ms21.0×

返回 API

Released under the MIT License.