java.lang.Object
imagingbook.common.image.access.ImageAccessor
imagingbook.common.image.access.ScalarAccessor
imagingbook.common.image.access.FloatAccessor
Image accessor for scalar images with 32-bit (float) values.
- Version:
- 2022/09/22
-
Field Summary
Fields inherited from class imagingbook.common.image.access.ImageAccessor
DefaultInterpolationMethod, DefaultOutOfBoundsStrategy, defaultValue, height, indexer, interpolationMethod, ip, outOfBoundsStrategy, width -
Constructor Summary
ConstructorsConstructorDescriptionFloatAccessor(FloatProcessor ip, OutOfBoundsStrategy obs, InterpolationMethod ipm) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic FloatAccessorcreate(FloatProcessor ip, OutOfBoundsStrategy obs, InterpolationMethod ipm) floatgetVal(int u, int v) Reads and returns the scalar pixel value for the given image position.voidsetVal(int u, int v, float val) Writes a scalar pixel value to the given image position.Methods inherited from class imagingbook.common.image.access.ScalarAccessor
create, getComponentAccessor, getDepth, getPix, getPix, getVal, getVal, getVal, setPix, setValMethods inherited from class imagingbook.common.image.access.ImageAccessor
create, getHeight, getInterpolationMethod, getOutOfBoundsStrategy, getProcessor, getWidth
-
Constructor Details
-
FloatAccessor
Constructor. See also the factory methodScalarAccessor.create(ImageProcessor, OutOfBoundsStrategy, InterpolationMethod).- Parameters:
ip- an instance ofFloatProcessorobs- the out-of-bounds strategy to be used (usenullfor default settings)ipm- the interpolation method to be used (usenullfor default settings)
-
-
Method Details
-
create
public static FloatAccessor create(FloatProcessor ip, OutOfBoundsStrategy obs, InterpolationMethod ipm) -
getVal
Description copied from class:ScalarAccessorReads and returns the scalar pixel value for the given image position. The value returned for coordinates outside the image boundaries depends on theOutOfBoundsStrategyspecified for thisImageAccessor.- Specified by:
getValin classScalarAccessor- Parameters:
u- the x-coordinatev- the y-coordinate- Returns:
- the pixel value (
float)
-
setVal
Description copied from class:ScalarAccessorWrites a scalar pixel value to the given image position. An exception is thrown if u, v coordinates are outside the image.- Specified by:
setValin classScalarAccessor- Parameters:
u- the x-coordinatev- the y-coordinateval- the new pixel value (float)
-