Common Graphics image support
An image is a two-dimensional array of pixels, with an associated palette defining the pixel values to color mapping. An icon is a small image augmented with tranparency information. Modern graphical user interfaces require not only the ability to draw lines, rectangles, arcs, and text, but also to display images and icons. The support for this in Xlib, on which the core Common Graphics classes are based, is minimal, providing only a low-level mechanism (XImage) for transferring image data between the application and drawables. Xlib's color mechanism (Colormap) is also very low level. The XImage and Colormap mechanisms place a heavy burden on the application, leaving it responsible for parsing image file formats, allocating the image's palette of colors one color at a time, remapping the image data to use the allocated pixel values for the colors, transferring the remapped data to a window or a pixmap whenever the image needs to be redrawn, and freeing color resources when the image is no longer required.
Common Graphics Image Support provides higher level abstractions for handling images, icons, colors, and palettes of colors. In keeping with the design philosophy of VA Smalltalk, these abstractions are implemented using the highest level capabilities applicable on each platform. Image Support provides the following additional capabilities:
• A color class, which allows the application to describe a color
• Palette classes, which allow the application to describe the set of colors it requires or the set of colors associated with an image
• A device-independent representation of images, which allows the application to create, modify, or display an image
• An icon class, which allows the application to describe an icon as a single object containing both its image and its mask, simplifying the use of icons in labels, buttons, and other widgets, and in operations such as drag-and-drop
• Classes for reading and writing image and icon file formats, with several standard file formats supported
Last modified date: 01/29/2015