draw.sources.formats
Class Pgm

java.lang.Object
  extended by draw.sources.formats.Image
      extended by draw.sources.formats.Pgm

public class Pgm
extends Image

Image PGM.
Le fichier se décomposent en 6 parties.
2 couches suffisent à définir ces parties.
Types utilisées :

  • CHAR (8 bits)
  • INT (32 bits)


  • Couche PGMHEADER
    pgmName : Nom du format (CHAR[])
    pgmComments : Commentaires (CHAR[][])
    pgmWidth : Largeur de l'image (CHAR[])
    pgmHeight : Hauteur de l'image (CHAR[])
    pgmGrey : Couleur entre noir et blanc (CHAR[])
    Couche PGMIMAGE
    pgmPixels : Pixels de l'image en RGB avec R = G = B (CHAR[][])

    Version:
    1.0.0
    Author:
    COLIN Mathieu

    Field Summary
    static java.lang.String[] pgmComments
              Commentaires.
    static int pgmGrey
              Couleur entre noir et blanc.
    private  int pgmHeight
              Hauteur de l'image.
    static java.lang.String pgmName
              Nom du format.
    private  int[][] pgmPixels
              Pixels de l'image en RGB avec R = G = B.
    private  int pgmWidth
              Largeur de l'image.
    private  java.awt.Color[][] pixels
              Optimisation.
     
    Constructor Summary
    Pgm()
              Crée une image PGM.
    Pgm(Cadre cadre)
              Crée une image PGM.
     
    Method Summary
     Draw convert()
              Convertit l'image en une image DRAW.
     int getHeight()
              Retourne pgmHeight.
     java.lang.String getName()
              Retourne pgmName.
     int getWidth()
              Retourne pgmWidth.
     void read(java.lang.String fichier)
              Lit un fichier PGM.
     void write(java.lang.String fichier)
              Ecrit un fichier PGM.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    pgmName

    public static final java.lang.String pgmName
    Nom du format.

    See Also:
    Constant Field Values

    pgmComments

    public static final java.lang.String[] pgmComments
    Commentaires.


    pgmWidth

    private int pgmWidth
    Largeur de l'image.


    pgmHeight

    private int pgmHeight
    Hauteur de l'image.


    pgmGrey

    public static final int pgmGrey
    Couleur entre noir et blanc.

    See Also:
    Constant Field Values

    pgmPixels

    private int[][] pgmPixels
    Pixels de l'image en RGB avec R = G = B.


    pixels

    private java.awt.Color[][] pixels
    Optimisation.

    Constructor Detail

    Pgm

    public Pgm(Cadre cadre)
    Crée une image PGM.

    Parameters:
    cadre - Cadre.

    Pgm

    public Pgm()
    Crée une image PGM.

    Method Detail

    getName

    public java.lang.String getName()
    Retourne pgmName.

    Specified by:
    getName in class Image
    Returns:
    pgmName.

    getWidth

    public int getWidth()
    Retourne pgmWidth.

    Specified by:
    getWidth in class Image
    Returns:
    pgmWidth.

    getHeight

    public int getHeight()
    Retourne pgmHeight.

    Specified by:
    getHeight in class Image
    Returns:
    pgmHeight.

    read

    public void read(java.lang.String fichier)
    Lit un fichier PGM.

    Specified by:
    read in class Image
    Parameters:
    fichier - Nom du fichier.

    write

    public void write(java.lang.String fichier)
    Ecrit un fichier PGM.

    Specified by:
    write in class Image
    Parameters:
    fichier - Nom du fichier.

    convert

    public Draw convert()
    Convertit l'image en une image DRAW.

    Specified by:
    convert in class Image
    Returns:
    Image DRAW.