Package io.github.humbleui.skija
Interface IHasImageInfo
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default @NotNull ColorAlphaTypegetAlphaType()default intgetBytesPerPixel()Returns number of bytes per pixel required by ColorType.default @NotNull ColorInfogetColorInfo()default @Nullable ColorSpacegetColorSpace()default @NotNull ColorTypegetColorType()default intgetHeight()Returns pixel row count.ImageInfogetImageInfo()default intgetShiftPerPixel()Returns bit shift converting row bytes to row pixels.default intgetWidth()Returns pixel count in each row.default booleanisEmpty()Returns true if either getWidth() or getHeight() are zero.default booleanisOpaque()Returns true if ColorAlphaType is set to hint that all pixels are opaque; their alpha value is implicitly or explicitly 1.0.
-
-
-
Method Detail
-
getImageInfo
ImageInfo getImageInfo()
-
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 isColorType.UNKNOWN.- Returns:
- bytes in pixel
-
getShiftPerPixel
default int getShiftPerPixel()
Returns bit shift converting row bytes to row pixels. Returns zero forColorType.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; callBitmap.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
-
-