fr.umlv.lovmi.image.mapped
Class AbstractMappedImage

java.lang.Object
  extended by fr.umlv.lovmi.image.AbstractImage
      extended by fr.umlv.lovmi.image.mapped.AbstractMappedImage
All Implemented Interfaces:
Image
Direct Known Subclasses:
ImageBil, ImageBip, ImageBsq, ImageSBsq

public abstract class AbstractMappedImage
extends AbstractImage

Cette classe abstraite, permet de créer des images mappés en mémoire. En effet, cette méthode permet de ne pas charger en mémoire toute l'image. Elle est utilisée lors de la création ou l'ouverture d'image de grande taille.

Author:
Goulamhoussen Feriel

Field Summary
protected  java.nio.MappedByteBuffer[] buffer
           
protected static byte[] darkpixel
           
protected  java.nio.channels.FileChannel[] tmp_channel
           
protected  byte[] tmp_pixel
           
 
Fields inherited from class fr.umlv.lovmi.image.AbstractImage
height, loadingState, MAXSIZEOFHISTO, numberOfChannels, type, width
 
Constructor Summary
AbstractMappedImage()
           
 
Method Summary
protected  void close()
          Ferme l'image
protected  void empty(int height, int width, fr.umlv.lovmi.types.ImageType type, int numberOfChannels)
          Crée une image vide en lecture-écriture
protected  void open(java.lang.String[] fileName, int height, int width, fr.umlv.lovmi.types.ImageType type, int numberOfChannels)
          Ouvre une image en lecture seule
 
Methods inherited from class fr.umlv.lovmi.image.AbstractImage
applyFilter, applyFilter, getDisplayableImage, getHeight, getHistogram, getHistogram, getImageType, getLoadinState, getNumberOfChannels, getResizedImage, getWidth
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface fr.umlv.lovmi.image.Image
getPixelValue, save, setPixelValue
 

Field Detail

buffer

protected java.nio.MappedByteBuffer[] buffer

tmp_channel

protected java.nio.channels.FileChannel[] tmp_channel

tmp_pixel

protected byte[] tmp_pixel

darkpixel

protected static final byte[] darkpixel
Constructor Detail

AbstractMappedImage

public AbstractMappedImage()
Method Detail

empty

protected void empty(int height,
                     int width,
                     fr.umlv.lovmi.types.ImageType type,
                     int numberOfChannels)
              throws java.io.IOException
Crée une image vide en lecture-écriture

Parameters:
height - Nombre de lignes
width - Nombre de colones
type - Type de l'image que l'on veut créer
numberOfChannels - Nombre de canaux de l'image
Throws:
java.io.IOException - Cette exception est remontée si une erreur est survenue lors de la création de ce fichier

open

protected void open(java.lang.String[] fileName,
                    int height,
                    int width,
                    fr.umlv.lovmi.types.ImageType type,
                    int numberOfChannels)
             throws java.io.IOException
Ouvre une image en lecture seule

Parameters:
fileName - Nom des fichiers
height - Nombre de lignes
width - Nombre de colones
type - Type de l'image à ouvrir
numberOfChannels - Nombre de canaux
Throws:
java.io.IOException - Cette exception est remontée si une erreur lors de l'ouverture s'est produite

close

protected void close()
Ferme l'image