|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Image
For adding or averaging images or for holding them in a format that is not provided by
java.awt.image.BufferedImage (eg, floating-point pixel values).
NB: The layout of the data is very important: bear in mind that every sub-array has an overhead of 12 bytes.
11.10.23: Changes made to reduce interdependencies:
1. void drawImage (net.grelf.grip.Imframe) becomes void drawImage (java.awt.image.BufferedImage)
2. void splitChannels (net.grelf.grip.Imframe) becomes Image [] splitChannels ()
3. displayAs3x16bitImage () has been obsolete for some time and has been removed completely.
11.11.3: Refactored as base interface for Accumulator by removing the warp/shift methods. This is a further
step towards reducing interdependencies.
Method Summary | |
---|---|
void |
add(java.awt.image.BufferedImage bim)
Add pixel values from bim into the data array. |
void |
add(java.awt.image.BufferedImage bim,
double dx,
double dy)
Add pixel values from bim into the data array, offset by vector (dx, dy). |
void |
add(java.awt.image.BufferedImage bim,
int dx,
int dy)
Add pixel values from bim into the data array, offset by vector (dx, dy). |
void |
add(Image other)
Add pixel values from the other Image into the current data array. |
void |
applyCurve(RangeInt currentRange,
java.util.List<java.awt.Point> points,
java.awt.image.BufferedImage bim)
Apply a look-up curve to transform data pixels into BufferedImage pixels. |
void |
autoCrop()
Automatically remove any rectangular margin of black (0, 0, 0) pixels from the image, thereby cropping it. |
void |
autoStretch(boolean allChannelsSame)
Stretch the contrast in the image so the full range of levels is used. |
void |
autoStretch(boolean allChannelsSame,
java.awt.Point topLeft,
java.awt.Point bottomRight)
Stretch the contrast in the image so the full range of levels is used. |
byte[][] |
autoThreshold()
Threshold automatically. |
void |
averageVertically()
Replace every pixel of every vertical line in the image by the average of the levels along the line. |
void |
averageVertically(int yMin,
int yMax)
Replace every pixel of every vertical line in the image by the average of the levels along the line, within two y coordinate limits. |
Image |
clone()
|
void |
convertToMonochrome()
Reduce the number of bands from 3 to 1, converting RGB to monochrome, using 0.325 x red + 0.5 * green + 0.175 * blue. |
void |
convertToMonochrome(double... f)
Reduce the number of bands to 1, combining channels, using sum_i (f[i]/I x px[i]), where I = sum_i (f[i]). |
void |
crop(java.awt.Point pt1,
java.awt.Point pt2)
Crop the Image by a rectangle defined by the diagonally opposite points. |
void |
divide(int n)
Divide all pixel values (in all bands) in the Image by n. |
void |
drawImage(java.awt.image.BufferedImage bim)
Convert the Image data into a BufferedImage, by drawing them into the image displayed in an ImFrame. |
void |
fit(int width,
int height)
Scale the image so it fits into the given width and height (in pixels), without changing its proportions. |
void |
flipHorizontal()
Flip the image horizontally. |
void |
flipVertical()
Flip the image vertically. |
int |
getBitsPerChannel()
Get the number of bits per channel. |
RangeInt[] |
getChannelRanges()
Find the range of values in each channel, as pairs of int values. |
RangeDouble[] |
getChannelRangesDouble()
Find the range of values in each channel, as pairs of double values. |
int |
getHeight()
Get the height, in pixels, of the Image. |
Metadata |
getMetadata()
Get metadata associated with the image. |
int |
getNBands()
Get the number of bands (channels) in the Image. |
RangeInt |
getOverallRange()
Get overall range of values across all channels, as a pair of int values |
RangeDouble |
getOverallRangeDouble()
Get overall range of values across all channels, as a pair of double values |
int[] |
getPixel(int x,
int y)
Get array of int pixel values for all bands at the given integer (x, y) position. |
double[] |
getPixelDouble(int x,
int y)
Get array of double pixel values for all bands at the given integer (x, y) position. |
double[] |
getPixelDoubleInterpolated(double x,
double y)
Get array of double pixel values for all bands at the given fractional (x, y) position. |
int[] |
getPixelInterpolated(double x,
double y)
Get array of int pixel values for all bands at the given fractional (x, y) position. |
RangeInt |
getRange()
Get the minimum and maximum values occurring across all channels, as a pair of int values. |
RangeDouble |
getRangeDouble()
Get the minimum and maximum values occurring across all channels, as a pair of double values. |
int |
getWidth()
Get the width, in pixels, of the Image. |
Image |
gnomonicProjection(int focalLength)
Project from sphere to plane. |
Image |
inverseGnomonicProjection(int focalLength)
Project from plane to sphere. |
void |
invert()
Invert the colour at every pixel in the image. |
void |
meanFilter(int halfWidth,
javax.swing.ProgressMonitor monitor)
Replace every pixel in the image by the mean value of its n x n neighbourhood, where n = 2.halfWidth + 1. |
void |
medianFilter(int halfWidth,
javax.swing.ProgressMonitor monitor)
Replace every pixel in the image by the median value of its n x n neighbourhood, where n = 2.halfWidth + 1. |
void |
multiply(double f)
Multiply all pixel values (in all bands) in the Image by factor f, truncating the result if pixels contain integer values. |
void |
nearestExtremeFilter(int halfWidth,
javax.swing.ProgressMonitor monitor)
Replace every pixel in the image by the nearest of the max and min of its n x n neighbourhood, where n = 2.halfWidth + 1. |
void |
neutraliseBackground()
Equate the histogram modes of all channels by stretching from the overall maximum value. |
void |
rankFilter(int halfWidth,
javax.swing.ProgressMonitor monitor)
Replace every pixel in the image by its rank in its n x n neighbourhood, where n = 2.halfWidth + 1. |
void |
reapplyColour(Image intensityAcc,
Image colourAcc)
For combining a monochrome intensity image with a multi-band colour information image, the 2 images having been created by ImProcess.splitIntensity (). |
Image |
rotate(double angleDegs)
Rotate the image anticlockwise by the given angle (in degrees). |
void |
save(java.lang.String filePath)
Save on disc: slower version, has to work out the range of values occurring in the Image. |
void |
save(java.lang.String filePath,
RangeDouble range)
Save on disc: faster version if the range of values occurring in the Image is already known. |
void |
save(java.lang.String filePath,
RangeInt range)
Save on disc: faster version if the range of values occurring in the Image is already known. |
void |
saveAsFITS(java.lang.String filePath)
|
Image |
scale(double factor,
boolean interpolating)
Scale the image in x and y by the given factor |
void |
scale(RangeDouble[] currentChannelRanges,
java.awt.image.BufferedImage bim)
Offset and scale all values to fit into the supplied BufferdImage. |
void |
scale(RangeDouble[] currentChannelRanges,
RangeDouble[] targetChannelRanges)
Offset and scale all values to fit in the given target ranges. |
void |
scale(RangeInt[] currentChannelRanges,
java.awt.image.BufferedImage bim)
Offset and scale all values to fit into the supplied BufferedImage. |
void |
scale(RangeInt[] currentChannelRanges,
RangeInt[] targetChannelRanges)
Offset and scale all values to fit in the given target ranges. |
void |
set(java.awt.image.BufferedImage bim)
Set pixel values from bim into the data array. |
void |
setMetadata(Metadata theData)
Associate metadata with the image. |
void |
setPixel(int x,
int y,
int[] px)
Does nothing if (x, y) is outside the image. |
void |
setPixel(int x,
int y,
int band,
int px)
Set value into a single band of a pixel without changing the other bands. |
void |
setPixelDouble(int x,
int y,
double[] px)
Does nothing if (x, y) is outside the image. |
void |
setPixelDouble(int x,
int y,
int band,
double px)
Set value into a single band of a pixel without changing the other bands. |
Image[] |
splitChannels()
Convert image to any array of monochrome images. |
void |
subtract(java.awt.image.BufferedImage bim)
Subtract pixel values of bim from the data array. |
byte[][] |
threshold(Threshold thresh)
Threshold the image to detect pixels in the range(s) specified by the given threshold. |
java.lang.String |
toString()
|
Image |
translate(int dx,
int dy)
Displace the image content by the given offset vector. |
void |
varianceFilter(int halfWidth,
javax.swing.ProgressMonitor monitor)
Replace every pixel in the image by the variance of its n x n neighbourhood, where n = 2.halfWidth + 1. |
Method Detail |
---|
void add(Image other) throws IncompatibleImageException
IncompatibleImageException
void add(java.awt.image.BufferedImage bim) throws IncompatibleImageException
IncompatibleImageException
void add(java.awt.image.BufferedImage bim, int dx, int dy) throws IncompatibleImageException
IncompatibleImageException
void add(java.awt.image.BufferedImage bim, double dx, double dy) throws IncompatibleImageException
IncompatibleImageException
void applyCurve(RangeInt currentRange, java.util.List<java.awt.Point> points, java.awt.image.BufferedImage bim) throws IncompatibleImageException
IncompatibleImageException
void autoCrop()
void autoStretch(boolean allChannelsSame)
void autoStretch(boolean allChannelsSame, java.awt.Point topLeft, java.awt.Point bottomRight)
byte[][] autoThreshold()
void averageVertically()
void averageVertically(int yMin, int yMax)
Image clone()
void convertToMonochrome()
void convertToMonochrome(double... f)
void crop(java.awt.Point pt1, java.awt.Point pt2)
void divide(int n)
void drawImage(java.awt.image.BufferedImage bim)
void fit(int width, int height)
void flipHorizontal()
void flipVertical()
int getBitsPerChannel()
RangeInt[] getChannelRanges()
RangeDouble[] getChannelRangesDouble()
int getHeight()
Metadata getMetadata()
int getNBands()
RangeInt getOverallRange()
RangeDouble getOverallRangeDouble()
int[] getPixel(int x, int y)
double[] getPixelDouble(int x, int y)
double[] getPixelDoubleInterpolated(double x, double y)
int[] getPixelInterpolated(double x, double y)
RangeInt getRange()
RangeDouble getRangeDouble()
int getWidth()
Image gnomonicProjection(int focalLength)
Image inverseGnomonicProjection(int focalLength)
void invert()
void meanFilter(int halfWidth, javax.swing.ProgressMonitor monitor)
void medianFilter(int halfWidth, javax.swing.ProgressMonitor monitor)
void multiply(double f)
void nearestExtremeFilter(int halfWidth, javax.swing.ProgressMonitor monitor)
void neutraliseBackground()
void rankFilter(int halfWidth, javax.swing.ProgressMonitor monitor)
void reapplyColour(Image intensityAcc, Image colourAcc)
Image rotate(double angleDegs)
void save(java.lang.String filePath)
void save(java.lang.String filePath, RangeInt range)
void save(java.lang.String filePath, RangeDouble range)
void saveAsFITS(java.lang.String filePath)
Image scale(double factor, boolean interpolating)
void scale(RangeInt[] currentChannelRanges, RangeInt[] targetChannelRanges)
void scale(RangeDouble[] currentChannelRanges, RangeDouble[] targetChannelRanges)
void scale(RangeInt[] currentChannelRanges, java.awt.image.BufferedImage bim) throws IncompatibleImageException
IncompatibleImageException
void scale(RangeDouble[] currentChannelRanges, java.awt.image.BufferedImage bim) throws IncompatibleImageException
IncompatibleImageException
void set(java.awt.image.BufferedImage bim) throws IncompatibleImageException
IncompatibleImageException
void setMetadata(Metadata theData)
void setPixel(int x, int y, int[] px)
void setPixel(int x, int y, int band, int px)
void setPixelDouble(int x, int y, double[] px)
void setPixelDouble(int x, int y, int band, double px)
Image[] splitChannels()
void subtract(java.awt.image.BufferedImage bim) throws IncompatibleImageException
IncompatibleImageException
byte[][] threshold(Threshold thresh)
Image translate(int dx, int dy)
java.lang.String toString()
toString
in class java.lang.Object
void varianceFilter(int halfWidth, javax.swing.ProgressMonitor monitor)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |