public class ImageType extends Object
Allows to classify the ImageType of an InputStream via ImageType(InputStream)
or to simply define one ImageType via ImageType(String).
| Modifier and Type | Class and Description |
|---|---|
static class |
ImageType.Util
|
| Modifier and Type | Field and Description |
|---|---|
byte[] |
header
The optionally read header of size
MAGIC_MAX_SIZE bytes as used to determine the type,
i.e. |
static int |
MAGIC_MAX_SIZE
Minimum number of bytes to determine the image data type, i.e.
|
static String |
T_3D2
Constant which can be used as a file suffix to indicate a
TBD stream, value "3d2". |
static String |
T_3DMF
Constant which can be used as a file suffix to indicate an Apple QuickDraw 3D 3DMF stream, value "3dmf".
|
static String |
T_92I
Constant which can be used as a file suffix to indicate a Texas Instruments TI-92 Bitmap stream, value "92i".
|
static String |
T_AMFF
Constant which can be used as a file suffix to indicate an Amiga metafile stream, value "amff".
|
static String |
T_ART
Constant which can be used as a file suffix to indicate an America Online Art stream, value "art".
|
static String |
T_BMP
Constant which can be used as a file suffix to indicate a GIF stream, value "bmp".
|
static String |
T_CALS
Constant which can be used as a file suffix to indicate a United States Department of Defence Continuous Acquisition and Life-cycle Support Raster stream, value "cals".
|
static String |
T_CAM
Constant which can be used as a file suffix to indicate a
TBD stream, value "cam". |
static String |
T_CBD
Constant which can be used as a file suffix to indicate a
TBD stream, value "cbd". |
static String |
T_CE2
Constant which can be used as a file suffix to indicate a
TBD stream, value "ce2". |
static String |
T_CIN
Constant which can be used as a file suffix to indicate a Kodak Cineon System stream, value "cin".
|
static String |
T_COB
Constant which can be used as a file suffix to indicate a
TBD stream, value "cob". |
static String |
T_CPT
Constant which can be used as a file suffix to indicate a Corel Photo Paint stream, value "cpt".
|
static String |
T_CUR
Constant which can be used as a file suffix to indicate a Microsoft Windows Cursor stream, value "cur".
|
static String |
T_CVG
Constant which can be used as a file suffix to indicate a
TBD stream, value "cvg". |
static String |
T_DCX
Constant which can be used as a file suffix to indicate a
TBD stream, value "dcx". |
static String |
T_DDS
Constant which can be used as a file suffix to indicate a DirectDraw Surface stream, value "dds".
|
static String |
T_DEM
Constant which can be used as a file suffix to indicate a
TBD stream, value "dem". |
static String |
T_DIB
Constant which can be used as a file suffix to indicate a
TBD stream, value "dib". |
static String |
T_DPX
Constant which can be used as a file suffix to indicate a Digital Picture Exchange stream, value "dpx".
|
static String |
T_DRW
Constant which can be used as a file suffix to indicate a
TBD stream, value "drw". |
static String |
T_DWG
Constant which can be used as a file suffix to indicate a Autocad drawing stream, value "dwg".
|
static String |
T_ECW
Constant which can be used as a file suffix to indicate a Hexagon Geospatial Enhanced Compression Wavelet stream, value "ecw".
|
static String |
T_EMF
Constant which can be used as a file suffix to indicate a Microsoft Windows Enhanced metafile stream, value "emf".
|
static String |
T_FPX
Constant which can be used as a file suffix to indicate a FlashPix stream, value "fpx".
|
static String |
T_FTS
Constant which can be used as a file suffix to indicate a
TBD stream, value "fts". |
static String |
T_GIF
Constant which can be used as a file suffix to indicate a GIF stream, value "gif".
|
static String |
T_GRO
Constant which can be used as a file suffix to indicate a
TBD stream, value "gro". |
static String |
T_HDR
Constant which can be used as a file suffix to indicate a
TBD stream, value "hdr". |
static String |
T_HRU
Constant which can be used as a file suffix to indicate a
TBD stream, value "hru". |
static String |
T_ICNS
Constant which can be used as a file suffix to indicate an Apple Icon Image stream, value "icns".
|
static String |
T_ICO
Constant which can be used as a file suffix to indicate a Microsoft Windows Icon stream, value "ico".
|
static String |
T_IMG
Constant which can be used as a file suffix to indicate a
TBD stream, value "img". |
static String |
T_INFINI_D
Constant which can be used as a file suffix to indicate a
TBD stream, value "infini-d". |
static String |
T_IWC
Constant which can be used as a file suffix to indicate a
TBD stream, value "iwc". |
static String |
T_J6I
Constant which can be used as a file suffix to indicate a
TBD stream, value "j6i". |
static String |
T_JIF
Constant which can be used as a file suffix to indicate a
TBD stream, value "jif". |
static String |
T_JP2
Constant which can be used as a file suffix to indicate a JPEG-2000 stream, value "jp2".
|
static String |
T_JPG
Constant which can be used as a file suffix to indicate a JPEG stream, value "jpg".
|
static String |
T_KDC
Constant which can be used as a file suffix to indicate a
TBD stream, value "kdc". |
static String |
T_L64
Constant which can be used as a file suffix to indicate a
TBD stream, value "l64". |
static String |
T_LBM
Constant which can be used as a file suffix to indicate a
TBD stream, value "lbm". |
static String |
T_LDF
Constant which can be used as a file suffix to indicate a
TBD stream, value "ldf". |
static String |
T_LWF
Constant which can be used as a file suffix to indicate a
TBD stream, value "lwf". |
static String |
T_MBM
Constant which can be used as a file suffix to indicate a
TBD stream, value "mbm". |
static String |
T_MGL
Constant which can be used as a file suffix to indicate a
TBD stream, value "mgl". |
static String |
T_MIF
Constant which can be used as a file suffix to indicate an Imagemagick stream, value "mif".
|
static String |
T_MNG
Constant which can be used as a file suffix to indicate a Multiple-image Network Graphics stream, value "mng".
|
static String |
T_MPW
Constant which can be used as a file suffix to indicate a
TBD stream, value "mpw". |
static String |
T_MSP
Constant which can be used as a file suffix to indicate a
TBD stream, value "msp". |
static String |
T_N64
Constant which can be used as a file suffix to indicate a
TBD stream, value "n64". |
static String |
T_NCR
Constant which can be used as a file suffix to indicate a
TBD stream, value "ncr". |
static String |
T_NFF
Constant which can be used as a file suffix to indicate a
TBD stream, value "nff". |
static String |
T_NGG
Constant which can be used as a file suffix to indicate a
TBD stream, value "ngg". |
static String |
T_NLM
Constant which can be used as a file suffix to indicate a
TBD stream, value "nlm". |
static String |
T_NOL
Constant which can be used as a file suffix to indicate a
TBD stream, value "nol". |
static String |
T_PAL
Constant which can be used as a file suffix to indicate a
TBD stream, value "pal". |
static String |
T_PAM
Constant which can be used as a file suffix to indicate a Portable Arbitrary Map stream, NetPbm magic 7 - binary RGB and RGBA.
|
static String |
T_PAX
Constant which can be used as a file suffix to indicate a
TBD stream, value "pax". |
static String |
T_PBM
Constant which can be used as a file suffix to indicate a PGM stream, NetPbm magic 4 - binary monochrome.
|
static String |
T_PCD
Constant which can be used as a file suffix to indicate a
TBD stream, value "pcd". |
static String |
T_PCL
Constant which can be used as a file suffix to indicate a
TBD stream, value "pcl". |
static String |
T_PCX
Constant which can be used as a file suffix to indicate a
TBD stream, value "pcx". |
static String |
T_PGM
Constant which can be used as a file suffix to indicate a PGM stream, NetPbm magic 5 - binary grayscale.
|
static String |
T_PIC
Constant which can be used as a file suffix to indicate a Softimage pic stream, value "pic".
|
static String |
T_PIX
Constant which can be used as a file suffix to indicate a
TBD stream, value "pix". |
static String |
T_PNG
Constant which can be used as a file suffix to indicate a PNG stream, value "png".
|
static String |
T_POL
Constant which can be used as a file suffix to indicate a
TBD stream, value "pol". |
static String |
T_PPM
Constant which can be used as a file suffix to indicate a PAM stream, NetPbm magic 6 - binary RGB.
|
static String |
T_PSD
Constant which can be used as a file suffix to indicate a Adobe PhotoShop stream, value "psd".
|
static String |
T_PSP
Constant which can be used as a file suffix to indicate a PaintShop Pro stream, value "psp".
|
static String |
T_QFX
Constant which can be used as a file suffix to indicate a
TBD stream, value "qfx". |
static String |
T_QTM
Constant which can be used as a file suffix to indicate a
TBD stream, value "qtm". |
static String |
T_RAD
Constant which can be used as a file suffix to indicate a
TBD stream, value "rad". |
static String |
T_RAS
Constant which can be used as a file suffix to indicate a Sun Raster stream, value "ras".
|
static String |
T_RIX
Constant which can be used as a file suffix to indicate a
TBD stream, value "rix". |
static String |
T_SGI_RGB
Constant which can be used as a file suffix to indicate an SGI RGB stream, value "rgb".
|
static String |
T_SID
Constant which can be used as a file suffix to indicate a
TBD stream, value "sid". |
static String |
T_SLD
Constant which can be used as a file suffix to indicate a
TBD stream, value "sld". |
static String |
T_SOD
Constant which can be used as a file suffix to indicate a
TBD stream, value "sod". |
static String |
T_TGA
Constant which can be used as a file suffix to indicate a Targa stream, value "tga".
|
static String |
T_TIFF
Constant which can be used as a file suffix to indicate a TIFF stream, value "tiff".
|
static String |
T_WIC
Constant which can be used as a file suffix to indicate a
TBD stream, value "wic". |
static String |
T_WLM
Constant which can be used as a file suffix to indicate a
TBD stream, value "wlm". |
static String |
T_WMF
Constant which can be used as a file suffix to indicate a
TBD stream, value "wmf". |
static String |
T_WPG
Constant which can be used as a file suffix to indicate a Wordperfect Graphics vectors stream, value "wpg".
|
static String |
T_WRL
Constant which can be used as a file suffix to indicate a
TBD stream, value "wrl". |
static String |
T_XBM
Constant which can be used as a file suffix to indicate a
TBD stream, value "xbm". |
static String |
T_XPM
Constant which can be used as a file suffix to indicate a X PixMap stream, value "xpm".
|
String |
type
The determined unique type, e.g.
|
| Constructor and Description |
|---|
ImageType(InputStream stream)
Creates instance based on given stream.
|
ImageType(String type)
Creates instance based on the given type.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
int |
hashCode() |
boolean |
isDefined()
Returns
true if type is determined, i.e. |
String |
toString() |
public static final int MAGIC_MAX_SIZE
public static final String T_JPG
http://www.faqs.org/faqs/jpeg-faq/part1/http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=54989public static final String T_PNG
http://www.libpng.org/pub/png/spec/1.1/PNG-Rationale.html#R.PNG-file-signaturepublic static final String T_ICNS
'i' 'c' 'n' 's' ascii code
TODOpublic static final String T_ICO
TODO
https://msdn.microsoft.com/en-us/library/ms997538.aspxpublic static final String T_CUR
TODO
TODOpublic static final String T_GIF
GIF87A or GIF89A ascii code
http://www.w3.org/Graphics/GIF/spec-gif87a.txt http://www.w3.org/Graphics/GIF/spec-gif89a.txtpublic static final String T_BMP
BM ascii code
FIXME: Collision or supertype of T_DIB?
http://www.fileformat.info/format/bmp/spec/e27073c25463436f8a64fa789c886d9c/view.htmpublic static final String T_DIB
TBD stream, value "dib".
FIXME: Collision or subtype of T_BMP?
TODOpublic static final String T_DCX
TBD stream, value "dcx".
TODO
TODOpublic static final String T_PCX
TBD stream, value "pcx".
TODO
TODOpublic static final String T_PPM
http://netpbm.sourceforge.net/doc/ppm.htmlpublic static final String T_PSD
TODO
TODOpublic static final String T_TIFF
Intentionally detects only the little endian tiff images ("II" in the spec).
FIXME: Collision or supertype of T_LDF?
http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdfpublic static final String T_LDF
TBD stream, value "ldf".
FIXME: Collision or subtype of T_TIFF?
TODOpublic static final String T_SGI_RGB
"474 saved as a short" 474 = 0x01DA
http://paulbourke.net/dataformats/sgirgb/sgiversion.htmlpublic static final String T_DDS
'D' 'D' 'S' ' ' ascii code
https://msdn.microsoft.com/en-us/library/windows/desktop/bb943991%28v=vs.85%29.aspx#File_Layout1public static final String T_PAM
http://netpbm.sourceforge.net/doc/pam.htmlpublic static final String T_PGM
http://netpbm.sourceforge.net/doc/pgm.htmlpublic static final String T_PBM
http://netpbm.sourceforge.net/doc/pbm.htmlpublic static final String T_3D2
TBD stream, value "3d2".
TODO
TODOpublic static final String T_3DMF
TODO
TODOpublic static final String T_92I
TODO
TODOpublic static final String T_AMFF
TODO
TODOpublic static final String T_ART
TODO
TODOpublic static final String T_CALS
TODO
http://www.fileformat.info/format/cals/egff.htmpublic static final String T_CAM
TBD stream, value "cam".
TODO
TODOpublic static final String T_CBD
TBD stream, value "cbd".
TODO
TODOpublic static final String T_CE2
TBD stream, value "ce2".
TODO
TODOpublic static final String T_CIN
TODO
http://www.cineon.com/ff_draft.phppublic static final String T_COB
TBD stream, value "cob".
TODO
TODOpublic static final String T_CPT
TODO
TODOpublic static final String T_CVG
TBD stream, value "cvg".
TODO
TODOpublic static final String T_DEM
TBD stream, value "dem".
TODO
TODOpublic static final String T_DPX
TODO
TODOpublic static final String T_DRW
TBD stream, value "drw".
TODO
TODOpublic static final String T_DWG
TODO
TODOpublic static final String T_ECW
TODO
TODOpublic static final String T_EMF
TODO
TODOpublic static final String T_FPX
TODO
TODOpublic static final String T_FTS
TBD stream, value "fts".
TODO
TODOpublic static final String T_GRO
TBD stream, value "gro".
TODO
TODOpublic static final String T_HDR
TBD stream, value "hdr".
TODO
TODOpublic static final String T_HRU
TBD stream, value "hru".
TODO
TODOpublic static final String T_IMG
TBD stream, value "img".
TODO
TODOpublic static final String T_INFINI_D
TBD stream, value "infini-d".
TODO
TODOpublic static final String T_IWC
TBD stream, value "iwc".
TODO
TODOpublic static final String T_J6I
TBD stream, value "j6i".
TODO
TODOpublic static final String T_JIF
TBD stream, value "jif".
TODO
TODOpublic static final String T_JP2
TODO
TODOpublic static final String T_KDC
TBD stream, value "kdc".
TODO
TODOpublic static final String T_L64
TBD stream, value "l64".
TODO
TODOpublic static final String T_LBM
TBD stream, value "lbm".
FIXME: Collision or supertype of T_RAD?
TODOpublic static final String T_RAD
TBD stream, value "rad".
FIXME: Collision or subtype of T_LBM?
TODOpublic static final String T_LWF
TBD stream, value "lwf".
TODO
TODOpublic static final String T_MBM
TBD stream, value "mbm".
TODO
TODOpublic static final String T_MGL
TBD stream, value "mgl".
TODO
TODOpublic static final String T_MIF
TODO
TODOpublic static final String T_MNG
TODO
TODOpublic static final String T_MPW
TBD stream, value "mpw".
TODO
TODOpublic static final String T_MSP
TBD stream, value "msp".
TODO
TODOpublic static final String T_N64
TBD stream, value "n64".
TODO
TODOpublic static final String T_NCR
TBD stream, value "ncr".
TODO
TODOpublic static final String T_NFF
TBD stream, value "nff".
TODO
TODOpublic static final String T_NGG
TBD stream, value "ngg".
TODO
TODOpublic static final String T_NLM
TBD stream, value "nlm".
TODO
TODOpublic static final String T_NOL
TBD stream, value "nol".
TODO
TODOpublic static final String T_PAL
TBD stream, value "pal".
TODO
TODOpublic static final String T_PAX
TBD stream, value "pax".
TODO
TODOpublic static final String T_PCD
TBD stream, value "pcd".
TODO
TODOpublic static final String T_PCL
TBD stream, value "pcl".
TODO
TODOpublic static final String T_PIC
TODO
http://paulbourke.net/dataformats/softimagepic/public static final String T_PIX
TBD stream, value "pix".
TODO
TODOpublic static final String T_POL
TBD stream, value "pol".
TODO
TODOpublic static final String T_PSP
TODO
TODOpublic static final String T_QFX
TBD stream, value "qfx".
TODO
TODOpublic static final String T_QTM
TBD stream, value "qtm".
TODO
TODOpublic static final String T_RAS
TODO
TODOpublic static final String T_RIX
TBD stream, value "rix".
TODO
TODOpublic static final String T_SID
TBD stream, value "sid".
TODO
TODOpublic static final String T_SLD
TBD stream, value "sld".
TODO
TODOpublic static final String T_SOD
TBD stream, value "sod".
TODO
TODOpublic static final String T_WIC
TBD stream, value "wic".
TODO
TODOpublic static final String T_WLM
TBD stream, value "wlm".
TODO
TODOpublic static final String T_WMF
TBD stream, value "wmf".
TODO
TODOpublic static final String T_WPG
TODO
TODOpublic static final String T_WRL
TBD stream, value "wrl".
TODO
TODOpublic static final String T_XBM
TBD stream, value "xbm".
TODO
TODOpublic static final String T_XPM
TODO
TODOpublic static final String T_TGA
public final String type
T_PNG, T_JPG, etc.
Maybe null if undetermined, i.e. isDefined() returns false.
public final byte[] header
MAGIC_MAX_SIZE bytes as used to determine the type,
i.e. ImageType(InputStream).
May be null, if type has been determined otherwise, i.e ImageType(String).
The header is not being used for hashCode() and equals(Object)!
public ImageType(InputStream stream) throws IOException
stream - stream to parse, InputStream.available() must be ≥ MAGIC_MAX_SIZEIOException - if an I/O exception occurredCopyright 2010 JogAmp Community.