The run length can simply be extracted and stored as part of the iterator state. For each iteration, check if the length is > 0, and emit more pixels until it isn't. Then continue the normal decode process.