Package com.google.code.appengine.imageio

Examples of com.google.code.appengine.imageio.ImageTypeSpecifier


            throw new IllegalArgumentException(
                            "width * height > Integer.MAX_VALUE!"); //$NON-NLS-1$
        }

        final Rectangle dst;
        ImageTypeSpecifier its = null;

        if (param != null) {
            final BufferedImage img = param.getDestination();

            if (img != null) {
                return img;
            }

            its = param.getDestinationType();
        }

        try {
            isValid: if (its != null) {
                while (imageTypes.hasNext()) {
                    if (its.equals((ImageTypeSpecifier) imageTypes.next())) {
                        break isValid;
                    }
                }
                throw new IIOException(Messages.getString("imageio.3", its)); //$NON-NLS-1$
            } else {
                its = imageTypes.next();
            }
        } catch (final ClassCastException ex) {
            throw new IllegalArgumentException(ex);
        }

        dst = new Rectangle(0, 0, 0, 0);
        computeRegions(param, width, height, null, new Rectangle(0, 0, 0, 0),
            dst);
        return its.createBufferedImage(dst.width, dst.height);
    }
View Full Code Here


                    final int alphaMask, final int transferType,
                    final boolean isAlphaPremultiplied) {
        final ColorModel model = new DirectColorModel(colorSpace, 32, redMask,
                        greenMask, blueMask, alphaMask, isAlphaPremultiplied,
                        transferType);
        return new ImageTypeSpecifier(model, model.createCompatibleSampleModel(
            1, 1));
    }
View Full Code Here

                                                                  1,
                                                                  pixelStride,
                                                                  pixelStride,
                                                                  bandOffsets);
              
        return new ImageTypeSpecifier(colorModel, sampleModel);
    }
View Full Code Here

                                                        1,
                                                        1,
                                                        bankIndices,
                                                        bandOffsets);
       
        return new ImageTypeSpecifier(colorModel, sampleModel);
    }
View Full Code Here

            numBits[1] = bits;
        }
        int transparency = hasAlpha ? Transparency.TRANSLUCENT : Transparency.OPAQUE;
        ColorModel model = new ComponentColorModel(colorSpace, numBits, hasAlpha, isAlphaPremultiplied, transparency, dataType);

        return new ImageTypeSpecifier(model, model.createCompatibleSampleModel(1, 1));
    }
View Full Code Here

           model = new IndexColorModel(bits, size, redLUT, greenLUT, blueLUT);
       } else {
           model = new IndexColorModel(bits, size, redLUT, greenLUT, blueLUT, alphaLUT);
       }
      
       return new ImageTypeSpecifier(model, model.createCompatibleSampleModel(1, 1));
    }
View Full Code Here

    public static ImageTypeSpecifier createFromRenderedImage(RenderedImage image) {
        if (null == image) {
            throw new IllegalArgumentException(Messages.getString("imageio.27"));
        }
        return new ImageTypeSpecifier(image);
    }
View Full Code Here

    @Override
    public boolean equals(Object o) {
        boolean rt = false;
        if (o instanceof ImageTypeSpecifier) {
            ImageTypeSpecifier ts = (ImageTypeSpecifier) o;
            rt = colorModel.equals(ts.colorModel) && sampleModel.equals(ts.sampleModel);
        }
        return rt;
    }
View Full Code Here

    @Override
    public Iterator<ImageTypeSpecifier> getImageTypes(final int i)
                    throws IOException {
        final ColorModel model = getImage(i).getColorModel();
        final ImageTypeSpecifier[] spec = { new ImageTypeSpecifier(model,
                        model.createCompatibleSampleModel(1, 1)) };
        return Arrays.asList(spec).iterator();
    }
View Full Code Here

    JPEGImageWriteParam params = new JPEGImageWriteParam( null );
    params.setCompressionMode( ImageWriteParam.MODE_EXPLICIT );
    params.setCompressionQuality( quality );
    params.setProgressiveMode( com.google.code.appengine.imageio.ImageWriteParam.MODE_DISABLED );
    params.setDestinationType( new ImageTypeSpecifier( IndexColorModel.getRGBdefault(),
                                      IndexColorModel.getRGBdefault().createCompatibleSampleModel( 16, 16 ) ) );

    ImageOutputStream imageOutputStream = ImageIO.createImageOutputStream( outputStream );
    imageWriter.setOutput( imageOutputStream );
    imageWriter.write( null, new IIOImage( bufferedImage, null, null ), params );
View Full Code Here

TOP

Related Classes of com.google.code.appengine.imageio.ImageTypeSpecifier

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.