Browse Source

Lots changed: ImageData can now encode itself to any format you like as long as it's tga, love.filesystem can now write data to files, added EncodedImageData class.

bill@Ixion 16 years ago
parent
commit
3655c9caae

+ 6 - 0
platform/macosx/love.xcodeproj/project.pbxproj

@@ -193,6 +193,7 @@
 		A946D85610425002002BF36C /* Timer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A93E6B8F10420ACC007D418B /* Timer.cpp */; };
 		A946D8571042500F002BF36C /* resources.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A93E6B9410420ACC007D418B /* resources.cpp */; };
 		A946D8A3104254C4002BF36C /* libtcc.c in Sources */ = {isa = PBXBuildFile; fileRef = A93E6AD710420AC5007D418B /* libtcc.c */; };
+		A98D914410507C97008E03F2 /* EncodedImageData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A98D914310507C97008E03F2 /* EncodedImageData.cpp */; };
 		A9B4BA9C1045937F001DBC80 /* ParticleSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9B4BA9A1045937F001DBC80 /* ParticleSystem.cpp */; };
 		A9B4BA9D1045937F001DBC80 /* wrap_ParticleSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9B4BA9B1045937F001DBC80 /* wrap_ParticleSystem.cpp */; };
 		A9D8FC0F1043EBEC0063561F /* libmodplug.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A9DE839E1043D81A00567BA4 /* libmodplug.dylib */; };
@@ -639,6 +640,8 @@
 		A93E6E4810420B4A007D418B /* FreeType.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FreeType.framework; path = /Library/Frameworks/FreeType.framework; sourceTree = "<absolute>"; };
 		A93E6E5210420B57007D418B /* SDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL.framework; path = /Library/Frameworks/SDL.framework; sourceTree = "<absolute>"; };
 		A93E6E5310420B57007D418B /* Lua.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Lua.framework; path = /Library/Frameworks/Lua.framework; sourceTree = "<absolute>"; };
+		A98D913E10507BF9008E03F2 /* EncodedImageData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EncodedImageData.h; sourceTree = "<group>"; };
+		A98D914310507C97008E03F2 /* EncodedImageData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EncodedImageData.cpp; sourceTree = "<group>"; };
 		A9B4BA981045937F001DBC80 /* ParticleSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParticleSystem.h; sourceTree = "<group>"; };
 		A9B4BA991045937F001DBC80 /* wrap_ParticleSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wrap_ParticleSystem.h; sourceTree = "<group>"; };
 		A9B4BA9A1045937F001DBC80 /* ParticleSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ParticleSystem.cpp; sourceTree = "<group>"; };
@@ -1093,6 +1096,8 @@
 			isa = PBXGroup;
 			children = (
 				A93E6AA810420AC3007D418B /* devil */,
+				A98D913E10507BF9008E03F2 /* EncodedImageData.h */,
+				A98D914310507C97008E03F2 /* EncodedImageData.cpp */,
 				A93E6AAD10420AC3007D418B /* Image.h */,
 				A93E6AAE10420AC3007D418B /* ImageData.cpp */,
 				A93E6AAF10420AC3007D418B /* ImageData.h */,
@@ -1789,6 +1794,7 @@
 				A9255DEC1043188D00BA1496 /* SDLMain.m in Sources */,
 				A9B4BA9C1045937F001DBC80 /* ParticleSystem.cpp in Sources */,
 				A9B4BA9D1045937F001DBC80 /* wrap_ParticleSystem.cpp in Sources */,
