SkiaTransform
Spatial transforms operating directly on SKBitmap for CPU-optimized preprocessing.
| Function | Description |
|---|---|
centerCrop width height bitmap | Center crop a bitmap to the given width and height. |
flipH bitmap | Flip a bitmap horizontally. |
flipV bitmap | Flip a bitmap vertically. |
pipeline transforms bitmap device | Apply a list of bitmap transforms as a pipeline, then convert to a tensor. |
randomCrop width height bitmap | Random crop a bitmap to the given width and height. |
resize width height bitmap | Resize 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:intheight:intbitmap: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) listbitmap:SKBitmapdevice:Device
Returns Tensor
randomCrop
randomCrop width height bitmap
Random crop a bitmap to the given width and height.
Parameters
width:intheight:intbitmap:SKBitmap
Returns SKBitmap
resize
resize width height bitmap
Resize a bitmap to the given width and height using high-quality sampling.
Parameters
width:intheight:intbitmap:SKBitmap
Returns SKBitmap