Add some convenience Image functions.

This commit is contained in:
Pavel Krajcevski 2013-10-11 12:12:08 -04:00
parent dd1c3351ea
commit 42c6f85642

View file

@ -59,6 +59,7 @@ namespace FasTC {
class Image {
public:
Image() : m_Width(0), m_Height(0), m_Pixels(0) { }
Image(uint32 width, uint32 height);
Image(uint32 width, uint32 height,
const PixelType *pixels,
@ -95,6 +96,15 @@ namespace FasTC {
}
bool GetBlockStreamOrder() const { return m_bBlockStreamOrder; }
template<typename OtherPixelType>
void ConvertTo(Image<OtherPixelType> &other) const {
for(uint32 j = 0; j < other.GetWidth(); j++) {
for(uint32 i = 0; i < other.GetHeight(); i++) {
other(i, j).Unpack((*this)(i, j).Pack());
}
}
}
double ComputePSNR(Image<PixelType> *other);
// Function to allow derived classes to populate the pixel array.