+				A98D914410507C97008E03F2 /* EncodedImageData.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

+ 14 - 5
src/modules/filesystem/physfs/Filesystem.cpp

@@ -274,10 +274,10 @@ namespace physfs
 		// on-the-fly, or passed as a parameter.
 		File * file;
 		
-		// We know for sure that the second parameter must be a 
-		// a string, so let's check that first.
-		if(!lua_isstring(L, 2))
-			return luaL_error(L, "Second argument must be a string.");
+		// We know for sure that we need a second parameter, so 
+		// let's check that first.
+		if(lua_isnoneornil(L, 2))
+			return luaL_error(L, "Second argument needed.");
 
 		if(lua_isstring(L, 1))
 		{
@@ -302,7 +302,16 @@ namespace physfs
 		}
 
 		size_t length = 0;
-		const char * input = lua_tolstring(L, 2, &length);
+		const char * input;
+		if(lua_isstring(L, 2)) {
+			input = lua_tolstring(L, 2, &length);
+		} else if (luax_istype(L, 2, DATA_T)) {
+			love::Data * data = luax_totype<love::Data>(L, 2, "Data", DATA_T);
+			length = data->getSize();
+			input = (char *)data->getData();
+		} else {
+			return luaL_error(L, "Expected string or data for argument #2.");
+		}
 
 		// Get how much we should write. Length of string default.
 		length = luaL_optint(L, 3, length);

+ 45 - 0
src/modules/image/EncodedImageData.cpp

@@ -0,0 +1,45 @@
+/**
+ * Copyright (c) 2006-2009 LOVE Development Team
+ * 
+ * This software is provided 'as-is', without any express or implied
+ * warranty.  In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ * 
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ * 
+ * 1. The origin of this software must not be misrepresented; you must not
+ *    claim that you wrote the original software. If you use this software
+ *    in a product, an acknowledgment in the product documentation would be
+ *    appreciated but is not required.
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ *    misrepresented as being the original software.
+ * 3. This notice may not be removed or altered from any source distribution.
+ **/
+
+#include "EncodedImageData.h"
+
+namespace love
+{
+namespace image
+{
+	EncodedImageData::EncodedImageData(void * d, Image::ImageFormat f, int s) {
+		data = d;
+		format = f;
+		size = s;
+	}
+	
+	void * EncodedImageData::getData() const {
+		return data;
+	}
+	
+	Image::ImageFormat EncodedImageData::getFormat() {
+		return format;
+	}
+	
+	int EncodedImageData::getSize() const {
+		return size;
+	}
+} // image
+} // love

+ 82 - 0
src/modules/image/EncodedImageData.h

@@ -0,0 +1,82 @@
+/**
+ * Copyright (c) 2006-2009 LOVE Development Team
+ * 
+ * This software is provided 'as-is', without any express or implied
+ * warranty.  In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ * 
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ * 
+ * 1. The origin of this software must not be misrepresented; you must not
+ *    claim that you wrote the original software. If you use this software
+ *    in a product, an acknowledgment in the product documentation would be
+ *    appreciated but is not required.
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ *    misrepresented as being the original software.
+ * 3. This notice may not be removed or altered from any source distribution.
+ **/
+
+#ifndef LOVE_IMAGE_ENCODED_IMAGE_DATA_H
+#define LOVE_IMAGE_ENCODED_IMAGE_DATA_H
+
+// LOVE
+#include <common/Data.h>
+
+#include "Image.h"
+
+namespace love
+{	
+	namespace image
+	{
+		/**
+		 * Represents encoded pixel data. 
+		 **/
+		class EncodedImageData : public Data
+			{
+			public:
+				
+				/**
+				* Constructor.
+				**/
+				EncodedImageData(void * data, Image::ImageFormat format, int size);
+				
+				/**
+				* Destructor.
+				**/
+				virtual ~EncodedImageData(){};
+				
+				// Implements Data.
+				void * getData() const;
+				int getSize() const;
+				
+				/**
+				* Get the format the data is encoded in.
+				**/
+				
+				Image::ImageFormat EncodedImageData::getFormat();
+				
+			private:
+				
+				/**
+				* Actual data.
+				**/
+				void * data;
+				
+				/**
+				* Size of the data.
+				**/
+				int size;
+				
+				/**
+				 * Image format.
+				 **/
+				Image::ImageFormat format;
+				
+			}; // EncodedImageData
+		
+	} // image
+} // love
+
+#endif // LOVE_IMAGE_ENCODED_IMAGE_DATA_H

+ 4 - 0
src/modules/image/Image.h

@@ -76,6 +76,10 @@ namespace image
 		 * @return The new ImageData.
 		 **/
 		virtual ImageData * newImageData(int width, int height, void *data) = 0;
