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 tree.protected intCalculate distance in 3d geometric terms between two colors.protected OctreeQuantization.Nodefind(int packed, int depth) Find nearest node in tree to colorprivate final intpickChild(int packed, int depth) Select appropriate child node based on requested depthprotected voidreduce()Reduce a node and mark it as leaf.protected inttoPacked()Construct 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 final int pickChild(int packed, int depth) Select appropriate child node based on requested depth- Parameter:
packed-depth-- Gibt zurück:
- child index
-
add
protected void add(int packed, int weight, int depth) Add a weighed pixel into tree.- Parameter:
packed- the packed data to add.weight- the weight of this pixeldepth- current depth
-
find
Find nearest node in 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 leaf.Invariant: because this only collapses child nodes into itself, reference count of parent remains unchanged.
Because we are calling reduce always for the least referenced parent, every parent candidate for reduction can only have leaf nodes under it.
-
toPacked
protected int toPacked()Construct 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 perceptively linear coding system.- Parameter:
a-- Gibt zurück:
- distance squared.
-