/** * Returns the transformation matrix of the image. * * @return an array [AX, AY, BX, BY, CX, CY, DX, DY] */ public float[] matrix() { return matrix(1); }
/** * Returns the transformation matrix of the image. * * @return an array [AX, AY, BX, BY, CX, CY, DX, DY] */ public float[] matrix() { return matrix(1); }
/** * Sets the rotation of the image in radians. * * @param r * rotation in radians */ public void setRotation(final float r) { double d = 2.0 * Math.PI; rotationRadians = (float) ((r + initialRotation) % d); if (rotationRadians < 0) { rotationRadians += d; } float[] matrix = matrix(); scaledWidth = matrix[DX] - matrix[CX]; scaledHeight = matrix[DY] - matrix[CY]; }
/** * Sets the rotation of the image in radians. * * @param r * rotation in radians */ public void setRotation(final float r) { double d = 2.0 * Math.PI; rotationRadians = (float) ((r + initialRotation) % d); if (rotationRadians < 0) { rotationRadians += d; } float[] matrix = matrix(); scaledWidth = matrix[DX] - matrix[CX]; scaledHeight = matrix[DY] - matrix[CY]; }
/** * Scale the image to an absolute height. * * @param newHeight * the new height */ public void scaleAbsoluteHeight(final float newHeight) { plainHeight = newHeight; float[] matrix = matrix(); scaledWidth = matrix[DX] - matrix[CX]; scaledHeight = matrix[DY] - matrix[CY]; setWidthPercentage(0); }
/** * Scale the image to an absolute width. * * @param newWidth * the new width */ public void scaleAbsoluteWidth(final float newWidth) { plainWidth = newWidth; float[] matrix = matrix(); scaledWidth = matrix[DX] - matrix[CX]; scaledHeight = matrix[DY] - matrix[CY]; setWidthPercentage(0); }
/** * Scale the image to an absolute height. * * @param newHeight * the new height */ public void scaleAbsoluteHeight(final float newHeight) { plainHeight = newHeight; float[] matrix = matrix(); scaledWidth = matrix[DX] - matrix[CX]; scaledHeight = matrix[DY] - matrix[CY]; setWidthPercentage(0); }
/** * Scale the image to an absolute width. * * @param newWidth * the new width */ public void scaleAbsoluteWidth(final float newWidth) { plainWidth = newWidth; float[] matrix = matrix(); scaledWidth = matrix[DX] - matrix[CX]; scaledHeight = matrix[DY] - matrix[CY]; setWidthPercentage(0); }
/** * Scale the image to an absolute width and an absolute height. * * @param newWidth * the new width * @param newHeight * the new height */ public void scaleAbsolute(final float newWidth, final float newHeight) { plainWidth = newWidth; plainHeight = newHeight; float[] matrix = matrix(); scaledWidth = matrix[DX] - matrix[CX]; scaledHeight = matrix[DY] - matrix[CY]; setWidthPercentage(0); }
/** * Scale the image to an absolute width and an absolute height. * * @param newWidth * the new width * @param newHeight * the new height */ public void scaleAbsolute(final float newWidth, final float newHeight) { plainWidth = newWidth; plainHeight = newHeight; float[] matrix = matrix(); scaledWidth = matrix[DX] - matrix[CX]; scaledHeight = matrix[DY] - matrix[CY]; setWidthPercentage(0); }
/** * Scale the width and height of an image to a certain percentage. * * @param percentX * the scaling percentage of the width * @param percentY * the scaling percentage of the height */ public void scalePercent(final float percentX, final float percentY) { plainWidth = getWidth() * percentX / 100f; plainHeight = getHeight() * percentY / 100f; float[] matrix = matrix(); scaledWidth = matrix[DX] - matrix[CX]; scaledHeight = matrix[DY] - matrix[CY]; setWidthPercentage(0); }
/** * Scale the width and height of an image to a certain percentage. * * @param percentX * the scaling percentage of the width * @param percentY * the scaling percentage of the height */ public void scalePercent(final float percentX, final float percentY) { plainWidth = getWidth() * percentX / 100f; plainHeight = getHeight() * percentY / 100f; float[] matrix = matrix(); scaledWidth = matrix[DX] - matrix[CX]; scaledHeight = matrix[DY] - matrix[CY]; setWidthPercentage(0); }
/** * Adds an <CODE>Image</CODE> to the page. The <CODE>Image</CODE> must have * absolute positioning. The image can be placed inline. * @param image the <CODE>Image</CODE> object * @param inlineImage <CODE>true</CODE> to place this image inline, <CODE>false</CODE> otherwise * @throws DocumentException if the <CODE>Image</CODE> does not have absolute positioning */ public void addImage(final Image image, final boolean inlineImage) throws DocumentException { if (!image.hasAbsoluteY()) throw new DocumentException(MessageLocalization.getComposedMessage("the.image.must.have.absolute.positioning")); float matrix[] = image.matrix(); matrix[Image.CX] = image.getAbsoluteX() - matrix[Image.CX]; matrix[Image.CY] = image.getAbsoluteY() - matrix[Image.CY]; addImage(image, matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], inlineImage); }
/** * Adds an <CODE>Image</CODE> to the page. The <CODE>Image</CODE> must have * absolute positioning. The image can be placed inline. * @param image the <CODE>Image</CODE> object * @param inlineImage <CODE>true</CODE> to place this image inline, <CODE>false</CODE> otherwise * @throws DocumentException if the <CODE>Image</CODE> does not have absolute positioning */ public void addImage(final Image image, final boolean inlineImage) throws DocumentException { if (!image.hasAbsoluteY()) throw new DocumentException(MessageLocalization.getComposedMessage("the.image.must.have.absolute.positioning")); float matrix[] = image.matrix(); matrix[Image.CX] = image.getAbsoluteX() - matrix[Image.CX]; matrix[Image.CY] = image.getAbsoluteY() - matrix[Image.CY]; addImage(image, matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], inlineImage); }
float w = Math.min(img.getScaledWidth(), 460); float h = Math.min(img.getScaledHeight(), 300); for (float f : img.matrix()) { System.out.println(f);
Image image = chunk.getImage(); width = chunk.getImageWidth(); float matrix[] = image.matrix(chunk.getImageScalePercentage()); matrix[Image.CX] = xMarker + chunk.getImageOffsetX() - matrix[Image.CX]; matrix[Image.CY] = yMarker + chunk.getImageOffsetY() - matrix[Image.CY];
Image image = chunk.getImage(); width = chunk.getImageWidth(); float matrix[] = image.matrix(chunk.getImageScalePercentage()); matrix[Image.CX] = xMarker + chunk.getImageOffsetX() - matrix[Image.CX]; matrix[Image.CY] = yMarker + chunk.getImageOffsetY() - matrix[Image.CY];
float mt[] = image.matrix(); float startPosition = indentLeft() - mt[4]; if ((image.getAlignment() & Image.RIGHT) == Image.RIGHT) startPosition = indentRight() - image.getScaledWidth() - mt[4];
float mt[] = image.matrix(); float startPosition = indentLeft() - mt[4]; if ((image.getAlignment() & Image.RIGHT) == Image.RIGHT) startPosition = indentRight() - image.getScaledWidth() - mt[4];