Create  Edit  FrontPage  Index  Search  Changes  History  RSS  Login

Gdk::RGB

module Gdk::RGB

Gdk::RGB converts RGB, grayscale, and colormapped images into the native window pixel format and displays them. It takes care of colormaps, visuals, dithering, and management of the temporary buffers.

Module Functions

Gdk::RGB.colormap
Retrieves colormap set by Gdk::RGB.
Gdk::RGB.visual
Retrieves visual set by Gdk::RGB.
Gdk::RGB.draw_rgb_image(win, gc, x, y, w, h, dither, buf, rowstride)
Draws a rectangular RGB image in the Gdk::Drawable.
  • win: The Gdk::Drawable to draw in (usually a Gdk::Window).
  • gc: The Gdk::GC graphics context to control the drawing style.
  • x: The x coordinate of the top-left corner of the rectangle in the drawable.
  • y: The y coordinate of the top-left corner of the rectangle in the drawable.
  • w: The width of the rectangle to be drawn.
  • h: The height of the rectangle to be drawn.
  • dither: A GdkRgbDither value, selecting the desired dither mode.
  • buf: The 24-bit pixel data.
  • rowstride: The number of bytes from the start of one row in buf to the start of the next.
  • Returns: self
Gdk::RGB.draw_rgb_image_dithalign(win, gc, x, y w, h, dither, buf, rowstride, xdith, ydith)
Draws an RGB image in the Gdk::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.
  • win: The Gdk::Drawable to draw in (usually a Gdk::Window).
  • gc: The Gdk::GC graphics context to control the drawing style.
  • x: The x coordinate of the top-left corner of the rectangle in the drawable.
  • y: The y coordinate of the top-left corner of the rectangle in the drawable.
  • w: The width of the rectangle to be drawn.
  • h: The height of the rectangle to be drawn.
  • dither: A GdkRgbDither value, selecting the desired dither mode.
  • buf: The 24-bit pixel data.
  • rowstride: The number of bytes from the start of one row in buf to the start of the next.
  • xdith: x offset for dither alignment.
  • ydith: y offset for dither alignment.
  • Returns: self
Gdk::RGB.draw_gray_image(win, gc, x, y, w, h, dither, buf, rowstride)
Draws a grayscale image in the Gdk::Drawable.
  • win: The Gdk::Drawable to draw in (usually a Gdk::Window).
  • gc: The Gdk::GC graphics context to control the drawing style.
  • x: The x coordinate of the top-left corner of the rectangle in the drawable.
  • y: The y coordinate of the top-left corner of the rectangle in the drawable.
  • w: The width of the rectangle to be drawn.
  • h: The height of the rectangle to be drawn.
  • dither: A GdkRgbDither value, selecting the desired dither mode.
  • buf: The pixel data, represented as 8-bit gray values.
  • rowstride: The number of bytes from the start of one row in buf to the start of the next.
  • Returns: self
Gdk::RGB.draw_rgb_32_image(win, gc, x, y, w, h, dither, buf, rowstride)
Draws a padded RGB image in the Gdk::Drawable. The image is stored as one pixel per 32-bit word. It is laid out as a red byte, a green byte, a blue byte, and a padding byte.
  • win: The Gdk::Drawable to draw in (usually a Gdk::Window).
  • gc: The Gdk::GC graphics context to control the drawing style.
  • x: The x coordinate of the top-left corner of the rectangle in the drawable.
  • y: The y coordinate of the top-left corner of the rectangle in the drawable.
  • w: The width of the rectangle to be drawn.
  • h: The height of the rectangle to be drawn.
  • dither: A GdkRgbDither value, selecting the desired dither mode.
  • buf: The 32-bit pixel data.
  • rowstride: The number of bytes from the start of one row in buf to the start of the next.
  • Returns: self
Gdk::RGB.ditherable?
  • Returns: self: FIXME
Gdk::RGB.draw_indexed_image
  • Returns: self: FIXME
Gdk::RGB.find_color
  • Returns: self: FIXME
Gdk::RGB.set_install
  • Returns: self: FIXME
Gdk::RGB.set_min_colors
  • Returns: self: FIXME
Gdk::RGB.set_verbose
  • Returns: self: FIXME

ChangeLog

  • 2003-11-08: Masao - Move to Gdk::RGB from Gdk. Fix some links.
  • 2003-11-03: goddess101?
Last modified:2011/06/12 15:28:31
Keyword(s):
References:[Gdk::Window] [Gdk::Colormap] [Gdk::Visual] [Ruby/GDK] [Gdk::Screen] [api-gdk-index] [index-ruby-gdk2] [Gdk::Drawable] [Gdk::Image] [Gdk::RGB] [Gdk::RGB::Dither]