return !png_sig_cmp(reinterpret_cast<png_byte *>(const_cast<char*>(sig.data())), 0, sig.size());
}
-void PngLoader::load(Image::Data &data)
+void PngLoader::load_(Image::Data &data)
{
png_byte **rows = 0;
default: throw unsupported_image_format("unknown color type");
}
- data.data = new char[data.stride*data.height];
+ data.pixels = new char[data.stride*data.height];
if(interlace==PNG_INTERLACE_ADAM7)
{
unsigned n_passes = png_set_interlace_handling(priv->png);
rows = new png_byte *[data.height];
for(unsigned y=0; y<data.height; ++y)
- rows[y] = reinterpret_cast<png_byte *>(data.data+data.stride*(data.height-1-y));
+ rows[y] = reinterpret_cast<png_byte *>(data.pixels+data.stride*(data.height-1-y));
for(unsigned i=0; i<n_passes; ++i)
png_read_rows(priv->png, rows, 0, data.height);
else
{
for(unsigned y=0; y<data.height; ++y)
- png_read_row(priv->png, reinterpret_cast<png_byte *>(data.data+data.stride*(data.height-1-y)), 0);
+ png_read_row(priv->png, reinterpret_cast<png_byte *>(data.pixels+data.stride*(data.height-1-y)), 0);
}
png_read_end(priv->png, 0);