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 RgbAccessorcreate(ColorProcessor ip, OutOfBoundsStrategy obs, InterpolationMethod ipm) float[]getPix(double x, double y) Returns the interpolated pixel value for the specified continuous 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 integer position as afloat[]with either 1 element for scalar-valued images and or more elements (e.g., 3 for for RGB images).Returns the sourceImageProcessorassociated with thisImageAccessor.voidsetPix(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, setValMethods 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:ImageAccessorReturns the pixel value for the specified integer position as afloat[]with either 1 element for scalar-valued images and or more elements (e.g., 3 for for RGB images).- Specified by:
getPixin classImageAccessor- Parameters:
u- the x-coordinatev- the y-coordinate- Returns:
- the pixel value (
float[])
-
getPix
Description copied from class:ImageAccessorReturns the interpolated pixel value for the specified continuous 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:
getPixin classImageAccessor- Parameters:
x- the x-coordinatey- the y-coordinate- Returns:
- the interpolated pixel value (
float[])
-
setPix
Description copied from class:ImageAccessorSets 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:
setPixin classImageAccessor- Parameters:
u- the x-coordinatev- the y-coordinatevalf- the new pixel value (float[])
-
getProcessor
Description copied from class:ImageAccessorReturns the sourceImageProcessorassociated with thisImageAccessor.- Overrides:
getProcessorin classImageAccessor- Returns:
- the image processor
-