forked from ngageoint/six-library
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Squashed 'externals/coda-oss/' changes from 43cd38f..026c665
026c665 Merge pull request ngageoint#255 from mdaus/updateWscripts b88a2ce Update wscripts to work properly 059e0fc Merge pull request ngageoint#254 from mdaus/ignoreJ2k 374e701 Add new driver to gitignore bca6b3c Merge pull request ngageoint#253 from mdaus/addJ2k 7fb4541 Add J2K driver from NITRO 9063b5f Merge pull request ngageoint#252 from mdaus/ceilingDivide 29ebc51 Remove unneeded headers 928998b Remove commented code 629deda Move ceilingDivide to .cpp; apply elsewhere 4a953b8 Add ceilingDivide function; update Python git-subtree-dir: externals/coda-oss git-subtree-split: 026c6652d9866f5d29cae085df9f1f6864774ca3
- Loading branch information
1 parent
6e8ceb5
commit 0d512c1
Showing
21 changed files
with
627 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* ========================================================================= | ||
* This file is part of math-c++ | ||
* ========================================================================= | ||
* | ||
* (C) Copyright 2004 - 2018, MDA Information Systems LLC | ||
* | ||
* math-c++ is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation; either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this program; If not, | ||
* see <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
#include <except/Exception.h> | ||
#include <math/Round.h> | ||
#include <sys/Conf.h> | ||
|
||
namespace math | ||
{ | ||
size_t ceilingDivide(size_t numerator, size_t denominator) | ||
{ | ||
if (denominator == 0) | ||
{ | ||
throw except::Exception(Ctxt("Attempted division by 0")); | ||
} | ||
return (numerator / denominator) + (numerator % denominator != 0); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
import os, sys | ||
from os.path import join, exists | ||
from waflib import Options | ||
from waflib.TaskGen import feature, before, task_gen | ||
from build import untarFile | ||
|
||
SOURCE = 'jasper-1.900.1-mod' | ||
|
||
options = lambda x : None | ||
|
||
def configure(conf): | ||
|
||
j2kLayer = Options.options.j2k_layer | ||
|
||
if j2kLayer == 'jasper' : | ||
# NOTE: JasPer will compile in 64-bit mode, but it internally uses | ||
# 32-bit integers for some offsets. To prevent confusion/badness, | ||
# just don't allow it for a 64-bit build. | ||
if conf.env['IS64BIT'] : | ||
conf.msg('JPEG2000 library', 'jasper not available on 64-bit architectures', color='YELLOW') | ||
return | ||
|
||
# callback function to check for all #defines used by the jasper module | ||
def jas_callback(conf): | ||
# check functionality | ||
conf.check_cc(header_name="sys/types.h", define_name='HAVE_SYS_TYPES_H') | ||
conf.check_cc(type_name='uchar', header_name='sys/types.h', mandatory=False) | ||
conf.check_cc(type_name='ushort', header_name='sys/types.h', mandatory=False) | ||
conf.check_cc(type_name='longlong', header_name='sys/types.h', mandatory=False) | ||
conf.check_cc(type_name='ulonglong', header_name='sys/types.h', mandatory=False) | ||
|
||
conf.define('PACKAGE', 'jasper') | ||
conf.define('PACKAGE_NAME', 'jasper') | ||
conf.define('JAS_VERSION', '1.900.1') | ||
conf.define('PACKAGE_STRING', 'jasper 1.900.1') | ||
conf.define('PACKAGE_VERSION', '1.900.1') | ||
conf.define('PACKAGE_TARNAME', 'jasper') | ||
conf.define('VERSION', '1.900.1') | ||
|
||
# check for the source tarball | ||
# TODO: I believe this file has some local mods and is not exactly | ||
# the vanilla tarball - need to confirm | ||
if not exists(join(conf.path.abspath(), SOURCE + '.tar')): | ||
conf.fatal('Missing JasPer tarfile') | ||
|
||
# setup env | ||
conf.env['MAKE_JASPER'] = True | ||
conf.env['MAKE_J2K'] = True | ||
conf.env['HAVE_J2K'] = True | ||
conf.msg('Building local lib', j2kLayer) | ||
untarFile(path=conf.path, fname=SOURCE + '.tar') | ||
|
||
jasperNode = bld.path.make_node(join(SOURCE, 'include', 'jasper')) | ||
writeConfig(conf, jas_callback, 'jas', infile=None, outfile='jas_config.h', | ||
path=jasperNode, feature='makeHeader') | ||
|
||
def build(bld): | ||
env = bld.get_env() | ||
|
||
# check it again just in case | ||
if 'MAKE_JASPER' in env : | ||
jasperDefs = [] | ||
if Options.platform.startswith('win'): | ||
jasperDefs.append('JAS_WIN_MSVC_BUILD') | ||
|
||
includes = 'bmp include jp2 jpc jpg mif pgx pnm ras'.split() | ||
sources = ( | ||
'bmp/bmp_cod.c', | ||
'bmp/bmp_dec.c', | ||
'bmp/bmp_enc.c', | ||
'base/jas_cm.c', | ||
'base/jas_debug.c', | ||
'base/jas_getopt.c', | ||
'base/jas_icc.c', | ||
'base/jas_iccdata.c', | ||
'base/jas_image.c', | ||
'base/jas_init.c', | ||
'base/jas_malloc.c', | ||
'base/jas_seq.c', | ||
'base/jas_stream.c', | ||
'base/jas_string.c', | ||
'base/jas_tmr.c', | ||
'base/jas_tvp.c', | ||
'base/jas_version.c', | ||
'jp2/jp2_cod.c', | ||
'jp2/jp2_dec.c', | ||
'jp2/jp2_enc.c', | ||
'jpc/jpc_bs.c', | ||
'jpc/jpc_cs.c', | ||
'jpc/jpc_dec.c', | ||
'jpc/jpc_enc.c', | ||
'jpc/jpc_math.c', | ||
'jpc/jpc_mct.c', | ||
'jpc/jpc_mqcod.c', | ||
'jpc/jpc_mqdec.c', | ||
'jpc/jpc_mqenc.c', | ||
'jpc/jpc_qmfb.c', | ||
'jpc/jpc_t1cod.c', | ||
'jpc/jpc_t1dec.c', | ||
'jpc/jpc_t1enc.c', | ||
'jpc/jpc_t2cod.c', | ||
'jpc/jpc_t2dec.c', | ||
'jpc/jpc_t2enc.c', | ||
'jpc/jpc_tagtree.c', | ||
'jpc/jpc_tsfb.c', | ||
'jpc/jpc_util.c', | ||
'jpg/jpg_dummy.c', | ||
'jpg/jpg_val.c', | ||
'mif/mif_cod.c', | ||
'pgx/pgx_cod.c', | ||
'pgx/pgx_dec.c', | ||
'pgx/pgx_enc.c', | ||
'pnm/pnm_cod.c', | ||
'pnm/pnm_dec.c', | ||
'pnm/pnm_enc.c', | ||
'ras/ras_cod.c', | ||
'ras/ras_dec.c', | ||
'ras/ras_enc.c', | ||
) | ||
|
||
jasper = bld(features='c cstlib add_targets', includes=includes, | ||
source=sources, | ||
target='jasper', | ||
name='J2K', | ||
export_includes='include', | ||
defines=env['DEFINES'] + jasperDefs, | ||
targets_to_add='config_h', | ||
env=env.derive(), | ||
path=bld.path.make_node(SOURCE)) | ||
|
||
# install lib | ||
if env['install_libs']: | ||
jasper.install_path = env['install_libdir'] | ||
|
||
# TODO: install headers | ||
|
||
def distclean(context): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
The openjpeg-2.3.0_mod.tar file is a slight modification of a release of | ||
OpenJPEG 2.3.0. These changes allow for compressing a single tile within an | ||
image, in order to use multiple threads for compression. | ||
|
||
diff -wr openjpeg-2.3.0_mod openjpeg-2.3.0 | ||
diff -wr openjpeg-2.3.0_mod/src/lib/openjp2/j2k.c openjpeg-2.3.0/src/lib/openjp2/j2k.c | ||
11352c11352,11353 | ||
< p_j2k->m_current_tile_number = p_tile_index; | ||
--- | ||
> opj_event_msg(p_manager, EVT_ERROR, "The given tile index does not | ||
> match."); | ||
> return OPJ_FALSE; | ||
11534a11536,11537 | ||
> ++p_j2k->m_current_tile_number; | ||
> | ||
diff -wr openjpeg-2.3.0_mod/src/lib/openjp2/openjpeg.c openjpeg-2.3.0/src/lib/openjp2/openjpeg.c | ||
791,798d790 | ||
< OPJ_BOOL OPJ_CALLCONV opj_flush(opj_codec_t *p_codec, opj_stream_t *p_stream) | ||
< { | ||
< opj_codec_private_t *l_codec = (opj_codec_private_t *) p_codec; | ||
< opj_stream_private_t *l_stream = (opj_stream_private_t *) p_stream; | ||
< | ||
< return opj_stream_flush(l_stream, &l_codec->m_event_mgr); | ||
< } | ||
< | ||
diff -wr openjpeg-2.3.0_mod/src/lib/openjp2/openjpeg.h openjpeg-2.3.0/src/lib/openjp2/openjpeg.h | ||
1121,1122d1120 | ||
< OPJ_API OPJ_BOOL OPJ_CALLCONV opj_flush(opj_codec_t *p_codec, opj_stream_t | ||
*p_stream); | ||
< | ||
|
Binary file not shown.
Oops, something went wrong.