animator.skia.Pixmap¶
- class animator.skia.Pixmap¶
Bases:
pybind11_builtins.pybind11_objectPixmapprovides a utility to pairImageInfowith pixels and row bytes. The buffer protocol is supported. It is possible to mountPixmapas array:array = np.array(pixmap, copy=False)
Or mount array as
PixmapwithImageInfo:buffer = np.zeros((100, 100, 4), np.uint8) array = skia.Pixmap(skia.ImageInfo.MakeN32Premul(100, 100), buffer)
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: animator.skia.Pixmap) -> None
__init__(self: animator.skia.Pixmap, info: animator.skia.ImageInfo, addr: Optional[buffer], rowBytes: int = 0) -> None
__init__(self: animator.skia.Pixmap, array: numpy.ndarray, colorType: animator.skia.ColorType = <ColorType.kRGBA_8888_ColorType: 4>, alphaType: animator.skia.AlphaType = <AlphaType.kUnpremul_AlphaType: 3>, colorSpace: animator.skia.ColorSpace = None) -> None
Creates
Pixmapbacked by numpy array.
Methods
__init__(*args, **kwargs)Overloaded function.
addr(self)Returns the pixels as a
memoryview.addr16(self)addr32(self)addr64(self)addr8(self)addrF16(self)alphaType(self)bounds(self)colorSpace(self)colorType(self)computeByteSize(self)computeIsOpaque(self)dimensions(self)erase(*args, **kwargs)Overloaded function.
extractSubset(self, area)Returns a new
Pixmapwith subset of the originalPixmapspecified by area.getAlphaf(self, x, y)getColor(self, x, y)getColor4f(self, x, y)height(self)info(self)isOpaque(self)readPixels(*args, **kwargs)Overloaded function.
refColorSpace(self)reset(*args, **kwargs)Overloaded function.
rowBytes(self)rowBytesAsPixels(self)scalePixels(self, dst, sampling)setColorSpace(self, colorSpace)shiftPerPixel(self)tobytes(self)Convert
Pixmapto bytes.width(self)writable_addr(self)- addr(self: animator.skia.Pixmap) memoryview¶
Returns the pixels as a
memoryview.
- addr16(self: animator.skia.Pixmap) memoryview¶
- addr32(self: animator.skia.Pixmap) memoryview¶
- addr64(self: animator.skia.Pixmap) memoryview¶
- addr8(self: animator.skia.Pixmap) memoryview¶
- addrF16(self: animator.skia.Pixmap) memoryview¶
- alphaType(self: animator.skia.Pixmap) animator.skia.AlphaType¶
- bounds(self: animator.skia.Pixmap) animator.skia.IRect¶
- colorSpace(self: animator.skia.Pixmap) animator.skia.ColorSpace¶
- colorType(self: animator.skia.Pixmap) animator.skia.ColorType¶
- computeByteSize(self: animator.skia.Pixmap) int¶
- computeIsOpaque(self: animator.skia.Pixmap) bool¶
- dimensions(self: animator.skia.Pixmap) animator.skia.ISize¶
- erase(*args, **kwargs)¶
Overloaded function.
erase(self: animator.skia.Pixmap, color: int, subset: animator.skia.IRect) -> bool
erase(self: animator.skia.Pixmap, color: int) -> bool
erase(self: animator.skia.Pixmap, color: animator.skia.Color4f, subset: animator.skia.IRect = None) -> bool
- extractSubset(self: animator.skia.Pixmap, area: animator.skia.IRect) animator.skia.Pixmap¶
Returns a new
Pixmapwith subset of the originalPixmapspecified by area.
- getAlphaf(self: animator.skia.Pixmap, x: int, y: int) float¶
- getColor(self: animator.skia.Pixmap, x: int, y: int) int¶
- getColor4f(self: animator.skia.Pixmap, x: int, y: int) animator.skia.Color4f¶
- height(self: animator.skia.Pixmap) int¶
- info(self: animator.skia.Pixmap) animator.skia.ImageInfo¶
- isOpaque(self: animator.skia.Pixmap) bool¶
- readPixels(*args, **kwargs)¶
Overloaded function.
readPixels(self: animator.skia.Pixmap, dstInfo: animator.skia.ImageInfo, dstPixels: buffer, dstRowBytes: int = 0, srcX: int = 0, srcY: int = 0) -> bool
Copies dstInfo pixels starting from (srcX, srcY) to dstPixels buffer.
readPixels(self: animator.skia.Pixmap, dst: animator.skia.Pixmap, srcX: int = 0, srcY: int = 0) -> bool
- refColorSpace(self: animator.skia.Pixmap) animator.skia.ColorSpace¶
- reset(*args, **kwargs)¶
Overloaded function.
reset(self: animator.skia.Pixmap) -> None
reset(self: animator.skia.Pixmap, info: animator.skia.ImageInfo, addr: Optional[buffer], rowBytes: int = 0) -> None
Sets width, height,
AlphaType, andColorTypefrom info, and a buffer addr.
- rowBytes(self: animator.skia.Pixmap) int¶
- rowBytesAsPixels(self: animator.skia.Pixmap) int¶
- scalePixels(self: animator.skia.Pixmap, dst: animator.skia.Pixmap, sampling: SkSamplingOptions) bool¶
- setColorSpace(self: animator.skia.Pixmap, colorSpace: animator.skia.ColorSpace) None¶
- shiftPerPixel(self: animator.skia.Pixmap) int¶
- tobytes(self: animator.skia.Pixmap) bytes¶
Convert
Pixmapto bytes.
- width(self: animator.skia.Pixmap) int¶
- writable_addr(self: animator.skia.Pixmap) memoryview¶