Class FileFormat
java.lang.Object
org.eclipse.swt.internal.image.FileFormat
- Direct Known Subclasses:
FileFormat.StaticImageFileFormat, SVGFileFormat
Abstract factory class for loading/unloading images from files or streams
in various image file formats.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescription(package private) intstatic final intprivate static final List<Supplier<FileFormat>> (package private) LEDataInputStream(package private) ImageLoaderprivate static final int(package private) LEDataOutputStream -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancanLoadAtZoom(DPIUtil.ElementAtZoom<InputStream> is, int targetZoom) private static Optional<FileFormat> determineFileFormat(LEDataInputStream stream) static boolean(package private) abstract booleanisFileFormat(LEDataInputStream stream) Return whether or not the specified input stream represents a supported file format.static ImageDataload(InputStream is, ImageLoader loader, int width, int height) static List<DPIUtil.ElementAtZoom<ImageData>> load(DPIUtil.ElementAtZoom<InputStream> is, ImageLoader loader, int targetZoom) Read the specified input stream using the specified loader, and return the device independent image array represented by the stream.(package private) abstract List<DPIUtil.ElementAtZoom<ImageData>> loadFromByteStream(int fileZoom, int targetZoom) Format that do not implementFileFormat.StaticImageFileFormatMUST returnImageDatawith the specifiedtargetZoom.(package private) abstract ImageDataloadFromByteStreamBySize(int width, int height) loadFromStream(LEDataInputStream stream, int fileZoom, int targetZoom) Read the specified input stream, and return the device independent image array represented by the stream.loadFromStreamBySize(LEDataInputStream stream, int width, int height) static voidsave(OutputStream os, int format, ImageLoader loader) Write the device independent image array stored in the specified loader to the specified output stream using the specified file format.(package private) abstract voidunloadIntoByteStream(ImageLoader loader) voidunloadIntoStream(ImageLoader loader, LEDataOutputStream stream) Write the device independent image array stored in the specified loader to the specified output stream.
-
Field Details
-
FORMAT_FACTORIES
-
DEFAULT_ZOOM
public static final int DEFAULT_ZOOM- See Also:
-
MAX_SIGNATURE_BYTES
private static final int MAX_SIGNATURE_BYTES- See Also:
-
inputStream
LEDataInputStream inputStream -
outputStream
LEDataOutputStream outputStream -
loader
ImageLoader loader -
compression
int compression
-
-
Constructor Details
-
FileFormat
public FileFormat()
-
-
Method Details
-
determineFileFormat
-
isDynamicallySizableFormat
-
isFileFormat
Return whether or not the specified input stream represents a supported file format.- Throws:
IOException
-
loadFromByteStream
Format that do not implementFileFormat.StaticImageFileFormatMUST returnImageDatawith the specifiedtargetZoom. -
loadFromByteStreamBySize
-
loadFromStream
public List<DPIUtil.ElementAtZoom<ImageData>> loadFromStream(LEDataInputStream stream, int fileZoom, int targetZoom) Read the specified input stream, and return the device independent image array represented by the stream. -
loadFromStreamBySize
-
load
public static List<DPIUtil.ElementAtZoom<ImageData>> load(DPIUtil.ElementAtZoom<InputStream> is, ImageLoader loader, int targetZoom) Read the specified input stream using the specified loader, and return the device independent image array represented by the stream. -
load
-
canLoadAtZoom
-
save
Write the device independent image array stored in the specified loader to the specified output stream using the specified file format. -
unloadIntoByteStream
-
unloadIntoStream
Write the device independent image array stored in the specified loader to the specified output stream.
-