Class NativeImageLoader
java.lang.Object
org.eclipse.swt.internal.NativeImageLoader
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intIf the 29th byte of the PNG file is not zero, then it is interlaced. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static intgetImageFormat(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_BMPWindows BMP file format, no compressionSWT.IMAGE_BMP_RLEWindows BMP file format, RLE compression if appropriateSWT.IMAGE_GIFGIF file formatSWT.IMAGE_ICOWindows ICO file formatSWT.IMAGE_JPEGJPEG file formatSWT.IMAGE_PNGPNG file formatSWT.IMAGE_TIFFTIFF file formatprivate static booleanisInterlacedPNG(byte[] imageAsByteArray) Return true if the image is an interlaced PNG file.static ImageDataload(InputStream streamAtZoom, ImageLoader imageLoader, int width, int height) static List<DPIUtil.ElementAtZoom<ImageData>> load(DPIUtil.ElementAtZoom<InputStream> streamAtZoom, ImageLoader imageLoader, int targetZoom) private static ImageDatapixbufToImageData(long pixbuf) Convert GdkPixbuf pointer to Java object ImageDatastatic voidsave(OutputStream stream, int format, ImageLoader imageLoader)
-
Field Details
-
PNG_INTERLACE_METHOD_OFFSET
private static final int PNG_INTERLACE_METHOD_OFFSETIf 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
Convert GdkPixbuf pointer to Java object ImageData- Returns:
- ImageData with pixbuf data
-
save
-