Blender V2.61 - r43446
|
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "imbuf.h"
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
#include "IMB_allocimbuf.h"
#include "IMB_filetype.h"
#include "openjpeg.h"
Go to the source code of this file.
Classes | |
struct | img_folder |
Defines | |
#define | JP2_FILEHEADER_SIZE 14 |
#define | UPSAMPLE_8_TO_12(_val) ((_val<<4) | (_val & ((1<<4)-1))) |
#define | UPSAMPLE_8_TO_16(_val) ((_val<<8)+_val) |
#define | DOWNSAMPLE_FLOAT_TO_8BIT(_val) (_val)<=0.0f?0: ((_val)>=1.0f?255: (int)(255.0f*(_val))) |
#define | DOWNSAMPLE_FLOAT_TO_12BIT(_val) (_val)<=0.0f?0: ((_val)>=1.0f?4095: (int)(4095.0f*(_val))) |
#define | DOWNSAMPLE_FLOAT_TO_16BIT(_val) (_val)<=0.0f?0: ((_val)>=1.0f?65535: (int)(65535.0f*(_val))) |
#define | CINEMA_24_CS 1302083 |
#define | CINEMA_48_CS 651041 |
#define | COMP_24_CS 1041666 |
#define | COMP_48_CS 520833 |
Typedefs | |
typedef struct img_folder | img_fol_t |
Functions | |
static int | check_jp2 (unsigned char *mem) |
int | imb_is_a_jp2 (unsigned char *buf) |
static void | error_callback (const char *msg, void *client_data) |
static void | warning_callback (const char *msg, void *client_data) |
static void | info_callback (const char *msg, void *client_data) |
struct ImBuf * | imb_jp2_decode (unsigned char *mem, size_t size, int flags) |
static int | initialise_4K_poc (opj_poc_t *POC, int numres) |
static void | cinema_parameters (opj_cparameters_t *parameters) |
static void | cinema_setup_encoder (opj_cparameters_t *parameters, opj_image_t *image, img_fol_t *img_fol) |
static opj_image_t * | ibuftoimage (ImBuf *ibuf, opj_cparameters_t *parameters) |
int | imb_savejp2 (struct ImBuf *ibuf, const char *name, int flags) |
Variables | |
static char | JP2_HEAD [] = {0x0, 0x0, 0x0, 0x0C, 0x6A, 0x50, 0x20, 0x20, 0x0D, 0x0A, 0x87, 0x0A} |
Definition in file jp2.c.
#define CINEMA_24_CS 1302083 |
Definition at line 305 of file jp2.c.
Referenced by cinema_setup_encoder().
#define CINEMA_48_CS 651041 |
Definition at line 306 of file jp2.c.
Referenced by cinema_setup_encoder().
#define COMP_24_CS 1041666 |
Definition at line 307 of file jp2.c.
Referenced by cinema_setup_encoder().
#define COMP_48_CS 520833 |
Definition at line 308 of file jp2.c.
Referenced by cinema_setup_encoder().
#define DOWNSAMPLE_FLOAT_TO_12BIT | ( | _val | ) | (_val)<=0.0f?0: ((_val)>=1.0f?4095: (int)(4095.0f*(_val))) |
Definition at line 291 of file jp2.c.
Referenced by ibuftoimage().
#define DOWNSAMPLE_FLOAT_TO_16BIT | ( | _val | ) | (_val)<=0.0f?0: ((_val)>=1.0f?65535: (int)(65535.0f*(_val))) |
Definition at line 292 of file jp2.c.
Referenced by ibuftoimage().
#define DOWNSAMPLE_FLOAT_TO_8BIT | ( | _val | ) | (_val)<=0.0f?0: ((_val)>=1.0f?255: (int)(255.0f*(_val))) |
Definition at line 290 of file jp2.c.
Referenced by ibuftoimage().
#define UPSAMPLE_8_TO_12 | ( | _val | ) | ((_val<<4) | (_val & ((1<<4)-1))) |
Definition at line 287 of file jp2.c.
Referenced by ibuftoimage().
#define UPSAMPLE_8_TO_16 | ( | _val | ) | ((_val<<8)+_val) |
Definition at line 288 of file jp2.c.
Referenced by ibuftoimage().
typedef struct img_folder img_fol_t |
static int check_jp2 | ( | unsigned char * | mem | ) | [static] |
Definition at line 59 of file jp2.c.
References JP2_HEAD.
Referenced by imb_is_a_jp2(), and imb_jp2_decode().
static void cinema_parameters | ( | opj_cparameters_t * | parameters | ) | [static] |
Definition at line 330 of file jp2.c.
Referenced by ibuftoimage().
static void cinema_setup_encoder | ( | opj_cparameters_t * | parameters, |
opj_image_t * | image, | ||
img_fol_t * | img_fol | ||
) | [static] |
Definition at line 364 of file jp2.c.
References CINEMA_24_CS, CINEMA_48_CS, COMP_24_CS, COMP_48_CS, i, initialise_4K_poc(), and img_folder::rates.
Referenced by ibuftoimage().
static void error_callback | ( | const char * | msg, |
void * | client_data | ||
) | [static] |
sample error callback expecting a FILE* client object
Definition at line 73 of file jp2.c.
Referenced by imb_jp2_decode(), and imb_savejp2().
static opj_image_t* ibuftoimage | ( | ImBuf * | ibuf, |
opj_cparameters_t * | parameters | ||
) | [static] |
Definition at line 451 of file jp2.c.
References cinema_parameters(), cinema_setup_encoder(), copy_v3_v3(), DOWNSAMPLE_FLOAT_TO_12BIT, DOWNSAMPLE_FLOAT_TO_16BIT, DOWNSAMPLE_FLOAT_TO_8BIT, ImBuf::ftype, i, IB_PROFILE_LINEAR_RGB, if(), linearrgb_to_srgb_v3_v3(), MEM_freeN(), MEM_mallocN(), NULL, ImBuf::planes, ImBuf::profile, img_folder::rates, ImBuf::rect, ImBuf::rect_float, UPSAMPLE_8_TO_12, UPSAMPLE_8_TO_16, simple_enum_gen::w, ImBuf::x, and ImBuf::y.
Referenced by imb_savejp2().
int imb_is_a_jp2 | ( | unsigned char * | buf | ) |
Definition at line 64 of file jp2.c.
References check_jp2().
struct ImBuf* imb_jp2_decode | ( | unsigned char * | mem, |
size_t | size, | ||
int | flags | ||
) | [read] |
Definition at line 97 of file jp2.c.
References check_jp2(), error_callback(), ImBuf::ftype, i, IB_rect, IB_rectfloat, if(), IMB_allocImBuf(), IMB_rect_from_float(), ImBuf::index, info_callback(), NULL, ImBuf::planes, ImBuf::rect, ImBuf::rect_float, simple_enum_gen::w, and warning_callback().
int imb_savejp2 | ( | struct ImBuf * | ibuf, |
const char * | name, | ||
int | flags | ||
) |
Definition at line 671 of file jp2.c.
References error_callback(), ImBuf::ftype, ibuftoimage(), info_callback(), NULL, and warning_callback().
static void info_callback | ( | const char * | msg, |
void * | client_data | ||
) | [static] |
sample debug callback expecting no client object
Definition at line 89 of file jp2.c.
Referenced by imb_jp2_decode(), and imb_savejp2().
static int initialise_4K_poc | ( | opj_poc_t * | POC, |
int | numres | ||
) | [static] |
Definition at line 311 of file jp2.c.
Referenced by cinema_setup_encoder().
static void warning_callback | ( | const char * | msg, |
void * | client_data | ||
) | [static] |
sample warning callback expecting a FILE* client object
Definition at line 81 of file jp2.c.
Referenced by imb_jp2_decode(), and imb_savejp2().
char JP2_HEAD[] = {0x0, 0x0, 0x0, 0x0C, 0x6A, 0x50, 0x20, 0x20, 0x0D, 0x0A, 0x87, 0x0A} [static] |
Definition at line 43 of file jp2.c.
Referenced by check_jp2().