diff options
Diffstat (limited to 'debian/jasper/jasper-1.900.1-debian1/src/libjasper/bmp')
7 files changed, 1857 insertions, 0 deletions
diff --git a/debian/jasper/jasper-1.900.1-debian1/src/libjasper/bmp/Makefile.am b/debian/jasper/jasper-1.900.1-debian1/src/libjasper/bmp/Makefile.am new file mode 100644 index 00000000..d70855a8 --- /dev/null +++ b/debian/jasper/jasper-1.900.1-debian1/src/libjasper/bmp/Makefile.am @@ -0,0 +1,67 @@ +# Copyright (c) 2001-2002 Michael David Adams. +# All rights reserved. + +# __START_OF_JASPER_LICENSE__ +# +# JasPer License Version 2.0 +# +# Copyright (c) 2001-2006 Michael David Adams +# Copyright (c) 1999-2000 Image Power, Inc. +# Copyright (c) 1999-2000 The University of British Columbia +# +# All rights reserved. +# +# Permission is hereby granted, free of charge, to any person (the +# "User") obtaining a copy of this software and associated documentation +# files (the "Software"), to deal in the Software without restriction, +# including without limitation the rights to use, copy, modify, merge, +# publish, distribute, and/or sell copies of the Software, and to permit +# persons to whom the Software is furnished to do so, subject to the +# following conditions: +# +# 1. The above copyright notices and this permission notice (which +# includes the disclaimer below) shall be included in all copies or +# substantial portions of the Software. +# +# 2. The name of a copyright holder shall not be used to endorse or +# promote products derived from the Software without specific prior +# written permission. +# +# THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS +# LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER +# THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS +# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO +# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL +# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING +# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, +# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION +# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE +# PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE +# THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY. +# EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS +# BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL +# PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS +# GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE +# ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE +# IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL +# SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES, +# AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL +# SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH +# THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH, +# PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH +# RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY +# EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES. +# +# __END_OF_JASPER_LICENSE__ + +noinst_LTLIBRARIES = libbmp.la +libbmp_la_SOURCES = \ + bmp_cod.h \ + bmp_enc.h \ + bmp_cod.c \ + bmp_dec.c \ + bmp_enc.c + +INCLUDES = -I$(top_srcdir)/src/libjasper/include diff --git a/debian/jasper/jasper-1.900.1-debian1/src/libjasper/bmp/Makefile.in b/debian/jasper/jasper-1.900.1-debian1/src/libjasper/bmp/Makefile.in new file mode 100644 index 00000000..a8297a60 --- /dev/null +++ b/debian/jasper/jasper-1.900.1-debian1/src/libjasper/bmp/Makefile.in @@ -0,0 +1,510 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Copyright (c) 2001-2002 Michael David Adams. +# All rights reserved. + +# __START_OF_JASPER_LICENSE__ +# +# JasPer License Version 2.0 +# +# Copyright (c) 2001-2006 Michael David Adams +# Copyright (c) 1999-2000 Image Power, Inc. +# Copyright (c) 1999-2000 The University of British Columbia +# +# All rights reserved. +# +# Permission is hereby granted, free of charge, to any person (the +# "User") obtaining a copy of this software and associated documentation +# files (the "Software"), to deal in the Software without restriction, +# including without limitation the rights to use, copy, modify, merge, +# publish, distribute, and/or sell copies of the Software, and to permit +# persons to whom the Software is furnished to do so, subject to the +# following conditions: +# +# 1. The above copyright notices and this permission notice (which +# includes the disclaimer below) shall be included in all copies or +# substantial portions of the Software. +# +# 2. The name of a copyright holder shall not be used to endorse or +# promote products derived from the Software without specific prior +# written permission. +# +# THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS +# LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER +# THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS +# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO +# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL +# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING +# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, +# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION +# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE +# PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE +# THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY. +# EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS +# BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL +# PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS +# GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE +# ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE +# IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL +# SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES, +# AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL +# SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH +# THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH, +# PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH +# RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY +# EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES. +# +# __END_OF_JASPER_LICENSE__ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = src/libjasper/bmp +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/acaux/mkinstalldirs +CONFIG_HEADER = \ + $(top_builddir)/src/libjasper/include/jasper/jas_config.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libbmp_la_LIBADD = +am_libbmp_la_OBJECTS = bmp_cod.lo bmp_dec.lo bmp_enc.lo +libbmp_la_OBJECTS = $(am_libbmp_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/libjasper/include/jasper +depcomp = $(SHELL) $(top_srcdir)/acaux/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libbmp_la_SOURCES) +DIST_SOURCES = $(libbmp_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +HAVE_LIBJPEG_FALSE = @HAVE_LIBJPEG_FALSE@ +HAVE_LIBJPEG_TRUE = @HAVE_LIBJPEG_TRUE@ +HAVE_OPENGL_FALSE = @HAVE_OPENGL_FALSE@ +HAVE_OPENGL_TRUE = @HAVE_OPENGL_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JAS_MAJOR_VERSION = @JAS_MAJOR_VERSION@ +JAS_MICRO_VERSION = @JAS_MICRO_VERSION@ +JAS_MINOR_VERSION = @JAS_MINOR_VERSION@ +JAS_RPM_RELEASE = @JAS_RPM_RELEASE@ +JAS_VERSION = @JAS_VERSION@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_AGE = @LT_AGE@ +LT_CURRENT = @LT_CURRENT@ +LT_RELEASE = @LT_RELEASE@ +LT_REVISION = @LT_REVISION@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +OPENGL_LIBS = @OPENGL_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +noinst_LTLIBRARIES = libbmp.la +libbmp_la_SOURCES = \ + bmp_cod.h \ + bmp_enc.h \ + bmp_cod.c \ + bmp_dec.c \ + bmp_enc.c + +INCLUDES = -I$(top_srcdir)/src/libjasper/include +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/libjasper/bmp/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign src/libjasper/bmp/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libbmp.la: $(libbmp_la_OBJECTS) $(libbmp_la_DEPENDENCIES) + $(LINK) $(libbmp_la_LDFLAGS) $(libbmp_la_OBJECTS) $(libbmp_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bmp_cod.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bmp_dec.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bmp_enc.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/debian/jasper/jasper-1.900.1-debian1/src/libjasper/bmp/bmp_cod.c b/debian/jasper/jasper-1.900.1-debian1/src/libjasper/bmp/bmp_cod.c new file mode 100644 index 00000000..4e84ecc9 --- /dev/null +++ b/debian/jasper/jasper-1.900.1-debian1/src/libjasper/bmp/bmp_cod.c @@ -0,0 +1,135 @@ +/* + * Copyright (c) 1999-2000 Image Power, Inc. and the University of + * British Columbia. + * Copyright (c) 2001-2002 Michael David Adams. + * All rights reserved. + */ + +/* __START_OF_JASPER_LICENSE__ + * + * JasPer License Version 2.0 + * + * Copyright (c) 2001-2006 Michael David Adams + * Copyright (c) 1999-2000 Image Power, Inc. + * Copyright (c) 1999-2000 The University of British Columbia + * + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person (the + * "User") obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, + * publish, distribute, and/or sell copies of the Software, and to permit + * persons to whom the Software is furnished to do so, subject to the + * following conditions: + * + * 1. The above copyright notices and this permission notice (which + * includes the disclaimer below) shall be included in all copies or + * substantial portions of the Software. + * + * 2. The name of a copyright holder shall not be used to endorse or + * promote products derived from the Software without specific prior + * written permission. + * + * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS + * LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER + * THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS + * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL + * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING + * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION + * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE + * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE + * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY. + * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS + * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL + * PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS + * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE + * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE + * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL + * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES, + * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL + * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH + * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH, + * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH + * RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY + * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES. + * + * __END_OF_JASPER_LICENSE__ + */ + +/* + * Windows Bitmap File Library + * + * $Id$ + */ + +/******************************************************************************\ +* Includes. +\******************************************************************************/ + +#include <assert.h> + +#include "jasper/jas_types.h" +#include "jasper/jas_image.h" +#include "jasper/jas_malloc.h" + +#include "bmp_cod.h" + +/******************************************************************************\ +* Constructors and destructors. +\******************************************************************************/ + +bmp_info_t *bmp_info_create() +{ + bmp_info_t *info; + if (!(info = jas_malloc(sizeof(bmp_info_t)))) { + return 0; + } + info->palents = 0; + return info; +} + +void bmp_info_destroy(bmp_info_t *info) +{ + if (info->palents) { + jas_free(info->palents); + } + jas_free(info); +} + +/******************************************************************************\ +* Miscellaneous functions. +\******************************************************************************/ + +int bmp_isgrayscalepal(bmp_palent_t *palents, int numpalents) +{ + bmp_palent_t *palent; + int i; + + for (i = numpalents, palent = palents; i > 0; --i, ++palent) { + if (palent->red != palent->grn || palent->red != palent->blu) { + return 0; + } + } + return 1; +} + +int bmp_numcmpts(bmp_info_t *info) +{ + int numcmpts; + + if (info->depth == 24) { + numcmpts = 3; + } else if (info->depth == 8) { + numcmpts = bmp_isgrayscalepal(info->palents, info->numcolors) ? + 1 : 3; + } else { + numcmpts = 0; + abort(); + } + return numcmpts; +} diff --git a/debian/jasper/jasper-1.900.1-debian1/src/libjasper/bmp/bmp_cod.h b/debian/jasper/jasper-1.900.1-debian1/src/libjasper/bmp/bmp_cod.h new file mode 100644 index 00000000..beaaf306 --- /dev/null +++ b/debian/jasper/jasper-1.900.1-debian1/src/libjasper/bmp/bmp_cod.h @@ -0,0 +1,215 @@ +/* + * Copyright (c) 1999-2000 Image Power, Inc. and the University of + * British Columbia. + * Copyright (c) 2001-2002 Michael David Adams. + * All rights reserved. + */ + +/* __START_OF_JASPER_LICENSE__ + * + * JasPer License Version 2.0 + * + * Copyright (c) 2001-2006 Michael David Adams + * Copyright (c) 1999-2000 Image Power, Inc. + * Copyright (c) 1999-2000 The University of British Columbia + * + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person (the + * "User") obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, + * publish, distribute, and/or sell copies of the Software, and to permit + * persons to whom the Software is furnished to do so, subject to the + * following conditions: + * + * 1. The above copyright notices and this permission notice (which + * includes the disclaimer below) shall be included in all copies or + * substantial portions of the Software. + * + * 2. The name of a copyright holder shall not be used to endorse or + * promote products derived from the Software without specific prior + * written permission. + * + * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS + * LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER + * THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS + * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL + * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING + * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION + * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE + * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE + * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY. + * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS + * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL + * PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS + * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE + * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE + * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL + * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES, + * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL + * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH + * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH, + * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH + * RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY + * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES. + * + * __END_OF_JASPER_LICENSE__ + */ + +/* + * Windows Bitmap File Library + * + * $Id$ + */ + +#ifndef BMP_COD_H +#define BMP_COD_H + +/******************************************************************************\ +* Includes. +\******************************************************************************/ + +#include "jasper/jas_types.h" + +/******************************************************************************\ +* Constants and macros. +\******************************************************************************/ + +#define BMP_MAGIC 0x4d42 +/* The signature for a BMP file. */ + +#define BMP_HDRLEN 14 +/* The nominal header length. */ + +#define BMP_INFOLEN 40 +/* The nominal info length. */ + +#define BMP_PALLEN(info) ((info)->numcolors * 4) +/* The length of the palette. */ + +#define BMP_HASPAL(info) ((info)->numcolors > 0) +/* Is this a palettized image? */ + +/* Encoding types. */ +#define BMP_ENC_RGB 0 /* No special encoding. */ +#define BMP_ENC_RLE8 1 /* Run length encoding. */ +#define BMP_ENC_RLE4 2 /* Run length encoding. */ + +/******************************************************************************\ +* Types. +\******************************************************************************/ + +/* BMP header. */ +typedef struct { + + int_fast16_t magic; + /* The signature (a.k.a. the magic number). */ + + int_fast32_t siz; + /* The size of the file in 32-bit words. */ + + int_fast16_t reserved1; + /* Ask Bill Gates what this is all about. */ + + int_fast16_t reserved2; + /* Ditto. */ + + int_fast32_t off; + /* The offset of the bitmap data from the bitmap file header in bytes. */ + +} bmp_hdr_t; + +/* Palette entry. */ +typedef struct { + + int_fast16_t red; + /* The red component. */ + + int_fast16_t grn; + /* The green component. */ + + int_fast16_t blu; + /* The blue component. */ + + int_fast16_t res; + /* Reserved. */ + +} bmp_palent_t; + +/* BMP info. */ +typedef struct { + + int_fast32_t len; + /* The length of the bitmap information header in bytes. */ + + int_fast32_t width; + /* The width of the bitmap in pixels. */ + + int_fast32_t height; + /* The height of the bitmap in pixels. */ + + int_fast8_t topdown; + /* The bitmap data is specified in top-down order. */ + + int_fast16_t numplanes; + /* The number of planes. This must be set to a value of one. */ + + int_fast16_t depth; + /* The number of bits per pixel. */ + + int_fast32_t enctype; + /* The type of compression used. */ + + int_fast32_t siz; + /* The size of the image in bytes. */ + + int_fast32_t hres; + /* The horizontal resolution in pixels/metre. */ + + int_fast32_t vres; + /* The vertical resolution in pixels/metre. */ + + int_fast32_t numcolors; + /* The number of color indices used by the bitmap. */ + + int_fast32_t mincolors; + /* The number of color indices important for displaying the bitmap. */ + + bmp_palent_t *palents; + /* The colors should be listed in order of importance. */ + +} bmp_info_t; + +/******************************************************************************\ +* Functions and macros. +\******************************************************************************/ + +#define bmp_issupported(hdr, info) \ + ((hdr)->magic == BMP_MAGIC && !(hdr)->reserved1 && \ + !(hdr)->reserved2 && (info)->numplanes == 1 && \ + ((info)->depth == 8 || (info)->depth == 24) && \ + (info)->enctype == BMP_ENC_RGB) +/* Is this type of BMP file supported? */ + +#define bmp_haspal(info) \ + ((info)->depth == 8) +/* Is there a palette? */ + +int bmp_numcmpts(bmp_info_t *info); +/* Get the number of components. */ + +bmp_info_t *bmp_info_create(void); +/* Create BMP information. */ + +void bmp_info_destroy(bmp_info_t *info); +/* Destroy BMP information. */ + +int bmp_isgrayscalepal(bmp_palent_t *palents, int numpalents); +/* Does the specified palette correspond to a grayscale image? */ + +#endif diff --git a/debian/jasper/jasper-1.900.1-debian1/src/libjasper/bmp/bmp_dec.c b/debian/jasper/jasper-1.900.1-debian1/src/libjasper/bmp/bmp_dec.c new file mode 100644 index 00000000..4cb0df3d --- /dev/null +++ b/debian/jasper/jasper-1.900.1-debian1/src/libjasper/bmp/bmp_dec.c @@ -0,0 +1,463 @@ +/* + * Copyright (c) 1999-2000 Image Power, Inc. and the University of + * British Columbia. + * Copyright (c) 2001-2003 Michael David Adams. + * All rights reserved. + */ + +/* __START_OF_JASPER_LICENSE__ + * + * JasPer License Version 2.0 + * + * Copyright (c) 2001-2006 Michael David Adams + * Copyright (c) 1999-2000 Image Power, Inc. + * Copyright (c) 1999-2000 The University of British Columbia + * + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person (the + * "User") obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, + * publish, distribute, and/or sell copies of the Software, and to permit + * persons to whom the Software is furnished to do so, subject to the + * following conditions: + * + * 1. The above copyright notices and this permission notice (which + * includes the disclaimer below) shall be included in all copies or + * substantial portions of the Software. + * + * 2. The name of a copyright holder shall not be used to endorse or + * promote products derived from the Software without specific prior + * written permission. + * + * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS + * LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER + * THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS + * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL + * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING + * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION + * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE + * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE + * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY. + * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS + * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL + * PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS + * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE + * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE + * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL + * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES, + * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL + * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH + * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH, + * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH + * RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY + * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES. + * + * __END_OF_JASPER_LICENSE__ + */ + +/* + * Windows Bitmap File Library + * + * $Id$ + */ + +/******************************************************************************\ +* Includes. +\******************************************************************************/ + +#include <assert.h> + +#include "jasper/jas_types.h" +#include "jasper/jas_stream.h" +#include "jasper/jas_image.h" +#include "jasper/jas_malloc.h" + +#include "bmp_cod.h" + +/******************************************************************************\ +* Local prototypes. +\******************************************************************************/ + +static int bmp_gethdr(jas_stream_t *in, bmp_hdr_t *hdr); +static bmp_info_t *bmp_getinfo(jas_stream_t *in); +static int bmp_getdata(jas_stream_t *in, bmp_info_t *info, jas_image_t *image); +static int bmp_getint16(jas_stream_t *in, int_fast16_t *val); +static int bmp_getint32(jas_stream_t *in, int_fast32_t *val); +static int bmp_gobble(jas_stream_t *in, long n); + +/******************************************************************************\ +* Interface functions. +\******************************************************************************/ + +jas_image_t *bmp_decode(jas_stream_t *in, char *optstr) +{ + jas_image_t *image; + bmp_hdr_t hdr; + bmp_info_t *info; + uint_fast16_t cmptno; + jas_image_cmptparm_t cmptparms[3]; + jas_image_cmptparm_t *cmptparm; + uint_fast16_t numcmpts; + long n; + + if (optstr) { + jas_eprintf("warning: ignoring BMP decoder options\n"); + } + + jas_eprintf( + "THE BMP FORMAT IS NOT FULLY SUPPORTED!\n" + "THAT IS, THE JASPER SOFTWARE CANNOT DECODE ALL TYPES OF BMP DATA.\n" + "IF YOU HAVE ANY PROBLEMS, PLEASE TRY CONVERTING YOUR IMAGE DATA\n" + "TO THE PNM FORMAT, AND USING THIS FORMAT INSTEAD.\n" + ); + + /* Read the bitmap header. */ + if (bmp_gethdr(in, &hdr)) { + jas_eprintf("cannot get header\n"); + return 0; + } + + /* Read the bitmap information. */ + if (!(info = bmp_getinfo(in))) { + jas_eprintf("cannot get info\n"); + return 0; + } + + /* Ensure that we support this type of BMP file. */ + if (!bmp_issupported(&hdr, info)) { + jas_eprintf("error: unsupported BMP encoding\n"); + bmp_info_destroy(info); + return 0; + } + + /* Skip over any useless data between the end of the palette + and start of the bitmap data. */ + if ((n = hdr.off - (BMP_HDRLEN + BMP_INFOLEN + BMP_PALLEN(info))) < 0) { + jas_eprintf("error: possibly bad bitmap offset?\n"); + return 0; + } + if (n > 0) { + jas_eprintf("skipping unknown data in BMP file\n"); + if (bmp_gobble(in, n)) { + bmp_info_destroy(info); + return 0; + } + } + + /* Get the number of components. */ + numcmpts = bmp_numcmpts(info); + + for (cmptno = 0, cmptparm = cmptparms; cmptno < numcmpts; ++cmptno, + ++cmptparm) { + cmptparm->tlx = 0; + cmptparm->tly = 0; + cmptparm->hstep = 1; + cmptparm->vstep = 1; + cmptparm->width = info->width; + cmptparm->height = info->height; + cmptparm->prec = 8; + cmptparm->sgnd = false; + } + + /* Create image object. */ + if (!(image = jas_image_create(numcmpts, cmptparms, + JAS_CLRSPC_UNKNOWN))) { + bmp_info_destroy(info); + return 0; + } + + if (numcmpts == 3) { + jas_image_setclrspc(image, JAS_CLRSPC_SRGB); + jas_image_setcmpttype(image, 0, + JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_R)); + jas_image_setcmpttype(image, 1, + JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_G)); + jas_image_setcmpttype(image, 2, + JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_B)); + } else { + jas_image_setclrspc(image, JAS_CLRSPC_SGRAY); + jas_image_setcmpttype(image, 0, + JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_GRAY_Y)); + } + + /* Read the bitmap data. */ + if (bmp_getdata(in, info, image)) { + bmp_info_destroy(info); + jas_image_destroy(image); + return 0; + } + + bmp_info_destroy(info); + + return image; +} + +int bmp_validate(jas_stream_t *in) +{ + int n; + int i; + uchar buf[2]; + + assert(JAS_STREAM_MAXPUTBACK >= 2); + + /* Read the first two characters that constitute the signature. */ + if ((n = jas_stream_read(in, (char *) buf, 2)) < 0) { + return -1; + } + /* Put the characters read back onto the stream. */ + for (i = n - 1; i >= 0; --i) { + if (jas_stream_ungetc(in, buf[i]) == EOF) { + return -1; + } + } + /* Did we read enough characters? */ + if (n < 2) { + return -1; + } + /* Is the signature correct for the BMP format? */ + if (buf[0] == (BMP_MAGIC & 0xff) && buf[1] == (BMP_MAGIC >> 8)) { + return 0; + } + return -1; +} + +/******************************************************************************\ +* Code for aggregate types. +\******************************************************************************/ + +static int bmp_gethdr(jas_stream_t *in, bmp_hdr_t *hdr) +{ + if (bmp_getint16(in, &hdr->magic) || hdr->magic != BMP_MAGIC || + bmp_getint32(in, &hdr->siz) || bmp_getint16(in, &hdr->reserved1) || + bmp_getint16(in, &hdr->reserved2) || bmp_getint32(in, &hdr->off)) { + return -1; + } + return 0; +} + +static bmp_info_t *bmp_getinfo(jas_stream_t *in) +{ + bmp_info_t *info; + int i; + bmp_palent_t *palent; + + if (!(info = bmp_info_create())) { + return 0; + } + + if (bmp_getint32(in, &info->len) || info->len != 40 || + bmp_getint32(in, &info->width) || bmp_getint32(in, &info->height) || + bmp_getint16(in, &info->numplanes) || + bmp_getint16(in, &info->depth) || bmp_getint32(in, &info->enctype) || + bmp_getint32(in, &info->siz) || + bmp_getint32(in, &info->hres) || bmp_getint32(in, &info->vres) || + bmp_getint32(in, &info->numcolors) || + bmp_getint32(in, &info->mincolors)) { + bmp_info_destroy(info); + return 0; + } + + if (info->height < 0) { + info->topdown = 1; + info->height = -info->height; + } else { + info->topdown = 0; + } + + if (info->width <= 0 || info->height <= 0 || info->numplanes <= 0 || + info->depth <= 0 || info->numcolors < 0 || info->mincolors < 0) { + bmp_info_destroy(info); + return 0; + } + + if (info->enctype != BMP_ENC_RGB) { + jas_eprintf("unsupported BMP encoding\n"); + bmp_info_destroy(info); + return 0; + } + + if (info->numcolors > 0) { + if (!(info->palents = jas_malloc(info->numcolors * + sizeof(bmp_palent_t)))) { + bmp_info_destroy(info); + return 0; + } + } else { + info->palents = 0; + } + + for (i = 0; i < info->numcolors; ++i) { + palent = &info->palents[i]; + if ((palent->blu = jas_stream_getc(in)) == EOF || + (palent->grn = jas_stream_getc(in)) == EOF || + (palent->red = jas_stream_getc(in)) == EOF || + (palent->res = jas_stream_getc(in)) == EOF) { + bmp_info_destroy(info); + return 0; + } + } + + return info; +} + +static int bmp_getdata(jas_stream_t *in, bmp_info_t *info, jas_image_t *image) +{ + int i; + int j; + int y; + jas_matrix_t *cmpts[3]; + int numpad; + int red; + int grn; + int blu; + int ret; + int numcmpts; + int cmptno; + int ind; + bmp_palent_t *palent; + int mxind; + int haspal; + + assert(info->depth == 8 || info->depth == 24); + assert(info->enctype == BMP_ENC_RGB); + + numcmpts = bmp_numcmpts(info); + haspal = bmp_haspal(info); + + ret = 0; + for (i = 0; i < numcmpts; ++i) { + cmpts[i] = 0; + } + + /* Create temporary matrices to hold component data. */ + for (i = 0; i < numcmpts; ++i) { + if (!(cmpts[i] = jas_matrix_create(1, info->width))) { + ret = -1; + goto bmp_getdata_done; + } + } + + /* Calculate number of padding bytes per row of image data. */ + numpad = (numcmpts * info->width) % 4; + if (numpad) { + numpad = 4 - numpad; + } + + mxind = (1 << info->depth) - 1; + for (i = 0; i < info->height; ++i) { + for (j = 0; j < info->width; ++j) { + if (haspal) { + if ((ind = jas_stream_getc(in)) == EOF) { + ret = -1; + goto bmp_getdata_done; + } + if (ind > mxind) { + ret = -1; + goto bmp_getdata_done; + } + if (ind < info->numcolors) { + palent = &info->palents[ind]; + red = palent->red; + grn = palent->grn; + blu = palent->blu; + } else { + red = ind; + grn = ind; + blu = ind; + } + } else { + if ((blu = jas_stream_getc(in)) == EOF || + (grn = jas_stream_getc(in)) == EOF || + (red = jas_stream_getc(in)) == EOF) { + ret = -1; + goto bmp_getdata_done; + } + } + if (numcmpts == 3) { + jas_matrix_setv(cmpts[0], j, red); + jas_matrix_setv(cmpts[1], j, grn); + jas_matrix_setv(cmpts[2], j, blu); + } else { + jas_matrix_setv(cmpts[0], j, red); + } + } + for (j = numpad; j > 0; --j) { + if (jas_stream_getc(in) == EOF) { + ret = -1; + goto bmp_getdata_done; + } + } + for (cmptno = 0; cmptno < numcmpts; ++cmptno) { + y = info->topdown ? i : (info->height - 1 - i); + if (jas_image_writecmpt(image, cmptno, 0, y, info->width, + 1, cmpts[cmptno])) { + ret = -1; + goto bmp_getdata_done; + } + } + } + +bmp_getdata_done: + /* Destroy the temporary matrices. */ + for (i = 0; i < numcmpts; ++i) { + if (cmpts[i]) { + jas_matrix_destroy(cmpts[i]); + } + } + + return ret; +} + +/******************************************************************************\ +* Code for primitive types. +\******************************************************************************/ + +static int bmp_getint16(jas_stream_t *in, int_fast16_t *val) +{ + int lo; + int hi; + if ((lo = jas_stream_getc(in)) == EOF || (hi = jas_stream_getc(in)) == EOF) { + return -1; + } + if (val) { + *val = (hi << 8) | lo; + } + return 0; +} + +static int bmp_getint32(jas_stream_t *in, int_fast32_t *val) +{ + int n; + uint_fast32_t v; + int c; + for (n = 4, v = 0;;) { + if ((c = jas_stream_getc(in)) == EOF) { + return -1; + } + v |= (c << 24); + if (--n <= 0) { + break; + } + v >>= 8; + } + if (val) { + *val = v; + } + return 0; +} + +static int bmp_gobble(jas_stream_t *in, long n) +{ + while (--n >= 0) { + if (jas_stream_getc(in) == EOF) { + return -1; + } + } + return 0; +} diff --git a/debian/jasper/jasper-1.900.1-debian1/src/libjasper/bmp/bmp_enc.c b/debian/jasper/jasper-1.900.1-debian1/src/libjasper/bmp/bmp_enc.c new file mode 100644 index 00000000..26c658c3 --- /dev/null +++ b/debian/jasper/jasper-1.900.1-debian1/src/libjasper/bmp/bmp_enc.c @@ -0,0 +1,395 @@ +/* + * Copyright (c) 1999-2000 Image Power, Inc. and the University of + * British Columbia. + * Copyright (c) 2001-2003 Michael David Adams. + * All rights reserved. + */ + +/* __START_OF_JASPER_LICENSE__ + * + * JasPer License Version 2.0 + * + * Copyright (c) 2001-2006 Michael David Adams + * Copyright (c) 1999-2000 Image Power, Inc. + * Copyright (c) 1999-2000 The University of British Columbia + * + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person (the + * "User") obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, + * publish, distribute, and/or sell copies of the Software, and to permit + * persons to whom the Software is furnished to do so, subject to the + * following conditions: + * + * 1. The above copyright notices and this permission notice (which + * includes the disclaimer below) shall be included in all copies or + * substantial portions of the Software. + * + * 2. The name of a copyright holder shall not be used to endorse or + * promote products derived from the Software without specific prior + * written permission. + * + * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS + * LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER + * THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS + * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL + * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING + * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION + * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE + * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE + * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY. + * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS + * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL + * PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS + * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE + * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE + * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL + * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES, + * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL + * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH + * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH, + * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH + * RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY + * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES. + * + * __END_OF_JASPER_LICENSE__ + */ + +/* + * Windows Bitmap File Library + * + * $Id$ + */ + +/******************************************************************************\ +* Includes. +\******************************************************************************/ + +#include <assert.h> + +#include "jasper/jas_types.h" +#include "jasper/jas_stream.h" +#include "jasper/jas_image.h" +#include "jasper/jas_debug.h" + +#include "bmp_enc.h" +#include "bmp_cod.h" + +/******************************************************************************\ +* Local prototypes. +\******************************************************************************/ + +static int bmp_puthdr(jas_stream_t *out, bmp_hdr_t *hdr); +static int bmp_putinfo(jas_stream_t *out, bmp_info_t *info); +static int bmp_putdata(jas_stream_t *out, bmp_info_t *info, jas_image_t *image, int *cmpts); +static int bmp_putint16(jas_stream_t *in, int_fast16_t val); +static int bmp_putint32(jas_stream_t *out, int_fast32_t val); + +/******************************************************************************\ +* Interface functions. +\******************************************************************************/ + +int bmp_encode(jas_image_t *image, jas_stream_t *out, char *optstr) +{ + jas_image_coord_t width; + jas_image_coord_t height; + int depth; + int cmptno; + bmp_hdr_t hdr; + bmp_info_t *info; + int_fast32_t datalen; + int numpad; + bmp_enc_t encbuf; + bmp_enc_t *enc = &encbuf; + jas_clrspc_t clrspc; + + if (optstr) { + jas_eprintf("warning: ignoring BMP encoder options\n"); + } + + clrspc = jas_image_clrspc(image); + switch (jas_clrspc_fam(clrspc)) { + case JAS_CLRSPC_FAM_RGB: + if (clrspc != JAS_CLRSPC_SRGB) + jas_eprintf("warning: inaccurate color\n"); + break; + case JAS_CLRSPC_FAM_GRAY: + if (clrspc != JAS_CLRSPC_SGRAY) + jas_eprintf("warning: inaccurate color\n"); + break; + default: + jas_eprintf("error: BMP format does not support color space\n"); + return -1; + break; + } + + switch (jas_clrspc_fam(clrspc)) { + case JAS_CLRSPC_FAM_RGB: + enc->numcmpts = 3; + if ((enc->cmpts[0] = jas_image_getcmptbytype(image, + JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_R))) < 0 || + (enc->cmpts[1] = jas_image_getcmptbytype(image, + JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_G))) < 0 || + (enc->cmpts[2] = jas_image_getcmptbytype(image, + JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_B))) < 0) { + jas_eprintf("error: missing color component\n"); + return -1; + } + break; + case JAS_CLRSPC_FAM_GRAY: + enc->numcmpts = 1; + if ((enc->cmpts[0] = jas_image_getcmptbytype(image, + JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_GRAY_Y))) < 0) { + jas_eprintf("error: missing color component\n"); + return -1; + } + break; + default: + abort(); + break; + } + + width = jas_image_cmptwidth(image, enc->cmpts[0]); + height = jas_image_cmptheight(image, enc->cmpts[0]); + depth = jas_image_cmptprec(image, enc->cmpts[0]); + + /* Check to ensure that the image to be saved can actually be represented + using the BMP format. */ + for (cmptno = 0; cmptno < enc->numcmpts; ++cmptno) { + if (jas_image_cmptwidth(image, enc->cmpts[cmptno]) != width || + jas_image_cmptheight(image, enc->cmpts[cmptno]) != height || + jas_image_cmptprec(image, enc->cmpts[cmptno]) != depth || + jas_image_cmptsgnd(image, enc->cmpts[cmptno]) != false || + jas_image_cmpttlx(image, enc->cmpts[cmptno]) != 0 || + jas_image_cmpttly(image, enc->cmpts[cmptno]) != 0) { + jas_eprintf("The BMP format cannot be used to represent an image with this geometry.\n"); + return -1; + } + } + + /* The component depths must be 1, 4, or 8. */ + if (depth != 1 && depth != 4 && depth != 8) { + return -1; + } + + numpad = (width * enc->numcmpts) % 4; + if (numpad) { + numpad = 4 - numpad; + } + datalen = (enc->numcmpts * width + numpad) * height; + + if (!(info = bmp_info_create())) { + return -1; + } + info->len = BMP_INFOLEN; + info->width = width; + info->height = height; + info->numplanes = 1; + info->depth = enc->numcmpts * depth; + info->enctype = BMP_ENC_RGB; + info->siz = datalen; + info->hres = 0; + info->vres = 0; + info->numcolors = (enc->numcmpts == 1) ? 256 : 0; + info->mincolors = 0; + + hdr.magic = BMP_MAGIC; + hdr.siz = BMP_HDRLEN + BMP_INFOLEN + 0 + datalen; + hdr.off = BMP_HDRLEN + BMP_INFOLEN + BMP_PALLEN(info); + + /* Write the bitmap header. */ + if (bmp_puthdr(out, &hdr)) { + return -1; + } + + /* Write the bitmap information. */ + if (bmp_putinfo(out, info)) { + return -1; + } + + /* Write the bitmap data. */ + if (bmp_putdata(out, info, image, enc->cmpts)) { + return -1; + } + + bmp_info_destroy(info); + + return 0; +} + +/******************************************************************************\ +* Code for aggregate types. +\******************************************************************************/ + +static int bmp_puthdr(jas_stream_t *out, bmp_hdr_t *hdr) +{ + assert(hdr->magic == BMP_MAGIC); + if (bmp_putint16(out, hdr->magic) || bmp_putint32(out, hdr->siz) || + bmp_putint32(out, 0) || bmp_putint32(out, hdr->off)) { + return -1; + } + return 0; +} + +static int bmp_putinfo(jas_stream_t *out, bmp_info_t *info) +{ + int i; + + info->len = 40; + if (bmp_putint32(out, info->len) || + bmp_putint32(out, info->width) || + bmp_putint32(out, info->height) || + bmp_putint16(out, info->numplanes) || + bmp_putint16(out, info->depth) || + bmp_putint32(out, info->enctype) || + bmp_putint32(out, info->siz) || + bmp_putint32(out, info->hres) || + bmp_putint32(out, info->vres) || + bmp_putint32(out, info->numcolors) || + bmp_putint32(out, info->mincolors)) { + return -1; + } + + for (i = 0; i < info->numcolors; ++i) + { + if (jas_stream_putc(out, i) == EOF || + jas_stream_putc(out, i) == EOF || + jas_stream_putc(out, i) == EOF || + jas_stream_putc(out, 0) == EOF) + { + return -1; + } + } + + return 0; +} + +static int bmp_putdata(jas_stream_t *out, bmp_info_t *info, jas_image_t *image, + int *cmpts) +{ + int i; + int j; + jas_matrix_t *bufs[3]; + int numpad; + unsigned char red; + unsigned char grn; + unsigned char blu; + int ret; + int numcmpts; + int v; + int cmptno; + + numcmpts = (info->depth == 24) ? 3:1; + + /* We do not support palettized images. */ + if (BMP_HASPAL(info) && numcmpts == 3) { + jas_eprintf("no palettized image support for BMP format\n"); + return -1; + } + + ret = 0; + for (i = 0; i < numcmpts; ++i) { + bufs[i] = 0; + } + + /* Create temporary matrices to hold component data. */ + for (i = 0; i < numcmpts; ++i) { + if (!(bufs[i] = jas_matrix_create(1, info->width))) { + ret = -1; + goto bmp_putdata_done; + } + } + + /* Calculate number of padding bytes per row of image data. */ + numpad = (numcmpts * info->width) % 4; + if (numpad) { + numpad = 4 - numpad; + } + + /* Put the image data. */ + for (i = info->height - 1; i >= 0; --i) { + for (cmptno = 0; cmptno < numcmpts; ++cmptno) { + if (jas_image_readcmpt(image, cmptno, 0, i, info->width, + 1, bufs[cmpts[cmptno]])) { + ret = -1; + goto bmp_putdata_done; + } + } + for (j = 0; j < info->width; ++j) { + if (numcmpts == 3) { + red = (jas_matrix_getv(bufs[0], j)); + grn = (jas_matrix_getv(bufs[1], j)); + blu = (jas_matrix_getv(bufs[2], j)); + if (jas_stream_putc(out, blu) == EOF || + jas_stream_putc(out, grn) == EOF || + jas_stream_putc(out, red) == EOF) { + ret = -1; + goto bmp_putdata_done; + } + } else if (numcmpts == 1) { + v = (jas_matrix_getv(bufs[cmpts[0]], j)); + if (jas_stream_putc(out, v) == EOF) { + ret = -1; + goto bmp_putdata_done; + } + } else { + abort(); + } + } + for (j = numpad; j > 0; --j) { + if (jas_stream_putc(out, 0) == EOF) { + ret = -1; + goto bmp_putdata_done; + } + } + } + +bmp_putdata_done: + /* Destroy the temporary matrices. */ + for (i = 0; i < numcmpts; ++i) { + if (bufs[i]) { + jas_matrix_destroy(bufs[i]); + } + } + + return ret; +} + +/******************************************************************************\ +* Code for primitive types. +\******************************************************************************/ + +static int bmp_putint16(jas_stream_t *in, int_fast16_t val) +{ + if (jas_stream_putc(in, val & 0xff) == EOF || jas_stream_putc(in, (val >> 8) & + 0xff) == EOF) { + return -1; + } + return 0; +} + +static int bmp_putint32(jas_stream_t *out, int_fast32_t val) +{ + int n; + int_fast32_t v; + + /* This code needs to be changed if we want to handle negative values. */ + assert(val >= 0); + v = val; + for (n = 4;;) { + if (jas_stream_putc(out, v & 0xff) == EOF) { + return -1; + } + if (--n <= 0) { + break; + } + v >>= 8; + } + return 0; +} diff --git a/debian/jasper/jasper-1.900.1-debian1/src/libjasper/bmp/bmp_enc.h b/debian/jasper/jasper-1.900.1-debian1/src/libjasper/bmp/bmp_enc.h new file mode 100644 index 00000000..f37e5049 --- /dev/null +++ b/debian/jasper/jasper-1.900.1-debian1/src/libjasper/bmp/bmp_enc.h @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2002 Michael David Adams. + * All rights reserved. + */ + +/* __START_OF_JASPER_LICENSE__ + * + * JasPer License Version 2.0 + * + * Copyright (c) 2001-2006 Michael David Adams + * Copyright (c) 1999-2000 Image Power, Inc. + * Copyright (c) 1999-2000 The University of British Columbia + * + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person (the + * "User") obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, + * publish, distribute, and/or sell copies of the Software, and to permit + * persons to whom the Software is furnished to do so, subject to the + * following conditions: + * + * 1. The above copyright notices and this permission notice (which + * includes the disclaimer below) shall be included in all copies or + * substantial portions of the Software. + * + * 2. The name of a copyright holder shall not be used to endorse or + * promote products derived from the Software without specific prior + * written permission. + * + * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS + * LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER + * THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS + * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL + * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING + * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION + * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE + * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE + * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY. + * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS + * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL + * PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS + * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE + * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE + * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL + * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES, + * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL + * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH + * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH, + * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH + * RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY + * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES. + * + * __END_OF_JASPER_LICENSE__ + */ + +#ifndef BMP_ENC_H +#define BMP_ENC_H + +typedef struct { + + int numcmpts; + int cmpts[4]; + +} bmp_enc_t; + +#endif |