gnu.x11.image
Class ZPixmap

java.lang.Object
  extended by gnu.x11.image.Image
      extended by gnu.x11.image.ZPixmap
Direct Known Subclasses:
PPM, XPM

public class ZPixmap
extends Image


Nested Class Summary
 
Nested classes/interfaces inherited from class gnu.x11.image.Image
Image.Format
 
Field Summary
 
Fields inherited from class gnu.x11.image.Image
LEAST_SIGNIFICANT, LSB_FIRST, MOST_SIGNIFICANT, MSB_FIRST
 
Constructor Summary
ZPixmap(Display display, int width, int height)
          Creates a new ZPixmap with the specified width and height and with the default pixmap format from the display.
ZPixmap(Display display, int width, int height, Pixmap.Format format)
           
ZPixmap(Display display, int width, int height, Pixmap.Format format, byte[] data)
          Creates a ZPixmap with the specified size and format, and initializes the underlying data array with an existing one.
 
Method Summary
 int get_blue(int x, int y)
           
 byte get_data_element(int index)
          Returns the data element at the specified index.
 int get_data_length()
          Returns the length of the underlying data array.
 int get_green(int x, int y)
           
 int get_red(int x, int y)
           
 void set_blue(int x, int y, int b)
           
 void set_data_element(int index, byte val)
          Sets a data element in the ZPixmap directly.
 void set_data(int[] image_data)
          Puts the image data into this image.
 void set_green(int x, int y, int g)
           
 void set_red(int x, int y, int r)
           
 void set(int x, int y, Color color)
           
 void set(int x, int y, int pixel)
           
 void set(int x, int y, int r, int g, int b)
           
 
Methods inherited from class gnu.x11.image.Image
get_data, get_format, get_height, get_left_pad, get_line_byte_count, get_pixmap_format, get_width
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZPixmap

public ZPixmap(Display display,
               int width,
               int height)
Creates a new ZPixmap with the specified width and height and with the default pixmap format from the display.

Parameters:
display - the display on which to create the pixmap
width - the width in pixels
height - the height in pixels

ZPixmap

public ZPixmap(Display display,
               int width,
               int height,
               Pixmap.Format format)

ZPixmap

public ZPixmap(Display display,
               int width,
               int height,
               Pixmap.Format format,
               byte[] data)
Creates a ZPixmap with the specified size and format, and initializes the underlying data array with an existing one.

Parameters:
display - the
width -
height -
format -
data -
Method Detail

set

public void set(int x,
                int y,
                Color color)

set

public void set(int x,
                int y,
                int pixel)

set_red

public void set_red(int x,
                    int y,
                    int r)

get_red

public int get_red(int x,
                   int y)

set_green

public void set_green(int x,
                      int y,
                      int g)

get_green

public int get_green(int x,
                     int y)

set_blue

public void set_blue(int x,
                     int y,
                     int b)

get_blue

public int get_blue(int x,
                    int y)

set

public void set(int x,
                int y,
                int r,
                int g,
                int b)

set_data

public void set_data(int[] image_data)
Puts the image data into this image. This data must be in the same format as specified in this image.

Parameters:
image_data - the data to set

set_data_element

public void set_data_element(int index,
                             byte val)
Sets a data element in the ZPixmap directly. This manipulates the underlying data directly. It is recommended to use one of the other accessor methods instead.

Parameters:
index - the index of the data element to set
val - the value

get_data_element

public byte get_data_element(int index)
Returns the data element at the specified index. This manipulates the underlying data directly. It is recommended to use one of the other accessor methods instead.

Parameters:
index - the index of the data element
Returns:
the data element at the specified index

get_data_length

public int get_data_length()
Returns the length of the underlying data array.

Returns:
the length of the underlying data array