Package libsidplay.components.mos656x
Klasse OctreeQuantization.Node
java.lang.Object
libsidplay.components.mos656x.OctreeQuantization.Node
- Umschließende Klasse:
OctreeQuantization
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungprotected intprivate final OctreeQuantization.Node[]protected intprivate booleanprotected final OctreeQuantization.Nodeprotected intprotected int -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected voidadd(int packed, int weight, int depth) Add a weighed pixel into a tree.protected intCalculate distance in 3d geometric terms between two colors.protected OctreeQuantization.Nodefind(int packed, int depth) Find the nearest node in a tree to colorprivate intpickChild(int packed, int depth) Select the appropriate child node based on the requested depthprotected voidreduce()Reduce a node and mark it as a leaf.protected inttoPacked()Construct the original kind of packed color value from the node.
-
Felddetails
-
leaf
private boolean leaf -
reference
protected int reference -
red
protected int red -
green
protected int green -
blue
protected int blue -
parent
-
children
-
-
Konstruktordetails
-
Node
-
-
Methodendetails
-
pickChild
private int pickChild(int packed, int depth) Select the appropriate child node based on the requested depth- Parameter:
packed- the packed color to pick child fordepth- 0-based depth- Gibt zurück:
- child index
-
add
protected void add(int packed, int weight, int depth) Add a weighed pixel into a tree.- Parameter:
packed- the packed data to add.weight- the weight of this pixeldepth- current depth
-
find
Find the nearest node in a tree to color- Parameter:
packed- the color to look fordepth- current depth- Gibt zurück:
- nearest node
-
reduce
protected void reduce()Reduce a node and mark it as a leaf.Invariant: because this only collapses child nodes into itself, the reference count of parent remains unchanged.
Because we are calling reduction always for the least referenced parent, every parent candidate for reduction can only have leaf nodes under it.
-
toPacked
protected int toPacked()Construct the original kind of packed color value from the node.- Gibt zurück:
- packed color.
-
distance
Calculate distance in 3d geometric terms between two colors. YUV palette is used: it should be a perceptively linear coding system.- Parameter:
a- color to compare to.- Gibt zurück:
- distance squared.
-