![]() |
openATV enigma2
openATV is an open source SetTopBox Graphical user interface.
|
#include <png.h>#include <fcntl.h>#include <lib/base/cfile.h>#include <lib/base/wrappers.h>#include <lib/gdi/picload.h>#include <lib/gdi/picexif.h>#include <jpeglib.h>#include <gif_lib.h>#include <nanosvg.h>#include <nanosvgrast.h>Classes | |
| struct | color |
| struct | r_jpeg_error_mgr |
Macros | |
| #define | PNG_SKIP_SETJMP_CHECK |
| #define | NANOSVG_ALL_COLOR_KEYWORDS |
| #define | NANOSVG_IMPLEMENTATION |
| #define | NANOSVGRAST_IMPLEMENTATION |
| #define | BMP_TORASTER_OFFSET 10 |
| #define | BMP_SIZE_OFFSET 18 |
| #define | BMP_BPP_OFFSET 28 |
| #define | BMP_RLE_OFFSET 30 |
| #define | BMP_COLOR_OFFSET 54 |
| #define | fill4B(a) ((4 - ((a) % 4 )) & 0x03) |
Functions | |
| DEFINE_REF (ePicLoad) | |
| static std::string | getSize (const char *file) |
| static int | convert_8Bit_to_24Bit (Cfilepara *filepara, unsigned char *dest) |
| static unsigned char * | simple_resize_24 (unsigned char *orgin, int ox, int oy, int dx, int dy) |
| static unsigned char * | simple_resize_8 (unsigned char *orgin, int ox, int oy, int dx, int dy) |
| static unsigned char * | color_resize (unsigned char *orgin, int ox, int oy, int dx, int dy) |
| static void | fetch_pallete (int fd, struct color pallete[], int count) |
| static unsigned char * | bmp_load (const char *file, int *x, int *y) |
| static void | png_load (Cfilepara *filepara, unsigned int background) |
| Load a png. More... | |
| void | jpeg_cb_error_exit (j_common_ptr cinfo) |
| static unsigned char * | jpeg_load (const char *file, int *ox, int *oy, unsigned int max_x, unsigned int max_y) |
| static int | jpeg_save (const char *filename, int ox, int oy, unsigned char *pic_buffer) |
| void | m_rend_gif_decodecolormap (unsigned char *cmb, unsigned char *rgbb, ColorMapObject *cm, int s, int l) |
| static void | svg_load (Cfilepara *filepara, bool forceRGB=false) |
| static void | gif_load (Cfilepara *filepara) |
| SWIG_VOID (int) loadPic(ePtr< gPixmap > &result | |
| eDebug ("[ePicLoad] deprecated loadPic function used!!! please use the non blocking version! you can see demo code in Pictureplayer plugin... this function is removed in the near future!") | |
| switch (aspect) | |
| PyTuple_SET_ITEM (tuple, 0, PyLong_FromLong(x)) | |
| PyTuple_SET_ITEM (tuple, 1, PyLong_FromLong(y)) | |
| PyTuple_SET_ITEM (tuple, 2, PyLong_FromLong(asp1)) | |
| PyTuple_SET_ITEM (tuple, 3, PyLong_FromLong(asp2)) | |
| PyTuple_SET_ITEM (tuple, 4, PyLong_FromLong(0)) | |
| PyTuple_SET_ITEM (tuple, 5, PyLong_FromLong(resize_mode)) | |
| if (background) PyTuple_SET_ITEM(tuple | |
| PyString_FromString ("#ff000000")) | |
| else | PyTuple_SET_ITEM (tuple, 6, PyString_FromString("#00000000")) |
| mPL | setPara (tuple) |
| if (!mPL.startDecode(filename.c_str(), 0, 0, false)) mPL.getData(result) | |
Variables | |
| const uint32_t | crc32_table [256] |
| std::string | filename |
| std::string int | x |
| std::string int int | y |
| std::string int int int | aspect |
| std::string int int int int | resize_mode |
| std::string int int int int int | rotate |
| std::string int int int int int unsigned int | background |
| std::string int int int int int unsigned int std::string | cachefile |
| ePyObject | tuple = PyTuple_New(7) |
| ePicLoad | mPL |
| else | result = 0 |
| return | |
| #define BMP_BPP_OFFSET 28 |
| #define BMP_COLOR_OFFSET 54 |
| #define BMP_RLE_OFFSET 30 |
| #define BMP_SIZE_OFFSET 18 |
| #define BMP_TORASTER_OFFSET 10 |
| #define fill4B | ( | a | ) | ((4 - ((a) % 4 )) & 0x03) |
| #define NANOSVG_ALL_COLOR_KEYWORDS |
| #define NANOSVG_IMPLEMENTATION |
| #define NANOSVGRAST_IMPLEMENTATION |
| #define PNG_SKIP_SETJMP_CHECK |
|
static |
|
static |
|
static |
| DEFINE_REF | ( | ePicLoad | ) |
| eDebug | ( | " deprecated loadPic function used!!! please use the non blocking version! you can see demo code in Pictureplayer plugin... this function is removed in the near future!" | [ePicLoad] | ) |
|
static |
|
static |
|
static |
| if | ( | !mPL. | startDecodefilename.c_str(), 0, 0, false | ) |
| if | ( | background | ) |
| void jpeg_cb_error_exit | ( | j_common_ptr | cinfo | ) |
|
static |
|
static |
|
inline |
|
static |
Load a png.
If you make change to png_load, check the functionality with PngSuite
http://www.schaik.com/pngsuite/
These are test images in all standard PNG.
| filepara | |
| background |
| PyString_FromString | ( | "#ff000000" | ) |
| PyTuple_SET_ITEM | ( | tuple | , |
| 0 | , | ||
| PyLong_FromLong(x) | |||
| ) |
| PyTuple_SET_ITEM | ( | tuple | , |
| 1 | , | ||
| PyLong_FromLong(y) | |||
| ) |
| PyTuple_SET_ITEM | ( | tuple | , |
| 2 | , | ||
| PyLong_FromLong(asp1) | |||
| ) |
| PyTuple_SET_ITEM | ( | tuple | , |
| 3 | , | ||
| PyLong_FromLong(asp2) | |||
| ) |
| PyTuple_SET_ITEM | ( | tuple | , |
| 4 | , | ||
| PyLong_FromLong(0) | |||
| ) |
| PyTuple_SET_ITEM | ( | tuple | , |
| 5 | , | ||
| PyLong_FromLong(resize_mode) | |||
| ) |
| else PyTuple_SET_ITEM | ( | tuple | , |
| 6 | , | ||
| PyString_FromString("#00000000") | |||
| ) |
|
static |
|
static |
|
static |
| SWIG_VOID | ( | int | ) | & |
| switch | ( | aspect | ) |
| std::string int int int aspect |
| std::string int int int int int unsigned int background |
| std::string int int int int int unsigned int std::string cachefile |
|
extern |
| std::string filename |
| ePicLoad mPL |
| std::string int int int int resize_mode |
| else result = 0 |
| return |
| std::string int int int int int rotate |
| ePyObject tuple = PyTuple_New(7) |
| std::string int x |
| std::string int int y |