Remove unused scale_surface_nn

XBRZ version of NN scaling, which we have already with scale_surface_sharp.
This commit is contained in:
Charles Dang 2024-08-15 19:34:16 -04:00
parent 8bf49639ea
commit d7a9421d26
2 changed files with 0 additions and 44 deletions

View file

@ -91,42 +91,6 @@ surface scale_surface_xbrz(const surface & surf, std::size_t z)
return dst;
}
surface scale_surface_nn (const surface & surf, int w, int h)
{
// Since SDL version 1.1.5 0 is transparent, before 255 was transparent.
assert(SDL_ALPHA_TRANSPARENT==0);
if (surf == nullptr)
return nullptr;
if(w == surf->w && h == surf->h) {
return surf;
}
assert(w >= 0);
assert(h >= 0);
surface dst(w,h);
if (w == 0 || h ==0) {
PLAIN_LOG << "Create an empty image";
return dst;
}
if(surf == nullptr || dst == nullptr) {
PLAIN_LOG << "Could not create surface to scale onto";
return nullptr;
}
{
const_surface_lock src_lock(surf);
surface_lock dst_lock(dst);
xbrz::nearestNeighborScale(src_lock.pixels(), surf->w, surf->h, dst_lock.pixels(), w, h);
}
return dst;
}
// NOTE: Don't pass this function 0 scaling arguments.
surface scale_surface(const surface &surf, int w, int h)
{

View file

@ -68,14 +68,6 @@ inline void sdl_blit(const surface& src, const SDL_Rect* src_rect, surface& dst,
*/
surface scale_surface_xbrz(const surface & surf, std::size_t z);
/** Scale a surface using the nearest neighbor algorithm (provided by xBRZ lib)
* @param surf The sources surface
* @param w The width of the resulting surface.
* @param h The height of the resulting surface.
* @return The rescaled surface.
*/
surface scale_surface_nn(const surface & surf, int w, int h);
/** Scale a surface using alpha-weighted modified bilinear filtering
* Note: causes artifacts with alpha gradients, for example in some portraits
* @param surf The source surface.