Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » ImageData inconsistency?
ImageData inconsistency? [message #529111] Fri, 23 April 2010 01:21 Go to next message
Eclipse User
Originally posted by: totolaricot.mac.com

This is a multi-part message in MIME format.
--------------050505090205050709080504
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Using the attached image, I created an ImageData two different ways:

1)
final Image load = new Image(display, "close.png");
final ImageData idLoad = load.getImageData();
System.out.println("ImageData (image load) " +
idLoad.width+ " " + idLoad.height + " " + idLoad.depth);

2)
ImageData id = new ImageData("close.png");
System.out.println("ImageData (name) " + id.width+ " " +
id.height + " " + id.depth);

this is the outcome
ImageData (image load) 18 18 32
ImageData (name) 18 18 24

the second ImageData structure is misleading as the alphaData array is
actually populated properly and the image is really a 32bpp image (this
is visible when the image is painted on a GC)

LM/

--------------050505090205050709080504
Content-Type: image/png;
name="close.png"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="close.png"

iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAC7mlDQ1BJQ0Mg UHJvZmlsZQAA
eAGFVM9rE0EU/jZuqdAiCFprDrJ4kCJJWatoRdQ2/RFiawzbH7ZFkGQzSdZu NuvuJrWliOTi
0SreRe2hB/+AHnrwZC9KhVpFKN6rKGKhFy3xzW5MtqXqwM5+8943731vdt8A DXLSNPWABOQN
x1KiEWlsfEJq/IgAjqIJQTQlVdvsTiQGQYNz+Xvn2HoPgVtWw3v7d7J3rZrS tpoHhP1A4Eea
2Sqw7xdxClkSAog836Epx3QI3+PY8uyPOU55eMG1Dys9xFkifEA1Lc5/TbhT zSXTQINIOJT1
cVI+nNeLlNcdB2luZsbIEL1PkKa7zO6rYqGcTvYOkL2d9H5Os94+wiHCCxmt P0a4jZ71jNU/
4mHhpObEhj0cGDX0+GAVtxqp+DXCFF8QTSeiVHHZLg3xmK79VvJKgnCQOMpk YYBzWkh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E/j2ibx6fxEEm p2U6AAAAAElF
TkSuQmCC
--------------050505090205050709080504--
Re: ImageData inconsistency? [message #529572 is a reply to message #529111] Mon, 26 April 2010 08:54 Go to previous messageGo to next message
Praveen  is currently offline Praveen
Messages: 86
Registered: July 2009
Member
which platform you are using ? When I run the reported scenario on Linux
distro - Ubuntu, I have seen the depth is reported as 24 in both the
cases, which seems to be expected. I believe alpha is not reported in
depth value, as it would be carried in a separate alphaData array.
Re: ImageData inconsistency? [message #529725 is a reply to message #529572] Mon, 26 April 2010 19:58 Go to previous messageGo to next message
Eclipse User
Originally posted by: totolaricot.mac.com

On 4/26/10 2:54 PM, Praveen wrote:
> which platform you are using ? When I run the reported scenario on
> Linux distro - Ubuntu, I have seen the depth is reported as 24 in both
> the cases, which seems to be expected. I believe alpha is not reported
> in depth value, as it would be carried in a separate alphaData array.
Sorry, I should have mentioned it originally. I ran the same code on XP
(3.5 latest stable) and Cocoa 64 swt_3641. In both case the reported
color depth was 24 when loading the ImageData by name, while building an
ImageData from an already loaded Image reported 32. As I mentioned, in
both cases the images were actually 32 bpp (the ImageData.alphaData[]
contained the right alpha values).
Re: ImageData inconsistency? [message #529727 is a reply to message #529725] Mon, 26 April 2010 20:11 Go to previous message
Eclipse User
Originally posted by: totolaricot.mac.com

On 4/27/10 1:58 AM, L. Mihalkovic wrote:
> On 4/26/10 2:54 PM, Praveen wrote:
>> which platform you are using ? When I run the reported scenario on
>> Linux distro - Ubuntu, I have seen the depth is reported as 24 in
>> both the cases, which seems to be expected. I believe alpha is not
>> reported in depth value, as it would be carried in a separate
>> alphaData array.
> Sorry, I should have mentioned it originally. I ran the same code on
> XP (3.5 latest stable) and Cocoa 64 swt_3641. In both case the
> reported color depth was 24 when loading the ImageData by name, while
> building an ImageData from an already loaded Image reported 32. As I
> mentioned, in both cases the images were actually 32 bpp (the
> ImageData.alphaData[] contained the right alpha values).

I see. so the color depth only deals with the main array, and does not
include the alphaData?! so in order to convert an image to 32 bits, I
have to check the depth to figure how to deal with the main array, and
separately check for the presence of alphaData
Previous Topic:browser and javascript
Next Topic:Dropdown always above CCombo
Goto Forum:
  


Current Time: Wed Apr 23 20:04:19 EDT 2014

Powered by FUDForum. Page generated in 0.04954 seconds