private void setColorModelOnce(final ColorModel pModel) { // NOTE: There seems to be a "bug" in AreaAveragingScaleFilter, as it // first passes the original color model through in setColorModel, then // later replaces it with the default RGB in the first setPixels call // (this is probably allowed according to the spec, but it's a waste of time and space). if (sourceColorModel != pModel) { if (/*sourceColorModel == null ||*/ sourcePixels == null) { sourceColorModel = pModel; } else { throw new IllegalStateException("Change of ColorModel after pixel delivery not supported"); } } // If color model is all we ask for, stop now if (readColorModelOnly) { consumer.imageComplete(ImageConsumer.IMAGEABORTED); } }
private void setColorModelOnce(final ColorModel pModel) { // NOTE: There seems to be a "bug" in AreaAveragingScaleFilter, as it // first passes the original color model through in setColorModel, then // later replaces it with the default RGB in the first setPixels call // (this is probably allowed according to the spec, but it's a waste of time and space). if (sourceColorModel != pModel) { if (/*sourceColorModel == null ||*/ sourcePixels == null) { sourceColorModel = pModel; } else { throw new IllegalStateException("Change of ColorModel after pixel delivery not supported"); } } // If color model is all we ask for, stop now if (readColorModelOnly) { consumer.imageComplete(ImageConsumer.IMAGEABORTED); } }
private void setColorModelOnce(ColorModel pModel) { // NOTE: There seems to be a "bug" in AreaAveragingScaleFilter, as it // first passes the original colormodel through in setColorModel, then // later replaces it with the default RGB in the first setPixels call // (this is probably allowed according to the spec, but it's a waste of // time and space). if (mSourceColorModel != pModel) { if (/*mSourceColorModel == null ||*/ mSourcePixels == null) { mSourceColorModel = pModel; } else { throw new IllegalStateException("Change of ColorModel after pixel delivery not supported"); } } // If color model is all we ask for, stop now if (mReadColorModelOnly) { mConsumer.imageComplete(ImageConsumer.IMAGEABORTED); } }
/** {@code ImageConsumer} implementation, do not invoke directly */ public void setDimensions(int pWidth, int pHeight) { //System.out.println("Setting dimensions: " + pWidth + ", " + pHeight); if (mWidth < 0) { mWidth = pWidth - mX; } if (mHeight < 0) { mHeight = pHeight - mY; } // Hmm.. Special case, but is it a good idea? if (mWidth <= 0 || mHeight <= 0) { imageComplete(STATICIMAGEDONE); } }
/** * Aborts the image prodcution. */ public void abort() { mConsumer.imageComplete(ImageConsumer.IMAGEABORTED); }
public void setDimensions(int pWidth, int pHeight) { if (width < 0) { width = pWidth - x; } if (height < 0) { height = pHeight - y; } // Hmm.. Special case, but is it a good idea? if (width <= 0 || height <= 0) { imageComplete(ImageConsumer.STATICIMAGEDONE); } }
/** * Aborts the image production. */ public void abort() { consumer.imageComplete(ImageConsumer.IMAGEABORTED); }
/** * Aborts the image production. */ public void abort() { consumer.imageComplete(ImageConsumer.IMAGEABORTED); }
public void setDimensions(int pWidth, int pHeight) { if (width < 0) { width = pWidth - x; } if (height < 0) { height = pHeight - y; } // Hmm.. Special case, but is it a good idea? if (width <= 0 || height <= 0) { imageComplete(ImageConsumer.STATICIMAGEDONE); } }