Move decoder-agnostic love.image code out of the magpie backend folder.

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2017-08-01 23:22:24 -03:00
parent 217552b5ff
commit 84d5d8b636
37 changed files with 631 additions and 921 deletions
+8 -11
View File
@@ -18,10 +18,9 @@
* 3. This notice may not be removed or altered from any source distribution.
**/
#ifndef LOVE_IMAGE_MAGPIE_STB_HANDLER_H
#define LOVE_IMAGE_MAGPIE_STB_HANDLER_H
#pragma once
#include "FormatHandler.h"
#include "image/FormatHandler.h"
namespace love
{
@@ -37,24 +36,22 @@ namespace magpie
* We could use stb_image to decode PNG as well, but performance and
* comprehensive format support is lacking compared to some alternatives.
**/
class STBHandler : public FormatHandler
class STBHandler final : public FormatHandler
{
public:
// Implements FormatHandler.
virtual bool canDecode(love::filesystem::FileData *data);
virtual bool canEncode(PixelFormat rawFormat, ImageData::EncodedFormat encodedFormat);
bool canDecode(love::filesystem::FileData *data) override;
bool canEncode(PixelFormat rawFormat, EncodedFormat encodedFormat) override;
virtual DecodedImage decode(love::filesystem::FileData *data);
virtual EncodedImage encode(const DecodedImage &img, ImageData::EncodedFormat format);
DecodedImage decode(love::filesystem::FileData *data) override;
EncodedImage encode(const DecodedImage &img, EncodedFormat format) override;
virtual void free(unsigned char *mem);
void free(unsigned char *mem) override;
}; // STBHandler
} // magpie
} // image
} // love
#endif // LOVE_IMAGE_MAGPIE_STB_HANDLER_H