Interface IMapColors
public interface IMapColors
This is used to convert 24-bit RGB color space
to the minecraft map color space.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
-
Method Summary
Modifier and TypeMethodDescriptionadjustColors
(FullSpacedColorBuffer buffer, Converter converter) Creates a copy and adjusts the colors of the full spaced color buffer to minecraft map colors.byte
color
(int rgb) byte
color
(int r, int g, int b) byte
default byte[]
colors
(int[] rgb) byte[]
colors
(int[] rgb, int threads) Converts the given RGB colors to the minecraft map color space.
The number of threads can be specified to speed up the process.default ColorBuffer
convertDirect
(FullSpacedColorBuffer buffer) byte[]
convertImage
(BufferedImage image) toColor
(byte color) int
toRGB
(byte color) int[]
toRGBs
(byte[] colors)
-
Field Details
-
TRANSPARENT
static final byte TRANSPARENT- See Also:
-
BLACK
static final byte BLACK- See Also:
-
WHITE
static final byte WHITE- See Also:
-
RED
static final byte RED- See Also:
-
GREEN
static final byte GREEN- See Also:
-
BLUE
static final byte BLUE- See Also:
-
CYAN
static final byte CYAN- See Also:
-
YELLOW
static final byte YELLOW- See Also:
-
ORANGE
static final byte ORANGE- See Also:
-
BROWN
static final byte BROWN- See Also:
-
PURPLE
static final byte PURPLE- See Also:
-
PINK
static final byte PINK- See Also:
-
-
Method Details
-
color
byte color(int r, int g, int b) - Returns:
- the minecraft map color nearest of the given red, green and blue colors.
-
color
- Returns:
- the minecraft map color nearest of the given color.
-
color
byte color(int rgb) - Returns:
- the minecraft map color nearest of the given RGB color.
-
colors
default byte[] colors(int[] rgb) - See Also:
-
colors
byte[] colors(int[] rgb, int threads) Converts the given RGB colors to the minecraft map color space.
The number of threads can be specified to speed up the process.
Tests show that the most efficient number of threads for converting colors is 3: Graph
If the number of used threads is not important, usecolors(int[])
instead.- Returns:
- the minecraft map colors
-
convertDirect
- Returns:
- a minecraft map color buffer converted from the specified RGB color buffer
-
adjustColors
Creates a copy and adjusts the colors of the full spaced color buffer to minecraft map colors.- Parameters:
buffer
- the buffer to adjustconverter
- the converter to use- Returns:
- the copied buffer with the adjusted colors
-
convertImage
- Returns:
- the minecraft map colors converted from the specified image.
-
toColor
- Returns:
- the RGB color associated with the specified minecraft map color
-
toRGB
int toRGB(byte color) - Returns:
- the RGB color associated with the specified minecraft map color
-
toRGBs
int[] toRGBs(byte[] colors) - Returns:
- the RGB colors associated with the specified minecraft map colors
-