#ifndef JPEG2000_H #define JPEG2000_H #ifdef __cplusplus extern "C" { #endif #include "bizchan.h" /** wrap jpeg2000 compress and decompress function */ /** only accept rgb24 color space now */ typedef struct jpeg2k_raw_image { unsigned char *data; int len; int width; int height; }jpeg2k_raw_image; typedef struct jpeg2k_coded_image { unsigned char *data; int len; int width; int height; }jpeg2k_coded_image; /** * encoding to jpeg2000 codec stream from raw rgb24 picture * @param raw rgb24 picture that provided by user * @param coded result image, all things in codec must be zero, memory will allocated by this function * @param ratio compress ration from 0 to 100, 0 means no compress, 100 full compress * @return return 0 on success */ BIZCHAN_API(int) jpeg2k_encode(jpeg2k_raw_image *raw, jpeg2k_coded_image * coded, int ratio); /** * free jpeg2k_encode coded image */ BIZCHAN_API(void) jpeg2k_encode_free(jpeg2k_coded_image * coded); /** * decoding to raw rgb24 picture from jpeg2000 codec stream * @param raw rgb24 picture that must be zero, memory will allocated by this function * @param coded result image, all things in codec must be zero * @return return 0 on success */ BIZCHAN_API(int) jpeg2k_decode(jpeg2k_raw_image *raw, jpeg2k_coded_image * codec); /** * free jpeg2k_decode raw image */ BIZCHAN_API(void) jpeg2k_decode_free(jpeg2k_raw_image *raw); #ifdef __cplusplus }//extern "C" { #endif #endif // JPEG2000_H