Adding JPEG/PNG file loading (PVRTC stub)
This commit is contained in:
committed by
Joshua Granick
parent
429f9bac86
commit
9f6debd95b
@@ -1,15 +1,28 @@
|
||||
#ifndef LIME_GRAPHICS_IMAGE_DATA_H
|
||||
#define LIME_GRAPHICS_IMAGE_DATA_H
|
||||
|
||||
#include <hx/CFFI.h>
|
||||
#include <utils/ByteArray.h>
|
||||
|
||||
|
||||
namespace lime {
|
||||
|
||||
|
||||
struct ImageData {
|
||||
class ImageData {
|
||||
|
||||
public:
|
||||
|
||||
int width;
|
||||
int height;
|
||||
unsigned char data;
|
||||
ByteArray *data;
|
||||
|
||||
ImageData();
|
||||
~ImageData();
|
||||
value Value();
|
||||
|
||||
private:
|
||||
|
||||
value mValue;
|
||||
|
||||
};
|
||||
|
||||
|
||||
23
project/include/graphics/JPEG.h
Normal file
23
project/include/graphics/JPEG.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef LIME_GRAPHICS_JPEG_H
|
||||
#define LIME_GRAPHICS_JPEG_H
|
||||
|
||||
|
||||
namespace lime {
|
||||
|
||||
class ImageData;
|
||||
|
||||
class JPEG {
|
||||
|
||||
|
||||
public:
|
||||
|
||||
static bool Decode (const char *path, ImageData *imageData);
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
@@ -2,19 +2,16 @@
|
||||
#define LIME_GRAPHICS_PNG_H
|
||||
|
||||
|
||||
#include <graphics/ImageData.h>
|
||||
#include <utils/ByteArray.h>
|
||||
|
||||
|
||||
namespace lime {
|
||||
|
||||
class ImageData;
|
||||
|
||||
class PNG {
|
||||
|
||||
|
||||
public:
|
||||
|
||||
static void Decode (ByteArray bytes, value imageData);
|
||||
static bool Decode (const char *path, ImageData *imageData);
|
||||
|
||||
|
||||
};
|
||||
|
||||
23
project/include/graphics/PVRTC.h
Normal file
23
project/include/graphics/PVRTC.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef LIME_GRAPHICS_PVRTC_H
|
||||
#define LIME_GRAPHICS_PVRTC_H
|
||||
|
||||
|
||||
namespace lime {
|
||||
|
||||
class ImageData;
|
||||
|
||||
class PVRTC {
|
||||
|
||||
|
||||
public:
|
||||
|
||||
static bool Decode (const char *path, ImageData *imageData);
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user