public final class JBHiDPIScaledImage
extends java.awt.image.BufferedImage
TYPE_3BYTE_BGR, TYPE_4BYTE_ABGR, TYPE_4BYTE_ABGR_PRE, TYPE_BYTE_BINARY, TYPE_BYTE_GRAY, TYPE_BYTE_INDEXED, TYPE_CUSTOM, TYPE_INT_ARGB, TYPE_INT_ARGB_PRE, TYPE_INT_BGR, TYPE_INT_RGB, TYPE_USHORT_555_RGB, TYPE_USHORT_565_RGB, TYPE_USHORT_GRAY
Constructor and Description |
---|
JBHiDPIScaledImage(double width,
double height,
int type)
Creates a scaled HiDPI-aware BufferedImage, targeting the system default scale.
|
JBHiDPIScaledImage(java.awt.Graphics2D g,
double width,
double height,
int type,
PaintUtil.RoundingMode rm)
Creates a scaled HiDPI-aware BufferedImage, targeting the graphics scale.
|
JBHiDPIScaledImage(java.awt.Graphics2D g,
int width,
int height,
int type) |
JBHiDPIScaledImage(java.awt.GraphicsConfiguration gc,
double width,
double height,
int type)
Creates a scaled HiDPI-aware BufferedImage, targeting the graphics config.
|
JBHiDPIScaledImage(java.awt.GraphicsConfiguration gc,
double width,
double height,
int type,
PaintUtil.RoundingMode rm)
Creates a scaled HiDPI-aware BufferedImage, targeting the graphics config.
|
JBHiDPIScaledImage(java.awt.GraphicsConfiguration gc,
int width,
int height,
int type) |
JBHiDPIScaledImage(java.awt.Image image,
double width,
double height,
int type)
Creates a HiDPI-aware BufferedImage wrapper for the provided scaled raw image.
|
JBHiDPIScaledImage(java.awt.Image image,
int width,
int height,
int type) |
JBHiDPIScaledImage(int width,
int height,
int type) |
JBHiDPIScaledImage(ScaleContext ctx,
double width,
double height,
int type,
PaintUtil.RoundingMode rm) |
Modifier and Type | Method and Description |
---|---|
java.awt.Graphics2D |
createGraphics() |
java.awt.Image |
getDelegate() |
int |
getHeight()
Returns the height in user coordinate space for the image created as a wrapper,
and the real height for the image created as a scaled one.
|
int |
getHeight(java.awt.image.ImageObserver observer)
Returns the height in user coordinate space for the image created as a wrapper,
and the real height for the image created as a scaled one.
|
int |
getRealHeight(java.awt.image.ImageObserver observer)
Returns the real height.
|
int |
getRealWidth(java.awt.image.ImageObserver observer)
Returns the real width.
|
double |
getScale() |
int |
getUserHeight(java.awt.image.ImageObserver observer)
Returns the height in user coordinate space.
|
int |
getUserWidth(java.awt.image.ImageObserver observer)
Returns the width in user coordinate space.
|
int |
getWidth()
Returns the width in user coordinate space for the image created as a wrapper,
and the real width for the image created as a scaled one.
|
int |
getWidth(java.awt.image.ImageObserver observer)
Returns the width in user coordinate space for the image created as a wrapper,
and the real width for the image created as a scaled one.
|
JBHiDPIScaledImage |
scale(double scaleFactor)
Returns JBHiDPIScaledImage of the same structure scaled by the provided factor.
|
JBHiDPIScaledImage |
scale(int targetUserWidth,
int targetUserHeight)
Returns JBHiDPIScaledImage of the same structure scaled to the provided dimensions.
|
addTileObserver, coerceData, copyData, getAlphaRaster, getColorModel, getData, getData, getGraphics, getMinTileX, getMinTileY, getMinX, getMinY, getNumXTiles, getNumYTiles, getProperty, getProperty, getPropertyNames, getRaster, getRGB, getRGB, getSampleModel, getSource, getSources, getSubimage, getTile, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, getTransparency, getType, getWritableTile, getWritableTileIndices, hasTileWriters, isAlphaPremultiplied, isTileWritable, releaseWritableTile, removeTileObserver, setData, setRGB, setRGB, toString
public JBHiDPIScaledImage(int width, int height, int type)
JBHiDPIScaledImage(double, double, int)
public JBHiDPIScaledImage(double width, double height, int type)
width
- the width in user coordinate spaceheight
- the height in user coordinate spacetype
- the typepublic JBHiDPIScaledImage(java.awt.Graphics2D g, int width, int height, int type)
#JBHiDPIScaledImage(Graphics2D, double, double, int, RoundingMode rm)
public JBHiDPIScaledImage(java.awt.Graphics2D g, double width, double height, int type, PaintUtil.RoundingMode rm)
g
- the graphics which provides the target scalewidth
- the width in user coordinate spaceheight
- the height in user coordinate spacetype
- the typerm
- the rounding modepublic JBHiDPIScaledImage(java.awt.GraphicsConfiguration gc, int width, int height, int type)
public JBHiDPIScaledImage(ScaleContext ctx, double width, double height, int type, PaintUtil.RoundingMode rm)
public JBHiDPIScaledImage(java.awt.GraphicsConfiguration gc, double width, double height, int type)
gc
- the graphics config which provides the target scalewidth
- the width in user coordinate spaceheight
- the height in user coordinate spacetype
- the typepublic JBHiDPIScaledImage(java.awt.GraphicsConfiguration gc, double width, double height, int type, PaintUtil.RoundingMode rm)
gc
- the graphics config which provides the target scalewidth
- the width in user coordinate spaceheight
- the height in user coordinate spacerm
- the rounding mode to apply when converting width/height to the device spacetype
- the typepublic JBHiDPIScaledImage(java.awt.Image image, int width, int height, int type)
public JBHiDPIScaledImage(java.awt.Image image, double width, double height, int type)
image
- the scaled raw imagewidth
- the width in user coordinate spaceheight
- the height in user coordinate spacetype
- the typepublic double getScale()
public JBHiDPIScaledImage scale(double scaleFactor)
scaleFactor
- the scale factorpublic JBHiDPIScaledImage scale(int targetUserWidth, int targetUserHeight)
public java.awt.Image getDelegate()
public int getWidth()
getWidth
in interface java.awt.image.RenderedImage
getWidth
in class java.awt.image.BufferedImage
public int getHeight()
getHeight
in interface java.awt.image.RenderedImage
getHeight
in class java.awt.image.BufferedImage
public int getWidth(java.awt.image.ImageObserver observer)
getWidth
in class java.awt.image.BufferedImage
public int getHeight(java.awt.image.ImageObserver observer)
getHeight
in class java.awt.image.BufferedImage
public int getUserWidth(java.awt.image.ImageObserver observer)
observer
- the image observerpublic int getUserHeight(java.awt.image.ImageObserver observer)
observer
- the image observerpublic int getRealWidth(java.awt.image.ImageObserver observer)
observer
- the image observerpublic int getRealHeight(java.awt.image.ImageObserver observer)
observer
- the image observerpublic java.awt.Graphics2D createGraphics()
createGraphics
in class java.awt.image.BufferedImage