Top Constructors Methods
org.apache.pdfbox.jbig2.image

public Class Bitmaps

extends Object
Class Inheritance
Imports
java.awt.Dimension, .Point, .Rectangle, java.awt.image.BufferedImage, .ColorModel, .DataBuffer, .DataBufferByte, .IndexColorModel, .Raster, .WritableRaster, javax.imageio.ImageReadParam, org.apache.pdfbox.jbig2.Bitmap, .JBIG2ReadParam, org.apache.pdfbox.jbig2.util.CombinationOperator

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static BufferedImage

Returns:

the image representation of the bitmap
asBufferedImage
(Bitmap
the given bitmap
bitmap
)

Returns the given bitmap as buffered image.

public static BufferedImage

Returns:

the image representation of the bitmap
asBufferedImage
(Bitmap
the given bitmap
bitmap
,
FilterType
type of filter which is used when creating the buffered image
filterType
)

Returns the given bitmap as buffered image.

public static BufferedImage

Returns:

the image representation of the bitmap
asBufferedImage
(Bitmap
the given bitmap
bitmap
,
ImageReadParam
ImageReadParam to be used when creating the buffered image
param
,
FilterType
type of filter which is used when creating the buffered image
filterType
)

Returns the given bitmap as buffered image.

public static WritableRaster

Returns:

the raster representation of the bitmap
asRaster
(final Bitmap
the given bitmap
bitmap
)

Returns the given bitmap as writable raster.

public static WritableRaster

Returns:

the raster representation of the bitmap
asRaster
(final Bitmap
the given bitmap
bitmap
,
final FilterType
type of filter which is used when creating the writable raster
filterType
)

Returns the given bitmap as writable raster.

public static WritableRaster

Returns:

the raster representation of the bitmap
asRaster
(Bitmap
the given bitmap
bitmap
,
final ImageReadParam
ImageReadParam to be used when creating the writable raster
param
,
final FilterType
type of filter which is used when creating the writable raster
filterType
)

Returns the given bitmap as writable raster.

public static void
blit(Bitmap
- The bitmap that should be combined with the one of the current instance.
src
,
Bitmap
- The destination bitmap.
dst
,
int
- The x coordinate where the upper left corner of the bitmap to blit should be positioned.
x
,
int
- The y coordinate where the upper left corner of the bitmap to blit should be positioned.
y
,
CombinationOperator
- The combination operator for combining two pixels.
combinationOperator
)

This method combines a given bitmap with the current instance.

private static void
blitShifted(Bitmap src, Bitmap dst, int startLine, int lastLine, int dstStartIdx, int srcStartIdx, int srcEndIdx, int toShift, int shiftVal1, int shiftVal2, CombinationOperator op, int padding)

private static void
blitSpecialShifted(Bitmap src, Bitmap dst, int startLine, int lastLine, int dstStartIdx, int srcStartIdx, int srcEndIdx, int toShift, int shiftVal1, int shiftVal2, CombinationOperator op)

private static void
blitUnshifted(Bitmap src, Bitmap dst, int startLine, int lastLine, int dstStartIdx, int srcStartIdx, int srcEndIdx, CombinationOperator op)

private static WritableRaster
buildRaster(final Bitmap bitmap, final FilterType filterType, final double scaleX, final double scaleY)

public static byte

Returns:

The combination result.
combineBytes
(byte
- The value that should be combined with value2.
value1
,
byte
- The value that should be combined with value1.
value2
,
CombinationOperator
- The specified combination operator.
op
)

The method combines two given bytes with an logical operator.

private static void
copyLine(Bitmap src, Bitmap dst, int sourceUpShift, int sourceDownShift, int padding, int firstSourceByteOfLine, int lastSourceByteOfLine, boolean usePadding, int sourceOffset, int targetOffset)

public static Bitmap

Returns:

A Bitmap that represents the requested image section.
extract
(final Rectangle
- A Rectangle that specifies the requested image section.
roi
,
final Bitmap
the given bitmap
src
)

Returns the specified rectangle area of the bitmap.

public static Bitmap
public static Bitmap
subsampleX(Bitmap src, final int xSubsampling, final int xSubsamplingOffset)

public static Bitmap
subsampleY(Bitmap src, final int ySubsampling, final int ySubsamplingOffset)

private static byte

Returns:

A cleaned byte.
unpad
(int
- The amount of unnecessary bits.
padding
,
byte
- The byte that should be cleaned up.
value
)

Removes unnecessary bits from a byte.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Bitmapsback to summary
public Bitmaps()

Method Detail

asBufferedImageback to summary
public static BufferedImage asBufferedImage(Bitmap bitmap)

Returns the given bitmap as buffered image.

Parameters
bitmap:Bitmap

the given bitmap

Returns:BufferedImage

the image representation of the bitmap

asBufferedImageback to summary
public static BufferedImage asBufferedImage(Bitmap bitmap, FilterType filterType)

