/**//* * Created on 2005-6-21 * * TODO To change the template for this generated file go to * Window - PReferences - java - Code Style - Code Templates */ package org.lotus.image.codec.bmp;
int value = size; data[2] = (byte) value; value = value >>> 8; data[3] = (byte) value; value = value >>> 8; data[4] = (byte) value; value = value >>> 8; data[5] = (byte) value;
value = offset; data[10] = (byte) value; value = value >>> 8; data[11] = (byte) value; value = value >>> 8; data[12] = (byte) value; value = value >>> 8; data[13] = (byte) value; }
}
/**//* * Created on 2005-6-21 * * TODO To change the template for this generated file go to * Window - Preferences - Java - Code Style - Code Templates */ package org.lotus.image.codec.bmp;
public int getBitCount() { return this.bitCount; }
public BMPInfoHeader(int width, int height, int bitCount) { this.width = width; this.height = height; this.bitCount = bitCount;
data[0] = 40;
int value = width; data[4] = (byte) value; value = value >>> 8; data[5] = (byte) value; value = value >>> 8; data[6] = (byte) value; value = value >>> 8; data[7] = (byte) value;
value = height; data[8] = (byte) value; value = value >>> 8; data[9] = (byte) value; value = value >>> 8; data[10] = (byte) value; value = value >>> 8; data[11] = (byte) value;
data[12] = 1;
data[14] = (byte) bitCount;
value = width * height * 3; if (width % 4 != 0) value += (width % 4) * height; data[20] = (byte) value; value = value >>> 8; data[21] = (byte) value; value = value >>> 8; data[22] = (byte) value; value = value >>> 8; data[23] = (byte) value; }
/**//* * Created on 2005-6-21 * * TODO To change the template for this generated file go to * Window - Preferences - Java - Code Style - Code Templates */ package org.lotus.image.codec.bmp;
public void encode(BufferedImage bi) throws IOException;
public static final int BIT_COUNT_BLACKWHITE = 1; public static final int BIT_COUNT_16COLORS = 4; public static final int BIT_COUNT_256COLORS = 8; public static final int BIT_COUNT_TRUECOLORS = 24;
}
BMPEncoder接口的实现BMPEncoderImpl。
/**//* * Created on 2005-6-21 * * TODO To change the template for this generated file go to * Window - Preferences - Java - Code Style - Code Templates */ package org.lotus.image.codec.bmp;