Add more CFFI methods, improve use within the tools (force color order)

This commit is contained in:
Joshua Granick
2015-04-14 16:15:32 -07:00
parent e2c2359726
commit 8680d42d25
8 changed files with 607 additions and 354 deletions

View File

@@ -0,0 +1,19 @@
#ifndef LIME_GRAPHICS_PIXEL_FORMAT_H
#define LIME_GRAPHICS_PIXEL_FORMAT_H
namespace lime {
enum PixelFormat {
RGBA,
ARGB
};
}
#endif

View File

@@ -4,10 +4,12 @@
#include <hx/CFFI.h>
#include <graphics/Image.h>
#include <graphics/PixelFormat.h>
#include <math/ColorMatrix.h>
#include <math/Rectangle.h>
#include <math/Vector2.h>
#include <system/System.h>
#include <utils/ByteArray.h>
namespace lime {
@@ -18,13 +20,16 @@ namespace lime {
public:
static void ColorTransform (Image *image, Rectangle *rect, ColorMatrix *ColorMatrix);
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 FloodFill (Image* image, int x, int y, int color);
static void MultiplyAlpha (Image *image);
static void UnmultiplyAlpha (Image *image);
static void GetPixels (Image* image, Rectangle* rect, PixelFormat format, ByteArray* pixels);
static void Merge (Image* image, Image* sourceImage, Rectangle* sourceRect, Vector2* destPoint, int redMultiplier, int greenMultiplier, int blueMultiplier, int alphaMultiplier);
static void MultiplyAlpha (Image* image);
static void Resize (Image* image, ImageBuffer* buffer, int width, int height);
static void UnmultiplyAlpha (Image* image);
};