本文整理汇总了Java中java.awt.image.renderable.RenderableImage.getHeight方法的典型用法代码示例。如果您正苦于以下问题:Java RenderableImage.getHeight方法的具体用法?Java RenderableImage.getHeight怎么用?Java RenderableImage.getHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.image.renderable.RenderableImage
的用法示例。
在下文中一共展示了RenderableImage.getHeight方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleImage
import java.awt.image.renderable.RenderableImage; //导入方法依赖的package包/类
/**
* The handler sets the xlink:href tag and returns a transform
*/
public AffineTransform handleImage(RenderableImage image,
Element imageElement,
double x, double y,
double width, double height,
SVGGeneratorContext generatorContext) {
double imageWidth = image.getWidth();
double imageHeight = image.getHeight();
if(imageWidth == 0 || imageHeight == 0 ||
width == 0 || height == 0) {
// Forget about it
handleEmptyImage(imageElement);
} else {
imageHandler.handleImage(image, imageElement, generatorContext);
setImageAttributes(imageElement, x, y, width, height, generatorContext);
}
return null;
}
示例2: getBounds2D
import java.awt.image.renderable.RenderableImage; //导入方法依赖的package包/类
/**
* Gets the bounding box for the output of <code>ScaleOpImage</code>.
* This method satisfies the implementation of CRIF.
*/
public Rectangle2D getBounds2D(ParameterBlock paramBlock) {
RenderableImage source = paramBlock.getRenderableSource(0);
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);
}
示例3: getBounds2D
import java.awt.image.renderable.RenderableImage; //导入方法依赖的package包/类
/**
* Gets the bounding box for the output of <code>ScaleOpImage</code>.
* This method satisfies the implementation of CRIF.
*/
public Rectangle2D getBounds2D(ParameterBlock paramBlock) {
RenderableImage source = paramBlock.getRenderableSource(0);
float scale_x = paramBlock.getFloatParameter(0);
float scale_y = paramBlock.getFloatParameter(1);
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);
}
示例4: handleImage
import java.awt.image.renderable.RenderableImage; //导入方法依赖的package包/类
/**
* The handler sets the xlink:href tag and returns a transform
*/
public AffineTransform handleImage(RenderableImage image,
Element imageElement,
double x, double y,
double width, double height,
SVGGeneratorContext generatorContext) {
double imageWidth = image.getWidth();
double imageHeight = image.getHeight();
AffineTransform af = null;
if(imageWidth == 0 || imageHeight == 0 ||
width == 0 || height == 0) {
// Forget about it
handleEmptyImage(imageElement);
} else {
// First set the href
try {
handleHREF(image, imageElement, generatorContext);
} catch (SVGGraphics2DIOException e) {
try {
generatorContext.errorHandler.handleError(e);
} catch (SVGGraphics2DIOException io) {
// we need a runtime exception because
// java.awt.Graphics2D method doesn't throw exceptions..
throw new SVGGraphics2DRuntimeException(io);
}
}
// Then create the transformation:
// Because we cache image data, the stored image may
// need to be scaled.
af = handleTransform(imageElement, x,y,
imageWidth, imageHeight,
width, height, generatorContext);
}
return af;
}
示例5: drawRenderableImage
import java.awt.image.renderable.RenderableImage; //导入方法依赖的package包/类
/**
* Renders a renderable image. This produces a RenderedImage, which is
* then passed to {@link #drawRenderedImage(RenderedImage, AffineTransform)}
* to perform the final rendering.
*
* @param image the renderable image to be rendered
* @param xform the transform from image space to user space
*/
public void drawRenderableImage(RenderableImage image, AffineTransform xform)
{
Rectangle areaOfInterest = new Rectangle((int) image.getMinX(),
(int) image.getHeight(),
(int) image.getWidth(),
(int) image.getHeight());
drawRenderableImageImpl(image, xform, areaOfInterest);
}
示例6: drawRenderableImage
import java.awt.image.renderable.RenderableImage; //导入方法依赖的package包/类
/**
* Renders a renderable image. This produces a RenderedImage, which is
* then passed to {@link #drawRenderedImage(RenderedImage, AffineTransform)}
* to perform the final rendering.
*
* @param image the renderable image to be rendered
* @param xform the transform from image space to user space
*/
public void drawRenderableImage(RenderableImage image, AffineTransform xform)
{
Rectangle areaOfInterest = new Rectangle((int) image.getMinX(),
(int) image.getHeight(),
(int) image.getWidth(),
(int) image.getHeight());
drawRenderableImageImpl(image, xform, areaOfInterest);
}
示例7: getBounds2D
import java.awt.image.renderable.RenderableImage; //导入方法依赖的package包/类
/**
* Gets the output bounding box in rendering-independent space.
* This method satisfies the implementation of CRIF.
*/
public Rectangle2D getBounds2D(ParameterBlock paramBlock) {
RenderableImage mres = createRenderable(paramBlock);
return new Rectangle2D.Float(mres.getMinX(), mres.getMinY(),
mres.getWidth(), mres.getHeight());
}
示例8: getBounds2D
import java.awt.image.renderable.RenderableImage; //导入方法依赖的package包/类
/**
* Gets the bounding box for output of <code>TranslateOpImage</code>.
* This method satisfies the implementation of CRIF.
*/
public Rectangle2D getBounds2D(ParameterBlock paramBlock) {
RenderableImage source = paramBlock.getRenderableSource(0);
float xTrans = paramBlock.getFloatParameter(0);
float yTrans = paramBlock.getFloatParameter(1);
return new Rectangle2D.Float(source.getMinX() + xTrans,
source.getMinY() + yTrans,
source.getWidth(),
source.getHeight());
}
示例9: getBounds2D
import java.awt.image.renderable.RenderableImage; //导入方法依赖的package包/类
/**
* Gets the bounding box for the output of <code>SubsampleBinaryToGrayOpImage</code>.
* This method satisfies the implementation of CRIF.
*/
public Rectangle2D getBounds2D(ParameterBlock paramBlock) {
RenderableImage source = paramBlock.getRenderableSource(0);
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);
}
示例10: drawRenderableImage
import java.awt.image.renderable.RenderableImage; //导入方法依赖的package包/类
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});
}
示例11: validateRenderableArgs
import java.awt.image.renderable.RenderableImage; //导入方法依赖的package包/类
/**
* Validates the input source and parameters in the renderable mode.
*
* <p> In addition to the standard checks performed by the
* superclass method, this method checks that "x", "y", "width",
* and "height" form a rectangle that is not empty and that
* is fully contained within the bounds of the source image.
*/
private boolean validateRenderableArgs(ParameterBlock args,
StringBuffer msg) {
// Get parameters.
float x_req = args.getFloatParameter(0);
float y_req = args.getFloatParameter(1);
float w_req = args.getFloatParameter(2);
float h_req = args.getFloatParameter(3);
// Create required rectangle.
Rectangle2D rect_req =
new Rectangle2D.Float(x_req, y_req, w_req, h_req);
// Check for an empty rectangle.
if(rect_req.isEmpty()) {
msg.append(getName() + " " +
JaiI18N.getString("CropDescriptor5"));
return false;
}
// 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;
}
示例12: getBounds2D
import java.awt.image.renderable.RenderableImage; //导入方法依赖的package包/类
/**
* Returns the bounding box for the output of the operation. The
* implementation in this class computes the bounding box as the
* intersection the bounding boxes of all the (renderable sources).
*
* @param paramBlock A <code>ParameterBlock</code> containing the
* sources and parameters of the operation.
* @return A <code>Rectangle2D</code> specifying the bounding box.
*/
public Rectangle2D getBounds2D(ParameterBlock paramBlock) {
int numSources = paramBlock.getNumSources();
if (numSources == 0) {
return null;
}
RenderableImage src = paramBlock.getRenderableSource(0);
Rectangle2D.Float box1 = new Rectangle2D.Float(src.getMinX(),
src.getMinY(),
src.getWidth(),
src.getHeight());
for (int i = 1; i < numSources; i++) {
src = paramBlock.getRenderableSource(i);
Rectangle2D.Float box2 =
new Rectangle2D.Float(src.getMinX(), src.getMinY(),
src.getWidth(), src.getHeight());
box1 = (Rectangle2D.Float)box1.createIntersection(box2);
if(box1.isEmpty()) {
break;
}
}
return box1;
}
示例13: drawRenderableImage
import java.awt.image.renderable.RenderableImage; //导入方法依赖的package包/类
@Override
public void drawRenderableImage(RenderableImage img, AffineTransform xform) {
Rectangle2D bounds = new Rectangle2D.Float(img.getMinX(), img.getMinY(),
img.getWidth(), img.getHeight());
Rectangle2D trBounds = xform.createTransformedShape(bounds).getBounds2D();
doDraw(OpType.DRAW_RENDERABLE_IMAGE, trBounds, img, xform);
}