Class Bitmaps
java.lang.Object
org.apache.pdfbox.jbig2.image.Bitmaps
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BufferedImageasBufferedImage(Bitmap bitmap) Returns the given bitmap as buffered image.static BufferedImageasBufferedImage(Bitmap bitmap, ImageReadParam param, FilterType filterType) Returns the given bitmap as buffered image.static BufferedImageasBufferedImage(Bitmap bitmap, FilterType filterType) Returns the given bitmap as buffered image.static WritableRasterReturns the given bitmap as writable raster.static WritableRasterasRaster(Bitmap bitmap, ImageReadParam param, FilterType filterType) Returns the given bitmap as writable raster.static WritableRasterasRaster(Bitmap bitmap, FilterType filterType) Returns the given bitmap as writable raster.static voidblit(Bitmap src, Bitmap dst, int x, int y, CombinationOperator combinationOperator) This method combines a given bitmap with the current instance.private static voidblitShifted(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 voidblitSpecialShifted(Bitmap src, Bitmap dst, int startLine, int lastLine, int dstStartIdx, int srcStartIdx, int srcEndIdx, int toShift, int shiftVal1, int shiftVal2, CombinationOperator op) private static voidblitUnshifted(Bitmap src, Bitmap dst, int startLine, int lastLine, int dstStartIdx, int srcStartIdx, int srcEndIdx, CombinationOperator op) private static WritableRasterbuildRaster(Bitmap bitmap, FilterType filterType, double scaleX, double scaleY) static bytecombineBytes(byte value1, byte value2, CombinationOperator op) The method combines two given bytes with an logical operator.private static voidcopyLine(Bitmap src, Bitmap dst, int sourceUpShift, int sourceDownShift, int padding, int firstSourceByteOfLine, int lastSourceByteOfLine, boolean usePadding, int sourceOffset, int targetOffset) static BitmapReturns the specified rectangle area of the bitmap.static Bitmapsubsample(Bitmap src, ImageReadParam param) static BitmapsubsampleX(Bitmap src, int xSubsampling, int xSubsamplingOffset) static BitmapsubsampleY(Bitmap src, int ySubsampling, int ySubsamplingOffset) private static byteunpad(int padding, byte value) Removes unnecessary bits from a byte.
-
Constructor Details
-
Bitmaps
public Bitmaps()
-
-
Method Details
-
asRaster
Returns the given bitmap as writable raster.- Parameters:
bitmap- the given bitmap- Returns:
- the raster representation of the bitmap
-
asRaster
Returns the given bitmap as writable raster.- Parameters:
bitmap- the given bitmapfilterType- type of filter which is used when creating the writable raster- Returns:
- the raster representation of the bitmap
-
asRaster
Returns the given bitmap as writable raster.- Parameters:
bitmap- the given bitmapparam- ImageReadParam to be used when creating the writable rasterfilterType- type of filter which is used when creating the writable raster- Returns:
- the raster representation of the bitmap
-
buildRaster
private static WritableRaster buildRaster(Bitmap bitmap, FilterType filterType, double scaleX, double scaleY) -
asBufferedImage
Returns the given bitmap as buffered image.- Parameters:
bitmap- the given bitmap- Returns:
- the image representation of the bitmap
-
asBufferedImage
Returns the given bitmap as buffered image.- Parameters:
bitmap- the given bitmapfilterType- type of filter which is used when creating the buffered image- Returns:
- the image representation of the bitmap
-
asBufferedImage
public static BufferedImage asBufferedImage(Bitmap bitmap, ImageReadParam param, FilterType filterType) Returns the given bitmap as buffered image.- Parameters:
bitmap- the given bitmapparam- ImageReadParam to be used when creating the buffered imagefilterType- type of filter which is used when creating the buffered image- Returns:
- the image representation of the bitmap
-
extract
-
copyLine
-
unpad
private static byte unpad(int padding, byte value) Removes unnecessary bits from a byte.- Parameters:
padding- - The amount of unnecessary bits.value- - The byte that should be cleaned up.- Returns:
- A cleaned byte.
-
subsample
-
subsampleX
-
subsampleY
-
combineBytes
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- - The value that should be combined with value2.value2- - The value that should be combined with value1.op- - The specified combination operator.- Returns:
- The combination result.
-
blit
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- - The bitmap that should be combined with the one of the current instance.dst- - The destination bitmap.x- - The x coordinate where the upper left corner of the bitmap to blit should be positioned.y- - The y coordinate where the upper left corner of the bitmap to blit should be positioned.combinationOperator- - The combination operator for combining two pixels.
-
blitUnshifted
private static void blitUnshifted(Bitmap src, Bitmap dst, int startLine, int lastLine, int dstStartIdx, int srcStartIdx, int srcEndIdx, CombinationOperator op) -
blitSpecialShifted
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) -
blitShifted
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)
-