34#include "loaders/SILLYPNGImageContext.h"
36#ifndef SILLY_OPT_INLINE
38#include "loaders/SILLYPNGImageContext.icpp"
46int PNGImageContext::read(png_bytep data, png_size_t length)
51 if (d_offset + length > d_data->getSize())
53 memcpy(data, d_data->getDataPtr() + d_offset, length);
59PNGImageContext::PNGImageContext(
DataSource* data)
60 :
ImageContext(0,0), d_offset(0), d_data(data), d_png_ptr(0), d_info_ptr(0)
65PNGImageContext::~PNGImageContext()
68 png_destroy_read_struct(&d_png_ptr, &d_info_ptr, 0);
70 png_destroy_read_struct(&d_png_ptr, 0, 0);
74void PNGImageContext::setImageSize()
76 setWidth(png_get_image_width(d_png_ptr, d_info_ptr));
77 setHeight(png_get_image_height(d_png_ptr, d_info_ptr));
Simple Image Loading LibrarY namespace.
This is an abstract class used to provide data to the loader.
Store the data needed by an ImageLoader object during the parsing of an image.