float r=gamma().r_U8_to_F32((unsigned char)png_ptr->palette[row_pointers[y][x]].red);
float g=gamma().g_U8_to_F32((unsigned char)png_ptr->palette[row_pointers[y][x]].green);
float b=gamma().b_U8_to_F32((unsigned char)png_ptr->palette[row_pointers[y][x]].blue);
+ float a=1.0;
+ if(info_ptr->valid & PNG_INFO_tRNS)
+ a = (float)(unsigned char)png_ptr->trans[row_pointers[y][x]]*(1.0/255.0);
surface_buffer[y][x]=Color(
r,
g,
b,
- 1.0
+ a
);
}
break;