jhplot.utils
Class ColorPixel

java.lang.Object
  extended by jhplot.utils.ColorPixel

public class ColorPixel
extends Object

Static methods which help to convert colors and vectors with pixels. They are helpful to integrate ImageJ API with JHepWork API. The methods allows to convert pixel colors (integer) into the usual (R,G,B). Also conversion of arrays is supported.


Constructor Summary
ColorPixel()
           
 
Method Summary
static Color getColor(int c)
          Return color from pixel color (integer compact value representing color in the ImageJ representation).
static ArrayList<P0I> getP0I(int[] c)
          Get array list with (R,G,B) from list of pixels.
static int getPixel(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 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 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 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 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(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.


jHepWork 3.1 ©