picasso.model
Class Pixmap

java.lang.Object
  extended by picasso.model.Pixmap

public class Pixmap
extends java.lang.Object

Class for manipulating graphics images, originally developed in C++.

This class represents an image that supports manipulation, i.e., reflection, expansion, inversion, etc. It has an analog in C++, for comparison between the two languages, although there is more support in Java for images than there is in C++.

Creating a pixmap requires a filename that should be a gif or jpg image (or others if getImage() supports them). Currently the filename represents a local image, but changing the URL to support network retrievable images should be straightforward.

Revision history for C++ version:
Modified: 3/21/94 11/29/94 4/13/95

Ported: 10/16/1996 to Java (Syam Gadde) re-implemented, ported to 1.1 6/1/97 (Owen Astrachan)

Author:
Robert C. Duvall, Owen Astrachan, Syam Gadde

Field Summary
static java.awt.Color DEFAULT_COLOR
           
static java.lang.String DEFAULT_NAME
           
static java.awt.Dimension DEFAULT_SIZE
           
 
Constructor Summary
Pixmap()
          Create a default pixmap (300x300 black)
Pixmap(java.awt.Dimension size)
          Create a black pixmap with given size
Pixmap(int width, int height)
          Create a black pixmap with given width and height
Pixmap(int width, int height, java.awt.Color color)
          Create a pixmap with given width and height and filled with given initial color
Pixmap(Pixmap other)
          Create this image as a copy of the given image
Pixmap(java.lang.String fileName)
          Create a pixmap from the given local file
 
Method Summary
 java.awt.Color getColor(int x, int y)
           
 java.lang.String getName()
           
 java.awt.Dimension getSize()
           
 boolean isInBounds(int x, int y)
           
 void paint(java.awt.Graphics pen)
           
 void read(java.lang.String fileName)
           
 void setColor(int x, int y, java.awt.Color value)
           
 void setSize(java.awt.Dimension size)
           
 void setSize(int width, int height)
           
 void write(java.lang.String fileName)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SIZE

public static final java.awt.Dimension DEFAULT_SIZE

DEFAULT_COLOR

public static final java.awt.Color DEFAULT_COLOR

DEFAULT_NAME

public static final java.lang.String DEFAULT_NAME
See Also:
Constant Field Values
Constructor Detail

Pixmap

public Pixmap()
Create a default pixmap (300x300 black)


Pixmap

public Pixmap(java.awt.Dimension size)
Create a black pixmap with given size


Pixmap

public Pixmap(int width,
              int height)
Create a black pixmap with given width and height


Pixmap

public Pixmap(int width,
              int height,
              java.awt.Color color)
Create a pixmap with given width and height and filled with given initial color


Pixmap

public Pixmap(Pixmap other)
Create this image as a copy of the given image


Pixmap

public Pixmap(java.lang.String fileName)
Create a pixmap from the given local file

Parameters:
filename - complete pathname of local file
Method Detail

getName

public java.lang.String getName()

isInBounds

public boolean isInBounds(int x,
                          int y)

getSize

public java.awt.Dimension getSize()

getColor

public java.awt.Color getColor(int x,
                               int y)

setColor

public void setColor(int x,
                     int y,
                     java.awt.Color value)

setSize

public void setSize(java.awt.Dimension size)

setSize

public void setSize(int width,
                    int height)

read

public void read(java.lang.String fileName)

write

public void write(java.lang.String fileName)

paint

public void paint(java.awt.Graphics pen)