Class IndexImage.Counter

java.lang.Object
org.apache.batik.ext.awt.image.rendered.IndexImage.Counter
Enclosing class:
IndexImage

private static class IndexImage.Counter extends Object
Used to track a color and the number of pixels of that colors
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) int
    the number of image-pixels with this color.
    (package private) final int
    contains the 'packed' rgb-color for this point.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Counter(int val)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) boolean
    add(int val)
     
    (package private) int[]
    getRgb(int[] rgb)
    convert the color-point of this counter to an rgb-array.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • val

      final int val
      contains the 'packed' rgb-color for this point. Must not change after construction!
    • count

      int count
      the number of image-pixels with this color.
  • Constructor Details

    • Counter

      Counter(int val)
  • Method Details

    • add

      boolean add(int val)
    • getRgb

      int[] getRgb(int[] rgb)
      convert the color-point of this counter to an rgb-array. To avoid creating lots of arrays, the caller passes the array to store the result.
      Parameters:
      rgb - an int[ 3 ] to store the result.
      Returns:
      an int-array with rgb-color-values (same as rgb-parameter)