Skip to content

Commit

Permalink
Improved hq2x implementation:
Browse files Browse the repository at this point in the history
* Fixed: Filter sampling did not wrap around texture borders resulting in noticeable artefacts when tiled.
* Changed: Removed 24 to 16-bit color downsampling when doing RGB to YUV conversion (merged changes by Cameron Zemek see here: http://code.google.com/p/hqx/).
* Optimize: Removed additional 16bit matrix as now unnecessary.

Todo: Make new wrap behavior call-time optional.
  • Loading branch information
danij-deng committed Feb 25, 2011
1 parent 82fc9ae commit d22926a
Show file tree
Hide file tree
Showing 3 changed files with 679 additions and 882 deletions.
27 changes: 17 additions & 10 deletions doomsday/engine/portable/include/gl_hq2x.h
@@ -1,9 +1,10 @@
/**\file
/**\file gl_hq2x.h
*\section License
* License: GPL
* Online License Link: http://www.gnu.org/licenses/gpl.html
*
*\author Copyright © 2003-2009 Jaakko Keränen <jaakko.keranen@iki.fi>
*\author Copyright © 2003-2011 Jaakko Keränen <jaakko.keranen@iki.fi>
*\author Copyright © 2009-2011 Daniel Swanson <danij@dengine.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -21,15 +22,21 @@
* Boston, MA 02110-1301 USA
*/

/*
* gl_hq2x.h: High-Quality 2x Graphics Resizing
/**
* High-Quality 2x Graphics Resizing.
*/

#ifndef __DOOMSDAY_HQ2X_H__
#define __DOOMSDAY_HQ2X_H__
#ifndef LIBDENG_GRAPHICS_HQ2X_H
#define LIBDENG_GRAPHICS_HQ2X_H

void GL_InitSmartFilter(void);
void GL_SmartFilter2x(unsigned char *pIn, unsigned char *pOut,
int Xres, int Yres, int BpL);
/**
* Initialize the lookup tables used in the hq2x algorithm.
*/
void GL_InitSmartFilter(void);

/**
* Operates on 32-bit pixels.
*/
void GL_SmartFilter2x(const uint8_t* src, int width, int height, uint8_t* dst);

#endif
#endif /* LIBDENG_GRAPHICS_HQ2X_H */

0 comments on commit d22926a

Please sign in to comment.