RLE? What file formats supported?

In photoshop, I found an option for storing bitmap files RLE compressed.

For the RLEACCEL option to provide a benefit in SDL, does the image file
itself have to be stored RLE-encoded, or is there a way to tell SDL to
convert them to RLE encoding when they are read in?

If it must be RLE compressed in the file itself, it would seem to me that
RLE is only supported on non compressed images (bitmaps for example).

Does calling DisplayFormat() on a RLE encoded image lose the encoding?

I have been unable to find much information on using RLE with SDL, other
than a single flag. Any help or suggestions would be greatly appreciated.

Thanks a bunch,–
Brian

hayward at slothmud.org wrote:

In photoshop, I found an option for storing bitmap files RLE compressed.

For the RLEACCEL option to provide a benefit in SDL, does the image file
itself have to be stored RLE-encoded, or is there a way to tell SDL to
convert them to RLE encoding when they are read in?

RLE Encoding in SDL is there for increased speed in rendering and not for saving space.It boosts the
performance A LOT when you to blit surfaces which are transparent by specifying the color you want
to be transparent using SDL_SetColorKey.Well the image file itself does not have to be RLE encoded
since SetColorKey works on SDL surfaces.

If it must be RLE compressed in the file itself, it would seem to me that
RLE is only supported on non compressed images (bitmaps for example).

Does calling DisplayFormat() on a RLE encoded image lose the encoding?

Apparently not.Look at testsprite.c in the test/ directory.Try removing the RLE_ACCEL flag and
you’ll see the difference.

I have been unable to find much information on using RLE with SDL, other
than a single flag. Any help or suggestions would be greatly appreciated.

I think RLE_ACCEL is only for surfaces that are meant to be transparent which means the only place
you ever use is in SDL_SetColorKey.

RLE Encoding in SDL is there for increased speed in rendering and not for saving space.It boosts the
performance A LOT when you to blit surfaces which are transparent by specifying the color you want
to be transparent using SDL_SetColorKey.Well the image file itself does not have to be RLE encoded
since SetColorKey works on SDL surfaces.

I think RLE_ACCEL is only for surfaces that are meant to be transparent which means the only place
you ever use is in SDL_SetColorKey.

Yup, this is exactly why I want to use RLEACCEL. To speed up transparent
blits. I understand the concept, I just didn’t understand exactly how
to use it with SDL. For RLE acceleration to work, it must be stored
internally in SDL as RLE format. This is why I was asking whether it has
to be RLE within the image file to take advantage of it, or if I have to
convert the image to RLE format.

So does the conversion to RLE take place when you call SDL_SetColorKey()
with a flag of SDL_RLEACCEL ?–
Brian

Yup, this is exactly why I want to use RLEACCEL. To speed up transparent
blits. I understand the concept, I just didn’t understand exactly how
to use it with SDL. For RLE acceleration to work, it must be stored
internally in SDL as RLE format. This is why I was asking whether it has
to be RLE within the image file to take advantage of it, or if I have to
convert the image to RLE format.

SDL RLE encoding has nothing to do with RLE encoded bitmaps as saved by
image programs. In fact, SDL does not currently support loading RLE
encoded BMP images. It performs it’s own internal conversion of a
partially transparent image into a series of opcodes and pixels that
it uses as instructions for blitting an image.

So does the conversion to RLE take place when you call SDL_SetColorKey()
with a flag of SDL_RLEACCEL ?

Yes.

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec