Skip to content

Commit

Permalink
Update xBRZ texture filter to version 1.4
Browse files Browse the repository at this point in the history
xBRZ: "Scale by rules" - high quality image upscaling filter by Zenju

Adopted sources from
http://sourceforge.net/projects/xbrz/files/xBRZ/
  • Loading branch information
gonetz committed Aug 17, 2015
1 parent 2f34089 commit daf18ef
Show file tree
Hide file tree
Showing 5 changed files with 548 additions and 566 deletions.
1 change: 1 addition & 0 deletions src/GLideNHQ/Ext_TxFilter.h
Expand Up @@ -82,6 +82,7 @@ typedef unsigned char boolean;
#define BRZ3X_ENHANCEMENT 0x00000900
#define BRZ4X_ENHANCEMENT 0x00000a00
#define BRZ5X_ENHANCEMENT 0x00000b00
#define BRZ6X_ENHANCEMENT 0x00000c00

#define HIRESTEXTURES_MASK 0x000f0000
#define NO_HIRESTEXTURES 0x00000000
Expand Down
11 changes: 7 additions & 4 deletions src/GLideNHQ/TextureFilters.cpp
Expand Up @@ -678,17 +678,20 @@ void SmoothFilter_4444(uint16 *src, uint32 srcwidth, uint32 srcheight, uint16 *d
void filter_8888(uint32 *src, uint32 srcwidth, uint32 srcheight, uint32 *dest, uint32 filter) {
switch (filter & ENHANCEMENT_MASK) {
case BRZ2X_ENHANCEMENT:
xbrz::xbrz_scale(2, (const uint32_t *)const_cast<const uint32 *>(src), (uint32_t *)dest, srcwidth, srcheight, xbrz::ColorFormat::ABGR);
xbrz::scale(2, (const uint32_t *)const_cast<const uint32 *>(src), (uint32_t *)dest, srcwidth, srcheight, xbrz::ColorFormat::ABGR);
return;
case BRZ3X_ENHANCEMENT:
xbrz::xbrz_scale(3, (const uint32_t *)const_cast<const uint32 *>(src), (uint32_t *)dest, srcwidth, srcheight, xbrz::ColorFormat::ABGR);
xbrz::scale(3, (const uint32_t *)const_cast<const uint32 *>(src), (uint32_t *)dest, srcwidth, srcheight, xbrz::ColorFormat::ABGR);
return;
case BRZ4X_ENHANCEMENT:
xbrz::xbrz_scale(4, (const uint32_t *)const_cast<const uint32 *>(src), (uint32_t *)dest, srcwidth, srcheight, xbrz::ColorFormat::ABGR);
xbrz::scale(4, (const uint32_t *)const_cast<const uint32 *>(src), (uint32_t *)dest, srcwidth, srcheight, xbrz::ColorFormat::ABGR);
return;
case BRZ5X_ENHANCEMENT:
xbrz::xbrz_scale(5, (const uint32_t *)const_cast<const uint32 *>(src), (uint32_t *)dest, srcwidth, srcheight, xbrz::ColorFormat::ABGR);
xbrz::scale(5, (const uint32_t *)const_cast<const uint32 *>(src), (uint32_t *)dest, srcwidth, srcheight, xbrz::ColorFormat::ABGR);
return;
case BRZ6X_ENHANCEMENT:
xbrz::scale(6, (const uint32_t *)const_cast<const uint32 *>(src), (uint32_t *)dest, srcwidth, srcheight, xbrz::ColorFormat::ABGR);
return;
case HQ4X_ENHANCEMENT:
hq4x_8888((uint8*)src, (uint8*)dest, srcwidth, srcheight, srcwidth, (srcwidth << 4));
return;
Expand Down

0 comments on commit daf18ef

Please sign in to comment.