Documentation of 'jhplot.utils.ColorPixel' Java class.
ColorPixel
jhplot.utils

Class ColorPixel



  • public class ColorPixel
    extends java.lang.Object
    Static methods which help to convert colors and vectors with pixels. They are helpful to integrate ImageJ API with ScaVi API. The methods allows to convert pixel colors (integer) into the usual (R,G,B). Also conversion of arrays is supported.
    • Constructor Summary

      Constructors 
      Constructor and Description
      ColorPixel() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static java.awt.Color getColor(int c)
      Return color from pixel color (integer compact value representing color in the ImageJ representation).
      static java.util.ArrayList<P0I> getP0I(int[] c)
      Get array list with (R,G,B) from list of pixels.
      static int getPixel(java.awt.Color c)
      Convert color into compact integer representation of pixel.
      static int[] getPixel(int[] red, int[] green, int[] blue)
      Convert arrays with R,G,B into a pixel color as in ImageJ.
      static int getPixel(int red, int green, int blue)
      Convert color (red,green,blue) into compact integer representation of pixel.
      static PNI getPNI(int[] c)
      Get array list with (R,G,B) from list of pixels.
      static int[] getRGB(int c)
      Get (R,G,B) from a pixel color.
      static java.util.ArrayList<int[]> getRGB(int[] c)
      Get array list with (R,G,B) from list of pixels.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ColorPixel

        public ColorPixel()
    • Method Detail

      • getColor

        public static java.awt.Color getColor(int c)
        Return color from pixel color (integer compact value representing color in the ImageJ representation).
        Parameters:
        c - pixel color in compact representation
        Returns:
        java color
      • getRGB

        public static int[] getRGB(int c)
        Get (R,G,B) from a pixel color.
        Parameters:
        c - pixel color
        Returns:
        (R,G,B) of this pixel.
      • getRGB

        public static java.util.ArrayList<int[]> getRGB(int[] c)
        Get array list with (R,G,B) from list of pixels. The array has dimension 3 and contains 3 arrays with (R,G,B).
        Parameters:
        c - pixel color
        Returns:
        array with 3 elements. Each is an array with (R,G,B).
      • getP0I

        public static java.util.ArrayList<P0I> getP0I(int[] c)
        Get array list with (R,G,B) from list of pixels. The array has size 3, and each object is P0D keeping R,G,B color.
        Parameters:
        c - pixel color
        Returns:
        array with 3 elements. Each is an array with (R,G,B).
      • getPNI

        public static PNI getPNI(int[] c)
        Get array list with (R,G,B) from list of pixels. The array has size 3, and each object is P0D keeping R,G,B color.
        Parameters:
        c - pixel color
        Returns:
        array with 3 elements. Each is an array with (R,G,B).
      • getPixel

        public static int getPixel(java.awt.Color c)
        Convert color into compact integer representation of pixel.
        Parameters:
        c - color
        Returns:
        integer representing a pixel.
      • getPixel

        public static int getPixel(int red,
                                   int green,
                                   int blue)
        Convert color (red,green,blue) into compact integer representation of pixel.
        Parameters:
        red - Red
        green - Green
        blue - Blue
        Returns:
        integer representing a pixel.
      • getPixel

        public static int[] getPixel(int[] red,
                                     int[] green,
                                     int[] blue)
        Convert arrays with R,G,B into a pixel color as in ImageJ. All arrays should have the same length.
        Parameters:
        red - array with red (0-255)
        green - array with green
        blue - array with blue
        Returns:
        pixel array color in compact form.

DMelt 3.0 © DataMelt by jWork.ORG