Details
|
Initializes GdkRgb statically. It may be called more than once with no ill effects. It must, however, be called before any other GdkRgb operations are performed.
The GdkRgb "context" is allocated statically. Thus, GdkRgb may be used to drive only one visual in any given application. GdkRgb automatically selects a best visual and sets its own colormap, if necessary. gdk_rgb_get_visual() and gdk_rgb_get_cmap() retrieve the chosen visual and colormap, respectively.
|
Draws an RGB image in the drawable. This is the core GdkRgb function, and likely the only one you will need to use other than the initialization stuff.
The rowstride parameter allows for lines to be aligned more flexibly. For example, lines may be allocated to begin on 32-bit boundaries, even if the width of the rectangle is odd. Rowstride is also useful when drawing a subrectangle of a larger image in memory. Finally, to replicate the same line a number of times, the trick of setting rowstride to 0 is allowed.
In general, for 0 <= i < width and 0 <= j < height, the pixel (x + i, y + j) is colored with red value rgb_buf[j * rowstride + i * 3], green value rgb_buf[j * rowstride + i * 3 + 1], and blue value rgb_buf[j * rowstride + i * 3 + 2].
drawable : The GdkDrawable to draw in (usually a GdkWindow).
gc : The graphics context (all Gdk drawing operations require one; its contents are ignored).
x : The x coordinate of the top-left corner in the drawable.
y : The y coordinate of the top-left corner in the drawable.
width : The width of the rectangle to be drawn.
height : The height of the rectangle to be drawn.
dith : A GdkRgbDither value, selecting the desired dither mode.
rgb_buf : The pixel data, represented as packed 24-bit data.
rowstride : The number of bytes from the start of one row in rgb_buf to the start of the next.
|
Draws an RGB image in the drawable, with an adjustment for dither alignment.
This function is useful when drawing dithered images into a window that may be scrolled. Pixel (x, y) will be drawn dithered as if its actual location is (x + xdith, y + ydith). Thus, if you draw an image into a window using zero dither alignment, then scroll up one pixel, subsequent draws to the window should have ydith = 1.
Setting the dither alignment correctly allows updating of small parts of the screen while avoiding visible "seams" between the different dither textures.
drawable : The GdkDrawable to draw in (usually a GdkWindow).
gc : The graphics context.
x : The x coordinate of the top-left corner in the drawable.
y : The y coordinate of the top-left corner in the drawable.
width : The width of the rectangle to be drawn.
height : The height of the rectangle to be drawn.
dith : A GdkRgbDither value, selecting the desired dither mode.
rgb_buf : The pixel data, represented as packed 24-bit data.
rowstride : The number of bytes from the start of one row in rgb_buf to the start of the next.
xdith : An x offset for dither alignment.
ydith : A y offset for dither alignment.
|
Draws an indexed image in the drawable, using a GdkRgbCmap to assign actual colors to the color indices.
drawable : The GdkDrawable to draw in (usually a GdkWindow).
gc : The graphics context.
x : The x coordinate of the top-left corner in the drawable.
y : The y coordinate of the top-left corner in the drawable.
width : The width of the rectangle to be drawn.
height : The height of the rectangle to be drawn.
dith : A GdkRgbDither value, selecting the desired dither mode.