public final class ImageDataFactory extends Object
| Modifier and Type | Method and Description |
|---|---|
static ImageData |
create(byte[] bytes)
Create an ImageData instance representing the image from the image bytes.
|
static ImageData |
create(byte[] bytes,
boolean recoverImage)
Create an ImageData instance representing the image from the image bytes.
|
static ImageData |
create(Image image,
Color color)
Gets an instance of an Image from a java.awt.Image
|
static ImageData |
create(Image image,
Color color,
boolean forceBW)
Gets an instance of an Image from a java.awt.Image.
|
static ImageData |
create(int width,
int height,
boolean reverseBits,
int typeCCITT,
int parameters,
byte[] data,
int[] transparency)
Create an ImageData instance from the passed parameters.
|
static ImageData |
create(int width,
int height,
int components,
int bpc,
byte[] data,
int[] transparency)
Create an ImageData instance from the passed parameters.
|
static ImageData |
create(String filename)
Create an ImageData instance representing the image from the specified file.
|
static ImageData |
create(String filename,
boolean recoverImage)
Create an ImageData instance representing the image from the specified file.
|
static ImageData |
create(URL url)
Create an ImageData instance representing the image from the file located at the specified url.
|
static ImageData |
create(URL url,
boolean recoverImage)
Create an ImageData instance representing the image from the file located at the specified url.
|
static ImageData |
createBmp(byte[] bytes,
boolean noHeader)
Get a bitmap ImageData instance from the provided bytes.
|
static ImageData |
createBmp(URL url,
boolean noHeader)
Get a bitmap ImageData instance from the specified url.
|
static GifImageData |
createGif(byte[] bytes)
Return a GifImage object.
|
static ImageData |
createGifFrame(byte[] bytes,
int frame)
Returns a specified frame of the gif image
|
static ImageData |
createGifFrame(URL url,
int frame)
Returns a specified frame of the gif image
|
static List<ImageData> |
createGifFrames(byte[] bytes)
Returns
List of gif image frames |
static List<ImageData> |
createGifFrames(byte[] bytes,
int[] frameNumbers)
Returns
List of gif image frames |
static List<ImageData> |
createGifFrames(URL url)
Returns
List of gif image frames |
static List<ImageData> |
createGifFrames(URL url,
int[] frameNumbers)
Returns
List of gif image frames |
static ImageData |
createJbig2(byte[] bytes,
int page) |
static ImageData |
createJbig2(URL url,
int page) |
static ImageData |
createJpeg(byte[] bytes) |
static ImageData |
createJpeg(URL url)
Create an
ImageData instance from a Jpeg image url |
static ImageData |
createJpeg2000(byte[] bytes) |
static ImageData |
createJpeg2000(URL url) |
static ImageData |
createPng(byte[] bytes) |
static ImageData |
createPng(URL url) |
static ImageData |
createRawImage(byte[] bytes) |
static ImageData |
createTiff(byte[] bytes,
boolean recoverFromImageError,
int page,
boolean direct) |
static ImageData |
createTiff(URL url,
boolean recoverFromImageError,
int page,
boolean direct) |
static boolean |
isSupportedType(byte[] source)
Checks if the type of image (based on first 8 bytes) is supported by factory.
|
static boolean |
isSupportedType(ImageType imageType)
Checks if the type of image is supported by factory.
|
static boolean |
isSupportedType(URL source)
Checks if the type of image (based on first 8 bytes) is supported by factory.
|
public static ImageData create(byte[] bytes, boolean recoverImage)
bytes - byte representation of the image.recoverImage - whether to recover from a image error (for TIFF-images)public static ImageData create(byte[] bytes)
bytes - byte representation of the image.public static ImageData create(URL url, boolean recoverImage)
url - location of the imagerecoverImage - whether to recover from a image error (for TIFF-images)public static ImageData create(URL url)
url - location of the imagepublic static ImageData create(String filename, boolean recoverImage) throws MalformedURLException
filename - filename of the file containing the imagerecoverImage - whether to recover from a image error (for TIFF-images)MalformedURLException - if an error occurred generating the URL.public static ImageData create(String filename) throws MalformedURLException
filename - filename of the file containing the imageMalformedURLException - if an error occurred generating the URL.public static ImageData create(int width, int height, boolean reverseBits, int typeCCITT, int parameters, byte[] data, int[] transparency)
width - width of the image in pixelsheight - height of the image in pixelsreverseBits - whether to reverse the bits stored in data (TIFF images).typeCCITT - Type of CCITT encodingparameters - colour space parametersdata - array containing raw image datatransparency - array containing transparency informationpublic static ImageData create(int width, int height, int components, int bpc, byte[] data, int[] transparency)
width - width of the image in pixelsheight - height of the image in pixelscomponents - colour space componentsbpc - bits per colour.data - array containing raw image datatransparency - array containing transparency informationpublic static ImageData create(Image image, Color color) throws IOException
image - the java.awt.Image to convertcolor - if different from null the transparency pixels are replaced by this colorIOException - if an I/O error occurs.public static ImageData create(Image image, Color color, boolean forceBW) throws IOException
image - the java.awt.Image to convertcolor - if different from null the transparency pixels are replaced by this colorforceBW - if true the image is treated as black and whiteIOException - if an I/O error occurs.public static ImageData createBmp(URL url, boolean noHeader)
url - location of the image.noHeader - Whether the image contains a header.public static ImageData createBmp(byte[] bytes, boolean noHeader)
bytes - array containing the raw image datanoHeader - Whether the image contains a header.public static GifImageData createGif(byte[] bytes)
bytes - array containing the raw image datapublic static ImageData createGifFrame(URL url, int frame)
url - url of gif imageframe - number of frame to be returned, 1-basedpublic static ImageData createGifFrame(byte[] bytes, int frame)
bytes - byte array of gif imageframe - number of frame to be returned, 1-basedpublic static List<ImageData> createGifFrames(byte[] bytes, int[] frameNumbers)
List of gif image framesbytes - byte array of gif imageframeNumbers - array of frame numbers of gif image, 1-basedpublic static List<ImageData> createGifFrames(URL url, int[] frameNumbers)
List of gif image framesurl - url of gif imageframeNumbers - array of frame numbers of gif image, 1-basedpublic static List<ImageData> createGifFrames(byte[] bytes)
List of gif image framesbytes - byte array of gif imagepublic static List<ImageData> createGifFrames(URL url)
List of gif image framesurl - url of gif imagepublic static ImageData createJbig2(byte[] bytes, int page)
public static ImageData createJpeg(URL url)
ImageData instance from a Jpeg image urlurl - URLpublic static ImageData createJpeg(byte[] bytes)
public static ImageData createJpeg2000(byte[] bytes)
public static ImageData createPng(byte[] bytes)
public static ImageData createTiff(URL url, boolean recoverFromImageError, int page, boolean direct)
public static ImageData createTiff(byte[] bytes, boolean recoverFromImageError, int page, boolean direct)
public static ImageData createRawImage(byte[] bytes)
public static boolean isSupportedType(byte[] source)
true it doesn't means that create(byte[]) won't throw exceptionsource - image raw bytestrue if first eight bytes are recognised by factory as valid image type and false otherwisepublic static boolean isSupportedType(URL source)
true it doesn't means that create(byte[]) won't throw exceptionsource - image URLtrue if first eight bytes are recognised by factory as valid image type and false otherwisepublic static boolean isSupportedType(ImageType imageType)
true it doesn't means that create(byte[]) won't throw exceptionimageType - image typetrue if image type is supported and false otherwiseCopyright © 1998–2022 iText Group NV. All rights reserved.