function decodeRLE( data, offset, pixelSize, outputSize)
   {
      var pos, c, count, i;
      var pixels, output;

      output = new Uint8Array(outputSize);
      pixels = new Uint8Array(pixelSize);
      pos    = 0;

      while (pos < outputSize) {
         c     = data[offset++];
         count = (c & 0x7f) + 1;

         // RLE pixels.
         if (c & 0x80) {
            // Bind pixel tmp array
            for (i = 0; i < pixelSize; ++i) {
               pixels[i] = data[offset++];
            }

            // Copy pixel array
            for (i = 0; i < count; ++i) {
               output.set(pixels, pos);
               pos += pixelSize;
            }
         }

         // Raw pixels.
         else {
            count *= pixelSize;
            for (i = 0; i < count; ++i) {
               output[pos++] = data[offset++];
            }
         }
      }

      return output;
   }
Decode RLE compression

@param {Uint8Array} data
@param {number} offset in data to start loading RLE
@param {number} pixel count
@param {number} output buffer size