mirror of
https://github.com/yuzu-emu/FasTC.git
synced 2025-01-09 02:35:41 +00:00
Add some convenience Image functions.
This commit is contained in:
parent
dd1c3351ea
commit
42c6f85642
|
@ -59,6 +59,7 @@ namespace FasTC {
|
||||||
class Image {
|
class Image {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
Image() : m_Width(0), m_Height(0), m_Pixels(0) { }
|
||||||
Image(uint32 width, uint32 height);
|
Image(uint32 width, uint32 height);
|
||||||
Image(uint32 width, uint32 height,
|
Image(uint32 width, uint32 height,
|
||||||
const PixelType *pixels,
|
const PixelType *pixels,
|
||||||
|
@ -95,6 +96,15 @@ namespace FasTC {
|
||||||
}
|
}
|
||||||
bool GetBlockStreamOrder() const { return m_bBlockStreamOrder; }
|
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);
|
double ComputePSNR(Image<PixelType> *other);
|
||||||
|
|
||||||
// Function to allow derived classes to populate the pixel array.
|
// Function to allow derived classes to populate the pixel array.
|
||||||
|
|
Loading…
Reference in a new issue