public final class DitherUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
DITHER_MATRIX_2X2
Selects a 2x2 Bayer dither matrix (5 grayscales)
|
static int |
DITHER_MATRIX_4X4
Selects a 4x4 Bayer dither matrix (17 grayscales)
|
static int |
DITHER_MATRIX_8X8
Selects a 8x8 Bayer dither matrix (65 grayscales)
|
Modifier and Type | Method and Description |
---|---|
static int[] |
getBayerBasePattern(int matrix)
Returns the Bayer dither base pattern for a particular matrix size.
|
static byte[] |
getBayerDither(int matrix,
java.awt.Color col,
boolean doubleMatrix)
Returns a byte array containing the dither pattern for the given 8-bit gray value.
|
static byte[] |
getBayerDither(int matrix,
int gray255,
boolean doubleMatrix)
Returns a byte array containing the dither pattern for the given 8-bit gray value.
|
public static final int DITHER_MATRIX_2X2
public static final int DITHER_MATRIX_4X4
public static final int DITHER_MATRIX_8X8
public static int[] getBayerBasePattern(int matrix)
matrix
- the matrix size (DITHER_MATRIX_2X2
, DITHER_MATRIX_4X4
or DITHER_MATRIX_8X8
)public static byte[] getBayerDither(int matrix, int gray255, boolean doubleMatrix)
matrix
- the matrix size (DITHER_MATRIX_2X2
, DITHER_MATRIX_4X4
or DITHER_MATRIX_8X8
)gray255
- the gray value (0-255)doubleMatrix
- true if the 4x4 matrix shall be doubled to a 8x8public static byte[] getBayerDither(int matrix, java.awt.Color col, boolean doubleMatrix)
matrix
- the matrix size (DITHER_MATRIX_2X2
, DITHER_MATRIX_4X4
or DITHER_MATRIX_8X8
)col
- the colordoubleMatrix
- true if the 4x4 matrix shall be doubled to a 8x8Copyright 1999-2012 The Apache Software Foundation. All Rights Reserved.