SkiaTransform

Spatial transforms operating directly on SKBitmap for CPU-optimized preprocessing.

FunctionDescription
centerCrop width height bitmapCenter crop a bitmap to the given width and height.
flipH bitmapFlip a bitmap horizontally.
flipV bitmapFlip a bitmap vertically.
pipeline transforms bitmap deviceApply a list of bitmap transforms as a pipeline, then convert to a tensor.
randomCrop width height bitmapRandom crop a bitmap to the given width and height.
resize width height bitmapResize a bitmap to the given width and height using high-quality sampling.

centerCrop

centerCrop width height bitmap

Center crop a bitmap to the given width and height.

Parameters

  • width : int
  • height : int
  • bitmap : SKBitmap

Returns SKBitmap


flipH

flipH bitmap

Flip a bitmap horizontally.

Parameters

  • bitmap : SKBitmap

Returns SKBitmap


flipV

flipV bitmap

Flip a bitmap vertically.

Parameters

  • bitmap : SKBitmap

Returns SKBitmap


pipeline

pipeline transforms bitmap device

Apply a list of bitmap transforms as a pipeline, then convert to a tensor.

Parameters

  • transforms : (SKBitmap -> SKBitmap) list
  • bitmap : SKBitmap
  • device : Device

Returns Tensor


randomCrop

randomCrop width height bitmap

Random crop a bitmap to the given width and height.

Parameters

  • width : int
  • height : int
  • bitmap : SKBitmap

Returns SKBitmap


resize

resize width height bitmap

Resize a bitmap to the given width and height using high-quality sampling.

Parameters

  • width : int
  • height : int
  • bitmap : SKBitmap

Returns SKBitmap