Package com.itextpdf.io.image
Class BmpImageHelper
- java.lang.Object
-
- com.itextpdf.io.image.BmpImageHelper
-
final class BmpImageHelper extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classBmpImageHelper.BmpParameters
-
Field Summary
Fields Modifier and Type Field Description private static intBI_BITFIELDSprivate static intBI_RGBprivate static intBI_RLE4private static intBI_RLE8private static intLCS_CALIBRATED_RGBprivate static intLCS_CMYKprivate static intLCS_SRGBprivate static intVERSION_2_1_BITprivate static intVERSION_2_24_BITprivate static intVERSION_2_4_BITprivate static intVERSION_2_8_BITprivate static intVERSION_3_1_BITprivate static intVERSION_3_24_BITprivate static intVERSION_3_4_BITprivate static intVERSION_3_8_BITprivate static intVERSION_3_NT_16_BITprivate static intVERSION_3_NT_32_BITprivate static intVERSION_4_1_BITprivate static intVERSION_4_16_BITprivate static intVERSION_4_24_BITprivate static intVERSION_4_32_BITprivate static intVERSION_4_4_BITprivate static intVERSION_4_8_BIT
-
Constructor Summary
Constructors Constructor Description BmpImageHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static byte[]decodeRLE(boolean is8, byte[] values, BmpImageHelper.BmpParameters bmp)private static intfindMask(int mask)private static intfindShift(int mask)private static booleangetImage(BmpImageHelper.BmpParameters bmp)private static byte[]getPalette(int group, BmpImageHelper.BmpParameters bmp)private static voidindexedModel(byte[] bdata, int bpc, int paletteEntries, BmpImageHelper.BmpParameters bmp)private static voidprocess(BmpImageHelper.BmpParameters bmp, java.io.InputStream stream)static voidprocessImage(ImageData image)Process the passed Image data as a BMP image.private static voidread1632Bit(boolean is32, BmpImageHelper.BmpParameters bmp)private static voidread1Bit(int paletteEntries, BmpImageHelper.BmpParameters bmp)private static voidread24Bit(byte[] bdata, BmpImageHelper.BmpParameters bmp)private static voidread4Bit(int paletteEntries, BmpImageHelper.BmpParameters bmp)private static voidread8Bit(int paletteEntries, BmpImageHelper.BmpParameters bmp)private static longreadDWord(java.io.InputStream stream)private static intreadInt(java.io.InputStream stream)private static intreadLong(java.io.InputStream stream)private static voidreadPalette(int sizeOfPalette, BmpImageHelper.BmpParameters bmp)private static voidreadRLE4(BmpImageHelper.BmpParameters bmp)private static voidreadRLE8(BmpImageHelper.BmpParameters bmp)private static intreadShort(java.io.InputStream stream)private static intreadUnsignedByte(java.io.InputStream stream)private static longreadUnsignedInt(java.io.InputStream stream)private static intreadUnsignedShort(java.io.InputStream stream)private static intreadWord(java.io.InputStream stream)
-
-
-
Field Detail
-
VERSION_2_1_BIT
private static final int VERSION_2_1_BIT
- See Also:
- Constant Field Values
-
VERSION_2_4_BIT
private static final int VERSION_2_4_BIT
- See Also:
- Constant Field Values
-
VERSION_2_8_BIT
private static final int VERSION_2_8_BIT
- See Also:
- Constant Field Values
-
VERSION_2_24_BIT
private static final int VERSION_2_24_BIT
- See Also:
- Constant Field Values
-
VERSION_3_1_BIT
private static final int VERSION_3_1_BIT
- See Also:
- Constant Field Values
-
VERSION_3_4_BIT
private static final int VERSION_3_4_BIT
- See Also:
- Constant Field Values
-
VERSION_3_8_BIT
private static final int VERSION_3_8_BIT
- See Also:
- Constant Field Values
-
VERSION_3_24_BIT
private static final int VERSION_3_24_BIT
- See Also:
- Constant Field Values
-
VERSION_3_NT_16_BIT
private static final int VERSION_3_NT_16_BIT
- See Also:
- Constant Field Values
-
VERSION_3_NT_32_BIT
private static final int VERSION_3_NT_32_BIT
- See Also:
- Constant Field Values
-
VERSION_4_1_BIT
private static final int VERSION_4_1_BIT
- See Also:
- Constant Field Values
-
VERSION_4_4_BIT
private static final int VERSION_4_4_BIT
- See Also:
- Constant Field Values
-
VERSION_4_8_BIT
private static final int VERSION_4_8_BIT
- See Also:
- Constant Field Values
-
VERSION_4_16_BIT
private static final int VERSION_4_16_BIT
- See Also:
- Constant Field Values
-
VERSION_4_24_BIT
private static final int VERSION_4_24_BIT
- See Also:
- Constant Field Values
-
VERSION_4_32_BIT
private static final int VERSION_4_32_BIT
- See Also:
- Constant Field Values
-
LCS_CALIBRATED_RGB
private static final int LCS_CALIBRATED_RGB
- See Also:
- Constant Field Values
-
LCS_SRGB
private static final int LCS_SRGB
- See Also:
- Constant Field Values
-
LCS_CMYK
private static final int LCS_CMYK
- See Also:
- Constant Field Values
-
BI_RGB
private static final int BI_RGB
- See Also:
- Constant Field Values
-
BI_RLE8
private static final int BI_RLE8
- See Also:
- Constant Field Values
-
BI_RLE4
private static final int BI_RLE4
- See Also:
- Constant Field Values
-
BI_BITFIELDS
private static final int BI_BITFIELDS
- See Also:
- Constant Field Values
-
-
Method Detail
-
processImage
public static void processImage(ImageData image)
Process the passed Image data as a BMP image. Image is loaded and all image attributes are initialized and/or updated- Parameters:
image- the image to process as a BMP image
-
process
private static void process(BmpImageHelper.BmpParameters bmp, java.io.InputStream stream) throws java.io.IOException
- Throws:
java.io.IOException
-
getPalette
private static byte[] getPalette(int group, BmpImageHelper.BmpParameters bmp)
-
getImage
private static boolean getImage(BmpImageHelper.BmpParameters bmp) throws java.io.IOException
- Throws:
java.io.IOException
-
indexedModel
private static void indexedModel(byte[] bdata, int bpc, int paletteEntries, BmpImageHelper.BmpParameters bmp)
-
readPalette
private static void readPalette(int sizeOfPalette, BmpImageHelper.BmpParameters bmp) throws java.io.IOException- Throws:
java.io.IOException
-
read1Bit
private static void read1Bit(int paletteEntries, BmpImageHelper.BmpParameters bmp) throws java.io.IOException- Throws:
java.io.IOException
-
read4Bit
private static void read4Bit(int paletteEntries, BmpImageHelper.BmpParameters bmp) throws java.io.IOException- Throws:
java.io.IOException
-
read8Bit
private static void read8Bit(int paletteEntries, BmpImageHelper.BmpParameters bmp) throws java.io.IOException- Throws:
java.io.IOException
-
read24Bit
private static void read24Bit(byte[] bdata, BmpImageHelper.BmpParameters bmp) throws java.io.IOException- Throws:
java.io.IOException
-
findMask
private static int findMask(int mask)
-
findShift
private static int findShift(int mask)
-
read1632Bit
private static void read1632Bit(boolean is32, BmpImageHelper.BmpParameters bmp) throws java.io.IOException- Throws:
java.io.IOException
-
readRLE8
private static void readRLE8(BmpImageHelper.BmpParameters bmp) throws java.io.IOException
- Throws:
java.io.IOException
-
readRLE4
private static void readRLE4(BmpImageHelper.BmpParameters bmp) throws java.io.IOException
- Throws:
java.io.IOException
-
decodeRLE
private static byte[] decodeRLE(boolean is8, byte[] values, BmpImageHelper.BmpParameters bmp)
-
readUnsignedByte
private static int readUnsignedByte(java.io.InputStream stream) throws java.io.IOException- Throws:
java.io.IOException
-
readUnsignedShort
private static int readUnsignedShort(java.io.InputStream stream) throws java.io.IOException- Throws:
java.io.IOException
-
readShort
private static int readShort(java.io.InputStream stream) throws java.io.IOException- Throws:
java.io.IOException
-
readWord
private static int readWord(java.io.InputStream stream) throws java.io.IOException- Throws:
java.io.IOException
-
readUnsignedInt
private static long readUnsignedInt(java.io.InputStream stream) throws java.io.IOException- Throws:
java.io.IOException
-
readInt
private static int readInt(java.io.InputStream stream) throws java.io.IOException- Throws:
java.io.IOException
-
readDWord
private static long readDWord(java.io.InputStream stream) throws java.io.IOException- Throws:
java.io.IOException
-
readLong
private static int readLong(java.io.InputStream stream) throws java.io.IOException- Throws:
java.io.IOException
-
-