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

This code example shows how to use the following methods:getHeight, getMinX, getMinY, getWidth
 
        double scaleX = paramBlock.getDoubleParameter(0);
        double scaleY = paramBlock.getDoubleParameter(1);
 
	// Get the source dimensions 
	float x0 = (float)source.getMinX();
	float y0 = (float)source.getMinY() ;
	float w = (float)source.getWidth();
	float h = (float)source.getHeight();
	 
	// Forward map the source using x0, y0, w and h 
	float d_x0 = (float)(x0 * scaleX);
	float d_y0 = (float)(y0 * scaleY);
	float d_w = (float)(w * scaleX);
	float d_h = (float)(h * scaleY);
	 
	return new Rectangle2D.Float(d_x0, d_y0, d_w, d_h);
    } 
 
} 
7
CodeRank
This code example shows how to use the following methods:getHeight, getMinX, getMinY, getWidth
 
        double scaleX = paramBlock.getDoubleParameter(0);
        double scaleY = paramBlock.getDoubleParameter(1);
 
        // Get the source dimensions 
        float x0 = (float) source.getMinX();
        float y0 = (float) source.getMinY();
        float w = (float) source.getWidth();
        float h = (float) source.getHeight();
 
        // Forward map the source using x0, y0, w and h 
        float d_x0 = (float) (x0 * scaleX);
        float d_y0 = (float) (y0 * scaleY);
        float d_w = (float) (w * scaleX);
        float d_h = (float) (h * scaleY);
 
        return new Rectangle2D.Float(d_x0, d_y0, d_w, d_h);
    } 
} 
6
CodeRank
This code example shows how to use the following methods:getHeight, getMinX, getMinY, getWidth
 
        float scale_x = paramBlock.getFloatParameter(0);
        float scale_y = paramBlock.getFloatParameter(1);
 
	// Get the source dimensions 
	float x0 = (float)source.getMinX();
	float y0 = (float)source.getMinY() ;
	float w = (float)source.getWidth();
	float h = (float)source.getHeight();
	 
	// Forward map the source using x0, y0, w and h 
	float d_x0 = x0 * scale_x;
	float d_y0 = y0 * scale_y;
	float d_w = w * scale_x;
	float d_h = h * scale_y;
	 
	// debugging 
	// System.out.println("*** CRIF getBounds2D() "); 
 
	return new Rectangle2D.Float(d_x0, d_y0, d_w, d_h);
6
CodeRank
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, getWidth
        float trans_x = paramBlock.getFloatParameter(2);
        float trans_y = paramBlock.getFloatParameter(3);
        Interpolation interp = (Interpolation)paramBlock.getObjectParameter(4);
 
	// Get the source dimensions 
	float x0 = (float)source.getMinX();
	float y0 = (float)source.getMinY() ;
	float w = (float)source.getWidth();
	float h = (float)source.getHeight();
	 
	// Forward map the source using x0, y0, w and h 
	float d_x0 = x0 * scale_x + trans_x;
	float d_y0 = y0 * scale_y + trans_y;
	float d_w = w * scale_x;
	float d_h = h * scale_y;
	 
	return new Rectangle2D.Float(d_x0, d_y0, d_w, d_h);
    } 
 
} 
6
CodeRank
This code example shows how to use the following methods:getHeight, getMinX, getMinY, getWidth
 
        // Check for out-of-bounds 
        RenderableImage src = (RenderableImage)args.getSource(0);
 
        Rectangle2D rect_src =
            new Rectangle2D.Float(src.getMinX(),
                                  src.getMinY(),
                                  src.getWidth(),
                                  src.getHeight());
 
        if (!rect_src.contains(rect_req)) {
            msg.append(getName() + " " +
                       JaiI18N.getString("CropDescriptor6")); 
            return false; 
        } 
 
        return true; 
    } 
 
 
6
CodeRank
This code example shows how to use the following methods:getHeight, getMinX, getMinY, getWidth
                     new Object[] {im, transform}); 
    } 
 
    public void drawRenderableImage(RenderableImage img,
                                    AffineTransform xform) {
        Rectangle2D.Double srcRect = new Rectangle2D.Double(img.getMinX(),
                                                            img.getMinY(),
                                                            img.getWidth(),
                                                            img.getHeight());
 
        Rectangle2D dstRect =
            xform.createTransformedShape(srcRect).getBounds2D();
 
        doGraphicsOp(dstRect, "drawRenderableImage",
                     new Class[] {java.awt.image.renderable.RenderableImage.class,
                                      java.awt.geom.AffineTransform.class},
                     new Object[] {img, xform}); 
    } 
 
    public boolean drawImage(Image img, int x, int y,
6
CodeRank
This code example shows how to use the following methods:getMediaSubtype, getMimeType
 */ 
public class DocFlavorComparator implements Comparator<DocFlavor> {
 
	public int compare(DocFlavor docFlavor1, DocFlavor docFlavor2) {
 
		int comparison = docFlavor1.getMimeType().compareTo(docFlavor2.getMimeType());
 
		if (comparison == 0) {
			return docFlavor1.getMediaSubtype().compareTo(docFlavor2.getMediaSubtype());
		} 
 
		return comparison;
	} 
 
} 
5
CodeRank
This code example shows how to use the following methods:
	public PrintMessageHandler(PrintServiceExecutor printServiceExecutor, String mimeType, String className) {
 
		Assert.hasText(className, "'className' must be neither null nor empty.");
		Assert.hasText(mimeType, "'mimeType' must be neither null nor empty.");
 
		this.docFlavor = new DocFlavor(mimeType, className);
		this.printServiceExecutor = printServiceExecutor;
 
	} 
 
	public PrintMessageHandler(PrintServiceExecutor printServiceExecutor) {
		this.docFlavor = DocFlavor.STRING.TEXT_PLAIN;
		this.printServiceExecutor = printServiceExecutor;
	} 
 
	@Override 
	protected void handleMessageInternal(Message<?> message) throws Exception {
 
		if (LOG.isDebugEnabled()) {
			LOG.debug("Printing using printer '" + this.printServiceExecutor.getPrintService().getName() + "'.");
4
CodeRank
This code example shows how to use the following methods:getWidth
     * ratio (width divided by height). 
     * 
     * @return the width of the image in user coordinates. 
     */ 
    public final float getWidth() { 
        return im.getWidth();
    } 
   
    /**  
     * Gets the height in user coordinate space.  By convention, the 
     * usual height of a RenderedImage is equal to 1.0F. 
     * 
     * @return the height of the image in user coordinates. 
     */ 
    public final float getHeight() { 
        return im.getHeight();
    } 
     
    /**  
     * Gets the minimum X coordinate of the rendering-independent image. 
4
CodeRank
See Code Examples for Java 8 RenderableImage Methods: