mirror of
https://github.com/yuzu-emu/FasTC
synced 2024-11-23 14:23:37 +00:00
Split apart the index calculation and pixel lookup functions
This commit is contained in:
parent
16cc7f4a93
commit
e609075d04
2 changed files with 7 additions and 2 deletions
|
@ -252,7 +252,11 @@ void Image::ExpandTo8888() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const Pixel &Image::GetPixel(int32 i, int32 j, EWrapMode wrapMode) {
|
const Pixel &Image::GetPixel(int32 i, int32 j, EWrapMode wrapMode) const {
|
||||||
|
return m_Pixels[GetPixelIndex(i, j, wrapMode)];
|
||||||
|
}
|
||||||
|
|
||||||
|
const uint32 Image::GetPixelIndex(int32 i, int32 j, EWrapMode wrapMode) const {
|
||||||
while(i < 0) {
|
while(i < 0) {
|
||||||
if(wrapMode == eWrapMode_Clamp) {
|
if(wrapMode == eWrapMode_Clamp) {
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|
|
@ -87,7 +87,8 @@ class Image {
|
||||||
Pixel *m_Pixels;
|
Pixel *m_Pixels;
|
||||||
Pixel *m_FractionalPixels;
|
Pixel *m_FractionalPixels;
|
||||||
|
|
||||||
const Pixel &GetPixel(int32 i, int32 j, EWrapMode wrapMode = eWrapMode_Clamp);
|
const uint32 GetPixelIndex(int32 i, int32 j, EWrapMode wrapMode = eWrapMode_Clamp) const;
|
||||||
|
const Pixel &GetPixel(int32 i, int32 j, EWrapMode wrapMode = eWrapMode_Clamp) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace PVRTCC
|
} // namespace PVRTCC
|
||||||
|
|
Loading…
Reference in a new issue