|
|
Home » Developing U++ » U++ Developers corner » Animated GIF support, anybody?
|
|
|
Re: Animated GIF support, anybody? [message #26969 is a reply to message #26966] |
Tue, 15 June 2010 23:52 |
|
koldo
Messages: 3394 Registered: August 2008
|
Senior Veteran |
|
|
luzr wrote on Tue, 15 June 2010 19:19 |
koldo wrote on Tue, 15 June 2010 09:33 |
Hello Mirek
This is very easy. The code is there.
Just tell how you want the interface for:
- loading images: How to cross through StreamRaster-Raster-GIFRaster
- showing them.
|
Actually, interfaces are already there for Raster:
class Raster {
....
public:
virtual void SeekPage(int page);
virtual int GetActivePage() const;
virtual int GetPageCount();
RasterEncoder might need one or two new virtual methods.
Mirek
|
Hello Mirek
I imagine you say the frame rate (time between frames per every frame) or the aspect ratio .
Meanwhile please think about visualization interface.
Best regards
Iñaki
[Updated on: Tue, 15 June 2010 23:59] Report message to a moderator
|
|
|
|
|
|
|
|
Re: Animated GIF support, anybody? [message #27006 is a reply to message #27005] |
Mon, 21 June 2010 00:24 |
|
Hi,
I just tested the reference player with this image, which is one of the nonworking ones. I came to conclusion that the troubles come from the fact that it is optimized. (Some of the subimages have smaller size).
If I changed the layer sizes in gimp and resaved, it works almost fine, it only changes the disposal method. That could be probably fixed too.
The changed file is attached for reference...
Honza
|
|
|
|
Re: Animated GIF support, anybody? [message #27010 is a reply to message #27007] |
Mon, 21 June 2010 09:38 |
|
Hi Koldo & Tomas,
I had a quick look at the GIF format spec. The relevant part is paragraph 20. The data block described there should be loaded in GifLocalInfo::Load(). The code seems that it is already doing that.
But since the picture loaded is distorted, it seems that this information (GifLocalInfo::{x,y,width,height}) is not treated in GifProcessor::LoadSubimage(). It only checks if the values are sane. I guess it should also pad the actual image with transparent frame according to the x,y,width and height.
Sorry I don't dig into it myself, but my finals are coming tommorow But expect my helping in few days, if it is not finished by then.
Honza
|
|
|
Re: Animated GIF support, anybody? [message #27011 is a reply to message #27010] |
Mon, 21 June 2010 10:53 |
|
koldo
Messages: 3394 Registered: August 2008
|
Senior Veteran |
|
|
dolik.rce wrote on Mon, 21 June 2010 09:38 | Hi Koldo & Tomas,
I had a quick look at the GIF format spec. The relevant part is paragraph 20. The data block described there should be loaded in GifLocalInfo::Load(). The code seems that it is already doing that.
But since the picture loaded is distorted, it seems that this information (GifLocalInfo::{x,y,width,height}) is not treated in GifProcessor::LoadSubimage(). It only checks if the values are sane. I guess it should also pad the actual image with transparent frame according to the x,y,width and height.
Sorry I don't dig into it myself, but my finals are coming tommorow But expect my helping in few days, if it is not finished by then.
Honza
|
Agree. Working on that now.
Best regards
Iñaki
|
|
|
|
|
Re: Animated GIF support, anybody? [message #27030 is a reply to message #27018] |
Tue, 22 June 2010 00:24 |
|
koldo
Messages: 3394 Registered: August 2008
|
Senior Veteran |
|
|
Hello Mirek
Included new code for Raster and plugin/Gif.
Virtual funcions added are:
- Rect GetPageRect(int n). Gets the subimage Rect
- int GetPageDisposal(int n). Gets the way the subimage has to be handled by the renderer
Reference/RasterMultiPage example has been uploaded covering these changes.
-
Attachment: Gif.7z
(Size: 8.93KB, Downloaded 268 times)
Best regards
Iñaki
[Updated on: Tue, 22 June 2010 00:25] Report message to a moderator
|
|
|
|
|
|
|
Goto Forum:
Current Time: Fri Sep 20 23:17:17 CEST 2024
Total time taken to generate the page: 0.05304 seconds
|
|
|