mirror of
https://github.com/yuzu-emu/FasTC
synced 2024-11-23 12:23:45 +00:00
Add some convenience Image functions.
This commit is contained in:
parent
dd1c3351ea
commit
42c6f85642
1 changed files with 10 additions and 0 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue