initial image_data_any read(...) implementation - always read into image_data_32

This commit is contained in:
artemp 2014-12-03 10:56:19 +01:00
parent 1df9d89a70
commit 802428712e
4 changed files with 12 additions and 4 deletions

View file

@ -316,7 +316,9 @@ void jpeg_reader<T>::read(unsigned x0, unsigned y0, image_data_32& image)
template <typename T>
image_data_any jpeg_reader<T>::read(unsigned x, unsigned y, unsigned width, unsigned height)
{
return image_data_any();
image_data_32 data(width,height);
read(x, y, data);
return image_data_any(std::move(data));
}
}

View file

@ -306,7 +306,9 @@ void png_reader<T>::read(unsigned x0, unsigned y0,image_data_32& image)
template <typename T>
image_data_any png_reader<T>::read(unsigned x, unsigned y, unsigned width, unsigned height)
{
return image_data_any();
image_data_32 data(width,height);
read(x, y, data);
return image_data_any(std::move(data));
}
}

View file

@ -300,7 +300,9 @@ void tiff_reader<T>::read(unsigned x,unsigned y,image_data_32& image)
template <typename T>
image_data_any tiff_reader<T>::read(unsigned x, unsigned y, unsigned width, unsigned height)
{
return image_data_any();
image_data_32 data(width,height);
read(x, y, data);
return image_data_any(std::move(data));
}
template <typename T>

View file

@ -264,7 +264,9 @@ void webp_reader<T>::read(unsigned x0, unsigned y0,image_data_32& image)
template <typename T>
image_data_any webp_reader<T>::read(unsigned x, unsigned y, unsigned width, unsigned height)
{
return image_data_any();
image_data_32 data(width,height);
read(x, y, data);
return image_data_any(std::move(data));
}
}