|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectcom.alibaba.simpleimage.util.PaletteBuilder
public class PaletteBuilder
Oracle的实现有bug,而且性能有待改进,所以在Oracle的基础上实现自己的版本
| 方法摘要 | |
|---|---|
static boolean |
canCreatePalette(ImageTypeSpecifier type)
Returns true if PaletteBuilder is able to create palette for given image type. |
static boolean |
canCreatePalette(RenderedImage image)
Returns true if PaletteBuilder is able to create palette for given rendered image. |
static IndexColorModel |
createIndexColorModel(RenderedImage img)
Creates an palette representing colors from given image img. |
static RenderedImage |
createIndexedImage(RenderedImage src)
Creates an image representing given image src using IndexColorModel. |
| 从类 java.lang.Object 继承的方法 |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 方法详细信息 |
|---|
public static RenderedImage createIndexedImage(RenderedImage src)
src using IndexColorModel. Lossless
conversion is not always possible (e.g. if number of colors in the given image exceeds maximum palette size).
Result image then is an approximation constructed by octree quantization method.
IllegalArgumentException - if src is null.
UnsupportedOperationException - if implemented method is unable to create approximation of
src and canCreatePalette returns false.createIndexColorModel,
canCreatePalettepublic static IndexColorModel createIndexColorModel(RenderedImage img)
img. If number of colors in the given image
exceeds maximum palette size closest colors would be merged.
IllegalArgumentException - if img is null.
UnsupportedOperationException - if implemented method is unable to create approximation of
img and canCreatePalette returns false.createIndexedImage,
canCreatePalettepublic static boolean canCreatePalette(ImageTypeSpecifier type)
true if PaletteBuilder is able to create palette for given image type.
type - an instance of ImageTypeSpecifier to be indexed.
true if the PaletteBuilder is likely to be able to create palette for this
image type.
IllegalArgumentException - if type is null.public static boolean canCreatePalette(RenderedImage image)
true if PaletteBuilder is able to create palette for given rendered image.
image - an instance of RenderedImage to be indexed.
true if the PaletteBuilder is likely to be able to create palette for this
image type.
IllegalArgumentException - if image is null.
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||