|
|
Re: Snippet194 throws under linux [message #467411 is a reply to message #467391] |
Tue, 31 January 2006 05:04 |
Jason Grant Messages: 77 Registered: July 2009 |
Member |
|
|
Thanks Carolyn,
I started to write a comment in the bug you mentioned, but aborted because
my issue is not with the functionality of the encoders, but rather with
the inability to use o.e.s.g.Image to *paint* in 4-bits (in a portable
way).
I have a need to do what Snippet194 is doing; I just want to generate a
4-bit-indexed image, and save it as 4-bit-indexed. Alas, even though I
construct an Image with my 4-bit-indexed ImageData, myImage.getImageData()
gives me back a 24-bit-direct one. If it would instead give me back a
4-bit-indexed ImageData, then I could save it OK with the existing encoder
functionality, which already supports 4-bit gifs.
I thought about blitting the 24-bit data back to 4 bits for cases where
Image doesn't return 4-bit ImageData, before realising that the blit
methods aren't public. So now I'm just not using SWT to do this - I don't
like it, but I've gone back to Java2D for now, since it's portable.
Hope this makes sense - in short, I cannot *paint* a 4-bit image under
linux.
1) I'd really rather paint using SWT, draw2d, etc. instead of awt; is
there a workaround that will allow me to draw on a GC, then get the result
as 4-bit-indexed?
2) Do you think this merits a new bug?
Thanks again,
Jason.
On Mon, 30 Jan 2006 15:49:08 -0500, Carolyn MacLeod wrote:
> Hi, Jason.
>
> There is already a bug open for this:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=38232
>
> Please add yourself as a cc to this bug to track progress. Feel free to
> mention Snippet194 in the bug as a good example of why this feature is
> needed.
>
> Thanks!
> Carolyn
>
> "Jason Grant" <junk@logular.com> wrote in message
> news:pan.2006.01.28.02.40.47.569038@logular.com...
>> [Eclipse 3.2M3, gtk]
>>
>> Snippet194 (write an animated gif) throws with message "Unsupported
>> color depth" under linux.
>>
>> This is because the return value from Image.getImageData() is always
>> 24-bit-direct, since Image.init() blits the 4-bit indexed data into
>> 24-bit direct data.
>>
>> 1) Should I register this as a bug?
>>
>> 2) To save a 4-bit-indexed gif under linux, should I blit the output
>> from Image.getImageData() back to 4 bits, then give this to
>> ImageLoader? Or is there a cleaner and more portable way?
>>
>> Thanks,
>>
>> Jason
>>
>> PS: I encountered this same fault as posted to this list on 27th June
>> 2005 with an earlier edition of Eclipse & SWT. Post subject was
>> "Saving an Image to GIF".
|
|
|
Powered by
FUDForum. Page generated in 0.03525 seconds