public final class ColorPaletteHelper extends Object
Helper class for color palettes manipulation.
Constructor and Description |
---|
ColorPaletteHelper() |
Modifier and Type | Method and Description |
---|---|
static IColorPalette |
create4Bit()
Creates the 4 bit color palette.
|
static IColorPalette |
create4BitGrayscale(boolean minIsWhite)
Creates the 4 bit grayscale palette.
|
static IColorPalette |
create8Bit()
Creates the 8 bit color palette.
|
static IColorPalette |
create8BitGrayscale(boolean minIsWhite)
Creates the 8 bit grayscale palette.
|
static IColorPalette |
createMonochrome()
Creates a monochrome color palette containing 2 colors only.
|
static IColorPalette |
getCloseImagePalette(RasterImage image,
int entriesCount)
Gets color palette from raster image (palletizes image) in case the image does not have one.
|
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.
|
static ColorPalette |
getDownscalePalette(RasterImage image)
Get 256 color palette, composed from upper bits of initial image color values.
|
static ColorPalette |
getUniformColorPalette(RasterImage image)
Get uniform 256 color palette.
|
public static IColorPalette createMonochrome()
Creates a monochrome color palette containing 2 colors only.
public static IColorPalette create4Bit()
Creates the 4 bit color palette.
public static IColorPalette create4BitGrayscale(boolean minIsWhite)
Creates the 4 bit grayscale palette.
minIsWhite
- if set to true
the palette starts with white color, otherwise it starts with black color.public static IColorPalette create8Bit()
Creates the 8 bit color palette.
public static IColorPalette create8BitGrayscale(boolean minIsWhite)
Creates the 8 bit grayscale palette.
minIsWhite
- if set to true
the palette starts with white color, otherwise it starts with black color.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.
image
- The raster image.entriesCount
- The desired entries count.image
and contains entriesCount
entries.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.
image
- The raster image.destBounds
- The destination image bounds.entriesCount
- The desired entries count.image
and contains entriesCount
entries.public static ColorPalette getUniformColorPalette(RasterImage image)
Get uniform 256 color palette.
image
- The image.ColorPalette
.public static ColorPalette getDownscalePalette(RasterImage image)
Get 256 color palette, composed from upper bits of initial image color values.
image
- The image.ColorPalette
.Copyright (c) 2008-2020 Aspose Pty Ltd. All Rights Reserved.