createImageTensor static method
Tensor
createImageTensor(
- HalideType type,
- int width,
- int height,
- int bytesPerChannel, {
- Image? image,
@brief create tensor with given data.
@param width image width. @param height image height. @param bytesPerChannel bytes per pixel. @param image image.
@return created tensor.
Implementation
static Tensor createImageTensor(
HalideType type,
int width,
int height,
int bytesPerChannel, {
Image? image,
}) {
final pImage = image == null ? ffi.nullptr : image.ptr;
final ptr =
c.mnn_cv_image_process_create_image_tensor(type.native.ref, width, height, bytesPerChannel, pImage);
return Tensor.fromPointer(ptr);
}