Maven module :un.api : api-image :
Class : un.api.image.Images
Extends/Implements : -
Subclasses : -

Convinient methods for image manipulation.
author  Johann Sorel


Variables : IMAGE_TYPE_RGB, IMAGE_TYPE_RGBA, IMAGE_TYPE_RGBA_PREMULTIPLIED
Functions : getBitsPerSample, createCustomBand, createCustomBand, create, create, copy, create, create, getFormats, getFormat, getFormatForExtension, toInputStream, toOutputStream, createReader, read, write, toChars


public int IMAGE_TYPE_RGB

public int IMAGE_TYPE_RGBA

public int IMAGE_TYPE_RGBA_PREMULTIPLIED



Returns the number of bits used for the given sample type.
param  sampleType one of ImageSampleModel.TYPE_X
return  number of bits persample
public int getBitsPerSample (int sampleType)


Create a ND image with an arbitrary number of bands.
param  extent image size, must be positive
param  nbSample number of bands/samples in the image
param  sampleType samples type.
return  Image, never null
public Image createCustomBand (Extent.Long extent, int nbSample, int sampleType)


Create a ND image with an arbitrary number of bands.
param  extent image size, must be positive
param  nbSample number of bands/samples in the image
param  sampleType samples type.
param  bufferFactory image buffer factory, can be null
return  Image, never null
public Image createCustomBand (Extent.Long extent, int nbSample, int sampleType, BufferFactory bufferFactory)

public Image create (Extent.Long extent, int imageType)

public Image create (Extent.Long extent, int imageType, BufferFactory factory)


Copy an image.
return  Image
public Image copy (Image image)


Create a new image with the same properties as given image but with a different
size.
param  image
param  dimensions
return  Image
public Image create (Image image, Extent dimensions)


Create a new image with the same properties as given image but with a different
size.
param  image
param  dimensions
return  Image
public Image create (Image image, long[] dimensions)


Lists available image formats.
return  array of ImageFormat, never null but can be empty.
public ImageFormat[] getFormats ()

public ImageFormat getFormat (Chars name)

public ImageFormat getFormatForExtension (Chars ext)

BacktrackInputStream toInputStream (Object input, boolean[] mustClose)

ByteOutputStream toOutputStream (Object output, boolean[] mustClose)


Convinient method to obtain an image reader.
The method will loop on available formats until one can decode the input.
param  input
return  ImageReader, never null
throws  IOException if not format could support the source.
public ImageReader createReader (Object input)


Convinient method to read an image source of unknowned format.
The method will loop on available formats until one can decode the source.
param  input
return  Image, never null
throws  IOException if not format could support the source.
public Image read (Object input)


Convenient method to write an image.
This method will search for the format with given name and trye to write
the image.
param  image
param  format
param  output
throws  IOException
public void write (Image image, Chars format, Object output)


Create a printable grid of the image data in bounding box.
Ensure the region isn't to large.
param  image 2D image only
param  ext printed area
return
public Chars toChars (Image image, Rectangle ext)