Replaced the devil love.image module with love.image.magpie, which can decide which image library to use in a similar manner to love.sound.lullaby. Some rough edges still exist.

love.filesystem.newFileData now accepts filepaths and File objects.

--HG--
branch : image-CompressedData
This commit is contained in:
Alex Szpakowski
2013-04-07 17:18:34 -03:00
parent 8a8adcce39
commit 88d64954a4
22 changed files with 846 additions and 531 deletions
+13 -31
View File
@@ -35,8 +35,10 @@ namespace image
/**
* This module is responsible for decoding files such as PNG, GIF, JPEG
* into raw pixel data. This module does not know how to draw images on
* screen; only love.graphics knows that.
* into raw pixel data, as well as parsing compressed formats which are designed
* to be uploaded to the GPU and rendered without being un-compressed.
* This module does not know how to draw images on screen; only love.graphics
* knows that.
**/
class Image : public Module
{
@@ -48,18 +50,11 @@ public:
virtual ~Image() {};
/**
* Creates new ImageData from a file.
* @param file The file containing the encoded image data.
* Creates new ImageData from FileData.
* @param data The FileData containing the encoded image data.
* @return The new ImageData.
**/
virtual ImageData *newImageData(love::filesystem::File *file) = 0;
/**
* Creates new ImageData from a raw Data.
* @param data The object containing encoded pixel data.
* @return The new ImageData.
**/
virtual ImageData *newImageData(Data *data) = 0;
virtual ImageData *newImageData(love::filesystem::FileData *data) = 0;
/**
* Creates empty ImageData with the given size.
@@ -79,30 +74,17 @@ public:
virtual ImageData *newImageData(int width, int height, void *data) = 0;
/**
* Creates new CompressedData from a file.
* @param file The file containing the compressed image data.
* Creates new CompressedData from FileData.
* @param data The FileData containing the compressed image data.
* @return The new CompressedData.
**/
virtual CompressedData *newCompressedData(love::filesystem::File *file) = 0;
virtual CompressedData *newCompressedData(love::filesystem::FileData *data) = 0;
/**
* Creates new CompressedData from a raw Data.
* @param data The object containing the compressed image data.
* @return The new CompressedData.
* Determines whether a FileData is Compressed image data or not.
* @param data The FileData to test.
**/
virtual CompressedData *newCompressedData(Data *data) = 0;
/**
* Determines whether a File is Compressed image data or not.
* @param file The file to test.
**/
virtual bool isCompressed(love::filesystem::File *file) = 0;
/**
* Determines whether a raw Data is Compressed image data or not.
* @param data The data to test.
**/
virtual bool isCompressed(Data *data) = 0;
virtual bool isCompressed(love::filesystem::FileData *data) = 0;
}; // Image