1 /* 2 * OpenBOR - http://www.LavaLit.com 3 * ----------------------------------------------------------------------- 4 * Licensed under the BSD license, see LICENSE in OpenBOR root for details. 5 * 6 * Copyright (c) 2004 - 2011 OpenBOR Team 7 */ 8 9 #ifndef __IMAGE_H__ 10 #define __IMAGE_H__ 11 12 #include <psptypes.h> 13 14 typedef u32 Color; 15 typedef struct 16 { 17 int textureWidth; 18 int textureHeight; 19 int imageWidth; 20 int imageHeight; 21 Color* data; 22 } 23 Image; 24 Image *text; 25 26 Image* loadImage(const char* filename); 27 void saveImage(const char* filename); 28 Image* createImage(int width, int height); 29 void freeImage(Image* image); 30 void clearImage(Image* image, Color color); 31 void putPixelToImage(Image* image, Color color, int x, int y); 32 Color getPixelFromImage(Image* image, int x, int y); 33 void drawLineInImage(Image* image, Color color, int x0, int y0, int x1, int y1); 34 void fillImageRect(Image* image, Color color, int x0, int y0, int width, int height); 35 void fillImageEllipse(Image* image, Color color, int x0, int y0, int width, int height, int r); 36 void copyImageToImage(int sx, int sy, int width, int height, Image* source, int dx, int dy, Image* destination); 37 void drawImageBox(Image *source, Color background, Color border, int borderwidth); 38 39 #endif 40