java.lang.Object
imagingbook.common.image.access.ImageAccessor
imagingbook.common.image.access.VectorAccessor
imagingbook.common.image.access.RgbAccessor
A special vector-valued image accessor for RGB images (direct subclass of
VectorAccessor
) with depth = 3
color components.- 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
ConstructorsConstructorDescriptionRgbAccessor
(ColorProcessor ip, OutOfBoundsStrategy obs, InterpolationMethod ipm) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic RgbAccessor
create
(ColorProcessor ip, OutOfBoundsStrategy obs, InterpolationMethod ipm) float[]
getPix
(double x, double y) Returns the interpolated pixel value for the specified floating-point position as afloat[]
with either 1 element for scalar-valued images and or more elements (e.g., 3 for for RGB images).float[]
getPix
(int u, int v) Returns the pixel value for the specified floating-point position as afloat[]
with either 1 element for scalar-valued images and or more elements (e.g., 3 for for RGB images).Returns the sourceImageProcessor
associated with thisImageAccessor
.void
setPix
(int u, int v, float[] valf) Sets the pixel value at the specified integer position.Methods inherited from class imagingbook.common.image.access.VectorAccessor
getComponentAccessor, getDepth, getVal, getVal, setVal
Methods inherited from class imagingbook.common.image.access.ImageAccessor
create, create, getHeight, getInterpolationMethod, getOutOfBoundsStrategy, getWidth
-
Constructor Details
-
RgbAccessor
Constructor.- Parameters:
ip
- the associated imageobs
- the out-of-bounds strategy to be usedipm
- the interpolation method to be used
-
-
Method Details
-
create
public static RgbAccessor create(ColorProcessor ip, OutOfBoundsStrategy obs, InterpolationMethod ipm) -
getPix
Description copied from class:ImageAccessor
Returns the pixel value for the specified floating-point position as afloat[]
with either 1 element for scalar-valued images and or more elements (e.g., 3 for for RGB images).- Specified by:
getPix
in classImageAccessor
- Parameters:
u
- the x-coordinatev
- the y-coordinate- Returns:
- the pixel value (
float[]
)
-
getPix
Description copied from class:ImageAccessor
Returns the interpolated pixel value for the specified floating-point position as afloat[]
with either 1 element for scalar-valued images and or more elements (e.g., 3 for for RGB images). Interpolation is used non-integer coordinates.- Specified by:
getPix
in classImageAccessor
- Parameters:
x
- the x-coordinatey
- the y-coordinate- Returns:
- the interpolated pixel value (
float[]
)
-
setPix
Description copied from class:ImageAccessor
Sets the pixel value at the specified integer position. The new value must be provided asfloat[]
with 1 element for scalar-valued images or 3 elements for RGB images.- Specified by:
setPix
in classImageAccessor
- Parameters:
u
- the x-coordinatev
- the y-coordinatevalf
- the new pixel value (float[]
)
-
getProcessor
Description copied from class:ImageAccessor
Returns the sourceImageProcessor
associated with thisImageAccessor
.- Overrides:
getProcessor
in classImageAccessor
- Returns:
- the image processor
-