类 OctTreeQuantizer
- java.lang.Object
-
- org.meteoinfo.image.filter.OctTreeQuantizer
-
- 所有已实现的接口:
Quantizer
public class OctTreeQuantizer extends Object implements Quantizer
An image Quantizer based on the Octree algorithm. This is a very basic implementation at present and could be much improved by picking the nodes to reduce more carefully (i.e. not completely at random) when I get the time.
-
-
构造器概要
构造器 构造器 说明 OctTreeQuantizer()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidaddPixels(int[] pixels, int offset, int count)Add pixels to the quantizer.int[]buildColorTable()Build the color table.voidbuildColorTable(int[] inPixels, int[] table)A quick way to use the quantizer.intgetIndexForColor(int rgb)Get the color table index for a color.voidsetup(int numColors)Initialize the quantizer.
-
-
-
方法详细资料
-
setup
public void setup(int numColors)
Initialize the quantizer. This should be called before adding any pixels.
-
addPixels
public void addPixels(int[] pixels, int offset, int count)Add pixels to the quantizer.
-
getIndexForColor
public int getIndexForColor(int rgb)
Get the color table index for a color.- 指定者:
getIndexForColor在接口中Quantizer- 参数:
rgb- the color- 返回:
- the index
-
buildColorTable
public int[] buildColorTable()
Build the color table.- 指定者:
buildColorTable在接口中Quantizer- 返回:
- the color table
-
buildColorTable
public void buildColorTable(int[] inPixels, int[] table)A quick way to use the quantizer. Just create a table the right size and pass in the pixels.- 参数:
inPixels- the input colorstable- the output color table
-
-