draw.sources.formats
Class Draw

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

public class Draw
extends Image

Image DRAW.
La structure d'un fichier *.draw est très simple.
Ce format est pris en compte par le cadre de l'application.
C'est le format par défaut. Le fichier se décompose en 7 parties.
2 couches suffisent à définir ces parties.
Types utilisées :

  • CHAR (8 bits)
  • DATE (24 bits)
  • INT (32 bits)
  • COLOR (24 bits)


  • Couche DRAWHEADER
    drawName : Nom du format (CHAR[])
    drawAuthor : Nom de l'auteur (CHAR[])
    drawDate : Date de création du type jjmmaa [010100;311299] (DATE)
    drawWidth : Largeur de l'image (INT)
    drawHeight : Hauteur de l'image (INT)
    drawSize : Taille de l'image en octet (INT)
    Couche DRAWIMAGE
    drawPixels : Pixels de l'image en RGB (COLOR[][])

    Version:
    1.0.0
    Author:
    COLIN Mathieu

    Field Summary
    static java.lang.String drawAuthor
              COLIN Mathieu.
    private  int drawDate
              Date de création de l'image.
    private  int drawHeight
              Hauteur de l'image.
    static java.lang.String drawName
              DRAW.
    private  java.awt.Color[][] drawPixels
              Tableau 2D des pixels en couleur.
    private  int drawSize
              Taille de l'image en octet.
    private  int drawWidth
              Largeur de l'image.
     
    Constructor Summary
    Draw()
              Crée une image DRAW.
    Draw(Cadre cadre)
              Crée une image DRAW.
     
    Method Summary
     int computeSize()
              Calcule la taille de l'image en octet.
     Draw convert()
              Aucune convertion.
     int getDrawDate()
              Retourne drawDate.
     java.awt.Color getDrawPixel(int x, int y)
              Retourne un pixel de drawPixels.
     int getDrawSize()
              Retourne drawSize.
     int getHeight()
              Retourne drawHeight.
     java.lang.String getName()
              Retourne drawName.
     int getWidth()
              Retourne drawWidth.
     void read(java.lang.String fichier)
              Lit un fichier DRAW.
     void setDrawPixels(java.awt.Color[][] pixels)
              Modifie drawPixels.
     int setHeight(int height)
              Modifie drawHeight.
     int setWidth(int width)
              Modifie drawWidth.
     void write(java.lang.String fichier)
              Ecrit un fichier DRAW.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    drawName

    public static final java.lang.String drawName
    DRAW.

    See Also:
    Constant Field Values

    drawAuthor

    public static final java.lang.String drawAuthor
    COLIN Mathieu.

    See Also:
    Constant Field Values

    drawDate

    private int drawDate
    Date de création de l'image.


    drawWidth

    private int drawWidth
    Largeur de l'image.


    drawHeight

    private int drawHeight
    Hauteur de l'image.


    drawSize

    private int drawSize
    Taille de l'image en octet.


    drawPixels

    private java.awt.Color[][] drawPixels
    Tableau 2D des pixels en couleur.

    Constructor Detail

    Draw

    public Draw(Cadre cadre)
    Crée une image DRAW.

    Parameters:
    cadre - Cadre.

    Draw

    public Draw()
    Crée une image DRAW.

    Method Detail

    computeSize

    public int computeSize()
    Calcule la taille de l'image en octet.

    Returns:
    Taille en octet.

    read

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

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

    write

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

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

    convert

    public Draw convert()
    Aucune convertion.

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

    getName

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

    Specified by:
    getName in class Image
    Returns:
    drawName.

    getDrawDate

    public int getDrawDate()
    Retourne drawDate.

    Returns:
    drawDate.

    getWidth

    public int getWidth()
    Retourne drawWidth.

    Specified by:
    getWidth in class Image
    Returns:
    drawWidth.

    setWidth

    public int setWidth(int width)
    Modifie drawWidth.

    Parameters:
    width - Largeur.

    setHeight

    public int setHeight(int height)
    Modifie drawHeight.

    Parameters:
    height - Hauteur.

    getHeight

    public int getHeight()
    Retourne drawHeight.

    Specified by:
    getHeight in class Image
    Returns:
    drawHeight.

    getDrawSize

    public int getDrawSize()
    Retourne drawSize.

    Returns:
    drawDate.

    getDrawPixel

    public java.awt.Color getDrawPixel(int x,
                                       int y)
    Retourne un pixel de drawPixels.

    Parameters:
    x - Abscisse.
    y - Ordonnée.
    Returns:
    Couleur.

    setDrawPixels

    public void setDrawPixels(java.awt.Color[][] pixels)
    Modifie drawPixels.

    Parameters:
    pixels - Nouveau pixels.