+		
+		enum ImageFormat {
+			FORMAT_TGA
+		};
 
 	}; // Image
 

+ 50 - 50
src/modules/image/ImageData.cpp

@@ -1,50 +1,50 @@
-/**
-* Copyright (c) 2006-2009 LOVE Development Team
-* 
-* This software is provided 'as-is', without any express or implied
-* warranty.  In no event will the authors be held liable for any damages
-* arising from the use of this software.
-* 
-* Permission is granted to anyone to use this software for any purpose,
-* including commercial applications, and to alter it and redistribute it
-* freely, subject to the following restrictions:
-* 
-* 1. The origin of this software must not be misrepresented; you must not
-*    claim that you wrote the original software. If you use this software
-*    in a product, an acknowledgment in the product documentation would be
-*    appreciated but is not required.
-* 2. Altered source versions must be plainly marked as such, and must not be
-*    misrepresented as being the original software.
-* 3. This notice may not be removed or altered from any source distribution.
-**/
-
-#include "ImageData.h"
-
-namespace love
-{
-namespace image
-{
-	void ImageData::paste(ImageData * src, int dx, int dy, int sx, int sy, int sw, int sh)
-	{
-		pixel * s = (pixel *)src->getData();
-		pixel * d = (pixel *)getData();
-
-		for(int i = 0; i < sh; i++)
-		{
-			for(int j = 0; j < sw; j++)
-			{
-				if(inside(dx+j, dy+i) && src->inside(sx+j, sy+i))
-				{
-					d[(dy+i)*getWidth() + (dx+j)] = s[(sy+i)*src->getWidth() + (sx+j)];
-				}
-			}
-		}
-	}
-
-	bool ImageData::inside(int x, int y) const
-	{
-		return (x >= 0 && x < getWidth() && y >= 0 && y < getHeight());
-	}
-
-} // image
-} // love
+/**
+* Copyright (c) 2006-2009 LOVE Development Team
+* 
+* This software is provided 'as-is', without any express or implied
+* warranty.  In no event will the authors be held liable for any damages
+* arising from the use of this software.
+* 
+* Permission is granted to anyone to use this software for any purpose,
+* including commercial applications, and to alter it and redistribute it
+* freely, subject to the following restrictions:
+* 
+* 1. The origin of this software must not be misrepresented; you must not
+*    claim that you wrote the original software. If you use this software
+*    in a product, an acknowledgment in the product documentation would be
+*    appreciated but is not required.
+* 2. Altered source versions must be plainly marked as such, and must not be
+*    misrepresented as being the original software.
+* 3. This notice may not be removed or altered from any source distribution.
+**/
+
+#include "ImageData.h"
+
+namespace love
+{
+namespace image
+{
+	void ImageData::paste(ImageData * src, int dx, int dy, int sx, int sy, int sw, int sh)
+	{
+		pixel * s = (pixel *)src->getData();
+		pixel * d = (pixel *)getData();
+
+		for(int i = 0; i < sh; i++)
+		{
+			for(int j = 0; j < sw; j++)
+			{
+				if(inside(dx+j, dy+i) && src->inside(sx+j, sy+i))
+				{
+					d[(dy+i)*getWidth() + (dx+j)] = s[(sy+i)*src->getWidth() + (sx+j)];
+				}
+			}
+		}
+	}
+
+	bool ImageData::inside(int x, int y) const
+	{
+		return (x >= 0 && x < getWidth() && y >= 0 && y < getHeight());
+	}
+
+} // image
+} // love

+ 48 - 0
src/modules/image/devil/ImageData.cpp

@@ -164,6 +164,54 @@ namespace devil
 		pixel * pixels = (pixel *)getData();
 		return pixels[y*width+x];
 	}
