Pasting RGB Data over UYVY Overlays

Hi all,

I am developing a simple game, and I am using Sprites over a screen

background. I have
everything up and running, but I am blitting too many images and it
gets a little blinky (or the effect
of slow graphics on a slow PC)…

I have been trying to use Overlays, and finally got some results. My
idea is to move a sprite over the
screen without been forced to Blit anything.
I have created the overlay, and I can move it around, no problem. It
even leaves no “trail” behind, as I move
it, because it is a hardware Overlay.

Now, everything seemed fine, but when I tried to fill the mem area
"overlay->pixels" with a BMP contents, I got
a horrible sprite, that looked nothing like the original BMP. The thing
is that the overlay (mine at least) uses UYVY format,
(which I have found out is the same as JPEG format, or same color map,
is this true?)… Anyway, is there a way to easily
convert a BMP (or any other known format) to UYVY , and then load all of
those bytes onto the OverLay? Is there an
SDL_Overlay * SDL_LoadYUVBMP(…) ??

Please point me in the right direction. Thanks.

Juan Carniglia, Programmer - Buenos Aires - Argentina.

Now, everything seemed fine, but when I tried to fill the mem area
"overlay->pixels" with a BMP contents, I got
a horrible sprite, that looked nothing like the original BMP. The thing
is that the overlay (mine at least) uses UYVY format,
(which I have found out is the same as JPEG format, or same color map,
is this true?)… Anyway, is there a way to easily
convert a BMP (or any other known format) to UYVY , and then load all of
those bytes onto the OverLay? Is there an
SDL_Overlay * SDL_LoadYUVBMP(…) ??

Please point me in the right direction. Thanks.

Take a look at the testoverlay.c file in the test subdirectory of the SDL
source archive. It’s got functions for converting RGB data to various YUV
formats.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Excelent! I used your functions, on the testoverlay.c file, and it is
working.
I also set the “luminance” variable to 99 to get a good result.

Now I only have to set the transparent color.

Thanks!> ----- Original Message -----

From: sdl-admin@libsdl.org [mailto:sdl-admin at libsdl.org] On Behalf Of
Sam Lantinga
Sent: Tuesday, August 19, 2003 1:55 AM
To: sdl at libsdl.org
Subject: Re: [SDL] Pasting RGB Data over UYVY Overlays

Now, everything seemed fine, but when I tried to fill the mem area
"overlay->pixels" with a BMP contents, I got a horrible sprite, that
looked nothing like the original BMP. The thing is that the overlay
(mine at least) uses UYVY format, (which I have found out is the same
as JPEG format, or same color map, is this true?)… Anyway, is there
a way to easily convert a BMP (or any other known format) to UYVY ,
and then load all of those bytes onto the OverLay? Is there an
SDL_Overlay * SDL_LoadYUVBMP(…) ??

Please point me in the right direction. Thanks.

Take a look at the testoverlay.c file in the test subdirectory of the
SDL source archive. It’s got functions for converting RGB data to
various YUV formats.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl