
gnu.x11.image.XPM Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of escher Show documentation
Show all versions of escher Show documentation
Escher is a collection of libraries for X Window System written purely in Java.
The newest version!
package gnu.x11.image;
import gnu.x11.Color;
import gnu.x11.Colormap;
import gnu.x11.Display;
import java.util.StringTokenizer;
public class XPM extends ZPixmap { // TODO
public XPM (Display display, String [] xpm) {
super (display);
StringTokenizer values = new StringTokenizer (xpm [0]);
width = Integer.parseInt (values.nextToken ());
height = Integer.parseInt (values.nextToken ());
int num_colors = Integer.parseInt (values.nextToken ());
int chars_per_pixel = Integer.parseInt (values.nextToken ());
// TODO how to select best SUITABLE format?
format = Format.ZPIXMAP;
pixmap_format = display.default_pixmap_format;
image_byte_order = display.image_byte_order;
pixel_byte_count = pixmap_format.bits_per_pixel () / 8;
init ();
java.util.Hashtable mapping = new java.util.Hashtable (2*num_colors);
Colormap cmap = display.default_colormap;
for (int i=0; i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy