public class SubpixAA
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.Object |
HBGR |
static java.lang.Object |
HRGB |
static java.lang.Object |
VBGR |
static java.lang.Object |
VRGB |
Constructor and Description |
---|
SubpixAA() |
Modifier and Type | Method and Description |
---|---|
static void |
aa(java.awt.image.BufferedImage src,
java.awt.image.BufferedImage dst,
java.lang.Object m)
Scales down an image using the specified antialiasing method.
|
static void |
aaHBGR(java.awt.image.BufferedImage src,
java.awt.image.BufferedImage dst)
Scales down an image using HBGR antia-aliasing.
|
static void |
aaHRGB(java.awt.image.BufferedImage src,
java.awt.image.BufferedImage dst)
Scales down an image using HRGB antia-aliasing.
|
static void |
aaVBGR(java.awt.image.BufferedImage src,
java.awt.image.BufferedImage dst)
Scales down an image using VBGR antia-aliasing.
|
static void |
aaVRGB(java.awt.image.BufferedImage src,
java.awt.image.BufferedImage dst)
Scales down an image using VRGB antia-aliasing.
|
void |
drawAA(java.awt.Graphics gr,
java.awt.image.BufferedImage img,
int x,
int y,
int width,
int height,
java.awt.image.ImageObserver observer)
Renders an image with subpixel antialiasing.
|
void |
drawAA(java.awt.Graphics gr,
java.awt.image.BufferedImage img,
int x,
int y,
int width,
int height,
java.lang.Object method,
java.awt.image.ImageObserver observer)
Renders an image with subpixel antialiasing.
|
static java.awt.Dimension |
getSourceDimension(int width,
int height,
java.lang.Object method)
Returns the dimensions needed of the source image for the desired
destination image size.
|
public static final java.lang.Object HBGR
public static final java.lang.Object VBGR
public static final java.lang.Object HRGB
public static final java.lang.Object VRGB
public void drawAA(java.awt.Graphics gr, java.awt.image.BufferedImage img, int x, int y, int width, int height, java.awt.image.ImageObserver observer)
public void drawAA(java.awt.Graphics gr, java.awt.image.BufferedImage img, int x, int y, int width, int height, java.lang.Object method, java.awt.image.ImageObserver observer)
public static java.awt.Dimension getSourceDimension(int width, int height, java.lang.Object method)
width
- The desired width of the destination image.height
- The desired height of the destination image.method
- The Antialiasing method to be used must be one of
RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB
, ..._HBGR
,public static void aa(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst, java.lang.Object m)
For methods HBGR
and HRGB
, the image width is scaled down
by factor 3.
For methods VBGR
and VRGB
, the image height is scaled down
by factor 3.
src
- The source image.dst
- The destination image.m
- The method.public static void aaHRGB(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)
Source and destination image must be of type BufferedImage.TYPE_RGB and have a data buffer of type DataBufferInt.
The height of source and destination image must be the same. The width of the source image must be 3 times the width of the destination image.
Intensity weights:
1 | +----+----+ | | | 1/3 1/3 1/3 | +----+----+----+----+ | | | | | 1/9 2/9 3/9 2/9 1/9
src
- The source image.dst
- The destination image.public static void aaHBGR(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)
Source and destination image must be of type BufferedImage.TYPE_RGB and have a data buffer of type DataBufferInt.
The height of source and destination image must be the same. The width of the source image must be 3 times the width of the destination image.
Intensity weights:
1 | +----+----+ | | | 1/3 1/3 1/3 | +----+----+----+----+ | | | | | 1/9 2/9 3/9 2/9 1/9
src
- The source image.dst
- The destination image.public static void aaVRGB(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)
Source and destination image must be of type BufferedImage.TYPE_RGB and have a data buffer of type DataBufferInt.
The width of source and destination image must be the same. The height of the source image must be 3 times the height of the destination image.
Intensity weights:
1 | +----+----+ | | | 1/3 1/3 1/3 | +----+----+----+----+ | | | | | 1/9 2/9 3/9 2/9 1/9
src
- The source image.dst
- The destination image.public static void aaVBGR(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)
Source and destination image must be of type BufferedImage.TYPE_RGB and have a data buffer of type DataBufferInt.
The width of source and destination image must be the same. The height of the source image must be 3 times the height of the destination image.
Intensity weights:
1 | +----+----+ | | | 1/3 1/3 1/3 | +----+----+----+----+ | | | | | 1/9 2/9 3/9 2/9 1/9
src
- The source image.dst
- The destination image.