BMPImageReader.java revision 1839
private long bitmapFileSize;
private long bitmapOffset;
private long compression;
private long imageSize;
private byte palette[];
private int imageType;
private int numBands;
private boolean isBottomUp;
private int bitsPerPixel;
private boolean gotHeader = false;
private int width;
private int height;
private boolean noTransform = true;
private boolean seleBand = false;
super(originator);
boolean seekForwardOnly,
boolean ignoreMetadata) {
readHeader();
return width;
readHeader();
return height;
if (gotHeader)
switch((int)compression) {
case BI_JPEG:
case BI_PNG:
case BI_BITFIELDS:
switch ((int)compression) {
case BI_JPEG:
case BI_PNG:
isBottomUp = true;
isBottomUp = false;
} catch (Exception e) {
int off;
r = new byte[(int)size];
g = new byte[(int)size];
b = new byte[(int)size];
int off;
r = new byte[(int)size];
g = new byte[(int)size];
b = new byte[(int)size];
bitMasks);
gotHeader = true;
throws IOException {
readHeader();
return new ImageReadParam();
throws IOException {
readHeader();
return metadata;
return null;
readHeader();
throws IOException {
readHeader();
if (!seleBand) {
if (seleBand)
bdata = (byte[])
sdata = (short[])
idata = (int[])
switch(imageType) {
case VERSION_2_1_BIT:
case VERSION_2_4_BIT:
case VERSION_2_8_BIT:
case VERSION_2_24_BIT:
case VERSION_3_1_BIT:
case VERSION_3_4_BIT:
switch((int)compression) {
case BI_RGB:
case BI_RLE4:
case VERSION_3_8_BIT:
switch((int)compression) {
case BI_RGB:
case BI_RLE8:
case VERSION_3_24_BIT:
case VERSION_3_NT_16_BIT:
case VERSION_3_NT_32_BIT:
case VERSION_3_XP_EMBEDDED:
case VERSION_4_XP_EMBEDDED:
case VERSION_5_XP_EMBEDDED:
case VERSION_4_1_BIT:
case VERSION_4_4_BIT:
switch((int)compression) {
case BI_RGB:
case BI_RLE4:
case VERSION_4_8_BIT:
switch((int)compression) {
case BI_RGB:
case BI_RLE8:
case VERSION_4_16_BIT:
case VERSION_4_24_BIT:
case VERSION_4_32_BIT:
if (abortRequested())
return bi;
public boolean canReadRaster() {
private void resetHeaderInfo() {
gotHeader = false;
public void reset() {
super.reset();
if (noTransform) {
if (abortRequested()) {
int lineStride =
if (isBottomUp) {
int lastLine =
i++, j++, x += scaleX) {
if (isBottomUp)
if (abortRequested())
if (noTransform) {
if (abortRequested()) {
int lineStride =
if (isBottomUp) {
int lastLine =
i++, j++, x += scaleX) {
if (isBottomUp)
if (abortRequested())
if (noTransform) {
if (abortRequested()) {
int lineStride =
if (isBottomUp) {
int lastLine =
if (isBottomUp)
k += destinationRegion.x;
if (abortRequested())
if (noTransform) {
if (abortRequested()) {
if (isBottomUp) {
int lastLine =
if (isBottomUp)
if (abortRequested())
if (noTransform) {
if (abortRequested()) {
int lineStride =
if (isBottomUp) {
int lastLine =
if (isBottomUp)
k += destinationRegion.x;
if (abortRequested())
if (noTransform) {
if (abortRequested()) {
int lineStride =
if (isBottomUp) {
int lastLine =
if (isBottomUp)
k += destinationRegion.x;
if (abortRequested())
int padding,
byte[] values,
int value;
boolean flag = false;
int lineStride =
if (noTransform) {
finished++;
for (int i = sourceRegion.x;
i += scaleX)
finished++;
if (abortRequested()) {
flag = true;
flag = true;
count++;
count++;
if (flag) {
int padding,
byte[] values,
int value;
boolean flag = false;
int lineStride =
if (noTransform) {
finished++;
for (int i = sourceRegion.x;
i += scaleX) {
pos++;
finished++;
if (abortRequested()) {
flag = true;
flag = true;
count++;
count++;
count++;
if (flag) {
throws IOException {
switch(type) {
case BI_JPEG:
case BI_PNG:
float percentageDone)
int[] bands)
int pass,
int[] bands)
bands);
int pass,
int[] bands) {}
int[] bands) {}
return bi;
private static boolean isLinkedProfileAllowed() {
return !isLinkedProfileDisabled;
private static boolean isUncOrDevicePath(byte[] p) {
if (!isWindowsPlatform) {