+	
+	love::image::EncodedImageData * ImageData::encodeImageData(love::image::ImageData * d, love::image::Image::ImageFormat f) {
+		ILubyte * data;
+		ILuint w = d->getWidth();
+		ILuint h = d->getHeight();
+		int headerLen, bpp;
+		switch (f) {
+			default: // since we only support one format
+				headerLen = 18;
+				bpp = 3;
+				int size = h * w * bpp;
+				data = new ILubyte[size + headerLen];
+				// here's the header for the Targa file format.
+				data[0] = 0; // ID field size
+				data[1] = 0; // colormap type
+				data[2] = 2; // image type
+				data[3] = data[4] = 0; // colormap start
+				data[5] = data[6] = 0; // colormap length
+				data[7] = 32; // colormap bits
+				data[8] = data[9] = 0; // x origin
+				data[10] = data[11] = 0; // y origin
+				// Targa is little endian, so:
+				data[12] = w & 255; // least significant byte of width
+				data[13] = w >> 8; // most significant byte of width
+				data[14] = h & 255; // least significant byte of height
+				data[15] = h >> 8; // most significant byte of height
+				data[16] = bpp * 8; // bits per pixel
+				data[17] = 0; // descriptor bits
+				// header done. write the pixel data to TGA:
+				data += headerLen;
+				d->getData(); // bind the imagedata's image
+				ilCopyPixels(0,0,0,w,h,1,IL_BGR,IL_UNSIGNED_BYTE,data); // convert the pixels to BGR (remember, little-endian) and copy them to data
+				
+				// It's Targa, so we have to flip the image.
+				int row = w * bpp;
+				ILubyte * temp = new ILubyte[row];
+				ILubyte * src = data - row;
+				ILubyte * dst = data + size;
+				for (int i = 0; i < (h >> 1); i++) {
+					memcpy(temp,src+=row,row);
+					memcpy(src,dst-=row,row);
+					memcpy(dst,temp,row);
+				}
+				data -= headerLen;
+				delete [] temp;
+				return new love::image::EncodedImageData(data, f, size + headerLen);
+		}
+	}
 
 } // devil
 } // image

+ 10 - 0
src/modules/image/devil/ImageData.h

@@ -23,7 +23,9 @@
 
 // LOVE
 #include <filesystem/File.h>
+#include <image/Image.h>
 #include <image/ImageData.h>
+#include <image/EncodedImageData.h>
 
 // DevIL
 #include <IL/il.h>
@@ -72,6 +74,14 @@ namespace devil
 		int getHeight() const ;
 		void setPixel(int x, int y, pixel c);
 		pixel getPixel(int x, int y) const;
+		
+		/**
+		 * Encodes raw pixel data into a given format.
+		 * @param d The pixel data to be converted.
+		 * @param f The format to convert to.
+		 * @return A pointer to the encoded image data.
+		 **/
+		static love::image::EncodedImageData * encodeImageData(love::image::ImageData * d, love::image::Image::ImageFormat f);
 
 	}; // ImageData
 

+ 111 - 99
src/modules/image/wrap_Image.cpp

