|
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 |
#include "marker_manager.h"
|
|
Packit |
caffb5 |
|
|
Packit |
caffb5 |
#ifdef SERVER
|
|
Packit |
caffb5 |
#include "fcgi_stdio.h"
|
|
Packit |
caffb5 |
#define logstream FCGI_stdout
|
|
Packit |
caffb5 |
#else
|
|
Packit |
caffb5 |
#define FCGI_stdout stdout
|
|
Packit |
caffb5 |
#define FCGI_stderr stderr
|
|
Packit |
caffb5 |
#define logstream stderr
|
|
Packit |
caffb5 |
#endif /*SERVER */
|
|
Packit |
caffb5 |
|
|
Packit |
caffb5 |
marker_param_t set_marker(codestream_param_t cs, Byte2_t code, OPJ_OFF_T offset,
|
|
Packit |
caffb5 |
Byte2_t length)
|
|
Packit |
caffb5 |
{
|
|
Packit |
caffb5 |
marker_param_t mkr;
|
|
Packit |
caffb5 |
|
|
Packit |
caffb5 |
mkr.cs = cs;
|
|
Packit |
caffb5 |
mkr.code = code;
|
|
Packit |
caffb5 |
mkr.offset = offset;
|
|
Packit |
caffb5 |
mkr.length = length;
|
|
Packit |
caffb5 |
|
|
Packit |
caffb5 |
return mkr;
|
|
Packit |
caffb5 |
}
|
|
Packit |
caffb5 |
|
|
Packit |
caffb5 |
|
|
Packit |
caffb5 |
Byte_t fetch_marker1byte(marker_param_t marker, OPJ_OFF_T offset)
|
|
Packit |
caffb5 |
{
|
|
Packit |
caffb5 |
return fetch_codestream1byte(&(marker.cs), marker.offset + offset);
|
|
Packit |
caffb5 |
}
|
|
Packit |
caffb5 |
|
|
Packit |
caffb5 |
Byte2_t fetch_marker2bytebigendian(marker_param_t marker, OPJ_OFF_T offset)
|
|
Packit |
caffb5 |
{
|
|
Packit |
caffb5 |
return fetch_codestream2bytebigendian(&(marker.cs), marker.offset + offset);
|
|
Packit |
caffb5 |
}
|
|
Packit |
caffb5 |
|
|
Packit |
caffb5 |
Byte4_t fetch_marker4bytebigendian(marker_param_t marker, OPJ_OFF_T offset)
|
|
Packit |
caffb5 |
{
|
|
Packit |
caffb5 |
return fetch_codestream4bytebigendian(&(marker.cs), marker.offset + offset);
|
|
Packit |
caffb5 |
}
|