Package gov.nih.mipav.model.algorithms
Interface ContourPlot.PixelBase
- 
- All Known Implementing Classes:
- ContourPlot.Pixel
 - Enclosing class:
- ContourPlot
 
 public static interface ContourPlot.PixelBaseBasic interface for Pixel classes ofContourPlot.ImgBaseimplementations.
 An implementation of PixelBase stores a position and works like a pointer into the data of an image. An instance of PixelBase (or any implementation of it) is NOT the pixel value of an image at a specific location and changing its position will not change that image. Instead an instance is used to iterate the pixel values of an image. Such a pixel value can be retrieved and manipulated as long as the instance points to it.- Since:
- 2.0
- Author:
- hageldave
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description doublea_asDouble()Returns the alpha value of this pixel at its current position.default java.lang.StringasString()Returns a String representation of this pixel at its current position.doubleb_asDouble()Returns the blue value of this pixel at its current position.doubleg_asDouble()Returns the green value of this pixel at its current position.intgetIndex()Returns this pixel's index.ContourPlot.ImgBase<?>getSource()Returns the underlying image of this pixel (the image referenced by this pixel)intgetX()default doublegetXnormalized()Returns the normalized x coordinate of this Pixel.intgetY()default doublegetYnormalized()Returns the normalized y coordinate of this Pixel.doubler_asDouble()Returns the red value of this pixel at its current position.ContourPlot.PixelBasesetA_fromDouble(double a)Sets the alpha value of this pixel at its current position with 0.0 as fully transparent and 1.0 as fully opaque.default ContourPlot.PixelBasesetARGB_fromDouble(double a, double r, double g, double b)Sets the alpha, red, green and blue value of this pixel.ContourPlot.PixelBasesetB_fromDouble(double b)Sets the blue value of this pixel at its current position with 0.0 as no blue contribution and 1.0 as full blue contribution.ContourPlot.PixelBasesetG_fromDouble(double g)Sets the green value of this pixel at its current position with 0.0 as no green contribution and 1.0 as full green contribution.ContourPlot.PixelBasesetIndex(int index)Sets the index of this pixel and thus its position.ContourPlot.PixelBasesetPosition(int x, int y)Sets the position of this pixel to the specified coordinates.ContourPlot.PixelBasesetR_fromDouble(double r)Sets the red value of this pixel at its current position with 0.0 as no red contribution and 1.0 as full red contribution.default ContourPlot.PixelBasesetRGB_fromDouble(double r, double g, double b)Sets the red, green and blue value of this pixel.default ContourPlot.PixelBasesetRGB_fromDouble_preserveAlpha(double r, double g, double b)Sets the red, green and blue value of this pixel.
 
- 
- 
- 
Method Detail- 
a_asDoubledouble a_asDouble() Returns the alpha value of this pixel at its current position. If the underlying image does not support alpha, 1.0 is returned.- Returns:
- alpha value of this pixel with 0.0 as fully transparent and 1.0 as fully opaque. May exceed [0,1] range depending on implementation.
- See Also:
- setA_fromDouble(double),- r_asDouble(),- g_asDouble(),- b_asDouble()
 
 - 
r_asDoubledouble r_asDouble() Returns the red value of this pixel at its current position.- Returns:
- red value of this pixel with 0.0 as no red contribution and 1.0 as full red contribution. May exceed [0,1] range depending on implementation.
- See Also:
- setR_fromDouble(double),- a_asDouble(),- g_asDouble(),- b_asDouble()
 
 - 
g_asDoubledouble g_asDouble() Returns the green value of this pixel at its current position.- Returns:
- green value of this pixel with 0.0 as no green contribution and 1.0 as full green contribution. May exceed [0,1] range depending on implementation.
- See Also:
- setG_fromDouble(double),- a_asDouble(),- r_asDouble(),- b_asDouble()
 
 - 
b_asDoubledouble b_asDouble() Returns the blue value of this pixel at its current position.- Returns:
- blue value of this pixel with 0.0 as no blue contribution and 1.0 as full blue contribution. May exceed [0,1] range depending on implementation.
- See Also:
- setB_fromDouble(double),- a_asDouble(),- r_asDouble(),- g_asDouble()
 
 - 
setA_fromDoubleContourPlot.PixelBase setA_fromDouble(double a) Sets the alpha value of this pixel at its current position with 0.0 as fully transparent and 1.0 as fully opaque. If the underlying image does not support alpha, this call imediately returns without modifying the image.- Parameters:
- a- the alpha value. May exceed [0,1] range depending on implementation.
- Returns:
- this pixel for chaining.
- See Also:
- a_asDouble(),- setR_fromDouble(double),- setG_fromDouble(double),- setB_fromDouble(double),- setARGB_fromDouble(double, double, double, double)
 
 - 
setR_fromDoubleContourPlot.PixelBase setR_fromDouble(double r) Sets the red value of this pixel at its current position with 0.0 as no red contribution and 1.0 as full red contribution.- Parameters:
- r- the red value. May exceed [0,1] range depending on implementation.
- Returns:
- this pixel for chaining.
- See Also:
- r_asDouble(),- setA_fromDouble(double),- setG_fromDouble(double),- setB_fromDouble(double),- setARGB_fromDouble(double, double, double, double)
 
 - 
setG_fromDoubleContourPlot.PixelBase setG_fromDouble(double g) Sets the green value of this pixel at its current position with 0.0 as no green contribution and 1.0 as full green contribution.- Parameters:
- g- the green value. May exceed [0,1] range depending on implementation.
- Returns:
- this pixel for chaining.
- See Also:
- g_asDouble(),- setA_fromDouble(double),- setR_fromDouble(double),- setB_fromDouble(double),- setARGB_fromDouble(double, double, double, double)
 
 - 