@@ -1,97 +1,109 @@
-/**
-* Copyright (c) 2006-2009 LOVE Development Team
-* 
-* This software is provided 'as-is', without any express or implied
-* warranty.  In no event will the authors be held liable for any damages
-* arising from the use of this software.
-* 
-* Permission is granted to anyone to use this software for any purpose,
-* including commercial applications, and to alter it and redistribute it
-* freely, subject to the following restrictions:
-* 
-* 1. The origin of this software must not be misrepresented; you must not
-*    claim that you wrote the original software. If you use this software
-*    in a product, an acknowledgment in the product documentation would be
-*    appreciated but is not required.
-* 2. Altered source versions must be plainly marked as such, and must not be
-*    misrepresented as being the original software.
-* 3. This notice may not be removed or altered from any source distribution.
-**/
-
-#include "wrap_Image.h"
-
-#include "devil/Image.h"
-
-namespace love
-{
-namespace image
-{
-	static Image * instance = 0;
-
-	int w_newImageData(lua_State * L)
-	{
-
-		// Case 1: Integers.
-		if(lua_isnumber(L, 1))
-		{
-			int w = luaL_checkint(L, 1);
-			int h = luaL_checkint(L, 2);
-			ImageData * t = instance->newImageData(w, h);
-			luax_newtype(L, "ImageData", IMAGE_IMAGE_DATA_T, (void*)t);
-			return 1;
-		}
-
-		// Case 2: Data
-		if(luax_istype(L, 1, DATA_T))
-		{
-			Data * d = luax_checktype<Data>(L, 1, "Data", DATA_T);
-			ImageData * t;
-			try {
-				t = instance->newImageData(d);
-			} catch (love::Exception & e) {
-				return luaL_error(L, e.what());
-			}
-			luax_newtype(L, "ImageData", IMAGE_IMAGE_DATA_T, (void*)t);
-			return 1;
-		}
-
-		// Case 3: String/File.
-
-		// Convert to File, if necessary.
-		if(lua_isstring(L, 1))
-			luax_convobj(L, 1, "filesystem", "newFile");
-
-		love::filesystem::File * file = luax_checktype<love::filesystem::File>(L, 1, "File", FILESYSTEM_FILE_T);
-		ImageData * t = instance->newImageData(file);
-		luax_newtype(L, "ImageData", IMAGE_IMAGE_DATA_T, (void*)t);
-		return 1;
-	}
-
-	// List of functions to wrap.
-	static const luaL_Reg functions[] = {
-		{ "newImageData",  w_newImageData },
-		{ 0, 0 }
-	};
-
-	static const lua_CFunction types[] = {
-		luaopen_imagedata,
-		0
-	};
-
-	int luaopen_love_image(lua_State * L)
-	{
-		if(instance == 0)
-		{
-			try 
-			{
-				instance = new love::image::devil::Image();
-			} 
-			catch(Exception & e)
-			{
-				return luaL_error(L, e.what());
-			}
-		}
-
+/**
+* Copyright (c) 2006-2009 LOVE Development Team
+* 
+* This software is provided 'as-is', without any express or implied
+* warranty.  In no event will the authors be held liable for any damages
+* arising from the use of this software.
+* 
+* Permission is granted to anyone to use this software for any purpose,
+* including commercial applications, and to alter it and redistribute it
+* freely, subject to the following restrictions:
+* 
+* 1. The origin of this software must not be misrepresented; you must not
+*    claim that you wrote the original software. If you use this software
+*    in a product, an acknowledgment in the product documentation would be
+*    appreciated but is not required.
+* 2. Altered source versions must be plainly marked as such, and must not be
+*    misrepresented as being the original software.
+* 3. This notice may not be removed or altered from any source distribution.
+**/
+
+#include "wrap_Image.h"
+
+#include <common/Data.h>
+
+#include "devil/Image.h"
+#include "devil/ImageData.h"
+
+namespace love
+{
+namespace image
+{
+	static Image * instance = 0;
+
+	int w_newImageData(lua_State * L)
+	{
+
+		// Case 1: Integers.
+		if(lua_isnumber(L, 1))
+		{
+			int w = luaL_checkint(L, 1);
+			int h = luaL_checkint(L, 2);
+			ImageData * t = instance->newImageData(w, h);
+			luax_newtype(L, "ImageData", IMAGE_IMAGE_DATA_T, (void*)t);
+			return 1;
+		}
+
+		// Case 2: Data
+		if(luax_istype(L, 1, DATA_T))
+		{
+			Data * d = luax_checktype<Data>(L, 1, "Data", DATA_T);
+			ImageData * t;
+			try {
+				t = instance->newImageData(d);
+			} catch (love::Exception & e) {
+				return luaL_error(L, e.what());
+			}
+			luax_newtype(L, "ImageData", IMAGE_IMAGE_DATA_T, (void*)t);
+			return 1;
+		}
+
+		// Case 3: String/File.
+
+		// Convert to File, if necessary.
+		if(lua_isstring(L, 1))
+			luax_convobj(L, 1, "filesystem", "newFile");
+
+		love::filesystem::File * file = luax_checktype<love::filesystem::File>(L, 1, "File", FILESYSTEM_FILE_T);
+		ImageData * t = instance->newImageData(file);
+		luax_newtype(L, "ImageData", IMAGE_IMAGE_DATA_T, (void*)t);
+		return 1;
+	}
+	
+	int w_newEncodedImageData(lua_State * L) {
+		ImageData * t = luax_checkimagedata(L, 1);
+		Image::ImageFormat format = (Image::ImageFormat)luaL_optint(L, 2, Image::FORMAT_TGA);
+		EncodedImageData * e = love::image::devil::ImageData::encodeImageData(t, format);
+		luax_newtype(L, "Data", DATA_T, (void*)e); // since we don't need any of EncodedImageData's features
+		return 1;
+	}
+
+	// List of functions to wrap.
+	static const luaL_Reg functions[] = {
+		{ "newImageData",  w_newImageData },
+		{ "newEncodedImageData", w_newEncodedImageData },
+		{ 0, 0 }
+	};
+
+	static const lua_CFunction types[] = {
+		luaopen_imagedata,
+		0
+	};
+
+	int luaopen_love_image(lua_State * L)
+	{
+		if(instance == 0)
+		{
+			try 
+			{
+				instance = new love::image::devil::Image();
+			} 
+			catch(Exception & e)
+			{
+				return luaL_error(L, e.what());
+			}
+		}
+
 		WrappedModule w;
 		w.module = instance;
 		w.name = "image";
@@ -100,8 +112,8 @@ namespace image
 		w.types = types;
 		w.constants = 0;
 
-		return luax_register_module(L, w);
-	}
-
-} // image
-} // love
+		return luax_register_module(L, w);
+	}
+
+} // image
+} // love

