Package com.itextpdf.io.image
Class RawImageHelper
java.lang.Object
com.itextpdf.io.image.RawImageHelper
Applies PDF image attributes to raw image data.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidupdateCcittImageParameters(RawImageData image, int width, int height, boolean reverseBits, int typeCcitt, int parameters, byte[] data) Updates dimensions and CCITT parameters of a raw image.static voidupdateImageAttributes(RawImageData image, Map<String, Object> additional) Sets filters, decoding parameters, and attributes required to embed raw image data.protected static voidupdateRawImageParameters(RawImageData image, int width, int height, boolean reverseBits, int typeCCITT, int parameters, byte[] data, int[] transparency) Updates a CCITT-compressed raw image and optional transparency range.protected static voidupdateRawImageParameters(RawImageData image, int width, int height, int components, int bpc, byte[] data) Update original image with Raw Image parameters.protected static voidupdateRawImageParameters(RawImageData image, int width, int height, int components, int bpc, byte[] data, int[] transparency) Updates a raw image and optional component transparency ranges.
-
Constructor Details
-
RawImageHelper
public RawImageHelper()
-
-
Method Details
-
updateImageAttributes
Sets filters, decoding parameters, and attributes required to embed raw image data.- Parameters:
-
image- raw image to update -
additional- additional attributes to retain for non-CCITT images - Throws:
-
IllegalArgumentException- ifimageis not raw image data
-
updateRawImageParameters
protected static void updateRawImageParameters(RawImageData image, int width, int height, int components, int bpc, byte[] data) Update original image with Raw Image parameters.- Parameters:
-
image- to update its parameters with Raw Image parameters. -
width- the exact width of the image -
height- the exact height of the image -
components- 1,3 or 4 for GrayScale, RGB and CMYK -
bpc- bits per component. Must be 1,2,4 or 8 -
data- the image data - Throws:
-
IOException- on error
-
updateRawImageParameters
protected static void updateRawImageParameters(RawImageData image, int width, int height, int components, int bpc, byte[] data, int[] transparency) Updates a raw image and optional component transparency ranges.Bilevel grayscale input is converted to CCITT Group 4 data.
- Parameters:
-
image- image to mutate -
width- image width in pixels -
height- image height in pixels -
components- number of color components -
bpc- bits per component -
data- encoded sample bytes -
transparency- component-value pairs, ornull - Throws:
-
IOException- if parameters or transparency ranges are invalid
-
updateRawImageParameters
protected static void updateRawImageParameters(RawImageData image, int width, int height, boolean reverseBits, int typeCCITT, int parameters, byte[] data, int[] transparency) Updates a CCITT-compressed raw image and optional transparency range.- Parameters:
-
image- image to mutate -
width- image width in pixels -
height- image height in pixels -
reverseBits- whether to reverse bits indatain place -
typeCCITT- CCITT compression type -
parameters- CCITT decoding parameters -
data- CCITT-compressed bytes to retain -
transparency- two-value transparency range, ornull - Throws:
-
IOException- if the transparency range or compression type is invalid
-
updateCcittImageParameters
protected static void updateCcittImageParameters(RawImageData image, int width, int height, boolean reverseBits, int typeCcitt, int parameters, byte[] data) Updates dimensions and CCITT parameters of a raw image.- Parameters:
-
image- image to mutate -
width- image width in pixels -
height- image height in pixels -
reverseBits- whether to reverse bits indatain place -
typeCcitt- CCITT compression type -
parameters- CCITT decoding parameters -
data- CCITT-compressed bytes to retain - Throws:
-
IOException- iftypeCcittis unsupported
-