jp2k_decoder.c File Reference
`#include <stdio.h>`
`#include <string.h>`
`#include <stdlib.h>`
`#include <assert.h>`
`#include <limits.h>`
`#include "jp2k_decoder.h"`
`#include "openjpeg.h"`

## Functions

static void | error_callback (const char *msg, void *client_data)
| sample error callback expecting a FILE* client object
static void | warning_callback (const char *msg, void *client_data)
| sample warning callback expecting a FILE* client object
static void | info_callback (const char *msg, void *client_data)
| sample debug callback expecting no client object
static Byte_t * | imagetopnm (opj_image_t *image, ihdrbox_param_t **ihdrbox)
Byte_t * | j2k_to_pnm (const char *fn, ihdrbox_param_t **ihdrbox)

## Function Documentation

## error_callback()

static void error_callback | ( | const char * | msg,
|  | void * | client_data
| ) |  |

static

sample error callback expecting a FILE* client object

Referenced by j2k_to_pnm().

## imagetopnm()

static Byte_t * imagetopnm | ( | opj_image_t * | image,
|  | ihdrbox_param_t ** | ihdrbox
| ) |  |

static

References opj_image::comps, opj_image_comp::data, opj_image_comp::h, opj_image::numcomps, opj_image_comp::prec, opj_image_comp::sgnd, opj_image_comp::w, and ihdrbox_param::width.

Referenced by j2k_to_pnm().

## info_callback()

static void info_callback | ( | const char * | msg,
|  | void * | client_data
| ) |  |

static

sample debug callback expecting no client object

Referenced by j2k_to_pnm().

## j2k_to_pnm()

Byte_t * j2k_to_pnm | ( | const char * | fn,
|  | ihdrbox_param_t ** | ihdrbox
| ) |  |

References opj_dparameters::DA_x0, opj_dparameters::DA_x1, opj_dparameters::DA_y0, opj_dparameters::DA_y1, error_callback(), imagetopnm(), info_callback(), OPJ_CODEC_J2K, opj_create_decompress(), opj_decode(), opj_destroy_codec(), opj_end_decompress(), opj_image_destroy(), opj_read_header(), opj_set_decode_area(), opj_set_default_decoder_parameters(), opj_set_error_handler(), opj_set_info_handler(), opj_set_warning_handler(), opj_setup_decoder(), opj_stream_create_default_file_stream(), opj_stream_destroy(), OPJ_TRUE, and warning_callback().

Referenced by jpipstream_to_pnm().

## warning_callback()

static void warning_callback | ( | const char * | msg,
|  | void * | client_data
| ) |  |

static

sample warning callback expecting a FILE* client object

Referenced by j2k_to_pnm().