/** * Creates an {@code InverseColorMapIndexColorModel} from the given arrays * of red, green, and blue components. * * @param pNumBits the number of bits each pixel occupies * @param pSize the size of the color component arrays * @param pReds the array of red color components * @param pGreens the array of green color components * @param pBlues the array of blue color components * * @throws IllegalArgumentException if bits is less than 1 or greater than 16, * or if size is less than 1 * * @see IndexColorModel#IndexColorModel(int, int, byte[], byte[], byte[]) */ public InverseColorMapIndexColorModel(int pNumBits, int pSize, byte[] pReds, byte[] pGreens, byte[] pBlues) { super(pNumBits, pSize, pReds, pGreens, pBlues); rgbs = getRGBs(this); mapSize = rgbs.length; inverseMap = new InverseColorMap(rgbs); whiteIndex = getWhiteIndex(); }
/** * @param pRGBColorMap the rgb color map to create inverse color map for. * @param pTransparent the index of the transparent pixel in the map */ InverseColorMap(int[] pRGBColorMap, int pTransparent) { rgbMapInt = pRGBColorMap; numColors = rgbMapInt.length; transparentIndex = pTransparent; inverseRGB = new byte[MAXQUANTVAL * MAXQUANTVAL * MAXQUANTVAL]; initIRGB(new int[MAXQUANTVAL * MAXQUANTVAL * MAXQUANTVAL]); }
pix = inverseMap.getIndexNearest(color);
pix = inverseMap.getIndexNearest(color);
/** * Creates an {@code InverseColorMapIndexColorModel} from the given array * of RGB components, plus one transparent index. * * @param pNumBits the number of bits each pixel occupies * @param pSize the size of the color component arrays * @param pRGBs the array of packed RGB color components * @param pStart the starting offset of the first color component * @param pAlpha indicates whether alpha values are contained in {@code pRGBs} * @param pTransparentIndex the index of the transparent pixel * @param pTransferType the data type of the array used to represent pixels * * @throws IllegalArgumentException if bits is less than 1 or greater than 16, * or if size is less than 1 * * @see IndexColorModel#IndexColorModel(int, int, int[], int, boolean, int, int) */ public InverseColorMapIndexColorModel(int pNumBits, int pSize, int[] pRGBs, int pStart, boolean pAlpha, int pTransparentIndex, int pTransferType) { super(pNumBits, pSize, pRGBs, pStart, pAlpha, pTransparentIndex, pTransferType); rgbs = getRGBs(this); mapSize = rgbs.length; inverseMap = new InverseColorMap(rgbs, pTransparentIndex); whiteIndex = getWhiteIndex(); }
/** * @param pRGBColorMap the rgb color map to create inverse color map for. * @param pTransparent the index of the transparent pixel in the map */ InverseColorMap(byte[] pRGBColorMap, int pTransparent) { rgbMapByte = pRGBColorMap; numColors = rgbMapByte.length / 4; transparentIndex = pTransparent; inverseRGB = new byte[MAXQUANTVAL * MAXQUANTVAL * MAXQUANTVAL]; initIRGB(new int[MAXQUANTVAL * MAXQUANTVAL * MAXQUANTVAL]); }
pix = mInverseMap.getIndexNearest(color);
/** * Creates an {@code InverseColorMapIndexColorModel} from the given arrays * of red, green, and blue components, plus one transparent index. * * @param pNumBits the number of bits each pixel occupies * @param pSize the size of the color component arrays * @param pReds the array of red color components * @param pGreens the array of green color components * @param pBlues the array of blue color components * @param pTransparentIndex the index of the transparent pixel * * @throws IllegalArgumentException if bits is less than 1 or greater than 16, * or if size is less than 1 * * @see IndexColorModel#IndexColorModel(int, int, byte[], byte[], byte[], int) */ public InverseColorMapIndexColorModel(int pNumBits, int pSize, byte[] pReds, byte[] pGreens, byte[] pBlues, int pTransparentIndex) { super(pNumBits, pSize, pReds, pGreens, pBlues, pTransparentIndex); rgbs = getRGBs(this); mapSize = rgbs.length; inverseMap = new InverseColorMap(rgbs, pTransparentIndex); whiteIndex = getWhiteIndex(); }
/** * @param pRGBColorMap the rgb color map to create inverse color map for. * @param pTransparent the index of the transparent pixel in the map */ InverseColorMap(byte[] pRGBColorMap, int pTransparent) { mRGBMapByte = pRGBColorMap; mNumColors = mRGBMapByte.length / 4; mTransparentIndex = pTransparent; mInverseRGB = new byte[MAXQUANTVAL * MAXQUANTVAL * MAXQUANTVAL]; initIRGB(new int[MAXQUANTVAL * MAXQUANTVAL * MAXQUANTVAL]); }
private InverseColorMapIndexColorModel(IndexColorModel pColorModel, int[] pRGBs) { super(pColorModel.getComponentSize()[0], pColorModel.getMapSize(), pRGBs, 0, pColorModel.getTransferType(), pColorModel.getValidPixels()); rgbs = pRGBs; mapSize = rgbs.length; inverseMap = new InverseColorMap(rgbs); whiteIndex = getWhiteIndex(); }
/** * @param pRGBColorMap the rgb color map to create inverse color map for. * @param pTransparent the index of the transparent pixel in the map */ InverseColorMap(int[] pRGBColorMap, int pTransparent) { rgbMapInt = pRGBColorMap; numColors = rgbMapInt.length; transparentIndex = pTransparent; inverseRGB = new byte[MAXQUANTVAL * MAXQUANTVAL * MAXQUANTVAL]; initIRGB(new int[MAXQUANTVAL * MAXQUANTVAL * MAXQUANTVAL]); }
/** * Creates an {@code InverseColorMapIndexColorModel} from the given arrays * of red, green, and blue components. * * @param pNumBits the number of bits each pixel occupies * @param pSize the size of the color component arrays * @param pReds the array of red color components * @param pGreens the array of green color components * @param pBlues the array of blue color components * * @throws IllegalArgumentException if bits is less than 1 or greater than 16, * or if size is less than 1 * * @see IndexColorModel#IndexColorModel(int, int, byte[], byte[], byte[]) */ public InverseColorMapIndexColorModel(int pNumBits, int pSize, byte[] pReds, byte[] pGreens, byte[] pBlues) { super(pNumBits, pSize, pReds, pGreens, pBlues); rgbs = getRGBs(this); mapSize = rgbs.length; inverseMap = new InverseColorMap(rgbs); whiteIndex = getWhiteIndex(); }
/** * @param pRGBColorMap the rgb color map to create inverse color map for. * @param pTransparent the index of the transparent pixel in the map */ InverseColorMap(int[] pRGBColorMap, int pTransparent) { mRGBMapInt = pRGBColorMap; mNumColors = mRGBMapInt.length; mTransparentIndex = pTransparent; mInverseRGB = new byte[MAXQUANTVAL * MAXQUANTVAL * MAXQUANTVAL]; initIRGB(new int[MAXQUANTVAL * MAXQUANTVAL * MAXQUANTVAL]); }
/** * Creates an {@code InverseColorMapIndexColorModel} from the given arrays * of red, green, and blue components, plus one transparent index. * * @param pNumBits the number of bits each pixel occupies * @param pSize the size of the color component arrays * @param pReds the array of red color components * @param pGreens the array of green color components * @param pBlues the array of blue color components * @param pTransparentIndex the index of the transparent pixel * * @throws IllegalArgumentException if bits is less than 1 or greater than 16, * or if size is less than 1 * * @see IndexColorModel#IndexColorModel(int, int, byte[], byte[], byte[], int) */ public InverseColorMapIndexColorModel(int pNumBits, int pSize, byte[] pReds, byte[] pGreens, byte[] pBlues, int pTransparentIndex) { super(pNumBits, pSize, pReds, pGreens, pBlues, pTransparentIndex); mRGBs = getRGBs(this); mMapSize = mRGBs.length; mInverseMap = new InverseColorMap(mRGBs, pTransparentIndex); mWhiteIndex = getWhiteIndex(); }
/** * @param pRGBColorMap the rgb color map to create inverse color map for. * @param pTransparent the index of the transparent pixel in the map */ InverseColorMap(byte[] pRGBColorMap, int pTransparent) { rgbMapByte = pRGBColorMap; numColors = rgbMapByte.length / 4; transparentIndex = pTransparent; inverseRGB = new byte[MAXQUANTVAL * MAXQUANTVAL * MAXQUANTVAL]; initIRGB(new int[MAXQUANTVAL * MAXQUANTVAL * MAXQUANTVAL]); }
/** * Creates an {@code InverseColorMapIndexColorModel} from the given arrays * of red, green, and blue components, plus one transparent index. * * @param pNumBits the number of bits each pixel occupies * @param pSize the size of the color component arrays * @param pReds the array of red color components * @param pGreens the array of green color components * @param pBlues the array of blue color components * @param pTransparentIndex the index of the transparent pixel * * @throws IllegalArgumentException if bits is less than 1 or greater than 16, * or if size is less than 1 * * @see IndexColorModel#IndexColorModel(int, int, byte[], byte[], byte[], int) */ public InverseColorMapIndexColorModel(int pNumBits, int pSize, byte[] pReds, byte[] pGreens, byte[] pBlues, int pTransparentIndex) { super(pNumBits, pSize, pReds, pGreens, pBlues, pTransparentIndex); rgbs = getRGBs(this); mapSize = rgbs.length; inverseMap = new InverseColorMap(rgbs, pTransparentIndex); whiteIndex = getWhiteIndex(); }
/** * Creates an {@code InverseColorMapIndexColorModel} from the given arrays * of red, green, and blue components. * * @param pNumBits the number of bits each pixel occupies * @param pSize the size of the color component arrays * @param pReds the array of red color components * @param pGreens the array of green color components * @param pBlues the array of blue color components * * @throws IllegalArgumentException if bits is less than 1 or greater than 16, * or if size is less than 1 * * @see IndexColorModel#IndexColorModel(int, int, byte[], byte[], byte[]) */ public InverseColorMapIndexColorModel(int pNumBits, int pSize, byte[] pReds, byte[] pGreens, byte[] pBlues) { super(pNumBits, pSize, pReds, pGreens, pBlues); mRGBs = getRGBs(this); mMapSize = mRGBs.length; mInverseMap = new InverseColorMap(mRGBs); mWhiteIndex = getWhiteIndex(); }
/** * Creates an {@code InverseColorMapIndexColorModel} from the given array * of RGB components, plus one transparent index. * * @param pNumBits the number of bits each pixel occupies * @param pSize the size of the color component arrays * @param pRGBs the array of packed RGB color components * @param pStart the starting offset of the first color component * @param pAlpha indicates whether alpha values are contained in {@code pRGBs} * @param pTransparentIndex the index of the transparent pixel * @param pTransferType the data type of the array used to represent pixels * * @throws IllegalArgumentException if bits is less than 1 or greater than 16, * or if size is less than 1 * * @see IndexColorModel#IndexColorModel(int, int, int[], int, boolean, int, int) */ public InverseColorMapIndexColorModel(int pNumBits, int pSize, int[] pRGBs, int pStart, boolean pAlpha, int pTransparentIndex, int pTransferType) { super(pNumBits, pSize, pRGBs, pStart, pAlpha, pTransparentIndex, pTransferType); mRGBs = getRGBs(this); mMapSize = mRGBs.length; mInverseMap = new InverseColorMap(mRGBs, pTransparentIndex); mWhiteIndex = getWhiteIndex(); }
/** * Creates an {@code InverseColorMapIndexColorModel} from the given array * of RGB components, plus one transparent index. * * @param pNumBits the number of bits each pixel occupies * @param pSize the size of the color component arrays * @param pRGBs the array of packed RGB color components * @param pStart the starting offset of the first color component * @param pAlpha indicates whether alpha values are contained in {@code pRGBs} * @param pTransparentIndex the index of the transparent pixel * @param pTransferType the data type of the array used to represent pixels * * @throws IllegalArgumentException if bits is less than 1 or greater than 16, * or if size is less than 1 * * @see IndexColorModel#IndexColorModel(int, int, int[], int, boolean, int, int) */ public InverseColorMapIndexColorModel(int pNumBits, int pSize, int[] pRGBs, int pStart, boolean pAlpha, int pTransparentIndex, int pTransferType) { super(pNumBits, pSize, pRGBs, pStart, pAlpha, pTransparentIndex, pTransferType); rgbs = getRGBs(this); mapSize = rgbs.length; inverseMap = new InverseColorMap(rgbs, pTransparentIndex); whiteIndex = getWhiteIndex(); }
private InverseColorMapIndexColorModel(IndexColorModel pColorModel, int[] pRGBs) { super(pColorModel.getComponentSize()[0], pColorModel.getMapSize(), pRGBs, 0, pColorModel.getTransferType(), pColorModel.getValidPixels()); rgbs = pRGBs; mapSize = rgbs.length; inverseMap = new InverseColorMap(rgbs); whiteIndex = getWhiteIndex(); }