org.jscience.media.pictures.filters
Class PixelUtils

java.lang.Object
  extended by org.jscience.media.pictures.filters.PixelUtils

public class PixelUtils
extends java.lang.Object

Some more useful math functions for image processing


Field Summary
static int ADD
          DOCUMENT ME!
static int ALPHA
          DOCUMENT ME!
static int ALPHA_TO_GRAY
          DOCUMENT ME!
static int AVERAGE
          DOCUMENT ME!
static int CLEAR
          DOCUMENT ME!
static int COLOR
          DOCUMENT ME!
static int DIFFERENCE
          DOCUMENT ME!
static int DISSOLVE
          DOCUMENT ME!
static int DST_IN
          DOCUMENT ME!
static int EXCHANGE
          DOCUMENT ME!
static int HUE
          DOCUMENT ME!
static int MAX
          DOCUMENT ME!
static int MIN
          DOCUMENT ME!
static int MULTIPLY
          DOCUMENT ME!
static int NORMAL
          DOCUMENT ME!
static int OVERLAY
          DOCUMENT ME!
static int REPLACE
          DOCUMENT ME!
static int SATURATION
          DOCUMENT ME!
static int SCREEN
          DOCUMENT ME!
static int SUBTRACT
          DOCUMENT ME!
static int VALUE
          DOCUMENT ME!
 
Constructor Summary
PixelUtils()
           
 
Method Summary
static int brightness(int rgb)
          DOCUMENT ME!
static int clamp(int c)
          Clamp a value to the range 0..255
static int combinePixels(int rgb1, int rgb2, int op)
          DOCUMENT ME!
static int combinePixels(int rgb1, int rgb2, int op, int extraAlpha)
          DOCUMENT ME!
static int combinePixels(int rgb1, int rgb2, int op, int extraAlpha, int channelMask)
          DOCUMENT ME!
static int interpolate(int v1, int v2, float f)
          DOCUMENT ME!
static boolean nearColors(int rgb1, int rgb2, int tolerance)
          DOCUMENT ME!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REPLACE

public static final int REPLACE
DOCUMENT ME!

See Also:
Constant Field Values

NORMAL

public static final int NORMAL
DOCUMENT ME!

See Also:
Constant Field Values

MIN

public static final int MIN
DOCUMENT ME!

See Also:
Constant Field Values

MAX

public static final int MAX
DOCUMENT ME!

See Also:
Constant Field Values

ADD

public static final int ADD
DOCUMENT ME!

See Also:
Constant Field Values

SUBTRACT

public static final int SUBTRACT
DOCUMENT ME!

See Also:
Constant Field Values

DIFFERENCE

public static final int DIFFERENCE
DOCUMENT ME!

See Also:
Constant Field Values

MULTIPLY

public static final int MULTIPLY
DOCUMENT ME!

See Also:
Constant Field Values

HUE

public static final int HUE
DOCUMENT ME!

See Also:
Constant Field Values

SATURATION

public static final int SATURATION
DOCUMENT ME!

See Also:
Constant Field Values

VALUE

public static final int VALUE
DOCUMENT ME!

See Also:
Constant Field Values

COLOR

public static final int COLOR
DOCUMENT ME!

See Also:
Constant Field Values

SCREEN

public static final int SCREEN
DOCUMENT ME!

See Also:
Constant Field Values

AVERAGE

public static final int AVERAGE
DOCUMENT ME!

See Also:
Constant Field Values

OVERLAY

public static final int OVERLAY
DOCUMENT ME!

See Also:
Constant Field Values

CLEAR

public static final int CLEAR
DOCUMENT ME!

See Also:
Constant Field Values

EXCHANGE

public static final int EXCHANGE
DOCUMENT ME!

See Also:
Constant Field Values

DISSOLVE

public static final int DISSOLVE
DOCUMENT ME!

See Also:
Constant Field Values

DST_IN

public static final int DST_IN
DOCUMENT ME!

See Also:
Constant Field Values

ALPHA

public static final int ALPHA
DOCUMENT ME!

See Also:
Constant Field Values

ALPHA_TO_GRAY

public static final int ALPHA_TO_GRAY
DOCUMENT ME!

See Also:
Constant Field Values
Constructor Detail

PixelUtils

public PixelUtils()
Method Detail

clamp

public static int clamp(int c)
Clamp a value to the range 0..255

Parameters:
c - DOCUMENT ME!
Returns:
DOCUMENT ME!

interpolate

public static int interpolate(int v1,
                              int v2,
                              float f)
DOCUMENT ME!

Parameters:
v1 - DOCUMENT ME!
v2 - DOCUMENT ME!
f - DOCUMENT ME!
Returns:
DOCUMENT ME!

brightness

public static int brightness(int rgb)
DOCUMENT ME!

Parameters:
rgb - DOCUMENT ME!
Returns:
DOCUMENT ME!

nearColors

public static boolean nearColors(int rgb1,
                                 int rgb2,
                                 int tolerance)
DOCUMENT ME!

Parameters:
rgb1 - DOCUMENT ME!
rgb2 - DOCUMENT ME!
tolerance - DOCUMENT ME!
Returns:
DOCUMENT ME!

combinePixels

public static int combinePixels(int rgb1,
                                int rgb2,
                                int op)
DOCUMENT ME!

Parameters:
rgb1 - DOCUMENT ME!
rgb2 - DOCUMENT ME!
op - DOCUMENT ME!
Returns:
DOCUMENT ME!

combinePixels

public static int combinePixels(int rgb1,
                                int rgb2,
                                int op,
                                int extraAlpha,
                                int channelMask)
DOCUMENT ME!

Parameters:
rgb1 - DOCUMENT ME!
rgb2 - DOCUMENT ME!
op - DOCUMENT ME!
extraAlpha - DOCUMENT ME!
channelMask - DOCUMENT ME!
Returns:
DOCUMENT ME!

combinePixels

public static int combinePixels(int rgb1,
                                int rgb2,
                                int op,
                                int extraAlpha)
DOCUMENT ME!

Parameters:
rgb1 - DOCUMENT ME!
rgb2 - DOCUMENT ME!
op - DOCUMENT ME!
extraAlpha - DOCUMENT ME!
Returns:
DOCUMENT ME!