We also have included a few functions to convert between different image and sound formats. The usage of the image conversion functions is pretty straightforward:
int convertRGBtoYCrCb(const byte* source, int sourcelen, byte* dest); int convertYCrCbtoRGB(const byte* source, int sourcelen, byte* dest); int convertJPEGtoYCrCb(const byte* source, int sourcelen, byte* dest, int &size); int convertJPEGtoRGB(const byte* source, int sourcelen, byte* dest, int &size);
The size parameter must be set to the size of the destination buffer. On return it will be set to the size of the output data.
To convert between different sound formats, the function convert can be used. It takes two USound structures as its parameters. The two audio formats currently supported are SOUND_RAW and SOUND_WAV, but support for compressed sound formats such as Ogg Vorbis and MP3 is planned.. If any field is set to zero in the destination structure, the corresponding value from the source sound will be used.