You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// calculate the segments per line in the input image
294
-
foreach(varlineinimg.ImageData.Chunk(img.Width))
297
+
foreach(varlineinimageData.Chunk(width))
295
298
{
296
299
List<(intStartX,List<byte>RunBytes)>segments=[];
297
-
for(varx=0;x<img.Width;)
300
+
for(varx=0;x<width;)
298
301
{
299
302
// find the start of a segment. previous pixel may be a segment
300
303
if(line[x]!=0x0)
301
304
{
302
305
// find the end
303
306
varstartOfSegment=x;
304
307
List<byte>run=[];
305
-
while(x<img.Width&&line[x]!=0x0&&run.Count<127)// runs can only be 127 bytes in length. if the run is truly longer, then it gets split into multiple runs
308
+
while(x<width&&line[x]!=0x0&&run.Count<127)// runs can only be 127 bytes in length. if the run is truly longer, then it gets split into multiple runs
306
309
{
307
310
run.Add(line[x]);
308
311
x++;
@@ -322,7 +325,7 @@ public static byte[] EncodeRLEImageData(G1Element32 img)
322
325
// write source pointers. will be (2 * img.Height) bytes. need to know RLE data first to know the offsets
323
326
varheaderOffset=lines.Count*2;
324
327
varbytesTotal=0;
325
-
for(varyy=0;yy<img.Height;++yy)
328
+
for(varyy=0;yy<height;++yy)
326
329
{
327
330
// bytes per previous line is the sum of all the bytes in the runs plus the number of line segments * 2
0 commit comments