Interface IHasImageInfo

  • All Known Implementing Classes:
    Bitmap, Codec, Image

    public interface IHasImageInfo
    • Method Detail

      • getWidth

        default int getWidth()
        Returns pixel count in each row. Should be equal or less than getRowBytes() / getImageInfo().getBytesPerPixel(). May be less than getPixelRef().getWidth(). Will not exceed getPixelRef().getWidth() less
        Returns:
        pixel width in ImageInfo
      • getHeight

        default int getHeight()
        Returns pixel row count. Maybe be less than getPixelRef().getHeight(). Will not exceed getPixelRef().getHeight()
        Returns:
        pixel height in ImageInfo
      • getColorInfo

        @NotNull
        default @NotNull ColorInfo getColorInfo()
      • getColorType

        @NotNull
        default @NotNull ColorType getColorType()
      • getAlphaType

        @NotNull
        default @NotNull ColorAlphaType getAlphaType()
      • getColorSpace

        @Nullable
        default @Nullable ColorSpace getColorSpace()
      • getBytesPerPixel

        default int getBytesPerPixel()
        Returns number of bytes per pixel required by ColorType. Returns zero if colorType is ColorType.UNKNOWN.
        Returns:
        bytes in pixel
      • getShiftPerPixel

        default int getShiftPerPixel()
        Returns bit shift converting row bytes to row pixels. Returns zero for ColorType.UNKNOWN.
        Returns:
        one of: 0, 1, 2, 3; left shift to convert pixels to bytes
      • isEmpty

        default boolean isEmpty()
        Returns true if either getWidth() or getHeight() are zero. Does not check if PixelRef is null; call Bitmap.drawsNothing() to check getWidth(), getHeight(), and PixelRef.
        Returns:
        true if dimensions do not enclose area
      • isOpaque

        default boolean isOpaque()

        Returns true if ColorAlphaType is set to hint that all pixels are opaque; their alpha value is implicitly or explicitly 1.0. If true, and all pixels are not opaque, Skia may draw incorrectly.

        Does not check if SkColorType allows alpha, or if any pixel value has transparency.

        Returns:
        true if ImageInfo ColorAlphaType is ColorAlphaType.OPAQUE