Package io.github.humbleui.skija
Class EncoderPNG
- java.lang.Object
-
- io.github.humbleui.skija.EncoderPNG
-
public class EncoderPNG extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description EncoderPNG()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static long_nEncode(long ctxPtr, long imagePtr, int flags, int zlibLevel)static @Nullable Dataencode(@NotNull Image image)Encode the provided image and return the resulting bytes.static @Nullable Dataencode(@NotNull Image image, @NotNull EncodePNGOptions opts)Encode the provided image and return the resulting bytes.static @Nullable Dataencode(@Nullable DirectContext ctx, @NotNull Image image, @NotNull EncodePNGOptions opts)Encode the provided image and return the resulting Data.
-
-
-
Method Detail
-
encode
@Nullable public static @Nullable Data encode(@NotNull @NotNull Image image)
Encode the provided image and return the resulting bytes.- Parameters:
image- image to encode- Returns:
- nullptr if the pixels could not be read or encoding otherwise fails.
-
encode
@Nullable public static @Nullable Data encode(@NotNull @NotNull Image image, @NotNull @NotNull EncodePNGOptions opts)
Encode the provided image and return the resulting bytes.- Parameters:
image- image to encodeopts- may be used to control the encoding behavior- Returns:
- nullptr if the pixels could not be read or encoding otherwise fails.
-
encode
@Nullable public static @Nullable Data encode(@Nullable @Nullable DirectContext ctx, @NotNull @NotNull Image image, @NotNull @NotNull EncodePNGOptions opts)
Encode the provided image and return the resulting Data.- Parameters:
ctx- If the image was created as a texture-backed image on a GPU context, that ctx must be provided so the pixels can be read before being encoded. For raster-backed images, ctx can be null.image- image to encodeopts- may be used to control the encoding behavior- Returns:
- nullptr if the pixels could not be read or encoding otherwise fails.
-
_nEncode
@Internal public static long _nEncode(long ctxPtr, long imagePtr, int flags, int zlibLevel)
-
-