Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/canvaseno/mod.ts>SkImage

Canvas API for deno
Latest
interface SkImage
implements EmbindObject<SkImage>
Re-export
import { type SkImage } from "https://deno.land/x/canvaseno@v1.0.2/mod.ts";

See SkImage.h for more information on this class.

Methods

encodeToData(): SkData

Encodes this image's pixels to PNG and returns them. Must be built with the PNG codec.

encodeToDataWithFormat(fmt: EncodedImageFormat, quality: number): SkData

Encodes this image's pixels to the specified format and returns them. Must be built with the specified codec.

height(): number

Return the height in pixels of the image.

makeShader(
localMatrix?: InputMatrix,
): SkShader

Returns this image as a shader with the specified tiling.

readPixels(
imageInfo: SkImageInfo,
srcX: number,
srcY: number,
): Uint8Array | Float32Array | null

Returns a TypedArray containing the pixels reading starting at (srcX, srcY) and does not exceed the size indicated by imageInfo. See SkImage.h for more on the caveats.

width(): number

Return the width in pixels of the image.