Imp
[using it]
Interface Manipulation Package v4.0 (2008-06-25) a-projector ©copyright Author


imp.ima.util
Class RgbFilter

java.lang.Object
  extended by imp.ima.util.RgbFilter
Direct Known Subclasses:
Binary, Curvature, EdgeMap, EdgeMap.Contrast, Gamma, Momenta.Filter, Monochrome, Noisy, Rectification, Regions, RgbDiffusionFilter, Smooth

public class RgbFilter
extends Object

Encapsulates a RGB color image filter.


Constructor Summary
RgbFilter(boolean channel, boolean neighbor, int borderSize, int borderValue)
          Creates a RgbFilter.
 
Method Summary
 void filterChannel(char channel, int[] src, int[] dst, int width, int height)
          Defines the filter operation on each red-green-blue channel level.
 void filterRGB(int[] src, int[] dst, int width, int height)
          Defines the filter operation at the RGB pixels buffer level.
 int getChannel(int ij, int src)
          Defines the filter operation at the red-green-blue pixel level.
 int getChannel(int ij, int width, int[] src)
          Defines the filter operation at the red-green-blue pixel neighborhood level.
 int getRGB(int ij, int width, int[] red, int[] green, int[] blue)
          Defines the filter operation at the RGB pixel neighborhood level.
 int getRGB(int ij, int red, int green, int blue)
          Defines the filter operation at the RGB pixel level.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RgbFilter

public RgbFilter(boolean channel,
                 boolean neighbor,
                 int borderSize,
                 int borderValue)
Creates a RgbFilter.

Parameters:
channel - [optional, default is false] If true filter each red-green-blue channel, else filter the RGB pixel.
neighbor - [optional, default is borderSize != 0] If true, defines the filter operation at the RGB pixel neighborhood level. If false defines the filter operation at the punctual RGB pixel.
borderSize - [optional, default is 0] Border size: width/height in pixel on the image border where the filter must not be computed.
borderValue - [optional, default is 0] Border RGB value: value to be set on border where the filter is not computed.
Method Detail

filterChannel

public void filterChannel(char channel,
                          int[] src,
                          int[] dst,
                          int width,
                          int height)
Defines the filter operation on each red-green-blue channel level.
Filters defined on each red-green-blue channel overwrite this method.

Parameters:
channel - 'r' for red, 'g' for green, 'b' for blue
src - Input buffer, may be null if e.g. the filter generates an image.
dst - Output buffer, may be null if the filter has no output by computes global values in the image.
width - Image width.
height - Image height.

filterRGB

public void filterRGB(int[] src,
                      int[] dst,
                      int width,
                      int height)
Defines the filter operation at the RGB pixels buffer level.
Filters defined on the RGB pixels buffer overwrite this method.

Parameters:
src - Input buffer, may be null if e.g. the filter generates an image.
dst - Output buffer, may be null if the filter has no output but computes global values in the image.
width - Image width.
height - Image height.

getChannel

public int getChannel(int ij,
                      int src)
Defines the filter operation at the red-green-blue pixel level.
Filters without border defined on each red-green-blue value overwrite this method.

Parameters:
ij - Buffer index with pixels[i,j] = pixels[ij = i + j * width]
src - Red/Green/Blue channel value.

getChannel

public int getChannel(int ij,
                      int width,
                      int[] src)
Defines the filter operation at the red-green-blue pixel neighborhood level.
Filters with a border defined on each red-green-blue value overwrite this method.

Parameters:
ij - Buffer index with pixels[i,j] = pixels[ij = i + j * width]
width - Buffer width.
src - Red/Green/Blue channel buffer.

getRGB

public int getRGB(int ij,
                  int width,
                  int[] red,
                  int[] green,
                  int[] blue)
Defines the filter operation at the RGB pixel neighborhood level.
Filters with a border defined on each RGB pixel overwrite this method.

Parameters:
ij - Buffer index with pixels[i,j] = pixels[ij = i + j * width]
width - Buffer width.
red - Red channel buffer.
green - Green channel buffer.
blue - Blue channel buffer.

getRGB

public int getRGB(int ij,
                  int red,
                  int green,
                  int blue)
Defines the filter operation at the RGB pixel level.
Filters without border defined on each RGB pixel overwrite this method.

Parameters:
ij - Buffer index with pixels[i,j] = pixels[ij = i + j * width]
red - Red channel value.
green - Green channel value.
blue - Blue channel value.