Diff of /png.c [0a87db] .. [8fbc76] Maximize Restore

  Switch to unified view

a/png.c b/png.c
...
...
231
    }
231
    }
232
232
233
    png_read_image(png_ptr, row_pointers);
233
    png_read_image(png_ptr, row_pointers);
234
    
234
    
235
    if(im->bitsPerPixel == 32){ // rgba; switch to argb 
235
    if(im->bitsPerPixel == 32){ // rgba; switch to argb 
236
      UCHAR pix, *p;      
236
      uint8_t pix, *p;        
237
        LOOP_IMAGE( im, p = (UCHAR*)idata; pix=p[0]; p[0]=p[3];p[3]=p[2];p[2]=p[1];p[1]=pix; )       
237
        LOOP_IMAGE( im, p = (uint8_t*)idata; pix=p[0]; p[0]=p[3];p[3]=p[2];p[2]=p[1];p[1]=pix; )     
238
    }
238
    }
239
    if(im->bitsPerPixel == 64){ // rgba; switch to argb 
239
    if(im->bitsPerPixel == 64){ // rgba; switch to argb 
240
      USHORT pix, *p;     
240
      uint16_t pix, *p;       
241
        LOOP_IMAGE( im, p = (USHORT*)idata; pix=p[0]; p[0]=p[3];p[3]=p[2];p[2]=p[1];p[1]=pix; )      
241
        LOOP_IMAGE( im, p = (uint16_t*)idata; pix=p[0]; p[0]=p[3];p[3]=p[2];p[2]=p[1];p[1]=pix; )        
242
    }
242
    }
243
243
244
#ifndef PT_BIGENDIAN
244
#ifndef PT_BIGENDIAN
245
    // Swap bytes in shorts
245
    // Swap bytes in shorts
246
    if(im->bitsPerPixel == 48){ 
246
    if(im->bitsPerPixel == 48){ 
247
      UCHAR  b,*id;
247
      uint8_t  b,*id;
248
248
249
// the original construct of *id = *(++id) results in:
249
// the original construct of *id = *(++id) results in:
250
//.L80:
250
//.L80:
251
//  movb    (%edx), %al
251
//  movb    (%edx), %al
252
//  incl    %ecx
252
//  incl    %ecx
...
...
269
                b = *id; *id = *(id + 1); id++; *(id++)=b; \
269
                b = *id; *id = *(id + 1); id++; *(id++)=b; \
270
                b = *id; *id = *(id + 1); id++; *(id++)=b; \
270
                b = *id; *id = *(id + 1); id++; *(id++)=b; \
271
                b = *id; *id = *(id + 1); id++; *(id)=b; )
271
                b = *id; *id = *(id + 1); id++; *(id)=b; )
272
        }
272
        }
273
    if(im->bitsPerPixel == 64){ 
273
    if(im->bitsPerPixel == 64){ 
274
      UCHAR  b,*id;   
274
      uint8_t  b,*id; 
275
        LOOP_IMAGE( im, id = idata; \
275
        LOOP_IMAGE( im, id = idata; \
276
                b = *id; *id = *(id + 1); id++; *(id++)=b; \
276
                b = *id; *id = *(id + 1); id++; *(id++)=b; \
277
                b = *id; *id = *(id + 1); id++; *(id++)=b; \
277
                b = *id; *id = *(id + 1); id++; *(id++)=b; \
278
                b = *id; *id = *(id + 1); id++; *(id++)=b; \
278
                b = *id; *id = *(id + 1); id++; *(id++)=b; \
279
                b = *id; *id = *(id + 1); id++; *(id)=b; )
279
                b = *id; *id = *(id + 1); id++; *(id)=b; )