ColorPaletteHelper
Inheritance: java.lang.Object
public final class ColorPaletteHelper
Helper class for color palettes manipulation.
Methods
Method | Description |
---|---|
create4Bit() | Creates the 4 bit color palette. |
create4BitGrayscale(boolean minIsWhite) | Creates the 4 bit grayscale palette. |
create8Bit() | Creates the 8 bit color palette. |
create8BitGrayscale(boolean minIsWhite) | Creates the 8 bit grayscale palette. |
createMonochrome() | Creates a monochrome color palette containing 2 colors only. |
equals(Object arg0) | |
getClass() | |
getCloseImagePalette(RasterImage image, Rectangle destBounds, int entriesCount) | Gets color palette from raster image (palletizes image) in case the image does not have one. |
getCloseImagePalette(RasterImage image, Rectangle destBounds, int entriesCount, boolean useImagePalette) | Gets color palette from raster image (palletizes image) in case the image does not have one. |
getCloseImagePalette(RasterImage image, int entriesCount) | Gets color palette from raster image (palletizes image) in case the image does not have one. |
getDownscalePalette(RasterImage image) | Get 256 color palette, composed from upper bits of initial image color values. |
getUniformColorPalette(RasterImage image) | Get uniform 256 color palette. |
hasTransparentColors(IColorPalette palette) | Determines whether the specified palette has transparent colors. |
hashCode() | |
notify() | |
notifyAll() | |
toString() | |
wait() | |
wait(long arg0) | |
wait(long arg0, int arg1) |
create4Bit()
public static IColorPalette create4Bit()
Creates the 4 bit color palette.
Returns: IColorPalette - The 4 bit color palette.
create4BitGrayscale(boolean minIsWhite)
public static IColorPalette create4BitGrayscale(boolean minIsWhite)
Creates the 4 bit grayscale palette.
Parameters:
Parameter | Type | Description |
---|---|---|
minIsWhite | boolean | if set to true the palette starts with white color, otherwise it starts with black color. |
Returns: IColorPalette - The 4 bit grayscale palette.
create8Bit()
public static IColorPalette create8Bit()
Creates the 8 bit color palette.
Returns: IColorPalette - The 8 bit color palette.
create8BitGrayscale(boolean minIsWhite)
public static IColorPalette create8BitGrayscale(boolean minIsWhite)
Creates the 8 bit grayscale palette.
Parameters:
Parameter | Type | Description |
---|---|---|
minIsWhite | boolean | if set to true the palette starts with white color, otherwise it starts with black color. |
Returns: IColorPalette - The 8 bit grayscale palette.
createMonochrome()
public static IColorPalette createMonochrome()
Creates a monochrome color palette containing 2 colors only.
Returns: IColorPalette - Color palette for monochrome images.
equals(Object arg0)
public boolean equals(Object arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | java.lang.Object |
Returns: boolean
getClass()
public final native Class<?> getClass()
Returns: java.lang.Class
getCloseImagePalette(RasterImage image, Rectangle destBounds, int entriesCount)
public static IColorPalette getCloseImagePalette(RasterImage image, Rectangle destBounds, int entriesCount)
Gets color palette from raster image (palletizes image) in case the image does not have one. In case palette exists it will be used instead performing calculations.
Parameters:
Parameter | Type | Description |
---|---|---|
image | RasterImage | The raster image. |
destBounds | Rectangle | The destination image bounds. |
entriesCount | int | The desired entries count. |
Returns: IColorPalette - The color palette which starts with the most frequent colors from the image and contains entriesCount entries.
getCloseImagePalette(RasterImage image, Rectangle destBounds, int entriesCount, boolean useImagePalette)
public static IColorPalette getCloseImagePalette(RasterImage image, Rectangle destBounds, int entriesCount, boolean useImagePalette)
Gets color palette from raster image (palletizes image) in case the image does not have one. In case palette exists it will be used instead performing calculations.
Parameters:
Parameter | Type | Description |
---|---|---|
image | RasterImage | The raster image. |
destBounds | Rectangle | The destination image bounds. |
entriesCount | int | The desired entries count. |
useImagePalette | boolean | If set, it will use its own image palette if available |
Returns: IColorPalette - The color palette which starts with the most frequent colors from the image and contains entriesCount entries.
getCloseImagePalette(RasterImage image, int entriesCount)
public static IColorPalette getCloseImagePalette(RasterImage image, int entriesCount)
Gets color palette from raster image (palletizes image) in case the image does not have one. In case palette exists it will be used instead performing calculations.
Parameters:
Parameter | Type | Description |
---|---|---|
image | RasterImage | The raster image. |
entriesCount | int | The desired entries count. |
Returns: IColorPalette - The color palette which starts with the most frequent colors from the image and contains entriesCount entries.
getDownscalePalette(RasterImage image)
public static ColorPalette getDownscalePalette(RasterImage image)
Get 256 color palette, composed from upper bits of initial image color values.
Parameters:
Parameter | Type | Description |
---|---|---|
image | RasterImage | The image. |
Returns: ColorPalette - The ColorPalette .
getUniformColorPalette(RasterImage image)
public static ColorPalette getUniformColorPalette(RasterImage image)
Get uniform 256 color palette.
Parameters:
Parameter | Type | Description |
---|---|---|
image | RasterImage | The image. |
Returns: ColorPalette - The ColorPalette .
hasTransparentColors(IColorPalette palette)
public static boolean hasTransparentColors(IColorPalette palette)
Determines whether the specified palette has transparent colors.
Parameters:
Parameter | Type | Description |
---|---|---|
palette | IColorPalette | The palette. |
Returns: boolean - true if the specified palette has transparent colors; otherwise, false .
hashCode()
public native int hashCode()
Returns: int
notify()
public final native void notify()
notifyAll()
public final native void notifyAll()
toString()
public String toString()
Returns: java.lang.String
wait()
public final void wait()
wait(long arg0)
public final void wait(long arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long |
wait(long arg0, int arg1)
public final void wait(long arg0, int arg1)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long | |
arg1 | int |