+ 41 - 39
src/modules/image/wrap_Image.h

@@ -1,39 +1,41 @@
-/**
-* Copyright (c) 2006-2009 LOVE Development Team
-* 
-* This software is provided 'as-is', without any express or implied
-* warranty.  In no event will the authors be held liable for any damages
-* arising from the use of this software.
-* 
-* Permission is granted to anyone to use this software for any purpose,
-* including commercial applications, and to alter it and redistribute it
-* freely, subject to the following restrictions:
-* 
-* 1. The origin of this software must not be misrepresented; you must not
-*    claim that you wrote the original software. If you use this software
-*    in a product, an acknowledgment in the product documentation would be
-*    appreciated but is not required.
-* 2. Altered source versions must be plainly marked as such, and must not be
-*    misrepresented as being the original software.
-* 3. This notice may not be removed or altered from any source distribution.
-**/
-
-#ifndef LOVE_IMAGE_WRAP_IMAGE_H
-#define LOVE_IMAGE_WRAP_IMAGE_H
-
-// LOVE
-#include "Image.h"
-#include "wrap_ImageData.h"
-
-namespace love
-{
-namespace image
-{
-	int w_getFormats(lua_State * L);
-	int w_newImageData(lua_State * L);
-	extern "C" LOVE_EXPORT int luaopen_love_image(lua_State * L);
-
-} // image
-} // love
-
-#endif // LOVE_IMAGE_WRAP_IMAGE_H
+/**
+* Copyright (c) 2006-2009 LOVE Development Team
+* 
+* This software is provided 'as-is', without any express or implied
+* warranty.  In no event will the authors be held liable for any damages
+* arising from the use of this software.
+* 
+* Permission is granted to anyone to use this software for any purpose,
+* including commercial applications, and to alter it and redistribute it
+* freely, subject to the following restrictions:
+* 
+* 1. The origin of this software must not be misrepresented; you must not
+*    claim that you wrote the original software. If you use this software
+*    in a product, an acknowledgment in the product documentation would be
+*    appreciated but is not required.
+* 2. Altered source versions must be plainly marked as such, and must not be
+*    misrepresented as being the original software.
+* 3. This notice may not be removed or altered from any source distribution.
+**/
+
+#ifndef LOVE_IMAGE_WRAP_IMAGE_H
+#define LOVE_IMAGE_WRAP_IMAGE_H
+
+// LOVE
+#include "Image.h"
+#include "EncodedImageData.h"
+#include "wrap_ImageData.h"
+
+namespace love
+{
+namespace image
+{
+	int w_getFormats(lua_State * L);
+	int w_newImageData(lua_State * L);
+	int w_newEncodedImageData(lua_State * L);
+	extern "C" LOVE_EXPORT int luaopen_love_image(lua_State * L);
+
+} // image
+} // love
+
+#endif // LOVE_IMAGE_WRAP_IMAGE_H