Returns the given bitmap as buffered image.

Parameters
bitmap:Bitmap

the given bitmap

filterType:FilterType

type of filter which is used when creating the buffered image

Returns:BufferedImage

the image representation of the bitmap

asBufferedImageback to summary
public static BufferedImage asBufferedImage(Bitmap bitmap, ImageReadParam param, FilterType filterType)

Returns the given bitmap as buffered image.

Parameters
bitmap:Bitmap

the given bitmap

param:ImageReadParam

ImageReadParam to be used when creating the buffered image

filterType:FilterType

type of filter which is used when creating the buffered image

Returns:BufferedImage

the image representation of the bitmap

asRasterback to summary
public static WritableRaster asRaster(final Bitmap bitmap)

Returns the given bitmap as writable raster.

Parameters
bitmap:Bitmap

the given bitmap

Returns:WritableRaster

the raster representation of the bitmap

asRasterback to summary
public static WritableRaster asRaster(final Bitmap bitmap, final FilterType filterType)

Returns the given bitmap as writable raster.

Parameters
bitmap:Bitmap

the given bitmap

filterType:FilterType

type of filter which is used when creating the writable raster

Returns:WritableRaster

the raster representation of the bitmap

asRasterback to summary
public static WritableRaster asRaster(Bitmap bitmap, final ImageReadParam param, final FilterType filterType)

Returns the given bitmap as writable raster.

Parameters
bitmap:Bitmap

the given bitmap

param:ImageReadParam

ImageReadParam to be used when creating the writable raster

filterType:FilterType

type of filter which is used when creating the writable raster

Returns:WritableRaster

the raster representation of the bitmap

blitback to summary
public static void blit(Bitmap src, Bitmap dst, int x, int y, CombinationOperator combinationOperator)

This method combines a given bitmap with the current instance.

Parts of the bitmap to blit that are outside of the target bitmap will be ignored.

Parameters
src:Bitmap

- The bitmap that should be combined with the one of the current instance.

dst:Bitmap

- The destination bitmap.

x:int

- The x coordinate where the upper left corner of the bitmap to blit should be positioned.

y:int

- The y coordinate where the upper left corner of the bitmap to blit should be positioned.

combinationOperator:CombinationOperator

- The combination operator for combining two pixels.

blitShiftedback to summary
private static void blitShifted(Bitmap src, Bitmap dst, int startLine, int lastLine, int dstStartIdx, int srcStartIdx, int srcEndIdx, int toShift, int shiftVal1, int shiftVal2, CombinationOperator op, int padding)
blitSpecialShiftedback to summary
private static void blitSpecialShifted(Bitmap src, Bitmap dst, int startLine, int lastLine, int dstStartIdx, int srcStartIdx, int srcEndIdx, int toShift, int shiftVal1, int shiftVal2, CombinationOperator op)
blitUnshiftedback to summary
private static void blitUnshifted(Bitmap src, Bitmap dst, int startLine, int lastLine, int dstStartIdx, int srcStartIdx, int srcEndIdx, CombinationOperator op)
buildRasterback to summary
private static WritableRaster buildRaster(final Bitmap bitmap, final FilterType filterType, final double scaleX, final double scaleY)
combineBytesback to summary
public static byte combineBytes(byte value1, byte value2, CombinationOperator op)

The method combines two given bytes with an logical operator.

The JBIG2 Standard specifies 5 possible combinations of bytes.

Hint: Please take a look at ISO/IEC 14492:2001 (E) for detailed definition and description of the operators.

Parameters
value1:byte

- The value that should be combined with value2.

value2:byte

- The value that should be combined with value1.

op:CombinationOperator

- The specified combination operator.

Returns:byte

The combination result.

copyLineback to summary
private static void copyLine(Bitmap src, Bitmap dst, int sourceUpShift, int sourceDownShift, int padding, int firstSourceByteOfLine, int lastSourceByteOfLine, boolean usePadding, int sourceOffset, int targetOffset)
extractback to summary
public static Bitmap extract(final Rectangle roi, final Bitmap src)

Returns the specified rectangle area of the bitmap.

Parameters
roi:Rectangle

- A Rectangle that specifies the requested image section.

src:Bitmap

the given bitmap

Returns:Bitmap

A Bitmap that represents the requested image section.

subsampleback to summary
public static Bitmap subsample(Bitmap src, ImageReadParam param)
subsampleXback to summary
public static Bitmap subsampleX(Bitmap src, final int xSubsampling, final int xSubsamplingOffset)
subsampleYback to summary
public static Bitmap subsampleY(Bitmap src, final int ySubsampling, final int ySubsamplingOffset)
unpadback to summary
private static byte unpad(int padding, byte value)

Removes unnecessary bits from a byte.

Parameters
padding:int

- The amount of unnecessary bits.

value:byte

- The byte that should be cleaned up.

Returns:byte

A cleaned byte.