Class NativeImageLoader

java.lang.Object
org.eclipse.swt.internal.NativeImageLoader

public class NativeImageLoader extends Object
  • Field Details

    • PNG_INTERLACE_METHOD_OFFSET

      private static final int PNG_INTERLACE_METHOD_OFFSET
      If the 29th byte of the PNG file is not zero, then it is interlaced.
      See Also:
  • Constructor Details

    • NativeImageLoader

      public NativeImageLoader()
  • Method Details

    • load

      public static List<DPIUtil.ElementAtZoom<ImageData>> load(DPIUtil.ElementAtZoom<InputStream> streamAtZoom, ImageLoader imageLoader, int targetZoom)
    • load

      public static ImageData load(InputStream streamAtZoom, ImageLoader imageLoader, int width, int height)
    • isInterlacedPNG

      private static boolean isInterlacedPNG(byte[] imageAsByteArray)
      Return true if the image is an interlaced PNG file. This is used to check whether ImageLoaderEvent should be fired when loading images.
      Returns:
      true iff 29th byte of PNG files is not zero
    • getImageFormat

      private static int getImageFormat(long loader)
      Return the type of file from which the image was read by inspecting GdkPixbufFormat from GdkPixbufLoader It is expressed as one of the following values:
      SWT.IMAGE_BMP
      Windows BMP file format, no compression
      SWT.IMAGE_BMP_RLE
      Windows BMP file format, RLE compression if appropriate
      SWT.IMAGE_GIF
      GIF file format
      SWT.IMAGE_ICO
      Windows ICO file format
      SWT.IMAGE_JPEG
      JPEG file format
      SWT.IMAGE_PNG
      PNG file format
      SWT.IMAGE_TIFF
      TIFF file format
    • pixbufToImageData

      private static ImageData pixbufToImageData(long pixbuf)
      Convert GdkPixbuf pointer to Java object ImageData
      Returns:
      ImageData with pixbuf data
    • save

      public static void save(OutputStream stream, int format, ImageLoader imageLoader)