com.pdftools.expa
Class Image

java.lang.Object
  extended by com.pdftools.NativeLibrary
      extended by com.pdftools.expa.ExpaInitialize
          extended by com.pdftools.expa.Image

public class Image
extends ExpaInitialize


Nested Class Summary
 
Nested classes/interfaces inherited from class com.pdftools.expa.ExpaInitialize
ExpaInitialize.CONTENTOBJECT, ExpaInitialize.ORIENTATION, ExpaInitialize.Rectangle, ExpaInitialize.TransformMatrix
 
Nested classes/interfaces inherited from class com.pdftools.NativeLibrary
NativeLibrary.COLORCONVERSION, NativeLibrary.COLORSPACE, NativeLibrary.COMPRESSION, NativeLibrary.DITHERINGMODE, NativeLibrary.ERRORCODE, NativeLibrary.FONTTYPE, NativeLibrary.PERMISSION, NativeLibrary.RENDEREROPTION, NativeLibrary.RENDERINGMODE, NativeLibrary.ROTATEMODE, NativeLibrary.STRIPTYPE
 
Field Summary
 
Fields inherited from class com.pdftools.NativeLibrary
VERSION
 
Constructor Summary
Image()
           
 
Method Summary
 boolean changeOrientation(int iOrientation)
          change image according to the specified orientation.
 boolean convertToRGB()
          convert image to RGB;
 AlternateImageArray getAlternates()
          get the alternative images.
 int getBitsPerComponent()
          get the number of bits that are used to represent a single color component.
 ColorSpace getColorSpace()
          get color space information for the image.
 int getHeight()
          get the height of the image in pixels.
 byte[] getImage()
          get the Image in memory as byte array.
 byte[] getMask()
          get the image’s explicit mask.
 byte[] getSamples()
          get the image’s data samples in a byte array.
 int getWidth()
          get the width of the image in pixels.
 boolean store(java.lang.String strFileName)
          store image in a file without compression;
 boolean store(java.lang.String strFileName, int iCompression)
          store image in a file;
 boolean storeInMemory(java.lang.String strExtension, int iCompression)
          store image in Memory.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Image

public Image()
Method Detail

getWidth

public int getWidth()
get the width of the image in pixels.

Returns:
the width of the image in pixels (also called samples). The unit of pixels can be converted to a distance unit such as inch, millimeters etc. using a resolution value, i.e. 72 dpi (dots per inch).

getHeight

public int getHeight()
get the height of the image in pixels.

Returns:
the height of the image in pixels (also called samples). The unit of pixels can be converted to a distance unit such as inch, millimeters etc. using a resolution value, i.e. 72 dpi (dots per inch)

getBitsPerComponent

public int getBitsPerComponent()
get the number of bits that are used to represent a single color component.

Returns:
the number of bits that are used to represent a single color component of an image sample.The number of color components per image data sample can be retrieved through the image’s color space interface.

getSamples

public byte[] getSamples()
get the image’s data samples in a byte array.

Returns:
the image’s data samples in a byte array. The sample data is ordered by line from top to bottom and within a line from left to right. The lines are byte aligned. If the number of bits per component is less than one byte then the samples are ordered beginning with the most significant bit first.

getMask

public byte[] getMask()
get the image’s explicit mask.

Returns:
the image’s explicit mask if available. The mask’s sample data is organized the same way as the image data except that the data contains one bit per pixel. A one bit indicates an opaque pixel and a zero bit indicates a transparent pixel.

getColorSpace

public ColorSpace getColorSpace()
get color space information for the image.

Returns:
color space information for the image.

convertToRGB

public boolean convertToRGB()
convert image to RGB;

Returns:
non-zero on success; BitsPerComponent must be >= 8

changeOrientation

public boolean changeOrientation(int iOrientation)
change image according to the specified orientation.


store

public boolean store(java.lang.String strFileName,
                     int iCompression)
store image in a file;

Parameters:
strFileName - The name of the disk file include path, drive.
iCompression - Compression type (refer to class COMPRESSION in NativeLibrary)
Returns:
non-zero on success

store

public boolean store(java.lang.String strFileName)
store image in a file without compression;

Parameters:
strFileName - The name of the disk file include path, drive.
Returns:
non-zero on success

storeInMemory

public boolean storeInMemory(java.lang.String strExtension,
                             int iCompression)
store image in Memory.

Parameters:
strExtension - Extension of the image format.
iCompression - Compression type (refer to class COMPRESSION in NativeLibrary)
Returns:
non-zero on success.

getImage

public byte[] getImage()
get the Image in memory as byte array.

Returns:
the Image in memory as byte array.

getAlternates

public AlternateImageArray getAlternates()
get the alternative images.