Java 8 RenderedImage - 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 RenderedImage class.

This code example shows how to use the following methods:getColorModel, getSampleModel, getTileGridXOffset, getTileGridYOffset, getTileHeight
    private static ImageLayout layoutHelper(RenderedImage source, float originX, float originY,
            float width, float height) {
        Rectangle bounds = new Rectangle2D.Float(originX, originY, width, height).getBounds();
 
        return new ImageLayout(bounds.x, bounds.y, bounds.width, bounds.height, source
                .getTileGridXOffset(), source.getTileGridYOffset(), source.getTileWidth(), source
                .getTileHeight(), source.getSampleModel(), source.getColorModel());
 
    } 
 
    /** 
     * Construct an GTCropOpImage. 
     */ 
    public GTCropOpImage(RenderedImage source, float originX, float originY, float width,
            float height, Map configuration) {
        super(source, layoutHelper(source, originX, originY, width, height), configuration, false);
    } 
 
    /** 
     * We just relay the original tiles, or return null 
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getHeight, getMinX, getMinY, getWidth
            bgValues = (double[]) backgroundValues;
        } 
 
        // CHECKING DATA IMAGE 
        RenderedImage dataImg = pb.getRenderedSource(0);
        Rectangle dataBounds = new Rectangle( dataImg.getMinX(), dataImg.getMinY(),
                dataImg.getWidth(), dataImg.getHeight());
 
        // CHECKING ROI 
        Object roiObject = pb.getObjectParameter(ROI_ARG);
        if (roiObject != null) { 
            if (!(roiObject instanceof ROI)) { 
                msg.append("The supplied ROI is not a supported class");
                return false; 
            } 
            final ROI roi = (ROI)roiObject;
            final Rectangle roiBounds = roi.getBounds(); 
            if (!roiBounds.intersects(dataBounds)) {
                msg.append("The supplied ROI does not intersect the source image");
                return false; 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getColorModel, getSampleModel, getTileGridXOffset, getTileGridYOffset, getTileHeight
 
        return new ImageLayout(bounds.x,
                               bounds.y,
                               bounds.width,
                               bounds.height,
                               source.getTileGridXOffset(),
                               source.getTileGridYOffset(),
                               source.getTileWidth(),
                               source.getTileHeight(),
                               source.getSampleModel(),
                               source.getColorModel());
 
    } 
 
    /** 
     * Construct an CropOpImage. 
     * 
     * @param source a RenderedImage. 
     * @param originX the new cropping rectangle x origin. 
     * @param originY the new cropping rectangle y origin. 
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getHeight, getMinX, getMinY, getTileGridXOffset, getTileGridYOffset
     *  
     * @param im 
     *            a <code>RenderedImage</code> whose layout will be copied. 
     */ 
    public RasterLayout(RenderedImage im) {
        this(im.getMinX(), im.getMinY(), im.getWidth(), im.getHeight(), im
                .getTileGridXOffset(), im.getTileGridYOffset(), im
                .getTileWidth(), im.getTileHeight());
    } 
 
    /** 
     * Returns the value of <code>minX</code>. 
     *  
     * @return the value of minX. 
     */ 
    public int getMinX() { 
        return minX;
    } 
 
    /** 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getHeight, getMinX, getMinY, getWidth
     */ 
    public RenderedImage create(ParameterBlock args,
                                RenderingHints hints) {
        RenderedImage src = args.getRenderedSource(0);
 
        int xStart = src.getMinX();	// default values
        int yStart = src.getMinY();
 
        int maxWidth = src.getWidth();
        int maxHeight = src.getHeight();
 
        ROI roi = (ROI)args.getObjectParameter(0);
        int xPeriod = args.getIntParameter(1);
        int yPeriod = args.getIntParameter(2);
        int[] numBins = (int[])args.getObjectParameter(3);
        double[] lowValue = (double[])args.getObjectParameter(4);
        double[] highValue = (double[])args.getObjectParameter(5);
 
        HistogramOpImage op = null;
        try { 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getHeight, getMinX, getMinY, getTileGridXOffset, getTileGridYOffset
     * to equal those of a given <code>RenderedImage</code>. 
     * 
     * @param im a <code>RenderedImage</code> whose layout will be copied. 
     */ 
    public RasterLayout(RenderedImage im) {
        this(im.getMinX(),
             im.getMinY(),
             im.getWidth(),
             im.getHeight(),
             im.getTileGridXOffset(),
             im.getTileGridYOffset(),
             im.getTileWidth(),
             im.getTileHeight());
    } 
 
    /** 
     * Returns the value of <code>minX</code>. 
     * @return the value of minX. 
     */ 
    public int getMinX() { 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getHeight, getWidth
	} 
 
	@Test
	public void testCropPNG() throws Exception {
		crop("liferay.png"); 
	} 
 
	@Test
	public void testReadBMP() throws Exception {
		read("liferay.bmp"); 
	} 
 
	@Test
	public void testReadGIF() throws Exception {
		read("liferay.gif"); 
	} 
 
	@Test
	public void testReadJPEG() throws Exception {
		read("liferay.jpeg"); 

7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getHeight, getMinX, getMinY, getWidth
    public int getYPad() { 
        return padY;
    } 
 
    public Dimension getMinimumSize() {
        return new Dimension(im.getMinX() + im.getWidth() +
                             (drawBorder ? 4 : 0),
                             im.getMinY() + im.getHeight() +
                             (drawBorder ? 4 : 0));
    } 
 
    public Dimension getPreferredSize() {
        return getMinimumSize(); 
    } 
 
    public Dimension getMaximumSize() {
        return getMinimumSize(); 
    } 
 
    /** Records a new size.  Called by the AWT. */ 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getHeight, getMinX, getMinY, getWidth
This code example shows how to use the following methods:getHeight, getMinX, getMinY, getSampleModel, getWidth
     * @return a RandomIter allowing read-only access to the source. 
     */ 
    public static RandomIter create(RenderedImage im,
                                    Rectangle bounds) {
        if (bounds == null) {
            bounds = new Rectangle(im.getMinX(), im.getMinY(),
                                   im.getWidth(), im.getHeight());
        } 
 
        SampleModel sm = im.getSampleModel();
        if (sm instanceof ComponentSampleModel) {
            switch (sm.getDataType()) {
            case DataBuffer.TYPE_BYTE:
                // return new RandomIterCSMByte(im, bounds); 
            case DataBuffer.TYPE_SHORT:
                // return new RandomIterCSMShort(im, bounds); 
            case DataBuffer.TYPE_USHORT:
                // return new RandomIterCSMUShort(im, bounds); 
            case DataBuffer.TYPE_INT:
                // return new RandomIterCSMInt(im, bounds); 

7
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Java 8 RenderedImage Methods: