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 class
BmpImageHelper.BmpParameters
-
Field Summary
Fields Modifier and Type Field Description private static int
BI_BITFIELDS
private static int
BI_RGB
private static int
BI_RLE4
private static int
BI_RLE8
private static int
LCS_CALIBRATED_RGB
private static int
LCS_CMYK
private static int
LCS_SRGB
private static int
VERSION_2_1_BIT
private static int
VERSION_2_24_BIT
private static int
VERSION_2_4_BIT
private static int
VERSION_2_8_BIT
private static int
VERSION_3_1_BIT
private static int
VERSION_3_24_BIT
private static int
VERSION_3_4_BIT
private static int
VERSION_3_8_BIT
private static int
VERSION_3_NT_16_BIT
private static int
VERSION_3_NT_32_BIT
private static int
VERSION_4_1_BIT
private static int
VERSION_4_16_BIT
private static int
VERSION_4_24_BIT
private static int
VERSION_4_32_BIT
private static int
VERSION_4_4_BIT
private static int
VERSION_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 int
findMask(int mask)
private static int
findShift(int mask)
private static boolean
getImage(BmpImageHelper.BmpParameters bmp)
private static byte[]
getPalette(int group, BmpImageHelper.BmpParameters bmp)
private static void
indexedModel(byte[] bdata, int bpc, int paletteEntries, BmpImageHelper.BmpParameters bmp)
private static void
process(BmpImageHelper.BmpParameters bmp, java.io.InputStream stream)
static void
processImage(ImageData image)
Process the passed Image data as a BMP image.private static void
read1632Bit(boolean is32, BmpImageHelper.BmpParameters bmp)
private static void
read1Bit(int paletteEntries, BmpImageHelper.BmpParameters bmp)
private static void
read24Bit(byte[] bdata, BmpImageHelper.BmpParameters bmp)
private static void
read4Bit(int paletteEntries, BmpImageHelper.BmpParameters bmp)
private static void
read8Bit(int paletteEntries, BmpImageHelper.BmpParameters bmp)
private static long
readDWord(java.io.InputStream stream)
private static int
readInt(java.io.InputStream stream)
private static int
readLong(java.io.InputStream stream)
private static void
readPalette(int sizeOfPalette, BmpImageHelper.BmpParameters bmp)
private static void
readRLE4(BmpImageHelper.BmpParameters bmp)
private static void
readRLE8(BmpImageHelper.BmpParameters bmp)
private static int
readShort(java.io.InputStream stream)
private static int
readUnsignedByte(java.io.InputStream stream)
private static long
readUnsignedInt(java.io.InputStream stream)
private static int
readUnsignedShort(java.io.InputStream stream)
private static int
readWord(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
-
-