skia
    Preparing search index...

    Interface Image

    See SkImage.h for more information on this class.

    interface Image {
        _type: "Image";
        delete(): void;
        deleteLater(): void;
        encodeToBytes(
            fmt?: EmbindEnumEntity,
            quality?: number,
        ): Uint8Array<ArrayBufferLike> | null;
        getColorSpace(): ColorSpace;
        getImageInfo(): PartialImageInfo;
        height(): number;
        isAliasOf(other: any): boolean;
        isDeleted(): boolean;
        makeCopyWithDefaultMipmaps(): Image;
        makeShaderCubic(
            tx: EmbindEnumEntity,
            ty: EmbindEnumEntity,
            B: number,
            C: number,
            localMatrix?: InputMatrix,
        ): Shader;
        makeShaderOptions(
            tx: EmbindEnumEntity,
            ty: EmbindEnumEntity,
            fm: EmbindEnumEntity,
            mm: EmbindEnumEntity,
            localMatrix?: InputMatrix,
        ): Shader;
        readPixels(
            srcX: number,
            srcY: number,
            imageInfo: ImageInfo,
            dest?: MallocObj,
            bytesPerRow?: number,
        ): Uint8Array<ArrayBufferLike> | Float32Array<ArrayBufferLike> | null;
        width(): number;
    }

    Hierarchy (View Summary)

    Index

    Properties

    _type: "Image"

    Methods

    • Encodes this image's pixels to the specified format and returns them. Must be built with the specified codec. If the options are unspecified, sensible defaults will be chosen.

      Parameters

      • Optionalfmt: EmbindEnumEntity

        PNG is the default value.

      • Optionalquality: number

        a value from 0 to 100; 100 is the least lossy. May be ignored.

      Returns Uint8Array<ArrayBufferLike> | null

    • Returns the color space associated with this object. It is the user's responsibility to call delete() on this after it has been used.

      Returns ColorSpace

    • Return the height in pixels of the image.

      Returns number

    • Returns an Image with the same "base" pixels as the this image, but with mipmap levels automatically generated and attached.

      Returns Image

    • 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.

      If dest is not provided, we allocate memory equal to the provided height * the provided bytesPerRow to fill the data with.

      Parameters

      • srcX: number
      • srcY: number
      • imageInfo: ImageInfo

        describes the destination format of the pixels.

      • Optionaldest: MallocObj

        If provided, the pixels will be copied into the allocated buffer allowing access to the pixels without allocating a new TypedArray.

      • OptionalbytesPerRow: number

        number of bytes per row. Must be provided if dest is set. This depends on destination ColorType. For example, it must be at least 4 * width for the 8888 color type.

      Returns Uint8Array<ArrayBufferLike> | Float32Array<ArrayBufferLike> | null

      a TypedArray appropriate for the specified ColorType. Note that 16 bit floats are not supported in JS, so that colorType corresponds to raw bytes Uint8Array.

    • Return the width in pixels of the image.

      Returns number