|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gnu.x11.Resource gnu.x11.Colormap
public class Colormap
X colormap.
Nested Class Summary | |
---|---|
static class |
Colormap.ColorCellsReply
Reply of alloc_color_cells(boolean, int, int) . |
static class |
Colormap.ColorItem
Used in Colormap#store_colors() . |
class |
Colormap.ColorPlaneReply
Reply for alloc_planes(boolean, int, int, int, int) . |
Field Summary | |
---|---|
static int |
ALL
|
static Colormap |
COPY_FROM_PARENT
Predefined colormap. |
static int |
NONE
|
Fields inherited from class gnu.x11.Resource |
---|
display, id |
Constructor Summary | |
---|---|
Colormap(Display display)
Create. |
|
Colormap(Display display,
int id)
Intern. |
|
Colormap(int id)
Predefined. |
|
Colormap(Window window,
int visual_id,
int alloc)
Creates a colormap of the specified visual type for the screen on which the window resides. |
Method Summary | |
---|---|
Colormap.ColorCellsReply |
alloc_color_cells(boolean contiguous,
int color_count,
int plane_count)
|
Color |
alloc_color(int red,
int green,
int blue)
Allocates a read-only colormap entry corresponding to the closest RGB values provided by the hardware. |
Color |
alloc_color(RGB rgb)
|
Color |
alloc_color8(int red8,
int green8,
int blue8)
|
Color |
alloc_named_color(java.lang.String name)
Looks up the named color with respect to the screen associated with the colormap. |
Colormap.ColorPlaneReply |
alloc_planes(boolean contiguous,
int color_count,
int red_count,
int green_count,
int blue_count)
|
Color |
alloc_random_color(java.util.Random random)
|
Color |
alloc_random_rainbow_color(java.util.Random random)
|
RGB[] |
colors(int[] pixels)
Returns the hardware specific color values stored in this colormap for the specified pixels. |
Colormap |
copy_and_free(int new_id)
|
void |
free_colors(int[] pixels,
int plane_mask)
|
void |
free()
|
void |
install()
|
static java.lang.Object |
intern(Display display,
int id)
|
Color |
lookup_color(java.lang.String name)
Looks up the name of a color with respect to the screen associated with this colormap, and returns both the exact color values and the closest values provided by the hardware with respect to the visual type of this colormap. |
void |
store_colors(Colormap.ColorItem[] items)
|
void |
store_named_color(int pixel,
java.lang.String name,
boolean do_reds,
boolean do_greens,
boolean do_blues)
|
void |
uninstall()
|
Methods inherited from class gnu.x11.Resource |
---|
id, unintern |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Colormap COPY_FROM_PARENT
Window.NONE
public static final int NONE
public static final int ALL
Constructor Detail |
---|
public Colormap(int id)
public Colormap(Display display)
public Colormap(Display display, int id)
public Colormap(Window window, int visual_id, int alloc)
alloc
must be specified
as NONE
(or a Match error results). For the other classes,
if alloc is NONE
the colormap initially has no allocated
entries, and clients can allocate entries. If alloc is ALL
,
then the entire colormap is allocated writable. The initial values of all
allocated entries are undefined. For GrayScale and PseudoColor, the effect
is as if an AllocColorCells request returned all pixel values from zero to
N − 1, where N is the colormap-entries value in the specified visual.
For DirectColor, the effect is as if an AllocColorPlanes request returned
a pixel value of zero and red-mask, green-mask, and blue-mask values
containing the same bits as the corresponding masks in the specified
visual. However, in all cases, none of these entries can be freed with
FreeColors.
window
- the window for which the colormap is allocatedvisual
- the visual typealloc
- one of NONE
, ALL
, see above for explanationMethod Detail |
---|
public void free()
public Colormap copy_and_free(int new_id)
public void install()
public void uninstall()
public static java.lang.Object intern(Display display, int id)
public Color alloc_color(int red, int green, int blue)
Color.pixel
and
the RGB value as Color.exact
.
red
- the red componentgreen
- the green componentblue
- the blue component
public Color alloc_named_color(java.lang.String name)
name
- the name of the color
public Colormap.ColorCellsReply alloc_color_cells(boolean contiguous, int color_count, int plane_count)
public Colormap.ColorPlaneReply alloc_planes(boolean contiguous, int color_count, int red_count, int green_count, int blue_count)
public void free_colors(int[] pixels, int plane_mask)
public void store_colors(Colormap.ColorItem[] items)
public void store_named_color(int pixel, java.lang.String name, boolean do_reds, boolean do_greens, boolean do_blues)
public RGB[] colors(int[] pixels)
pixels
- the pixels for which to return the color values
public Color lookup_color(java.lang.String name)
name
- the color name to lookup
public Color alloc_color(RGB rgb)
alloc_color(int, int, int)
public Color alloc_color8(int red8, int green8, int blue8)
alloc_color(RGB)
public Color alloc_random_color(java.util.Random random)
alloc_color(int, int, int)
public Color alloc_random_rainbow_color(java.util.Random random)
alloc_color(int, int, int)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |