(RJPEG) Add rjpeg_alloc

This commit is contained in:
twinaphex 2016-05-13 08:13:21 +02:00
parent 98a403defd
commit d3df016005
3 changed files with 19 additions and 0 deletions

View File

@ -38,6 +38,7 @@ void *image_transfer_new(enum image_type_enum type)
break;
case IMAGE_TYPE_JPEG:
#ifdef HAVE_RJPEG
return rjpeg_alloc();
#endif
break;
}

View File

@ -33,6 +33,7 @@
#include <retro_inline.h>
#include <boolean.h>
#include <formats/image.h>
#include <formats/rjpeg.h>
#include <features/features_cpu.h>
enum
@ -64,6 +65,11 @@ typedef struct
int ypos; /* which pre-expansion row we're on */
} rjpeg__resample;
struct rjpeg
{
void *empty;
};
#ifdef _MSC_VER
#define RJPEG_HAS_LROTL
#endif
@ -2460,3 +2466,11 @@ bool rjpeg_image_load(uint8_t *_buf, void *data, size_t size,
return true;
}
void *rjpeg_alloc(void)
{
rjpeg_t *rjpeg = (rjpeg_t*)calloc(1, sizeof(*rjpeg));
if (!rjpeg)
return NULL;
return rjpeg;
}

View File

@ -32,9 +32,13 @@
RETRO_BEGIN_DECLS
typedef struct rjpeg rjpeg_t;
bool rjpeg_image_load(uint8_t *buf, void *data, size_t size,
unsigned a_shift, unsigned r_shift, unsigned g_shift, unsigned b_shift);
void *rjpeg_alloc(void);
RETRO_END_DECLS
#endif