/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
int width;
int height;
if (properties != null) {
this.properties = properties;
} else {
this.properties = new Hashtable();
}
}
}
// We can only have one consumer since we immediately return the data...
theConsumer = ic;
produce();
}
return (ic == theConsumer);
}
if (theConsumer == ic) {
theConsumer = null;
}
}
}
}
private void sendPixels() {
boolean needToCvt = true;
if (cm instanceof IndexColorModel) {
if (raster instanceof ByteComponentRaster) {
needToCvt = false;
for (int y=0; y < height; y++) {
width);
}
}
else if (raster instanceof BytePackedRaster) {
needToCvt = false;
// Binary image. Need to unpack it
for (int y=0; y < height; y++) {
for (int x=0; x < width; x++) {
}
width);
}
}
{
// Probably a short or int "GRAY" image
needToCvt = false;
for (int y=0; y < height; y++) {
width);
}
}
}
else if (cm instanceof DirectColorModel) {
needToCvt = false;
switch (dataType) {
case DataBuffer.TYPE_INT:
for (int y=0; y < height; y++) {
width);
}
break;
case DataBuffer.TYPE_BYTE:
for (int y=0; y < height; y++) {
for (int x=0; x < width; x++) {
}
width);
}
break;
case DataBuffer.TYPE_USHORT:
for (int y=0; y < height; y++) {
for (int x=0; x < width; x++) {
}
width);
}
break;
default:
needToCvt = true;
}
}
if (needToCvt) {
// REMIND: Need to add other types of CMs here
for (int y=0; y < height; y++) {
for (int x=0; x < width; x++) {
}
width);
}
}
}
private void produce() {
try {
sendPixels();
} catch (NullPointerException e) {
if (theConsumer != null) {
}
}
}
}