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: 3458 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: 3458 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: 3458 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 352 times)
Best regards
Iñaki
[Updated on: Tue, 22 June 2010 00:25] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
| Re: Animated GIF support, anybody? [message #27227 is a reply to message #27120] |
Tue, 06 July 2010 09:29   |
 |
mirek
Messages: 14290 Registered: November 2005
|
Ultimate Member |
|
|
| koldo wrote on Sat, 26 June 2010 12:12 |
| luzr wrote on Sat, 26 June 2010 18:02 |
| koldo wrote on Thu, 24 June 2010 17:27 | Very good
Now last disposal method ("Restore to previous") is included in RasterMultiPage Reference demo.
And now is the time for the GIF animation player control. If you tell me the basic class methods I can do it for yourself.
|
You mean like specialized Ctrl to display GIF animation? Or rather some generic animation player?
Mirek
|
Yes 
Something somebody puts in the layout designer, enter a file name or String with GIF file, and just plays the animation when the window is opened.
|
No want to spoil the fun, but I think this is way specialized.... and the moment you add this, people will start requiring support for "real" video (divx, xvid, x264). Are your ready for THAT? 
That said, encapsulation of those formats would be really really nice.
But without them, animation player should be reserved for examples or bazaar IMO.
|
|
|
|
| Re: Animated GIF support, anybody? [message #27289 is a reply to message #27227] |
Sun, 11 July 2010 06:44   |
 |
koldo
Messages: 3458 Registered: August 2008
|
Senior Veteran |
|
|
| luzr wrote on Tue, 06 July 2010 09:29 |
| koldo wrote on Sat, 26 June 2010 12:12 |
| luzr wrote on Sat, 26 June 2010 18:02 |
| koldo wrote on Thu, 24 June 2010 17:27 | Very good
Now last disposal method ("Restore to previous") is included in RasterMultiPage Reference demo.
And now is the time for the GIF animation player control. If you tell me the basic class methods I can do it for yourself.
|
You mean like specialized Ctrl to display GIF animation? Or rather some generic animation player?
Mirek
|
Yes 
Something somebody puts in the layout designer, enter a file name or String with GIF file, and just plays the animation when the window is opened.
|
No want to spoil the fun, but I think this is way specialized.... and the moment you add this, people will start requiring support for "real" video (divx, xvid, x264). Are your ready for THAT? 
That said, encapsulation of those formats would be really really nice.
But without them, animation player should be reserved for examples or bazaar IMO.
|
Hello Mirek
I think a GIF animation is not used to display movies, just to show dynamic elements in motion, like an hourglass or a progress bar (remember the foot in Nautilus).
In fact I am working actively in a media player, but believe me, it is really much heavier than a GIF player.
Anyway if GIF animation is not going to be included in CtrlLib I will include it in Bazaar with pleasure .
Best regards
Iñaki
|
|
|
|
| Re: Animated GIF support, anybody? [message #27307 is a reply to message #27289] |
Sun, 11 July 2010 22:22   |
 |
mirek
Messages: 14290 Registered: November 2005
|
Ultimate Member |
|
|
| koldo wrote on Sun, 11 July 2010 00:44 |
| luzr wrote on Tue, 06 July 2010 09:29 |
No want to spoil the fun, but I think this is way specialized.... and the moment you add this, people will start requiring support for "real" video (divx, xvid, x264). Are your ready for THAT? 
That said, encapsulation of those formats would be really really nice.
But without them, animation player should be reserved for examples or bazaar IMO.
|
Hello Mirek
I think a GIF animation is not used to display movies, just to show dynamic elements in motion, like an hourglass or a progress bar (remember the foot in Nautilus).
|
Well, I have only outlined what IMO people will want after you add any kind of player 
| Quote: |
In fact I am working actively in a media player, but believe me, it is really much heavier than a GIF player.
|
Still, if current Raster interface is good enough for that, creating Raster player would make possible to connect it with streaming video one day... (represented as Raster).
| Quote: |
Anyway if GIF animation is not going to be included in CtrlLib I will include it in Bazaar with pleasure .
|
Well, I can include it with uppsrc, but I do not think it is a generic widget for CtrlLib. After all, RichEdit or Report are separate packages as well.
Mirek
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Re: Animated GIF support, anybody? [message #28642 is a reply to message #28601] |
Thu, 09 September 2010 09:09   |
Mindtraveller
Messages: 917 Registered: August 2007 Location: Russia, Moscow rgn.
|
Experienced Contributor |

|
|
It looks like RasterPlayer package has linking errors:
Linking...
$blitz.obj : error LNK2005: "class Upp::Image __cdecl GetRect(class Upp::Image const &,struct Upp::Rect_<int> const &)" (?GetRect@@YA?AVImage@Upp@@ABV12@
ABU?$Rect_@H@2@@Z) already defined in RasterPlayer.obj with MSC9 compiler, if Functions4U is added to project.
This is because GetRect duplicates one from Functions4U.
I've changed function name to GetRectRP and it links fine (quick & dirty).
It would be also great to support gif transparency.
[Updated on: Thu, 09 September 2010 09:12] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Tue Apr 28 13:36:32 GMT+2 2026
Total time taken to generate the page: 0.01237 seconds
|