Class EncoderJPEG


  • public class EncoderJPEG
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      EncoderJPEG()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static long _nEncode​(long ctxPtr, long imagePtr, int quality, int downsampleMode, int alphaMode)  
      static @Nullable Data encode​(@NotNull Image image)
      Encode the provided image and return the resulting bytes.
      static @Nullable Data encode​(@NotNull Image image, @NotNull EncodeJPEGOptions opts)
      Encode the provided image and return the resulting bytes.
      static @Nullable Data encode​(@Nullable DirectContext ctx, @NotNull Image image, @NotNull EncodeJPEGOptions opts)
      Encode the provided image and return the resulting Data.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EncoderJPEG

        public EncoderJPEG()
    • 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 EncodeJPEGOptions opts)
        Encode the provided image and return the resulting bytes.
        Parameters:
        image - image to encode
        opts - 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 EncodeJPEGOptions 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 encode
        opts - 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 quality,
                                    int downsampleMode,
                                    int alphaMode)