Method from com.lowagie.text.Image Detail: |
public float getAbsoluteX() {
return absoluteX;
}
Returns the absolute X position. |
public float getAbsoluteY() {
return absoluteY;
}
Returns the absolute Y position. |
public PdfDictionary getAdditional() {
return this.additional;
}
Getter for the dictionary with additional information. |
public int getAlignment() {
return alignment;
}
Gets the alignment for the image. |
public String getAlt() {
return alt;
}
Gets the alternative text for the image. |
public Annotation getAnnotation() {
return annotation;
}
|
public int getBpc() {
return bpc;
}
|
public int getColorspace() {
return colorspace;
}
|
public int getCompressionLevel() {
return compressionLevel;
}
Returns the compression level used for images written as a compressed stream. |
public PdfIndirectReference getDirectReference() {
return this.directReference;
}
Getter for property directReference. |
public int getDpiX() {
return dpiX;
}
Gets the dots-per-inch in the X direction. Returns 0 if not available. |
public int getDpiY() {
return dpiY;
}
Gets the dots-per-inch in the Y direction. Returns 0 if not available. |
public ICC_Profile getICCProfile() {
return profile;
}
Gets the images ICC profile. |
public Image getImageMask() {
return imageMask;
}
Gets the explicit masking. |
public float getImageRotation() {
double d = 2.0 * Math.PI;
float rot = (float) ((rotationRadians - initialRotation) % d);
if (rot < 0) {
rot += d;
}
return rot;
}
Gets the current image rotation in radians. |
public float getIndentationLeft() {
return indentationLeft;
}
Gets the left indentation. |
public float getIndentationRight() {
return indentationRight;
}
Gets the right indentation. |
public float getInitialRotation() {
return this.initialRotation;
}
Getter for property initialRotation. |
public static Image getInstance(URL url) throws BadElementException, MalformedURLException, IOException {
InputStream is = null;
try {
is = url.openStream();
int c1 = is.read();
int c2 = is.read();
int c3 = is.read();
int c4 = is.read();
// jbig2
int c5 = is.read();
int c6 = is.read();
int c7 = is.read();
int c8 = is.read();
is.close();
is = null;
if (c1 == 'G' && c2 == 'I' && c3 == 'F') {
GifImage gif = new GifImage(url);
Image img = gif.getImage(1);
return img;
}
if (c1 == 0xFF && c2 == 0xD8) {
return new Jpeg(url);
}
if (c1 == 0x00 && c2 == 0x00 && c3 == 0x00 && c4 == 0x0c) {
return new Jpeg2000(url);
}
if (c1 == 0xff && c2 == 0x4f && c3 == 0xff && c4 == 0x51) {
return new Jpeg2000(url);
}
if (c1 == PngImage.PNGID[0] && c2 == PngImage.PNGID[1]
&& c3 == PngImage.PNGID[2] && c4 == PngImage.PNGID[3]) {
return PngImage.getImage(url);
}
if (c1 == 0xD7 && c2 == 0xCD) {
return new ImgWMF(url);
}
if (c1 == 'B' && c2 == 'M') {
return BmpImage.getImage(url);
}
if ((c1 == 'M' && c2 == 'M' && c3 == 0 && c4 == 42)
|| (c1 == 'I' && c2 == 'I' && c3 == 42 && c4 == 0)) {
RandomAccessFileOrArray ra = null;
try {
if (url.getProtocol().equals("file")) {
String file = url.getFile();
file = Utilities.unEscapeURL(file);
ra = new RandomAccessFileOrArray(file);
} else
ra = new RandomAccessFileOrArray(url);
Image img = TiffImage.getTiffImage(ra, 1);
img.url = url;
return img;
} finally {
if (ra != null)
ra.close();
}
}
if ( c1 == 0x97 && c2 == 'J' && c3 == 'B' && c4 == '2' &&
c5 == '\r' && c6 == '\n' && c7 == 0x1a && c8 == '\n' ) {
RandomAccessFileOrArray ra = null;
try {
if (url.getProtocol().equals("file")) {
String file = url.getFile();
file = Utilities.unEscapeURL(file);
ra = new RandomAccessFileOrArray(file);
} else
ra = new RandomAccessFileOrArray(url);
Image img = JBIG2Image.getJbig2Image(ra, 1);
img.url = url;
return img;
} finally {
if (ra != null)
ra.close();
}
}
throw new IOException(url.toString()
+ " is not a recognized imageformat.");
} finally {
if (is != null) {
is.close();
}
}
}
Gets an instance of an Image. |
public static Image getInstance(String filename) throws BadElementException, MalformedURLException, IOException {
return getInstance(Utilities.toURL(filename));
}
Gets an instance of an Image. |
public static Image getInstance(byte[] imgb) throws BadElementException, MalformedURLException, IOException {
InputStream is = null;
try {
is = new java.io.ByteArrayInputStream(imgb);
int c1 = is.read();
int c2 = is.read();
int c3 = is.read();
int c4 = is.read();
is.close();
is = null;
if (c1 == 'G' && c2 == 'I' && c3 == 'F') {
GifImage gif = new GifImage(imgb);
return gif.getImage(1);
}
if (c1 == 0xFF && c2 == 0xD8) {
return new Jpeg(imgb);
}
if (c1 == 0x00 && c2 == 0x00 && c3 == 0x00 && c4 == 0x0c) {
return new Jpeg2000(imgb);
}
if (c1 == 0xff && c2 == 0x4f && c3 == 0xff && c4 == 0x51) {
return new Jpeg2000(imgb);
}
if (c1 == PngImage.PNGID[0] && c2 == PngImage.PNGID[1]
&& c3 == PngImage.PNGID[2] && c4 == PngImage.PNGID[3]) {
return PngImage.getImage(imgb);
}
if (c1 == 0xD7 && c2 == 0xCD) {
return new ImgWMF(imgb);
}
if (c1 == 'B' && c2 == 'M') {
return BmpImage.getImage(imgb);
}
if ((c1 == 'M' && c2 == 'M' && c3 == 0 && c4 == 42)
|| (c1 == 'I' && c2 == 'I' && c3 == 42 && c4 == 0)) {
RandomAccessFileOrArray ra = null;
try {
ra = new RandomAccessFileOrArray(imgb);
Image img = TiffImage.getTiffImage(ra, 1);
if (img.getOriginalData() == null)
img.setOriginalData(imgb);
return img;
} finally {
if (ra != null)
ra.close();
}
}
if ( c1 == 0x97 && c2 == 'J' && c3 == 'B' && c4 == '2' ) {
is = new java.io.ByteArrayInputStream(imgb);
is.skip(4);
int c5 = is.read();
int c6 = is.read();
int c7 = is.read();
int c8 = is.read();
if ( c5 == '\r' && c6 == '\n' && c7 == 0x1a && c8 == '\n' ) {
int file_header_flags = is.read();
int number_of_pages = -1;
if ( (file_header_flags & 0x2) == 0x2 ) {
number_of_pages = (is.read() < < 24) | (is.read() < < 16) | (is.read() < < 8) | is.read();
}
is.close();
// a jbig2 file with a file header. the header is the only way we know here.
// embedded jbig2s don't have a header, have to create them by explicit use of Jbig2Image?
// nkerr, 2008-12-05 see also the getInstance(URL)
RandomAccessFileOrArray ra = null;
try {
ra = new RandomAccessFileOrArray(imgb);
Image img = JBIG2Image.getJbig2Image(ra, 1);
if (img.getOriginalData() == null)
img.setOriginalData(imgb);
return img;
} finally {
if (ra != null)
ra.close();
}
}
}
throw new IOException(
"The byte array is not a recognized imageformat.");
} finally {
if (is != null) {
is.close();
}
}
}
gets an instance of an Image |
public static Image getInstance(PdfTemplate template) throws BadElementException {
return new ImgTemplate(template);
}
gets an instance of an Image |
public static Image getInstance(PRIndirectReference ref) throws BadElementException {
PdfDictionary dic = (PdfDictionary)PdfReader.getPdfObjectRelease(ref);
int width = ((PdfNumber)PdfReader.getPdfObjectRelease(dic.get(PdfName.WIDTH))).intValue();
int height = ((PdfNumber)PdfReader.getPdfObjectRelease(dic.get(PdfName.HEIGHT))).intValue();
Image imask = null;
PdfObject obj = dic.get(PdfName.SMASK);
if (obj != null && obj.isIndirect()) {
imask = getInstance((PRIndirectReference)obj);
}
else {
obj = dic.get(PdfName.MASK);
if (obj != null && obj.isIndirect()) {
PdfObject obj2 = PdfReader.getPdfObjectRelease(obj);
if (obj2 instanceof PdfDictionary)
imask = getInstance((PRIndirectReference)obj);
}
}
Image img = new ImgRaw(width, height, 1, 1, null);
img.imageMask = imask;
img.directReference = ref;
return img;
}
Reuses an existing image. |
public static Image getInstance(Image image) {
if (image == null)
return null;
try {
Class cs = image.getClass();
Constructor constructor = cs
.getDeclaredConstructor(new Class[] { Image.class });
return (Image) constructor.newInstance(new Object[] { image });
} catch (Exception e) {
throw new ExceptionConverter(e);
}
}
gets an instance of an Image |
public static Image getInstance(Image image,
Color color) throws BadElementException, IOException {
return Image.getInstance(image, color, false);
}
Gets an instance of an Image from a java.awt.Image. |
public static Image getInstance(Image image,
Color color,
boolean forceBW) throws BadElementException, IOException {
if(image instanceof BufferedImage){
BufferedImage bi = (BufferedImage) image;
if(bi.getType()==BufferedImage.TYPE_BYTE_BINARY) {
forceBW=true;
}
}
java.awt.image.PixelGrabber pg = new java.awt.image.PixelGrabber(image,
0, 0, -1, -1, true);
try {
pg.grabPixels();
} catch (InterruptedException e) {
throw new IOException(
"java.awt.Image Interrupted waiting for pixels!");
}
if ((pg.getStatus() & java.awt.image.ImageObserver.ABORT) != 0) {
throw new IOException("java.awt.Image fetch aborted or errored");
}
int w = pg.getWidth();
int h = pg.getHeight();
int[] pixels = (int[]) pg.getPixels();
if (forceBW) {
int byteWidth = (w / 8) + ((w & 7) != 0 ? 1 : 0);
byte[] pixelsByte = new byte[byteWidth * h];
int index = 0;
int size = h * w;
int transColor = 1;
if (color != null) {
transColor = (color.getRed() + color.getGreen()
+ color.getBlue() < 384) ? 0 : 1;
}
int transparency[] = null;
int cbyte = 0x80;
int wMarker = 0;
int currByte = 0;
if (color != null) {
for (int j = 0; j < size; j++) {
int alpha = (pixels[j] > > 24) & 0xff;
if (alpha < 250) {
if (transColor == 1)
currByte |= cbyte;
} else {
if ((pixels[j] & 0x888) != 0)
currByte |= cbyte;
}
cbyte > >= 1;
if (cbyte == 0 || wMarker + 1 >= w) {
pixelsByte[index++] = (byte) currByte;
cbyte = 0x80;
currByte = 0;
}
++wMarker;
if (wMarker >= w)
wMarker = 0;
}
} else {
for (int j = 0; j < size; j++) {
if (transparency == null) {
int alpha = (pixels[j] > > 24) & 0xff;
if (alpha == 0) {
transparency = new int[2];
/* bugfix by M.P. Liston, ASC, was: ... ? 1: 0; */
transparency[0] = transparency[1] = ((pixels[j] & 0x888) != 0) ? 0xff : 0;
}
}
if ((pixels[j] & 0x888) != 0)
currByte |= cbyte;
cbyte > >= 1;
if (cbyte == 0 || wMarker + 1 >= w) {
pixelsByte[index++] = (byte) currByte;
cbyte = 0x80;
currByte = 0;
}
++wMarker;
if (wMarker >= w)
wMarker = 0;
}
}
return Image.getInstance(w, h, 1, 1, pixelsByte, transparency);
} else {
byte[] pixelsByte = new byte[w * h * 3];
byte[] smask = null;
int index = 0;
int size = h * w;
int red = 255;
int green = 255;
int blue = 255;
if (color != null) {
red = color.getRed();
green = color.getGreen();
blue = color.getBlue();
}
int transparency[] = null;
if (color != null) {
for (int j = 0; j < size; j++) {
int alpha = (pixels[j] > > 24) & 0xff;
if (alpha < 250) {
pixelsByte[index++] = (byte) red;
pixelsByte[index++] = (byte) green;
pixelsByte[index++] = (byte) blue;
} else {
pixelsByte[index++] = (byte) ((pixels[j] > > 16) & 0xff);
pixelsByte[index++] = (byte) ((pixels[j] > > 8) & 0xff);
pixelsByte[index++] = (byte) ((pixels[j]) & 0xff);
}
}
} else {
int transparentPixel = 0;
smask = new byte[w * h];
boolean shades = false;
for (int j = 0; j < size; j++) {
byte alpha = smask[j] = (byte) ((pixels[j] > > 24) & 0xff);
/* bugfix by Chris Nokleberg */
if (!shades) {
if (alpha != 0 && alpha != -1) {
shades = true;
} else if (transparency == null) {
if (alpha == 0) {
transparentPixel = pixels[j] & 0xffffff;
transparency = new int[6];
transparency[0] = transparency[1] = (transparentPixel > > 16) & 0xff;
transparency[2] = transparency[3] = (transparentPixel > > 8) & 0xff;
transparency[4] = transparency[5] = transparentPixel & 0xff;
}
} else if ((pixels[j] & 0xffffff) != transparentPixel) {
shades = true;
}
}
pixelsByte[index++] = (byte) ((pixels[j] > > 16) & 0xff);
pixelsByte[index++] = (byte) ((pixels[j] > > 8) & 0xff);
pixelsByte[index++] = (byte) ((pixels[j]) & 0xff);
}
if (shades)
transparency = null;
else
smask = null;
}
Image img = Image.getInstance(w, h, 3, 8, pixelsByte, transparency);
if (smask != null) {
Image sm = Image.getInstance(w, h, 1, 8, smask);
try {
sm.makeMask();
img.setImageMask(sm);
} catch (DocumentException de) {
throw new ExceptionConverter(de);
}
}
return img;
}
}
Gets an instance of an Image from a java.awt.Image. |
public static Image getInstance(PdfWriter writer,
Image awtImage,
float quality) throws BadElementException, IOException {
return getInstance(new PdfContentByte(writer), awtImage, quality);
}
Gets an instance of a Image from a java.awt.Image.
The image is added as a JPEG with a user defined quality. |
public static Image getInstance(PdfContentByte cb,
Image awtImage,
float quality) throws BadElementException, IOException {
java.awt.image.PixelGrabber pg = new java.awt.image.PixelGrabber(awtImage,
0, 0, -1, -1, true);
try {
pg.grabPixels();
} catch (InterruptedException e) {
throw new IOException(
"java.awt.Image Interrupted waiting for pixels!");
}
if ((pg.getStatus() & java.awt.image.ImageObserver.ABORT) != 0) {
throw new IOException("java.awt.Image fetch aborted or errored");
}
int w = pg.getWidth();
int h = pg.getHeight();
PdfTemplate tp = cb.createTemplate(w, h);
Graphics2D g2d = tp.createGraphics(w, h, true, quality);
g2d.drawImage(awtImage, 0, 0, null);
g2d.dispose();
return getInstance(tp);
}
Gets an instance of a Image from a java.awt.Image.
The image is added as a JPEG with a user defined quality. |
public static Image getInstance(int width,
int height,
byte[] data,
byte[] globals) {
Image img = new ImgJBIG2(width, height, data, globals);
return img;
}
|
public static Image getInstance(int width,
int height,
int components,
int bpc,
byte[] data) throws BadElementException {
return Image.getInstance(width, height, components, bpc, data, null);
}
Gets an instance of an Image in raw mode. |
public static Image getInstance(int width,
int height,
boolean reverseBits,
int typeCCITT,
int parameters,
byte[] data) throws BadElementException {
return Image.getInstance(width, height, reverseBits, typeCCITT,
parameters, data, null);
}
Creates an Image with CCITT G3 or G4 compression. It assumes that the
data bytes are already compressed. |
public static Image getInstance(int width,
int height,
int components,
int bpc,
byte[] data,
int[] transparency) throws BadElementException {
if (transparency != null && transparency.length != components * 2)
throw new BadElementException(
"Transparency length must be equal to (componentes * 2)");
if (components == 1 && bpc == 1) {
byte g4[] = CCITTG4Encoder.compress(data, width, height);
return Image.getInstance(width, height, false, Image.CCITTG4,
Image.CCITT_BLACKIS1, g4, transparency);
}
Image img = new ImgRaw(width, height, components, bpc, data);
img.transparency = transparency;
return img;
}
Gets an instance of an Image in raw mode. |
public static Image getInstance(int width,
int height,
boolean reverseBits,
int typeCCITT,
int parameters,
byte[] data,
int[] transparency) throws BadElementException {
if (transparency != null && transparency.length != 2)
throw new BadElementException(
"Transparency length must be equal to 2 with CCITT images");
Image img = new ImgCCITT(width, height, reverseBits, typeCCITT,
parameters, data);
img.transparency = transparency;
return img;
}
Creates an Image with CCITT G3 or G4 compression. It assumes that the
data bytes are already compressed. |
public PdfOCG getLayer() {
return layer;
}
Gets the layer this image belongs to. |
public Long getMySerialId() {
return mySerialId;
}
Returns a serial id for the Image (reuse the same image more than once) |
public byte[] getOriginalData() {
return this.originalData;
}
Getter for property originalData. |
public int getOriginalType() {
return this.originalType;
}
Getter for property originalType. |
public float getPlainHeight() {
return plainHeight;
}
Gets the plain height of the image. |
public float getPlainWidth() {
return plainWidth;
}
Gets the plain width of the image. |
public byte[] getRawData() {
return rawData;
}
|
public float getScaledHeight() {
return scaledHeight;
}
Gets the scaled height of the image. |
public float getScaledWidth() {
return scaledWidth;
}
Gets the scaled width of the image. |
protected static synchronized Long getSerialId() {
++serialId;
return new Long(serialId);
}
|
public float getSpacingAfter() {
return spacingAfter;
}
Gets the spacing before this image. |
public float getSpacingBefore() {
return spacingBefore;
}
Gets the spacing before this image. |
public PdfTemplate getTemplateData() {
return template[0];
}
|
public int[] getTransparency() {
return transparency;
}
Returns the transparency. |
public URL getUrl() {
return url;
}
Gets the String -representation of the reference to the
image. |
public float getWidthPercentage() {
return this.widthPercentage;
}
Getter for property widthPercentage. |
public float getXYRatio() {
return this.XYRatio;
}
Gets the X/Y pixel dimensionless aspect ratio. |
public boolean hasAbsoluteX() {
return !Float.isNaN(absoluteX);
}
Checks if the Images has to be added at an absolute X
position. |
public boolean hasAbsoluteY() {
return !Float.isNaN(absoluteY);
}
Checks if the Images has to be added at an absolute
position. |
public boolean hasICCProfile() {
return (this.profile != null);
}
Checks is the image has an ICC profile. |
public boolean isDeflated() {
return this.deflated;
}
Getter for property deflated. |
public boolean isImgRaw() {
return type == IMGRAW;
}
Returns true if the image is a ImgRaw
-object. |
public boolean isImgTemplate() {
return type == IMGTEMPLATE;
}
Returns true if the image is an ImgTemplate
-object. |
public boolean isInterpolation() {
return interpolation;
}
Getter for property interpolation. |
public boolean isInverted() {
return invert;
}
Getter for the inverted value |
public boolean isJpeg() {
return type == JPEG;
}
Returns true if the image is a Jpeg
-object. |
public boolean isMask() {
return mask;
}
Returns true if this Image is a mask. |
public boolean isMaskCandidate() {
if (type == IMGRAW) {
if (bpc > 0xff)
return true;
}
return colorspace == 1;
}
Returns true if this Image has the
requisites to be a mask. |
public boolean isNestable() {
return true;
}
|
public boolean isSmask() {
return this.smask;
}
Getter for property smask. |
public void makeMask() throws DocumentException {
if (!isMaskCandidate())
throw new DocumentException("This image can not be an image mask.");
mask = true;
}
|
public float[] matrix() {
float[] matrix = new float[8];
float cosX = (float) Math.cos(rotationRadians);
float sinX = (float) Math.sin(rotationRadians);
matrix[AX] = plainWidth * cosX;
matrix[AY] = plainWidth * sinX;
matrix[BX] = (-plainHeight) * sinX;
matrix[BY] = plainHeight * cosX;
if (rotationRadians < Math.PI / 2f) {
matrix[CX] = matrix[BX];
matrix[CY] = 0;
matrix[DX] = matrix[AX];
matrix[DY] = matrix[AY] + matrix[BY];
} else if (rotationRadians < Math.PI) {
matrix[CX] = matrix[AX] + matrix[BX];
matrix[CY] = matrix[BY];
matrix[DX] = 0;
matrix[DY] = matrix[AY];
} else if (rotationRadians < Math.PI * 1.5f) {
matrix[CX] = matrix[AX];
matrix[CY] = matrix[AY] + matrix[BY];
matrix[DX] = matrix[BX];
matrix[DY] = 0;
} else {
matrix[CX] = 0;
matrix[CY] = matrix[AY];
matrix[DX] = matrix[AX] + matrix[BX];
matrix[DY] = matrix[BY];
}
return matrix;
}
Returns the transformation matrix of the image. |
public void scaleAbsolute(float newWidth,
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. |
public void scaleAbsoluteHeight(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 height. |
public void scaleAbsoluteWidth(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. |
public void scalePercent(float percent) {
scalePercent(percent, percent);
}
Scale the image to a certain percentage. |
public void scalePercent(float percentX,
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. |
public void scaleToFit(float fitWidth,
float fitHeight) {
scalePercent(100);
float percentX = (fitWidth * 100) / getScaledWidth();
float percentY = (fitHeight * 100) / getScaledHeight();
scalePercent(percentX < percentY ? percentX : percentY);
setWidthPercentage(0);
}
Scales the image so that it fits a certain width and height. |
public void setAbsolutePosition(float absoluteX,
float absoluteY) {
this.absoluteX = absoluteX;
this.absoluteY = absoluteY;
}
Sets the absolute position of the Image . |
public void setAdditional(PdfDictionary additional) {
this.additional = additional;
}
Sets the /Colorspace key. |
public void setAlignment(int alignment) {
this.alignment = alignment;
}
Sets the alignment for the image. |
public void setAlt(String alt) {
this.alt = alt;
}
Sets the alternative information for the image. |
public void setAnnotation(Annotation annotation) {
this.annotation = annotation;
}
Sets the annotation of this Image. |
public void setCompressionLevel(int compressionLevel) {
if (compressionLevel < PdfStream.NO_COMPRESSION || compressionLevel > PdfStream.BEST_COMPRESSION)
this.compressionLevel = PdfStream.DEFAULT_COMPRESSION;
else
this.compressionLevel = compressionLevel;
}
Sets the compression level to be used if the image is written as a compressed stream. |
public void setDeflated(boolean deflated) {
this.deflated = deflated;
}
Setter for property deflated. |
public void setDirectReference(PdfIndirectReference directReference) {
this.directReference = directReference;
}
Setter for property directReference. |
public void setDpi(int dpiX,
int dpiY) {
this.dpiX = dpiX;
this.dpiY = dpiY;
}
Sets the dots per inch value |
public void setImageMask(Image mask) throws DocumentException {
if (this.mask)
throw new DocumentException(
"An image mask cannot contain another image mask.");
if (!mask.mask)
throw new DocumentException(
"The image mask is not a mask. Did you do makeMask()?");
imageMask = mask;
smask = (mask.bpc > 1 && mask.bpc < = 8);
}
Sets the explicit masking. |
public void setIndentationLeft(float f) {
indentationLeft = f;
}
Sets the left indentation. |
public void setIndentationRight(float f) {
indentationRight = f;
}
Sets the right indentation. |
public void setInitialRotation(float initialRotation) {
float old_rot = rotationRadians - this.initialRotation;
this.initialRotation = initialRotation;
setRotation(old_rot);
}
Some image formats, like TIFF may present the images rotated that have
to be compensated. |
public void setInterpolation(boolean interpolation) {
this.interpolation = interpolation;
}
Sets the image interpolation. Image interpolation attempts to produce a
smooth transition between adjacent sample values. |
public void setInverted(boolean invert) {
this.invert = invert;
}
Sets inverted true or false |
public void setLayer(PdfOCG layer) {
this.layer = layer;
}
Sets the layer this image belongs to. |
public void setOriginalData(byte[] originalData) {
this.originalData = originalData;
}
Setter for property originalData. |
public void setOriginalType(int originalType) {
this.originalType = originalType;
}
Setter for property originalType. |
public void setRotation(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. |
public void setRotationDegrees(float deg) {
double d = Math.PI;
setRotation(deg / 180 * (float) d);
}
Sets the rotation of the image in degrees. |
public void setSmask(boolean smask) {
this.smask = smask;
}
Setter for property smask. |
public void setSpacingAfter(float spacing) {
this.spacingAfter = spacing;
}
Sets the spacing after this image. |
public void setSpacingBefore(float spacing) {
this.spacingBefore = spacing;
}
Sets the spacing before this image. |
public void setTemplateData(PdfTemplate template) {
this.template[0] = template;
}
Sets data from a PdfTemplate |
public void setTransparency(int[] transparency) {
this.transparency = transparency;
}
Sets the transparency values |
public void setUrl(URL url) {
this.url = url;
}
Sets the url of the image |
public void setWidthPercentage(float widthPercentage) {
this.widthPercentage = widthPercentage;
}
Setter for property widthPercentage. |
public void setXYRatio(float XYRatio) {
this.XYRatio = XYRatio;
}
Sets the X/Y pixel dimensionless aspect ratio. |
public void simplifyColorspace() {
if (additional == null)
return;
PdfArray value = additional.getAsArray(PdfName.COLORSPACE);
if (value == null)
return;
PdfObject cs = simplifyColorspace(value);
PdfObject newValue;
if (cs.isName())
newValue = cs;
else {
newValue = value;
PdfName first = value.getAsName(0);
if (PdfName.INDEXED.equals(first)) {
if (value.size() >= 2) {
PdfArray second = value.getAsArray(1);
if (second != null) {
value.set(1, simplifyColorspace(second));
}
}
}
}
additional.put(PdfName.COLORSPACE, newValue);
}
Replaces CalRGB and CalGray colorspaces with DeviceRGB and DeviceGray. |
public void tagICC(ICC_Profile profile) {
this.profile = profile;
}
Tags this image with an ICC profile. |
public int type() {
return type;
}
|