OpenJPEG 2.1.0

pi.h

Go to the documentation of this file.
00001 /*
00002  * The copyright in this software is being made available under the 2-clauses 
00003  * BSD License, included below. This software may be subject to other third 
00004  * party and contributor rights, including patent rights, and no such rights
00005  * are granted under this license.
00006  *
00007  * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
00008  * Copyright (c) 2002-2014, Professor Benoit Macq
00009  * Copyright (c) 2001-2003, David Janssens
00010  * Copyright (c) 2002-2003, Yannick Verschueren
00011  * Copyright (c) 2003-2007, Francois-Olivier Devaux 
00012  * Copyright (c) 2003-2014, Antonin Descampe
00013  * Copyright (c) 2005, Herve Drolon, FreeImage Team
00014  * All rights reserved.
00015  *
00016  * Redistribution and use in source and binary forms, with or without
00017  * modification, are permitted provided that the following conditions
00018  * are met:
00019  * 1. Redistributions of source code must retain the above copyright
00020  *    notice, this list of conditions and the following disclaimer.
00021  * 2. Redistributions in binary form must reproduce the above copyright
00022  *    notice, this list of conditions and the following disclaimer in the
00023  *    documentation and/or other materials provided with the distribution.
00024  *
00025  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
00026  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00028  * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
00029  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00030  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00031  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00032  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00033  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00034  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00035  * POSSIBILITY OF SUCH DAMAGE.
00036  */
00037 
00038 #ifndef __PI_H
00039 #define __PI_H
00040 
00051 
00055 typedef struct opj_pi_resolution {
00056   OPJ_UINT32 pdx, pdy;
00057   OPJ_UINT32 pw, ph;
00058 } opj_pi_resolution_t;
00059 
00063 typedef struct opj_pi_comp {
00064   OPJ_UINT32 dx, dy;
00066   OPJ_UINT32 numresolutions;
00067   opj_pi_resolution_t *resolutions;
00068 } opj_pi_comp_t;
00069 
00073 typedef struct opj_pi_iterator {
00075   OPJ_BYTE tp_on;
00077   OPJ_INT16 *include;
00079   OPJ_UINT32 step_l;
00081   OPJ_UINT32 step_r;
00083   OPJ_UINT32 step_c;
00085   OPJ_UINT32 step_p;
00087   OPJ_UINT32 compno;
00089   OPJ_UINT32 resno;
00091   OPJ_UINT32 precno;
00093   OPJ_UINT32 layno;
00095   OPJ_BOOL first;
00097   opj_poc_t poc;
00099   OPJ_UINT32 numcomps;
00101   opj_pi_comp_t *comps;
00103   OPJ_INT32 tx0, ty0, tx1, ty1;
00105   OPJ_INT32 x, y;
00107   OPJ_UINT32 dx, dy;
00108 } opj_pi_iterator_t;
00109 
00112 /* ----------------------------------------------------------------------- */
00123 opj_pi_iterator_t *opj_pi_initialise_encode(const opj_image_t *image,
00124                                             opj_cp_t *cp,
00125                                             OPJ_UINT32 tileno,
00126                                             J2K_T2_MODE t2_mode);
00127 
00135 void opj_pi_update_encoding_parameters( const opj_image_t *p_image,
00136                                         opj_cp_t *p_cp,
00137                                         OPJ_UINT32 p_tile_no );
00138 
00149 void opj_pi_create_encode(  opj_pi_iterator_t *pi, 
00150                             opj_cp_t *cp,
00151                             OPJ_UINT32 tileno, 
00152                             OPJ_UINT32 pino,
00153                             OPJ_UINT32 tpnum, 
00154                             OPJ_INT32 tppos, 
00155                             J2K_T2_MODE t2_mode);
00156 
00165 opj_pi_iterator_t *opj_pi_create_decode(opj_image_t * image, 
00166                                         opj_cp_t * cp,
00167                                         OPJ_UINT32 tileno);
00174 void opj_pi_destroy(opj_pi_iterator_t *p_pi,
00175                     OPJ_UINT32 p_nb_elements);
00176 
00182 OPJ_BOOL opj_pi_next(opj_pi_iterator_t * pi);
00183 /* ----------------------------------------------------------------------- */
00187 
00188 #endif /* __PI_H */