Add support for PixelFormat (RGBA, ARGB) in Image, add more CFFI methods

This commit is contained in:
Joshua Granick
2015-04-14 13:49:58 -07:00
parent a6cb988d72
commit 560a78db62
14 changed files with 574 additions and 102 deletions

View File

@@ -23,6 +23,7 @@ namespace lime {
int height;
int offsetX;
int offsetY;
bool transparent;
int width;
private:

View File

@@ -6,6 +6,8 @@
#include <graphics/Image.h>
#include <math/ColorMatrix.h>
#include <math/Rectangle.h>
#include <math/Vector2.h>
#include <system/System.h>
namespace lime {
@@ -17,6 +19,9 @@ namespace lime {
public:
static void ColorTransform (Image *image, Rectangle *rect, ColorMatrix *ColorMatrix);
static void CopyChannel (Image* image, Image* sourceImage, Rectangle* sourceRect, Vector2* destPoint, int srcChannel, int destChannel);
static void CopyPixels (Image* image, Image* sourceImage, Rectangle* sourceRect, Vector2* destPoint, bool mergeAlpha);
static void FillRect (Image* image, Rectangle* rect, int color);
static void MultiplyAlpha (Image *image);
static void UnmultiplyAlpha (Image *image);

View File

@@ -14,7 +14,7 @@ namespace lime {
public:
Rectangle ();
Rectangle (value _rect);
Rectangle (value rect);
double height;
double width;

View File

@@ -0,0 +1,29 @@
#ifndef LIME_MATH_VECTOR2_H
#define LIME_MATH_VECTOR2_H
#include <hx/CFFI.h>
namespace lime {
class Vector2 {
public:
Vector2 ();
Vector2 (value vec);
double x;
double y;
};
}
#endif