mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-25 20:25:42 +00:00
(RJPEG) Add rjpeg_alloc
This commit is contained in:
parent
98a403defd
commit
d3df016005
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user