|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpicasso.model.Pixmap
public class Pixmap
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)
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 |
---|
public static final java.awt.Dimension DEFAULT_SIZE
public static final java.awt.Color DEFAULT_COLOR
public static final java.lang.String DEFAULT_NAME
Constructor Detail |
---|
public Pixmap()
public Pixmap(java.awt.Dimension size)
public Pixmap(int width, int height)
public Pixmap(int width, int height, java.awt.Color color)
public Pixmap(Pixmap other)
public Pixmap(java.lang.String fileName)
filename
- complete pathname of local fileMethod Detail |
---|
public java.lang.String getName()
public boolean isInBounds(int x, int y)
public java.awt.Dimension getSize()
public java.awt.Color getColor(int x, int y)
public void setColor(int x, int y, java.awt.Color value)
public void setSize(java.awt.Dimension size)
public void setSize(int width, int height)
public void read(java.lang.String fileName)
public void write(java.lang.String fileName)
public void paint(java.awt.Graphics pen)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |