java.lang.Object
imagingbook.common.filter.generic.GenericFilter
imagingbook.common.filter.generic.GenericFilterScalar
imagingbook.common.filter.linear.LinearFilter
- All Implemented Interfaces:
ProgressReporter
- Direct Known Subclasses:
GaussianFilter
This class represents a 2D linear filter specified by an arbitrary 2D convolution kernel. It is based on
GenericFilter
and GenericFilterScalar
, which take care of all data copying and filter mechanics.
Since it is a "scalar" filter, pixel values are treated as scalars. If the processed image has more than one
component (e.g., a RGB color image), this filter is automatically and independently applied to all (scalar-valued)
components. To apply to an image, use the GenericFilter.applyTo(ij.process.ImageProcessor)
method, for example.-
Constructor Summary
ConstructorsConstructorDescriptionLinearFilter
(Kernel2D kernel) Constructor, only the 2D filter kernel needs to be specified. -
Method Summary
Modifier and TypeMethodDescriptionprotected float
doPixel
(PixelPack.PixelSlice plane, int u, int v) This method defines the steps to be performed for a single image pixel and must be implemented by any concrete sub-class.Methods inherited from class imagingbook.common.filter.generic.GenericFilterScalar
reportProgress, runPass
Methods inherited from class imagingbook.common.filter.generic.GenericFilter
abort, applyTo, applyTo, applyTo, closeFilter, getDepth, getHeight, getPass, getProgress, getWidth, initFilter, initPass, passesRequired, reportProgress
-
Constructor Details
-
LinearFilter
Constructor, only the 2D filter kernel needs to be specified.- Parameters:
kernel
- the 2D filter kernel
-
-
Method Details
-
doPixel
Description copied from class:GenericFilterScalar
This method defines the steps to be performed for a single image pixel and must be implemented by any concrete sub-class. The source data are passed as aPixelPack.PixelSlice
container, which holds the scalar values of one image component. The methodPixelPack.PixelSlice.getVal(int, int)
should be used to read individual pixel values. These data should not be modified but the (float) result of the single-pixel calculation must be returned.- Specified by:
doPixel
in classGenericFilterScalar
- Parameters:
plane
- the scalar-valued data for a single image componentu
- the current x-positionv
- the current y-position- Returns:
- the result of the filter calculation for this pixel
-