setB_fromDoubleContourPlot.PixelBase setB_fromDouble(double b) Sets the blue value of this pixel at its current position with 0.0 as no blue contribution and 1.0 as full blue contribution.- Parameters:
- b- the blue value. May exceed [0,1] range depending on implementation.
- Returns:
- this pixel for chaining.
- See Also:
- b_asDouble(),- setA_fromDouble(double),- setR_fromDouble(double),- setG_fromDouble(double),- setARGB_fromDouble(double, double, double, double)
 
 - 
setARGB_fromDoubledefault ContourPlot.PixelBase setARGB_fromDouble(double a, double r, double g, double b) Sets the alpha, red, green and blue value of this pixel. Assumed minimum and maximum value for each channel is 0.0 and 1.0 but values may exceed [0,1] range depending on implementation.- Parameters:
- a- alpha value (0=transparent, 1=opaque)
- r- red value
- g- green value
- b- blue value
- Returns:
- this pixel for chaining.
- See Also:
- setRGB_fromDouble_preserveAlpha(double, double, double),- setRGB_fromDouble(double, double, double)
 
 - 
setRGB_fromDoubledefault ContourPlot.PixelBase setRGB_fromDouble(double r, double g, double b) Sets the red, green and blue value of this pixel. The alpha value is set to 1.0 (opaque) if the underlying image supports alpha. Assumed minimum and maximum value for each channel is 0.0 and 1.0 but values may exceed [0,1] range depending on implementation.- Parameters:
- r- red value
- g- green value
- b- blue value
- Returns:
- this pixel for chaining.
- See Also:
- setARGB_fromDouble(double, double, double, double),- setRGB_fromDouble_preserveAlpha(double, double, double)
 
 - 
setRGB_fromDouble_preserveAlphadefault ContourPlot.PixelBase setRGB_fromDouble_preserveAlpha(double r, double g, double b) Sets the red, green and blue value of this pixel. The alpha value is preserved. Assumed minimum and maximum value for each channel is 0.0 and 1.0 but values may exceed [0,1] range depending on implementation.- Parameters:
- r- red value
- g- green value
- b- blue value
- Returns:
- this pixel for chaining.
- See Also:
- setARGB_fromDouble(double, double, double, double),- setRGB_fromDouble(double, double, double)
 
 - 
getXint getX() - Returns:
- the x coordinate of this pixel's current position
- See Also:
- getY(),- getXnormalized(),- setPosition(int, int),- getIndex(),- setIndex(int)
 
 - 
getYint getY() - Returns:
- the y coordinate of this pixel's current position
- See Also:
- getX(),- getYnormalized(),- setPosition(int, int),- getIndex(),- setIndex(int)
 
 - 
getXnormalizeddefault double getXnormalized() Returns the normalized x coordinate of this Pixel. This will return 0 for Pixels at the left boundary and 1 for Pixels at the right boundary of the Img.
 For Img's that are only 1 Pixel wide, NaN is returned.- Returns:
- normalized x coordinate within [0..1]
- See Also:
- getX(),- getYnormalized(),- setPosition(int, int),- getIndex(),- setIndex(int)
 
 - 
getYnormalizeddefault double getYnormalized() Returns the normalized y coordinate of this Pixel. This will return 0 for Pixels at the upper boundary and 1 for Pixels at the lower boundary of the Img.
 For Img's that are only 1 Pixel high, NaN is returned.- Returns:
- normalized y coordinate within [0..1]
- See Also:
- getY(),- getXnormalized(),- setPosition(int, int),- getIndex(),- setIndex(int)
 
 - 
getIndexint getIndex() Returns this pixel's index. The index relates to the pixels's position in the following way:
 index = y * width + x y = index / width x = index % width- Returns:
- index of this pixel
- See Also:
- setIndex(int),- getX(),- getY()
 
 - 
setIndexContourPlot.PixelBase setIndex(int index) Sets the index of this pixel and thus its position. The index relates to the pixels's position in the following way:
 index = y * width + x y = index / width x = index % widthIndex values outside the range [0, number of pixels] are not allowed but not necessarily enforced either. Accessing image data with an index/position outside of the underlying image's boundaries may cause an Exception.- Parameters:
- index- to set the pixel to
- Returns:
- this pixel for chaining
- See Also:
- getIndex(),- setPosition(int, int)
 
 - 
setPositionContourPlot.PixelBase setPosition(int x, int y) Sets the position of this pixel to the specified coordinates. Positions outside of the underlying images boundaries are not allowed but not necessarily enforced either. Accessing image data with a position outside of the boundaries may cause an Exception.- Parameters:
- x- coordinate (0 left most, width-1 right most)
- y- coordinate (0 top most, height-1 bottom most)
- Returns:
- this pixel for chaining
- See Also:
- getX(),- getY(),- setIndex(int)
 
 - 
getSourceContourPlot.ImgBase<?> getSource() Returns the underlying image of this pixel (the image referenced by this pixel)- Returns:
- the image this pixel belongs to
- See Also:
- ContourPlot.ImgBase
 
 - 
asStringdefault java.lang.String asString() Returns a String representation of this pixel at its current position. The returned String has the following pattern:
 Pixelclass[a:alpha r:red g:green b:blue]@(x,y)- Returns:
- string representation of this pixel at its current position
 
 
- 
 
-