Klasse OctreeQuantization.Node

java.lang.Object
libsidplay.components.mos656x.OctreeQuantization.Node
Umschließende Klasse:
OctreeQuantization

private class OctreeQuantization.Node extends Object
  • Felddetails

    • leaf

      private boolean leaf
    • reference

      protected int reference
    • red

      protected int red
    • green

      protected int green
    • blue

      protected int blue
    • parent

      protected final OctreeQuantization.Node parent
    • children

      private final OctreeQuantization.Node[] children
  • Konstruktordetails

  • 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 pixel
      depth - current depth
    • find

      protected OctreeQuantization.Node find(int packed, int depth)
      Find nearest node in tree to color
      Parameter:
      packed - the color to look for
      depth - 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

      protected int distance(OctreeQuantization.Node a)
      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.