/** * Returns an array of <code>RGB</code>s which comprise the * indexed color table of the receiver, or null if the receiver * has a direct color model. * * @return the RGB values for the image or null if direct color * * @see PaletteData#getRGBs() */ public RGB[] getRGBs() { return palette.getRGBs(); }
/** * Returns an array of <code>RGB</code>s which comprise the * indexed color table of the receiver, or null if the receiver * has a direct color model. * * @return the RGB values for the image or null if direct color * * @see PaletteData#getRGBs() */ public RGB[] getRGBs() { return palette.getRGBs(); }
/** * Set the data of a PLTE chunk to the colors * stored in the specified PaletteData object. */ void setPaletteData(PaletteData palette) { RGB[] rgbs = palette.getRGBs(); for (int i = 0; i < rgbs.length; i++) { int offset = DATA_OFFSET + (i * 3); reference[offset] = (byte) rgbs[i].red; reference[offset + 1] = (byte) rgbs[i].green; reference[offset + 2] = (byte) rgbs[i].blue; } }
/** * Returns an array of <code>RGB</code>s which comprise the * indexed color table of the receiver, or null if the receiver * has a direct color model. * * @return the RGB values for the image or null if direct color * * @see PaletteData#getRGBs() */ public RGB[] getRGBs() { return palette.getRGBs(); }
/** * Returns an array of <code>RGB</code>s which comprise the * indexed color table of the receiver, or null if the receiver * has a direct color model. * * @return the RGB values for the image or null if direct color * * @see PaletteData#getRGBs() */ public RGB[] getRGBs() { return palette.getRGBs(); }
/** * Returns an array of <code>RGB</code>s which comprise the * indexed color table of the receiver, or null if the receiver * has a direct color model. * * @return the RGB values for the image or null if direct color * * @see PaletteData#getRGBs() */ public RGB[] getRGBs() { return palette.getRGBs(); }
/** * Returns an array of <code>RGB</code>s which comprise the * indexed color table of the receiver, or null if the receiver * has a direct color model. * * @return the RGB values for the image or null if direct color * * @see PaletteData#getRGBs() */ public RGB[] getRGBs() { return palette.getRGBs(); }
/** * Set the data of a PLTE chunk to the colors * stored in the specified PaletteData object. */ void setPaletteData(PaletteData palette) { RGB[] rgbs = palette.getRGBs(); for (int i = 0; i < rgbs.length; i++) { int offset = DATA_OFFSET + (i * 3); reference[offset] = (byte) rgbs[i].red; reference[offset + 1] = (byte) rgbs[i].green; reference[offset + 2] = (byte) rgbs[i].blue; } }
void writePalette() { RGB[] RGBs = data.palette.getRGBs(); if (RGBs.length > 256) SWT.error(SWT.ERROR_INVALID_IMAGE); ByteArrayOutputStream baos = new ByteArrayOutputStream(RGBs.length); for (int i = 0; i < RGBs.length; i++) { baos.write((byte) RGBs[i].red); baos.write((byte) RGBs[i].green); baos.write((byte) RGBs[i].blue); } writeChunk(TAG_PLTE, baos.toByteArray()); }
void writePalette() { RGB[] RGBs = data.palette.getRGBs(); if (RGBs.length > 256) SWT.error(SWT.ERROR_INVALID_IMAGE); ByteArrayOutputStream baos = new ByteArrayOutputStream(RGBs.length); for (int i = 0; i < RGBs.length; i++) { baos.write((byte) RGBs[i].red); baos.write((byte) RGBs[i].green); baos.write((byte) RGBs[i].blue); } writeChunk(TAG_PLTE, baos.toByteArray()); }
void writePalette() { RGB[] RGBs = data.palette.getRGBs(); if (RGBs.length > 256) SWT.error(SWT.ERROR_INVALID_IMAGE); ByteArrayOutputStream baos = new ByteArrayOutputStream(RGBs.length); for (int i = 0; i < RGBs.length; i++) { baos.write((byte) RGBs[i].red); baos.write((byte) RGBs[i].green); baos.write((byte) RGBs[i].blue); } writeChunk(TAG_PLTE, baos.toByteArray()); }
void writePalette() { RGB[] RGBs = data.palette.getRGBs(); if (RGBs.length > 256) SWT.error(SWT.ERROR_INVALID_IMAGE); ByteArrayOutputStream baos = new ByteArrayOutputStream(RGBs.length); for (int i = 0; i < RGBs.length; i++) { baos.write((byte) RGBs[i].red); baos.write((byte) RGBs[i].green); baos.write((byte) RGBs[i].blue); } writeChunk(TAG_PLTE, baos.toByteArray()); }
void writePalette() { RGB[] RGBs = data.palette.getRGBs(); if (RGBs.length > 256) SWT.error(SWT.ERROR_INVALID_IMAGE); ByteArrayOutputStream baos = new ByteArrayOutputStream(RGBs.length); for (int i = 0; i < RGBs.length; i++) { baos.write((byte) RGBs[i].red); baos.write((byte) RGBs[i].green); baos.write((byte) RGBs[i].blue); } writeChunk(TAG_PLTE, baos.toByteArray()); }
void writePalette() { RGB[] RGBs = data.palette.getRGBs(); if (RGBs.length > 256) SWT.error(SWT.ERROR_INVALID_IMAGE); ByteArrayOutputStream baos = new ByteArrayOutputStream(RGBs.length); for (int i = 0; i < RGBs.length; i++) { baos.write((byte) RGBs[i].red); baos.write((byte) RGBs[i].green); baos.write((byte) RGBs[i].blue); } writeChunk(TAG_PLTE, baos.toByteArray()); }
PngPlteChunk(PaletteData palette) { super(palette.getRGBs().length * 3); paletteSize = length / 3; setType(TYPE_PLTE); setPaletteData(palette); setCRC(computeCRC()); }
PngPlteChunk(PaletteData palette) { super(palette.getRGBs().length * 3); paletteSize = length / 3; setType(TYPE_PLTE); setPaletteData(palette); setCRC(computeCRC()); }
PngPlteChunk(PaletteData palette) { super(palette.getRGBs().length * 3); paletteSize = length / 3; setType(TYPE_PLTE); setPaletteData(palette); setCRC(computeCRC()); }
PngPlteChunk(PaletteData palette) { super(palette.getRGBs().length * 3); paletteSize = length / 3; setType(TYPE_PLTE); setPaletteData(palette); setCRC(computeCRC()); }
PngPlteChunk(PaletteData palette) { super(palette.getRGBs().length * 3); paletteSize = length / 3; setType(TYPE_PLTE); setPaletteData(palette); setCRC(computeCRC()); }
PngPlteChunk(PaletteData palette) { super(palette.getRGBs().length * 3); paletteSize = length / 3; setType(TYPE_PLTE); setPaletteData(palette); setCRC(computeCRC()); }