net.grelf.image
Class Image8

java.lang.Object
  extended by net.grelf.image.ImageBase
      extended by net.grelf.image.Image8or16Base
          extended by net.grelf.image.Image8
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Image

public class Image8
extends Image8or16Base
implements Image, java.lang.Cloneable, java.io.Serializable

For holding and processing images having 8 bits (integer) per pixel per channel, either 1 or 3 channels. Wraps a java.awt.image.BufferedImage.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.grelf.image.Image8or16Base
bim, zeroPxDouble, zeroPxInt
 
Fields inherited from class net.grelf.image.ImageBase
metadata
 
Constructor Summary
Image8(java.awt.image.BufferedImage bim)
          Use the BufferedImage to set the width, height and number of bands (channels) in this Image.
Image8(int width, int height, int nBands)
          Creates image without setting any pixels.
Image8(int width, int height, int nBands, boolean fillWithZeroes, boolean compatibleWithDisplay)
          Creates image with pixels optionally set to zero.
 
Method Summary
 void add(Image other)
          Add pixel values from the other Image into the current data array.
 Image clone()
          Returns a new Image8 object with the same data.
 Image16 convertToImage16()
           
 Image32 convertToImage32()
           
 Image64 convertToImage64()
           
 Image8 convertToImage8()
          Simply returns this (not a clone).
static java.awt.GraphicsConfiguration getGraphicsConfiguration()
          Get a reference to the GraphicsConfiguration object, which is the default one for the display system.
 Image gnomonicProjection(int focalLength_mm, double detectorWidth_mm, double detectorHeight_mm)
          Project from sphere to plane.
 Image inverseGnomonicProjection(int focalLength_mm, double detectorWidth_mm, double detectorHeight_mm)
          Project from plane to sphere.
 boolean isRaw()
          Whether the image data are still in RAW format, as from a DSLR camera.
 Image[] splitChannels()
          Convert image to an array of monochrome images.
 
Methods inherited from class net.grelf.image.Image8or16Base
add, addProportion, addTranslated, addTranslated, applyCurve, autoCrop, autoStretch, autoStretch, autoThreshold, averageVertically, averageVertically, blurGaussian, checkCompatibility, convertToMonochrome, convertToMonochrome, convolve, convolve, correctBackground, crop, deconvolve, dispose, divide, divideByFlatField, drawRim, fit, flipHorizontal, flipVertical, getBitsPerChannel, getBitsPerChannel, getBufferedImage, getChannelRanges, getChannelRangesDouble, getHeight, getImageTypeAsString, getImageTypeAsString, getMaxLevel, getMaxLevel, getMetadata, getNBands, getNBands, getPixel, getPixelDouble, getPixelDoubleInterpolated, getPixelInterpolated, getRange, getRangeByRescanning, getRangeByRescanningDouble, getRangeDouble, getWidth, gnomonicProjection, inverseGnomonicProjection, invert, meanFilter, medianFilter, multiply, multiply, multiply, nearestExtremeFilter, neutraliseBackground, rankFilter, reapplyColour, rotate, save, save, save, saveAsFITS, scale, scaleDownForDisplay, set, setBufferedImage, setMetadata, setPixel, setPixel, setPixelDouble, setPixelDouble, showInfo, subtract, subtractToZero, threshold, toFoldedString, translate, translate, varianceFilter
 
Methods inherited from class net.grelf.image.ImageBase
createImage, createImage, getCalibration, getFilePath, recombine, sameBitsAndBands, sameSizeBitsAndBands, setCalibration, setFilePath, showInfo
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.grelf.image.Image
add, addProportion, addTranslated, addTranslated, applyCurve, autoCrop, autoStretch, autoStretch, autoThreshold, averageVertically, averageVertically, blurGaussian, convertToMonochrome, convertToMonochrome, convolve, convolve, correctBackground, crop, deconvolve, dispose, divide, divideByFlatField, drawRim, fit, flipHorizontal, flipVertical, getBitsPerChannel, getCalibration, getChannelRanges, getChannelRangesDouble, getFilePath, getHeight, getImageTypeAsString, getMetadata, getNBands, getPixel, getPixelDouble, getPixelDoubleInterpolated, getPixelInterpolated, getRange, getRangeByRescanning, getRangeByRescanningDouble, getRangeDouble, getWidth, invert, meanFilter, medianFilter, multiply, multiply, multiply, nearestExtremeFilter, neutraliseBackground, rankFilter, reapplyColour, rotate, save, save, save, saveAsFITS, scale, scaleDownForDisplay, set, setCalibration, setFilePath, setMetadata, setPixel, setPixel, setPixelDouble, setPixelDouble, showInfo, subtract, subtractToZero, threshold, toFoldedString, toString, translate, translate, varianceFilter
 

Constructor Detail

Image8

public Image8(int width,
              int height,
              int nBands)
Creates image without setting any pixels.


Image8

public Image8(int width,
              int height,
              int nBands,
              boolean fillWithZeroes,
              boolean compatibleWithDisplay)
Creates image with pixels optionally set to zero.


Image8

public Image8(java.awt.image.BufferedImage bim)
       throws IncompatibleImageException
Use the BufferedImage to set the width, height and number of bands (channels) in this Image. Populate the pixel values in the image data array from the BufferedImage also.

Throws:
IncompatibleImageException
Method Detail

getGraphicsConfiguration

public static java.awt.GraphicsConfiguration getGraphicsConfiguration()
Get a reference to the GraphicsConfiguration object, which is the default one for the display system.


add

public void add(Image other)
         throws IncompatibleImageException
Description copied from interface: Image
Add pixel values from the other Image into the current data array. If other is larger than the data then the rectangle starting at the top left corner of other which overlaps the data will be used.

Specified by:
add in interface Image
Throws:
IncompatibleImageException

clone

public Image clone()
Returns a new Image8 object with the same data.

Specified by:
clone in interface Image
Specified by:
clone in class Image8or16Base

convertToImage8

public Image8 convertToImage8()
Simply returns this (not a clone).

Specified by:
convertToImage8 in interface Image

convertToImage16

public Image16 convertToImage16()
Specified by:
convertToImage16 in interface Image

convertToImage32

public Image32 convertToImage32()
Specified by:
convertToImage32 in interface Image

convertToImage64

public Image64 convertToImage64()
Specified by:
convertToImage64 in interface Image

gnomonicProjection

public Image gnomonicProjection(int focalLength_mm,
                                double detectorWidth_mm,
                                double detectorHeight_mm)
Description copied from interface: Image
Project from sphere to plane.

Specified by:
gnomonicProjection in interface Image

inverseGnomonicProjection

public Image inverseGnomonicProjection(int focalLength_mm,
                                       double detectorWidth_mm,
                                       double detectorHeight_mm)
Description copied from interface: Image
Project from plane to sphere.

Specified by:
inverseGnomonicProjection in interface Image

isRaw

public boolean isRaw()
Description copied from interface: Image
Whether the image data are still in RAW format, as from a DSLR camera. Only an Image16 is likely to return true for this.

Specified by:
isRaw in interface Image

splitChannels

public Image[] splitChannels()
Description copied from interface: Image
Convert image to an array of monochrome images.

Specified by:
splitChannels in interface Image