org.eclipse.swt.graphics.PaletteData

Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html

Contributors: IBM Corporation - initial API and implementation Port to the D programming language: Frank Benoit <benoit@tionex.de>

Members

Classes

PaletteData
class PaletteData

Instances of this class describe the color data used by an image. <p> Depending on the depth of the image, the PaletteData can take one of two forms, indicated by the isDirect field: </p> <dl> <dt> <em>isDirect is false</em> </dt> <dd> If isDirect is <code>false</code>, this palette is an indexed palette which maps pixel values to RGBs. The actual RGB values may be retrieved by using the getRGBs() method. </dd> <dt> <em>isDirect is true</em> </dt> <dd> If isDirect is <code>true</code>, this palette is a direct color palette. Instead of containing RGB values, it contains red, green and blue mask and shift information which indicates how the color components may be extracted from a given pixel. This means that the RGB value is actually encoded in the pixel value. <p> In this case, the shift data is the number of bits required to shift the RGB value to the left in order to align the high bit of the corresponding mask with the high bit of the first byte. This number may be negative, so care must be taken when shifting. For example, with a red mask of 0xFF0000, the red shift would be -16. With a red mask of 0x1F, the red shift would be 3. </p> </dd> </dl>

Meta