Java 8 ImageProducer - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 ImageProducer class.

This code example shows how to use the following methods:removeConsumer
     */ 
    public synchronized void removeConsumer(ImageConsumer ic) {
        if (proxies != null) {
            ImageFilter imgf = (ImageFilter) proxies.get(ic);
            if (imgf != null) {
                src.removeConsumer(imgf);
                proxies.remove(ic);
                if (proxies.isEmpty()) {
                    proxies = null;
                } 
            } 
        } 
    } 
 
    /** 
     * Starts production of the filtered image. 
     * If the specified <code>ImageConsumer</code> 
     * isn't already a consumer of the filtered image, 
     * an instance of the original <code>ImageFilter</code> 
     * is created 
3
CodeRank
This code example shows how to use the following methods:removeConsumer
            } 
        } 
    } 
 
    public void imageComplete(int status) {
        producer.removeConsumer(this);
        if (status == ImageConsumer.IMAGEABORTED)
            iox = new IOException("image aborted");
        else { 
            try { 
                encodeFinish(); 
                encodeDone(); 
            } catch (IOException e) {
                iox = e;
            } 
        } 
        stop(); 
    } 
 
} 
4
CodeRank
This code example shows how to use the following methods:removeConsumer
            } 
        } 
    } 
 
    public void imageComplete(int status) {
        producer.removeConsumer(this);
        if (status == ImageConsumer.IMAGEABORTED)
            iox = new IOException("image aborted");
        else { 
            try { 
                encodeFinish(); 
                encodeDone(); 
            } catch (IOException e) {
                iox = e;
            } 
        } 
        stop(); 
    } 
 
} 
4
CodeRank
This code example shows how to use the following methods:removeConsumer
        } 
    } 
 
    private synchronized void stopProduction(){ 
        producing = false;
        src.removeConsumer(this);
    } 
 
    private void createRaster(){ 
        try{ 
            raster = cm.createCompatibleWritableRaster(width, height);
            isIntRGB = false;
            if(cm instanceof DirectColorModel){
                DirectColorModel dcm = (DirectColorModel) cm;
                if(dcm.getTransferType() == DataBuffer.TYPE_INT &&
                        dcm.getRedMask() == 0xff0000 &&
                        dcm.getGreenMask() == 0xff00 &&
                        dcm.getBlueMask() == 0xff){
                    isIntRGB = true;
                } 
4
CodeRank
This code example shows how to use the following methods:removeConsumer
            } 
        } 
    } 
 
    public void imageComplete(int status) {
        producer.removeConsumer(this);
        if (status == ImageConsumer.IMAGEABORTED)
            iox = new IOException("image aborted");
        else { 
            try { 
                encodeFinish(); 
                encodeDone(); 
            } catch (IOException e) {
                iox = e;
            } 
        } 
        stop(); 
    } 
 
} 
4
CodeRank
This code example shows how to use the following methods:removeConsumer
  public synchronized void imageComplete (int status)
  { 
    // we need to reuse the pixel cache for memory image sources since 
    // a memory image's backing array can be updated "live". 
    if (!(source instanceof MemoryImageSource))
      source.removeConsumer(this);
    target.setImage(width, height, pixelCache, properties);
  } 
 
  public synchronized void setColorModel (ColorModel model)
  { 
    // This method is to inform on what the most used color model 
    // in the image is, for optimization reasons. We ignore this 
    // information. 
  } 
 
  public synchronized void setDimensions (int width, int height)
  { 
    pixelCache = new int[width*height];
 
4
CodeRank
This code example shows how to use the following methods:startProduction
        if (!productionStarted) {
            final ImageProducer producer = initProducer;
            // Loads asynchronously initial image if not yet done 
            new Thread() {
                public void run() { 
                    producer.startProduction(new JNodeConsumer(producer, observer));
                } 
            } 
                .start();
 
            productionStarted = true;
            // v1.2 : Moved wait () out of if (!productionStarted) block 
            //        because loadInitImage () can called first with parameter wait == false (by prepareImage ()) 
            //        and then can be called again with parameter wait == true. In that case, 
            //        current thread must be stopped to complete image download. 
        } 
 
        try { 
            // If image isn't downloaded yet 
            if ((availableInfo & ImageObserver.ERROR) == 0 && (availableInfo & ImageObserver.ALLBITS) == 0) {
3
CodeRank
See Code Examples for Java 8 ImageProducer Methods: