Constructs a new, empty ImageData with the given width, height, depth and palette. The data will be initialized to an (all zero) array of the appropriate size.
Constructs a new, empty ImageData with the given width, height, depth, palette, scanlinePad and data.
Constructs an <code>ImageData</code> loaded from the specified input stream. Throws an error if an error occurs while loading the image, or if the image has an unsupported type. Application code is still responsible for closing the input stream. <p> This constructor is provided for convenience when loading a single image only. If the stream contains multiple images, only the first one will be loaded. To load multiple images, use <code>ImageLoader.load()</code>. </p><p> This constructor may be used to load a resource as follows: </p> <pre> static ImageData loadImageData (Class clazz, String string) { InputStream stream = clazz.getResourceAsStream (string); if (stream is null) return null; ImageData imageData = null; try { imageData = new ImageData (stream); } catch (SWTException ex) { } finally { try { stream.close (); } catch (IOException ex) {} } return imageData; } </pre>
Constructs an <code>ImageData</code> loaded from a file with the specified name. Throws an error if an error occurs loading the image, or if the image has an unsupported type. <p> This constructor is provided for convenience when loading a single image only. If the file contains multiple images, only the first one will be loaded. To load multiple images, use <code>ImageLoader.load()</code>. </p>
Constructs an image data by giving values for all non-computable fields. <p> This method is for internal use, and is not described further. </p>
Returns a new instance of the same class as the receiver, whose slots have been filled in with <em>copies</em> of the values in the slots of the receiver. That is, the returned object is a <em>deep copy</em> of the receiver.
Returns the alpha value at offset <code>x</code> in scanline <code>y</code> in the receiver's alpha data. The alpha value is between 0 (transparent) and 255 (opaque).
Returns <code>getWidth</code> alpha values starting at offset <code>x</code> in scanline <code>y</code> in the receiver's alpha data starting at <code>startIndex</code>. The alpha values are unsigned, between <code>(byte)0</code> (transparent) and <code>(byte)255</code> (opaque).
Returns the byte order of the receiver.
Returns the pixel value at offset <code>x</code> in scanline <code>y</code> in the receiver's data.
Returns <code>getWidth</code> pixel values starting at offset <code>x</code> in scanline <code>y</code> in the receiver's data starting at <code>startIndex</code>.
Returns <code>getWidth</code> pixel values starting at offset <code>x</code> in scanline <code>y</code> in the receiver's data starting at <code>startIndex</code>.
Returns an array of <code>RGB</code>s which comprise the indexed color table of the receiver, or null if the receiver has a direct color model.
Returns an <code>ImageData</code> which specifies the transparency mask information for the receiver. If the receiver has no transparency or is not an icon, returns an opaque mask.
Returns the image transparency type, which will be one of <code>SWT.TRANSPARENCY_NONE</code>, <code>SWT.TRANSPARENCY_MASK</code>, <code>SWT.TRANSPARENCY_PIXEL</code> or <code>SWT.TRANSPARENCY_ALPHA</code>.
Returns a copy of the receiver which has been stretched or shrunk to the specified size. If either the width or height is negative, the resulting image will be inverted in the associated axis.
Initializes all fields in the receiver. This method must be called by all public constructors to ensure that all fields are initialized for a new ImageData object. If a new field is added to the class, then it must be added to this method. <p> This method is for internal use, and is not described further. </p>
Sets the alpha value at offset <code>x</code> in scanline <code>y</code> in the receiver's alpha data. The alpha value must be between 0 (transparent) and 255 (opaque).
Sets the alpha values starting at offset <code>x</code> in scanline <code>y</code> in the receiver's alpha data to the values from the array <code>alphas</code> starting at <code>startIndex</code>. The alpha values must be between <code>(byte)0</code> (transparent) and <code>(byte)255</code> (opaque)
Sets the pixel value at offset <code>x</code> in scanline <code>y</code> in the receiver's data.
Sets the pixel values starting at offset <code>x</code> in scanline <code>y</code> in the receiver's data to the values from the array <code>pixels</code> starting at <code>startIndex</code>.
Sets the pixel values starting at offset <code>x</code> in scanline <code>y</code> in the receiver's data to the values from the array <code>pixels</code> starting at <code>startIndex</code>.
Blits a direct palette image into a direct palette image. <p> Note: When the source and destination depth, order and masks are pairwise equal and the blitter operation is BLIT_SRC, the masks are ignored. Hence when not changing the image data format, 0 may be specified for the masks. </p>
Blits an index palette image into an index palette image. <p> Note: The source and destination red, green, and blue arrays may be null if no alpha blending or dither is to be performed. </p>
Blits an index palette image into a direct palette image. <p> Note: The source and destination masks and palettes must always be fully specified. </p>
Blits a direct palette image into an index palette image. <p> Note: The source and destination masks and palettes must always be fully specified. </p>
Returns a palette with 2 colors: black & white.
Finds the closest match.
Creates an ImageData containing one band's worth of a gradient filled block. If <code>vertical</code> is true, the band must be tiled horizontally to fill a region, otherwise it must be tiled vertically.
Renders a gradient onto a GC. <p> This is a GC helper. </p>
Extracts a field from packed RGB data given a mask for that field.
Computes the required channel shift from a mask.
Computes the required channel width (depth) from a mask.
Gets the offset of the most significant bit for the given mask.
Invokes internal SWT functionality to create a new instance of this class. <p> <b>IMPORTANT:</b> This method is <em>not</em> part of the public API for <code>ImageData</code>. It is marked public only so that it can be shared within the packages provided by SWT. It is subject to change without notice, and should never be called from application code. </p> <p> This method is for internal use, and is not described further. </p>
Alpha mode, values 0 - 255 specify global alpha level
Alpha mode, values 0 - 255 specify global alpha level
Alpha mode, values 0 - 255 specify global alpha level
Alpha mode, values 0 - 255 specify global alpha level
Alpha mode, values 0 - 255 specify global alpha level
Alpha mode, values 0 - 255 specify global alpha level
Alpha mode, values 0 - 255 specify global alpha level
Alpha mode, values 0 - 255 specify global alpha level
Blit operation bits to be OR'ed together to specify the desired operation.
Blit operation bits to be OR'ed together to specify the desired operation.
Blit operation bits to be OR'ed together to specify the desired operation.
Scaled 8x8 Bayer dither matrix.
Byte and bit order constants.
The global alpha value to be used for every pixel. <p> If this value is set, the <code>alphaData</code> field is ignored and when the image is rendered each pixel will be blended with the background an amount proportional to this value. </p><p> The default is -1 which means 'no global alpha value' </p>
The alpha data of the image. <p> Every pixel can have an <em>alpha blending</em> value that varies from 0, meaning fully transparent, to 255 meaning fully opaque. The number of bytes per scanline is 'width'. </p>
The number of bytes per scanline. <p> This is a multiple of the scanline padding. </p>
The pixel data of the image. <p> Note that for 16 bit depth images the pixel data is stored in least significant byte order; however, for 24bit and 32bit depth images the pixel data is stored in most significant byte order. </p>
The time to delay before displaying the next image in an animation (this field corresponds to the GIF89a Delay Time value).
The color depth of the image, in bits per pixel. <p> Note that a depth of 8 or less does not necessarily mean that the image is palette indexed, or conversely that a depth greater than 8 means that the image is direct color. Check the associated PaletteData's isDirect field for such determinations.
A description of how to dispose of the current image before displaying the next.
The height of the image, in pixels.
An icon-specific field containing the data from the icon mask. <p> This is a 1 bit bitmap stored with the most significant bit first. The number of bytes per scanline is '((width + 7) / 8 + (maskPad - 1)) / maskPad * maskPad'. </p><p> The default is null which means 'no transparency mask'. </p>
An icon-specific field containing the scanline pad of the mask. <p> If one scanline of the transparency mask is not a multiple of this number, it will be padded with zeros until it is. </p>
The color table for the image.
The scanline padding. <p> If one scanline of the image is not a multiple of this number, it will be padded with zeros until it is. </p>
The transparent pixel. <p> Pixels with this value are transparent. </p><p> The default is -1 which means 'no transparent pixel'. </p>
The type of file from which the image was read.
The width of the image, in pixels.
The x coordinate of the top left corner of the image within the logical screen (this field corresponds to the GIF89a Image Left Position value).
The y coordinate of the top left corner of the image within the logical screen (this field corresponds to the GIF89a Image Top Position value).
Instances of this class are device-independent descriptions of images. They are typically used as an intermediate format between loading from or writing to streams and creating an <code>Image</code>. <p> Note that the public fields <code>x</code>, <code>y</code>, <code>disposalMethod</code> and <code>delayTime</code> are typically only used when the image is in a set of images used for animation. </p>
@see Image @see ImageLoader @see <a href="http://www.eclipse.org/swt/snippets/#image">ImageData snippets</a> @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ImageAnalyzer</a> @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>