Blame src/lib/openjpip/mhixbox_manager.h

Packit caffb5
/*
Packit caffb5
 * $Id$
Packit caffb5
 *
Packit caffb5
 * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
Packit caffb5
 * Copyright (c) 2002-2014, Professor Benoit Macq
Packit caffb5
 * Copyright (c) 2010-2011, Kaori Hagihara
Packit caffb5
 * All rights reserved.
Packit caffb5
 *
Packit caffb5
 * Redistribution and use in source and binary forms, with or without
Packit caffb5
 * modification, are permitted provided that the following conditions
Packit caffb5
 * are met:
Packit caffb5
 * 1. Redistributions of source code must retain the above copyright
Packit caffb5
 *    notice, this list of conditions and the following disclaimer.
Packit caffb5
 * 2. Redistributions in binary form must reproduce the above copyright
Packit caffb5
 *    notice, this list of conditions and the following disclaimer in the
Packit caffb5
 *    documentation and/or other materials provided with the distribution.
Packit caffb5
 *
Packit caffb5
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
Packit caffb5
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Packit caffb5
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Packit caffb5
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
Packit caffb5
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
Packit caffb5
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
Packit caffb5
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
Packit caffb5
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
Packit caffb5
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
Packit caffb5
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
Packit caffb5
 * POSSIBILITY OF SUCH DAMAGE.
Packit caffb5
 */
Packit caffb5
Packit caffb5
#ifndef     MHIXBOX_MANAGER_H_
Packit caffb5
# define    MHIXBOX_MANAGER_H_
Packit caffb5
Packit caffb5
#include "byte_manager.h"
Packit caffb5
#include "box_manager.h"
Packit caffb5
Packit caffb5
/** Marker index parameters*/
Packit caffb5
typedef struct markeridx_param {
Packit caffb5
    Byte2_t code;                 /**< marker code*/
Packit caffb5
    Byte2_t num_remain;           /**< remining number of the same marker index segments listed immediately*/
Packit caffb5
    OPJ_OFF_T offset;               /**< offset relative to the start of the*/
Packit caffb5
    /**codestream ( including the length*/
Packit caffb5
    /**parameter but not the marker itself)*/
Packit caffb5
    Byte2_t length;               /**< marker segment length*/
Packit caffb5
    struct markeridx_param *next; /**< pointer to the next markeridx*/
Packit caffb5
} markeridx_param_t;
Packit caffb5
Packit caffb5
Packit caffb5
Packit caffb5
/** header index table box parameters*/
Packit caffb5
/** I.3.2.4.3 Header Index Table box*/
Packit caffb5
typedef struct mhixbox_param {
Packit caffb5
    Byte8_t tlen;             /**< length ( total length of the main*/
Packit caffb5
    /**header or of the first tile-part header)*/
Packit caffb5
    markeridx_param_t *first; /**< first marker index pointer of the list*/
Packit caffb5
} mhixbox_param_t;
Packit caffb5
Packit caffb5
Packit caffb5
Packit caffb5
/**
Packit caffb5
 * generate mhix box
Packit caffb5
 *
Packit caffb5
 * @param[in] box pointer to the reference mhix box
Packit caffb5
 * @return        generated mhixbox pointer
Packit caffb5
 */
Packit caffb5
mhixbox_param_t * gene_mhixbox(box_param_t *box);
Packit caffb5
Packit caffb5
Packit caffb5
/**
Packit caffb5
 * search a marker index by marker code from mhix box
Packit caffb5
 *
Packit caffb5
 * @param[in] code marker code
Packit caffb5
 * @param[in] mhix mhix box pointer
Packit caffb5
 * @return         found marker index pointer
Packit caffb5
 */
Packit caffb5
markeridx_param_t * search_markeridx(Byte2_t code, mhixbox_param_t *mhix);
Packit caffb5
Packit caffb5
Packit caffb5
/**
Packit caffb5
 * print mhix box parameters
Packit caffb5
 *
Packit caffb5
 * @param[in] mhix mhix box pointer
Packit caffb5
 */
Packit caffb5
void print_mhixbox(mhixbox_param_t *mhix);
Packit caffb5
Packit caffb5
Packit caffb5
/**
Packit caffb5
 * print marker index parameters
Packit caffb5
 *
Packit caffb5
 * @param[in] markeridx marker index pointer
Packit caffb5
 */
Packit caffb5
void print_markeridx(markeridx_param_t *markeridx);
Packit caffb5
Packit caffb5
Packit caffb5
/**
Packit caffb5
 * delete mhix box
Packit caffb5
 *
Packit caffb5
 * @param[in,out] mhix address of the mhix box pointer
Packit caffb5
 */
Packit caffb5
void delete_mhixbox(mhixbox_param_t **mhix);
Packit caffb5
Packit caffb5
#endif      /* !MHIXBOX_MANAGER_H_ */