Question

I want to do Run Length Encoding on a Qt QByteArray of largely redundant image data. Right now I am using QByteArrays qCompress and qUncompress functions which use zlib with the default compression parameter.

After Googling I haven't found any third party libraries or Qt components that seem to do RLE out of the box. Can anyone point me to RLE Encoding for Qt?

Thanks -

Was it helpful?

Solution

There is no RLE that I could find in Qt or third party. For QByteArrays, qCompress and qUncompress work OK for compressing but are not able to work with zlib standard compressiom from other sources due to the fact that these Qt functions prepend an extra 4 bytes to the data describing the QByteArray. Quazip ( http://quazip.sourceforge.net/ ) looked promising but was overkill for my needs. I just wrote my own RLE.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top