public class ImagingPixmap
extends java.lang.Object
implements java.lang.AutoCloseable
Modifier and Type | Class and Description |
---|---|
static class |
ImagingPixmap.ColorSpace |
static class |
ImagingPixmap.Compression |
static class |
ImagingPixmap.Filter |
static class |
ImagingPixmap.FlipDirection |
static class |
ImagingPixmap.Format |
static class |
ImagingPixmap.RotateAngle |
Modifier and Type | Method and Description |
---|---|
void |
adjustBrightnessContrast(double brightness,
double contrast,
boolean preserveColors) |
void |
adjustBrightnessContrast(double brightness,
double contrast,
boolean preserveColors,
java.awt.image.BufferedImage bufferedImage) |
void |
adjustColors(double[] colors) |
void |
adjustColors(double[] colors,
java.awt.image.BufferedImage bufferedImage) |
void |
adjustGamma(double gamma,
boolean preserveColors) |
void |
adjustGamma(double gamma,
boolean preserveColors,
java.awt.image.BufferedImage bufferedImage) |
void |
close()
Free all associated resources of this instance.
|
void |
crop(int x,
int y,
int width,
int height)
Crops the pixmap to the specified rectangle.
|
void |
filter(ImagingPixmap.Filter filterType,
double radius,
double strength) |
void |
filter(ImagingPixmap.Filter filterType,
double radius,
double strength,
java.awt.image.BufferedImage bufferedImage) |
void |
flip(ImagingPixmap.FlipDirection direction)
Flips the pixmap.
|
java.awt.image.BufferedImage |
getBufferedImage()
Returns the pixmap as Java buffered image.
|
java.awt.image.BufferedImage |
getBufferedImage(int width,
int height)
Returns the pixmap as Java buffered image with the requested image dimension.
|
int |
getColorDepth()
Returns the color depth of the pixmap in bits.
|
ImagingPixmap.ColorSpace |
getColorSpace()
Returns the color space for the pixmap.
|
static java.lang.String |
getColorSpaceName(ImagingPixmap.ColorSpace colorSpace)
Returns a label for the given color space.
|
int |
getHeight()
Returns the pixel height of the pixmap.
|
int |
getNumberOfPages()
Returns the number of pages for the underlying asset.
|
static ImagingPixmap |
getPixmap(Item item)
Returns a new pixmap instance for the given record item that works on the preview of the related asset.
|
static ImagingPixmap |
getPixmap(Item item,
Asset asset,
java.lang.String assetHandlingSet,
int page)
Returns a new pixmap instance for the given record item that works on the preview (generated by using the specified asset handling set) of the given
asset.
|
static ImagingPixmap |
getPixmap(Item item,
java.lang.String assetHandlingSet)
Returns a new pixmap instance for the given record item that works on the preview (generated by using the specified asset handling set) of the related
asset.
|
static ImagingPixmap |
getPixmap(Item item,
java.lang.String assetHandlingSet,
int version)
Returns a new pixmap instance for the given record item that works on the preview (generated by using the specified asset handling set) of the related
asset.
|
static ImagingPixmap |
getPixmap(Item item,
java.lang.String assetHandlingSet,
int version,
int page)
Returns a new pixmap instance for the given record item that works on the preview (generated by using the specified asset handling set) of the related
asset.
|
int |
getWidth()
Returns the pixel width of the pixmap.
|
void |
rotate(ImagingPixmap.RotateAngle rotateAngle)
Rotates the pixmap.
|
void |
save(java.io.File file,
ImagingPixmap.Format format,
ImagingPixmap.ColorSpace colorspace,
ImagingPixmap.Compression compression,
int jpegQualityOrZIPCompression,
boolean embedTransparencyGrid,
int boundingBox)
Saves the current pixmap as a new file at the given location using the specified parameters.
|
void |
save(java.io.File file,
ImagingPixmap.Format format,
ImagingPixmap.ColorSpace colorspace,
ImagingPixmap.Compression compression,
int jpegQualityOrZIPCompression,
boolean embedTransparencyGrid,
int boundingBoxWidth,
int boundingBoxHeight)
Saves the current pixmap as a new file at the given location using the specified parameters.
|
void |
save(java.io.File file,
ImagingPixmap.Format format,
ImagingPixmap.ColorSpace colorspace,
ImagingPixmap.Compression compression,
int resolution,
int jpegQualityOrZIPCompression,
boolean embedTransparencyGrid,
int boundingBoxWidth,
int boundingBoxHeight)
Saves the current pixmap as a new file at the given location using the specified parameters.
|
void |
scale(int width,
int height)
Scales the pixmap to the specified width and height in pixels.
|
void |
setICCSupport(boolean supportICCProfile)
Specify whether the ImagingPixmap should support ICC profiles.
|
void |
setPage(int page)
Select a new page to render.
|
public static ImagingPixmap getPixmap(Item item)
item
- item specifying the asset to work onpublic static ImagingPixmap getPixmap(Item item, java.lang.String assetHandlingSet)
item
- item specifying the asset to work onassetHandlingSet
- asset handling set to use for generating the previewpublic static ImagingPixmap getPixmap(Item item, java.lang.String assetHandlingSet, int version)
item
- item specifying the asset to work onassetHandlingSet
- asset handling set to use for generating the previewversion
- the version of the asset to use. Specify 0
to use the latest version.public static ImagingPixmap getPixmap(Item item, java.lang.String assetHandlingSet, int version, int page)
item
- item specifying the asset to work onassetHandlingSet
- asset handling set to use for generating the previewversion
- the version of the asset to use. Specify 0
to use the latest version.page
- the page number of the asset to use starting at 1 for the first page. Specify 0
to use the default (first) page.public static ImagingPixmap getPixmap(Item item, Asset asset, java.lang.String assetHandlingSet, int page)
item
- item specifying the asset to work onasset
- asset to work onassetHandlingSet
- asset handling set to use for generating the previewpage
- the page number of the asset to use starting at 1 for the first page. Specify 0
to use the default (first) page.public void close()
close
in interface java.lang.AutoCloseable
public int getHeight()
public int getWidth()
public int getColorDepth()
public ImagingPixmap.ColorSpace getColorSpace()
public int getNumberOfPages()
public java.awt.image.BufferedImage getBufferedImage()
public java.awt.image.BufferedImage getBufferedImage(int width, int height)
width
- requested width for the returned imageheight
- requested height for the returned imagepublic void crop(int x, int y, int width, int height)
x
- distance from the left border to the crop rectangle in pixelsy
- distance from the top border to the crop rectangle in pixelswidth
- width of the crop rectangle in pixelsheight
- height of the crop rectangle in pixelspublic void rotate(ImagingPixmap.RotateAngle rotateAngle)
rotateAngle
- the rotate parameterpublic void flip(ImagingPixmap.FlipDirection direction)
direction
- the flip parameterpublic void scale(int width, int height)
width
- new pixmap width in pixelsheight
- new pixmap height in pixelspublic void filter(ImagingPixmap.Filter filterType, double radius, double strength)
public void filter(ImagingPixmap.Filter filterType, double radius, double strength, java.awt.image.BufferedImage bufferedImage)
public void adjustBrightnessContrast(double brightness, double contrast, boolean preserveColors)
public void adjustBrightnessContrast(double brightness, double contrast, boolean preserveColors, java.awt.image.BufferedImage bufferedImage)
public void adjustGamma(double gamma, boolean preserveColors)
public void adjustGamma(double gamma, boolean preserveColors, java.awt.image.BufferedImage bufferedImage)
public void adjustColors(double[] colors)
public void adjustColors(double[] colors, java.awt.image.BufferedImage bufferedImage)
public void save(java.io.File file, ImagingPixmap.Format format, ImagingPixmap.ColorSpace colorspace, ImagingPixmap.Compression compression, int jpegQualityOrZIPCompression, boolean embedTransparencyGrid, int boundingBoxWidth, int boundingBoxHeight)
BMP
, CompuServe GIF
, JPEG
, PCX
, PDF
,
PNG
, Scitex CT
and TIFF
.
The possible colorspaces depend on the used format:
Format / Color Space | Grayscale | RGB | CMYK |
---|---|---|---|
BMP |
Supported | Supported | - |
CompuServe GIF | Supported | Supported | - |
JPEG | Supported | Supported | Supported |
PCX |
Supported | Supported | - |
PDF | Supported | Supported | Supported |
PNG | Supported | Supported | - |
Scitex CT |
Supported | Supported | Supported |
TIFF | Supported | Supported | Supported |
The compression depends on the used format as well:
Format / Compression | None | Flate |
---|---|---|
BMP | Supported | - |
CompuServe GIF | Supported | - |
JPEG |
Supported | - |
PCX | Supported | - |
PDF |
Supported | - |
PNG | Supported | - |
Scitex CT |
Supported | - |
TIFF | Supported | Supported |
The jpeg quality
obviously is only being used when using the JPEG
format and has to be between 1 (minimum quality) and 10 (maximum quality).
file
- the file to save toformat
- the wanted formatcolorspace
- wanted color spacecompression
- the wanted compression if supported by the formatjpegQualityOrZIPCompression
- the jpeg quality if using the JPEG format between 1 and 10, for PNG this is the ZIP compression level (0..9).embedTransparencyGrid
- specify whether transparent images should get the users transparency grid embedded in transparent areasboundingBoxWidth
- optionally resize image on saving into a bounding box of the given widthboundingBoxHeight
- optionally resize image on saving into a bounding box of the given heightpublic void save(java.io.File file, ImagingPixmap.Format format, ImagingPixmap.ColorSpace colorspace, ImagingPixmap.Compression compression, int jpegQualityOrZIPCompression, boolean embedTransparencyGrid, int boundingBox)
BMP
, CompuServe GIF
, JPEG
, PCX
, PDF
,
PNG
, Scitex CT
and TIFF
.
The possible colorspaces depend on the used format:
Format / Color Space | Grayscale | RGB | CMYK |
---|---|---|---|
BMP |
Supported | Supported | - |
CompuServe GIF | Supported | Supported | - |
JPEG | Supported | Supported | Supported |
PCX |
Supported | Supported | - |
PDF | Supported | Supported | Supported |
PNG | Supported | Supported | - |
Scitex CT |
Supported | Supported | Supported |
TIFF | Supported | Supported | Supported |
The compression depends on the used format as well:
Format / Compression | None | Flate |
---|---|---|
BMP | Supported | - |
CompuServe GIF | Supported | - |
JPEG |
Supported | - |
PCX | Supported | - |
PDF |
Supported | - |
PNG | Supported | - |
Scitex CT |
Supported | - |
TIFF | Supported | Supported |
The jpeg quality
obviously is only being used when using the JPEG
format and has to be between 1 (minimum quality) and 10 (maximum quality).
file
- the file to save toformat
- the wanted formatcolorspace
- wanted color spacecompression
- the wanted compression if supported by the formatjpegQualityOrZIPCompression
- the jpeg quality if using the JPEG format between 1 and 10, for PNG this is the ZIP compression level (0..9).embedTransparencyGrid
- specify whether transparent images should get the users transparency grid embedded in transparent areasboundingBox
- optionally resize image on savingpublic void save(java.io.File file, ImagingPixmap.Format format, ImagingPixmap.ColorSpace colorspace, ImagingPixmap.Compression compression, int resolution, int jpegQualityOrZIPCompression, boolean embedTransparencyGrid, int boundingBoxWidth, int boundingBoxHeight)
BMP
, CompuServe GIF
, JPEG
, PCX
, PDF
,
PNG
, Scitex CT
and TIFF
.
The possible colorspaces depend on the used format:
Format / Color Space | Grayscale | RGB | CMYK |
---|---|---|---|
BMP |
Supported | Supported | - |
CompuServe GIF | Supported | Supported | - |
JPEG | Supported | Supported | Supported |
PCX |
Supported | Supported | - |
PDF | Supported | Supported | Supported |
PNG | Supported | Supported | - |
Scitex CT |
Supported | Supported | Supported |
TIFF | Supported | Supported | Supported |
The compression depends on the used format as well:
Format / Compression | None | Flate |
---|---|---|
BMP | Supported | - |
CompuServe GIF | Supported | - |
JPEG |
Supported | - |
PCX | Supported | - |
PDF |
Supported | - |
PNG | Supported | - |
Scitex CT |
Supported | - |
TIFF | Supported | Supported |
The jpeg quality
obviously is only being used when using the JPEG
format and has to be between 1 (minimum quality) and 10 (maximum quality).
file
- the file to save toformat
- the wanted formatcolorspace
- wanted color spacecompression
- the wanted compression if supported by the formatresolution
- wanted resolutionjpegQualityOrZIPCompression
- the jpeg quality if using the JPEG format between 1 and 10, for PNG this is the ZIP compression level (0..9).embedTransparencyGrid
- specify whether transparent images should get the users transparency grid embedded in transparent areasboundingBoxWidth
- optionally resize image on saving into a bounding box of the given widthboundingBoxHeight
- optionally resize image on saving into a bounding box of the given heightpublic static java.lang.String getColorSpaceName(ImagingPixmap.ColorSpace colorSpace)
colorSpace
- color space to get the label forpublic void setPage(int page)
page
- the page number of the asset to use starting at 1 for the first page. Specify 0
to use the default (first) page.public void setICCSupport(boolean supportICCProfile)
supportICCProfile
- support ICC profileswww.canto.com
Canto, the Canto logo, the Cumulus logo, and Cumulus are registered trademarks of Canto GmbH, registered in the U.S. and other countries.