mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 05:38:56 +00:00
56 lines
2.0 KiB
C++
56 lines
2.0 KiB
C++
/* ScummVM - Graphic Adventure Engine
|
|
*
|
|
* ScummVM is the legal property of its developers, whose names
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
* file distributed with this source distribution.
|
|
*
|
|
* 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
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*
|
|
*/
|
|
|
|
/*
|
|
* This file contains an example implementation of the Scale effect
|
|
* applied to a generic bitmap.
|
|
*
|
|
* You can find a high-level description of the effect at:
|
|
*
|
|
* https://www.scale2x.it
|
|
*
|
|
* Alternatively at the previous license terms, you are allowed to use this
|
|
* code in your program with these conditions:
|
|
* - the program is not used in commercial activities.
|
|
* - the whole source code of the program is released with the binary.
|
|
* - derivative works of the program are allowed.
|
|
*/
|
|
|
|
#ifndef SCALER_SCALEBIT_H
|
|
#define SCALER_SCALEBIT_H
|
|
|
|
#include "graphics/scalerplugin.h"
|
|
|
|
int scale_precondition(unsigned scale, unsigned pixel, unsigned width, unsigned height);
|
|
void scale(unsigned scale, void* void_dst, unsigned dst_slice, const void* void_src, unsigned src_slice, unsigned pixel, unsigned width, unsigned height);
|
|
|
|
class AdvMameScaler : public Scaler {
|
|
public:
|
|
AdvMameScaler(const Graphics::PixelFormat &format) : Scaler(format) { _factor = 2; }
|
|
uint increaseFactor() override;
|
|
uint decreaseFactor() override;
|
|
protected:
|
|
virtual void scaleIntern(const uint8 *srcPtr, uint32 srcPitch,
|
|
uint8 *dstPtr, uint32 dstPitch, int width, int height, int x, int y) override;
|
|
};
|
|
|
|
#endif
|