From: Duilio J. P. <dp...@fc...> - 2004-07-01 16:17:49
|
I suggest to change the _VisPalette structure from: struct _VisPalette { unsigned char r[256]; unsigned char g[256]; unsigned char b[256]; }; to struct _VisPalette { int ncolors; VisColor *colors; }; where _VisColor is: struct _VisColor { unsigned char r; unsigned char g; unsigned char b; unsigned char unused; }; This way the palette size is not fixed, the colors fit well in memory, and we have the same structure than SDL have, so we can copy palettes with just a memcpy(). Regards, Duilio. |
From: Dennis S. <sy...@yo...> - 2004-07-01 16:39:03
|
Sounds good, would you like to do it before 0.1.6 or after 0.1.6 ? It's quite a bit of work, I suspect... :( Also we need to have good visual_palette helper functions to allocate colors and the such! Thanks, Dennis On Thu, 2004-07-01 at 13:18 -0300, Duilio Javier Protti wrote: > I suggest to change the _VisPalette structure from: > > struct _VisPalette { > unsigned char r[256]; > unsigned char g[256]; > unsigned char b[256]; > }; > > to > > struct _VisPalette { > int ncolors; > VisColor *colors; > }; > > where _VisColor is: > > struct _VisColor { > unsigned char r; > unsigned char g; > unsigned char b; > unsigned char unused; > }; > > This way the palette size is not fixed, > the colors fit well in memory, and we have > the same structure than SDL have, so we > can copy palettes with just a memcpy(). > > > Regards, > Duilio. |
From: Duilio J. P. <dp...@fc...> - 2004-07-02 14:54:49
|
El jue, 01 de 07 de 2004 a las 13:38, Dennis Smit escribi=C3=B3: > Sounds good, would you like to do it before 0.1.6 or after 0.1.6 ? > It's quite a bit of work, I suspect... :( I will work on XMMS plugin now, if there is some time later I will try it before 0.1.6, but there is no hurry, I guess (read below).=20 > Also we need to have good visual_palette helper functions to allocate > colors and the such! Ok, we must begin doing a small wishlist about this. Do you need this functions as soon as possible, for the new things in lv_bmp in example? If this is the case we can focus work on this. Bye, Duilio. |
From: Dennis S. <sy...@yo...> - 2004-07-01 17:29:24
|
I was thinking some more about this.. I think it's wise to change the void *screenbuffer in VisVideo to some union that is goom it's Pixel thingy: typedef union _PIXEL { struct { unsigned char b; unsigned char g; unsigned char r; unsigned char a; } channels; unsigned int val; unsigned char cop[4]; } Pixel; Not entirely the same, also adding support for all the depths very well. I think it would be good to do this at the same time as the VisColor change, don't you agree ? On Thu, 2004-07-01 at 13:18 -0300, Duilio Javier Protti wrote: > I suggest to change the _VisPalette structure from: > ...... |
From: Duilio J. P. <dp...@fc...> - 2004-07-02 14:54:42
|
El jue, 01 de 07 de 2004 a las 14:26, Dennis Smit escribi=C3=B3: > I was thinking some more about this.. >=20 > I think it's wise to change the void *screenbuffer in VisVideo > to some union that is goom it's Pixel thingy: >=20 > typedef union _PIXEL { > struct { > unsigned char b; > unsigned char g; > unsigned char r; > unsigned char a; > } channels; > unsigned int val; > unsigned char cop[4]; > } Pixel; >=20 >=20 > Not entirely the same, also adding support for all the depths very well. >=20 > I think it would be good to do this at the same time as the VisColor > change, don't you agree ? IMHO, the void* is better. Typing as suggested above is good on the user side, but a library like libvisual must be as reusable as possible, and for the pixels I think the only way is to give the void*. Is ugly, but this way can be used on any context. May be I'm wrong :-) Duilio. |
From: Dennis S. <sy...@yo...> - 2004-07-02 21:14:33
|
On Fri, 2004-07-02 at 11:56 -0300, Duilio Javier Protti wrote: > > Not entirely the same, also adding support for all the depths very well. > > > > I think it would be good to do this at the same time as the VisColor > > change, don't you agree ? > > IMHO, the void* is better. Typing as suggested above is good on the user > side, but a library like libvisual must be as reusable as possible, and > for the pixels I think the only way is to give the void*. You're probably right, we should avoid crack code :). We'll see in the future :) Dennis |
From: Dennis S. <sy...@yo...> - 2004-07-02 21:14:38
|
On Fri, 2004-07-02 at 11:56 -0300, Duilio Javier Protti wrote: > El jue, 01 de 07 de 2004 a las 13:38, Dennis Smit escribi=F3: > > Sounds good, would you like to do it before 0.1.6 or after 0.1.6 = ? > > It's quite a bit of work, I suspect... :( >=20 > I will work on XMMS plugin now, if there is some time later I will > try it before 0.1.6, but there is no hurry, I guess (read below).= =20 >=20 > > Also we need to have good visual_palette helper functions to allo= cate > > colors and the such! >=20 > Ok, we must begin doing a small wishlist about this. Do you need > this functions as soon as possible, for the new things in lv_bmp > in example? If this is the case we can focus work on this. Nah, totally take your time... I think it's more important to get libvisual usable for users for now. Let's first work over the current TODO list and then see if there is anything left ;) Cheers, Dennis |