public final class ColorPaletteHelper extends Object
Helper class for color palettes manipulation.
| 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 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.
|
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.
|
static boolean |
hasTransparentColors(IColorPalette palette)
Determines whether the specified palette has transparent colors.
|
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 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.
image - The raster image.destBounds - The destination image bounds.entriesCount - The desired entries count.useImagePalette - If set, it will use its own image palette if availableimage 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.public static boolean hasTransparentColors(IColorPalette palette)
Determines whether the specified palette has transparent colors.
palette - The palette.true if the specified palette has transparent colors; otherwise, false.com.aspose.ms.System.ArgumentNullException - palette is null.Copyright (c) 2008-2020 Aspose Pty Ltd. All Rights Reserved.