renamed and reorganized "jp3d" directory to "openjpeg3d". Is now a standalone directory, with independent cmake files. Done as it uses its own version of the openjpeg library and does not depend on the one currently developped. Will be removed from the trunk and stored in a branch.

This commit is contained in:
Antonin Descampe 2011-04-13 15:24:36 +00:00
parent e5f3a10160
commit a6f19781d7
55 changed files with 370 additions and 261 deletions

View File

@ -0,0 +1,15 @@
# Check if getopt is present:
INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
SET(DONT_HAVE_GETOPT 1)
IF(UNIX) #I am pretty sure only *nix sys have this anyway
CHECK_INCLUDE_FILE("getopt.h" CMAKE_HAVE_GETOPT_H)
# Seems like we need the contrary:
IF(CMAKE_HAVE_GETOPT_H)
SET(DONT_HAVE_GETOPT 0)
ENDIF(CMAKE_HAVE_GETOPT_H)
ENDIF(UNIX)
IF(DONT_HAVE_GETOPT)
ADD_DEFINITIONS(-DDONT_HAVE_GETOPT)
ENDIF(DONT_HAVE_GETOPT)

View File

@ -0,0 +1,48 @@
#-----------------------------------------------------------------------------
#
# OPENJPEG3DConfig.cmake - CMake configuration file for external projects.
#
# This file is configured by OPENJPEG3D and used by the UseOPENJPEG3D.cmake
# module to load OPENJPEG3D's settings for an external project.
@OPENJPEG3D_CONFIG_INSTALL_ONLY@
# The OPENJPEG3D version number.
SET(OPENJPEG3D_MAJOR_VERSION "@OPENJPEG3D_VERSION_MAJOR@")
SET(OPENJPEG3D_MINOR_VERSION "@OPENJPEG3D_VERSION_MINOR@")
SET(OPENJPEG3D_BUILD_VERSION "@OPENJPEG3D_VERSION_BUILD@")
# The libraries.
SET(OPENJPEG3D_LIBRARIES "@OPENJPEG3D_LIBRARIES@")
# The CMake macros dir.
SET(OPENJPEG3D_CMAKE_DIR "@OPENJPEG3D_CMAKE_DIR_CONFIG@")
# The configuration options.
SET(OPENJPEG3D_BUILD_SHARED_LIBS "@OPENJPEG3D_BUILD_SHARED_LIBS@")
# The "use" file.
SET(OPENJPEG3D_USE_FILE "@OPENJPEG3D_USE_FILE_CONFIG@")
get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
if(EXISTS ${SELF_DIR}/OpenJPEG3DTargets.cmake)
# This is an install tree
include(${SELF_DIR}/OpenJPEG3DTargets.cmake)
get_filename_component(OPENJPEG3D_INCLUDE_ROOT "${SELF_DIR}/../../@OPENJPEG3D_INSTALL_INCLUDE_DIR@" ABSOLUTE)
set(OPENJPEG3D_INCLUDE_DIRS ${OPENJPEG3D_INCLUDE_ROOT})
else(EXISTS ${SELF_DIR}/OpenJPEG3DTargets.cmake)
if(EXISTS ${SELF_DIR}/OpenJPEG3DExports.cmake)
# This is a build tree
SET( OPENJPEG3D_INCLUDE_DIRS @OPENJPEG3D_INCLUDE_PATH@)
include(${SELF_DIR}/OpenJPEG3DExports.cmake)
else(EXISTS ${SELF_DIR}/OpenJPEG3DExports.cmake)
message(FATAL_ERROR "ooops")
endif(EXISTS ${SELF_DIR}/OpenJPEG3DExports.cmake)
endif(EXISTS ${SELF_DIR}/OpenJPEG3DTargets.cmake)
set(OPENJPEG3D_USE_FILE ${SELF_DIR}/UseOPENJPEG3D.cmake)
# Backward compatible part:
SET(OPENJPEG3D_FOUND TRUE)

View File

@ -1,15 +1,223 @@
# jp3d # Main CMakeLists.txt to build the OpenJPEG3D 3D project using CMake (www.cmake.org)
# Written by Mathieu Malaterre
# This CMake project will by default create a library called openjpeg3d3d
# But if you want to use this project within your own (CMake) project
# you will eventually like to prefix the library to avoid linking confusion
# For this purpose you can define a CMake var: OPENJPEG3D_NAMESPACE to whatever you like
# e.g.:
# SET(OPENJPEG3D_NAMESPACE "GDCMOPENJPEG3D")
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
IF(COMMAND CMAKE_POLICY)
CMAKE_POLICY(SET CMP0003 NEW)
ENDIF(COMMAND CMAKE_POLICY)
IF(NOT OPENJPEG3D_NAMESPACE)
SET(OPENJPEG3D_NAMESPACE "OPENJPEG3D")
SET(OPENJPEG3D_STANDALONE 1)
ENDIF(NOT OPENJPEG3D_NAMESPACE)
# In all cases:
STRING(TOLOWER ${OPENJPEG3D_NAMESPACE} OPENJPEG3D_LIBRARY_NAME)
PROJECT(${OPENJPEG3D_NAMESPACE} C)
# Do full dependency headers.
INCLUDE_REGULAR_EXPRESSION("^.*$")
#-----------------------------------------------------------------------------
# OPENJPEG3D version number, useful for packaging and doxygen doc:
SET(OPENJPEG3D_VERSION_MAJOR 1)
SET(OPENJPEG3D_VERSION_MINOR 3)
SET(OPENJPEG3D_VERSION_BUILD 0)
SET(OPENJPEG3D_VERSION
"${OPENJPEG3D_VERSION_MAJOR}.${OPENJPEG3D_VERSION_MINOR}.${OPENJPEG3D_VERSION_BUILD}")
SET(PACKAGE_VERSION
"${OPENJPEG3D_VERSION_MAJOR}.${OPENJPEG3D_VERSION_MINOR}.${OPENJPEG3D_VERSION_BUILD}")
SET(OPENJPEG3D_LIBRARY_PROPERTIES
VERSION "${OPENJPEG3D_VERSION_MAJOR}.${OPENJPEG3D_VERSION_MINOR}.${OPENJPEG3D_VERSION_BUILD}"
SOVERSION "${OPENJPEG3D_VERSION_MAJOR}"
)
# You will also need to define a value for the following variables:
# OPENJPEG3D_INSTALL_BIN_DIR - binary dir (executables)
# OPENJPEG3D_INSTALL_LIB_DIR - library dir (libs)
# OPENJPEG3D_INSTALL_DATA_DIR - share dir (say, examples, data, etc)
# OPENJPEG3D_INSTALL_INCLUDE_DIR - include dir (headers)
# On Visual Studio 8 MS deprecated C. This removes all 1.276E1265 security
# warnings
IF(WIN32)
IF(NOT BORLAND)
IF(NOT CYGWIN)
IF(NOT MINGW)
IF(NOT ITK_ENABLE_VISUAL_STUDIO_DEPRECATED_C_WARNINGS)
ADD_DEFINITIONS(
-D_CRT_FAR_MAPPINGS_NO_DEPRECATE
-D_CRT_IS_WCTYPE_NO_DEPRECATE
-D_CRT_MANAGED_FP_NO_DEPRECATE
-D_CRT_NONSTDC_NO_DEPRECATE
-D_CRT_SECURE_NO_DEPRECATE
-D_CRT_SECURE_NO_DEPRECATE_GLOBALS
-D_CRT_SETERRORMODE_BEEP_SLEEP_NO_DEPRECATE
-D_CRT_TIME_FUNCTIONS_NO_DEPRECATE
-D_CRT_VCCLRIT_NO_DEPRECATE
-D_SCL_SECURE_NO_DEPRECATE
)
ENDIF(NOT ITK_ENABLE_VISUAL_STUDIO_DEPRECATED_C_WARNINGS)
ENDIF(NOT MINGW)
ENDIF(NOT CYGWIN)
ENDIF(NOT BORLAND)
ENDIF(WIN32)
# --------------------------------------------------------------------------
# Install directories
STRING(TOLOWER ${PROJECT_NAME} projectname)
SET(subdir "${projectname}-${OPENJPEG3D_VERSION_MAJOR}.${OPENJPEG3D_VERSION_MINOR}")
IF(NOT OPENJPEG3D_INSTALL_BIN_DIR)
SET(OPENJPEG3D_INSTALL_BIN_DIR "bin")
ENDIF(NOT OPENJPEG3D_INSTALL_BIN_DIR)
IF(NOT OPENJPEG3D_INSTALL_LIB_DIR)
SET(OPENJPEG3D_INSTALL_LIB_DIR "lib")
ENDIF(NOT OPENJPEG3D_INSTALL_LIB_DIR)
IF(NOT OPENJPEG3D_INSTALL_DATA_DIR)
SET(OPENJPEG3D_INSTALL_DATA_DIR "share/${subdir}")
ENDIF(NOT OPENJPEG3D_INSTALL_DATA_DIR)
IF(NOT OPENJPEG3D_INSTALL_INCLUDE_DIR)
SET(OPENJPEG3D_INSTALL_INCLUDE_DIR "include/")
ENDIF(NOT OPENJPEG3D_INSTALL_INCLUDE_DIR)
IF(NOT OPENJPEG3D_INSTALL_MAN_DIR)
SET(OPENJPEG3D_INSTALL_MAN_DIR "share/man/")
ENDIF(NOT OPENJPEG3D_INSTALL_MAN_DIR)
IF(NOT OPENJPEG3D_INSTALL_DOC_DIR)
SET(OPENJPEG3D_INSTALL_DOC_DIR "share/doc/${subdir}")
ENDIF(NOT OPENJPEG3D_INSTALL_DOC_DIR)
IF(NOT OPENJPEG3D_INSTALL_PACKAGE_DIR)
SET(OPENJPEG3D_INSTALL_PACKAGE_DIR ${OPENJPEG3D_INSTALL_LIB_DIR}/${subdir}
CACHE INTERNAL "")
ENDIF(NOT OPENJPEG3D_INSTALL_PACKAGE_DIR)
#-----------------------------------------------------------------------------
# Test for some required system information.
INCLUDE (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityC.cmake)
#-----------------------------------------------------------------------------
# Test for getopt being available in this system
INCLUDE (${PROJECT_SOURCE_DIR}/CMake/CheckHaveGetopt.cmake )
#-----------------------------------------------------------------------------
# OpenJPEG3D build configuration options.
OPTION(BUILD_SHARED_LIBS "Build OpenJPEG3D shared library and link executables against it." ON)
#-----------------------------------------------------------------------------
SET (EXECUTABLE_OUTPUT_PATH ${OPENJPEG3D_BINARY_DIR}/bin CACHE PATH "Single output directory for building all executables.")
SET (LIBRARY_OUTPUT_PATH ${OPENJPEG3D_BINARY_DIR}/bin CACHE PATH "Single output directory for building all libraries.")
MARK_AS_ADVANCED(LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH)
# configure name mangling to allow multiple libraries to coexist
# peacefully
IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/openjpeg3d_mangle.h.in)
SET(MANGLE_PREFIX ${OPENJPEG3D_LIBRARY_NAME})
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/openjpeg3d_mangle.h.in
${CMAKE_CURRENT_BINARY_DIR}/openjpeg3d_mangle.h
@ONLY IMMEDIATE)
ENDIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/openjpeg3d_mangle.h.in)
#-----------------------------------------------------------------------------
# pkgconfig support
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/libopenjpeg3d.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/libopenjpeg3d.pc @ONLY)
INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/libopenjpeg3d.pc DESTINATION ${OPENJPEG3D_INSTALL_LIB_DIR}/pkgconfig )
#-----------------------------------------------------------------------------
# Always build the library
INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
SUBDIRS(libopenjpeg3d)
#-----------------------------------------------------------------------------
# Compiler specific flags:
IF(CMAKE_COMPILER_IS_GNUCC)
# For all builds, make sure openjpeg3d is std99 compliant:
# SET(CMAKE_C_FLAGS "-Wall -std=c99 ${CMAKE_C_FLAGS}") # FIXME: this setting prevented us from setting a coverage build.
# Do not use ffast-math for all build, it would produce incorrect results, only set for release:
SET(CMAKE_C_FLAGS_RELEASE "-ffast-math ${CMAKE_C_FLAGS_RELEASE}")
ENDIF(CMAKE_COMPILER_IS_GNUCC)
# install all targets referenced as OPENJPEG3DTargets
install(EXPORT OpenJPEG3DTargets DESTINATION ${OPENJPEG3D_INSTALL_PACKAGE_DIR})
CONFIGURE_FILE( ${OPENJPEG3D_SOURCE_DIR}/CMake/OpenJPEG3DConfig.cmake.in
${OPENJPEG3D_BINARY_DIR}/OpenJPEG3DConfig.cmake
@ONLY
)
INSTALL( FILES ${OPENJPEG3D_BINARY_DIR}/OpenJPEG3DConfig.cmake
DESTINATION ${OPENJPEG3D_INSTALL_PACKAGE_DIR}
)
# install CHANGES and LICENSE
INSTALL(
FILES LICENSE
DESTINATION ${OPENJPEG3D_INSTALL_DOC_DIR})
#
FIND_FILE(HAVE_STRINGS_H_FOUND strings.h)
IF(NOT HAVE_STRINGS_H_FOUND STREQUAL "HAVE_STRINGS_H_FOUND-NOTFOUND")
FIND_FILE(HAVE_STRINGS_H strings.h)
SET(HAS_STRINGS_H 1)
ENDIF()
FIND_FILE(HAVE_INTTYPES_H_FOUND inttypes.h)
IF(NOT HAVE_INTTYPES_H_FOUND STREQUAL "HAVE_INTTYPES_H_FOUND-NOTFOUND")
FIND_FILE(HAVE_INTTYPES_H inttypes.h)
SET(HAS_INTTYPES_H 1)
ENDIF()
FIND_FILE(HAVE_MEMORY_H_FOUND memory.h)
IF(NOT HAVE_MEMORY_H_FOUND STREQUAL "HAVE_MEMORY_H_FOUND-NOTFOUND")
FIND_FILE(HAVE_MEMORY_H memory.h)
SET(HAS_MEMORY_H 1)
ENDIF()
FIND_FILE(HAVE_STDINT_H_FOUND stdint.h)
IF(NOT HAVE_STDINT_H_FOUND STREQUAL "HAVE_STDINT_H_FOUND-NOTFOUND")
FIND_FILE(HAVE_STDINT_H stdint.h)
SET(HAS_STDINT_H 1)
ENDIF()
FIND_FILE(HAVE_STDLIB_H_FOUND stdlib.h)
IF(NOT HAVE_STDLIB_H_FOUND STREQUAL "HAVE_STDLIB_H_FOUND-NOTFOUND")
FIND_FILE(HAVE_STDLIB_H stdlib.h)
SET(HAS_STDLIB_H 1)
ENDIF()
FIND_FILE(HAVE_STRING_H_FOUND string.h)
IF(NOT HAVE_STRING_H_FOUND STREQUAL "HAVE_STRING_H_FOUND-NOTFOUND")
FIND_FILE(HAVE_STRING_H string.h)
SET(HAS_STRING_H 1)
ENDIF()
FIND_FILE(HAVE_SYS_STAT_H_FOUND sys/stat.h)
IF(NOT HAVE_SYS_STAT_H_FOUND STREQUAL "HAVE_SYS_STAT_H_FOUND-NOTFOUND")
FIND_FILE(HAVE_SYS_STAT_H sys/stat.h)
SET(HAS_SYS_STAT_H 1)
ENDIF()
FIND_FILE(HAVE_SYS_TYPES_H_FOUND sys/types.h)
IF(NOT HAVE_SYS_TYPES_H_FOUND STREQUAL "HAVE_SYS_TYPES_H_FOUND-NOTFOUND")
FIND_FILE(HAVE_SYS_TYPES_H sys/types.h)
SET(HAS_SYS_TYPES_H 1)
ENDIF()
FIND_FILE(HAVE_UNISTD_H_FOUND unistd.h)
IF(NOT HAVE_UNISTD_H_FOUND STREQUAL "HAVE_UNISTD_H_FOUND-NOTFOUND")
FIND_FILE(HAVE_UNISTD_H unistd.h)
SET(HAS_UNISTD_H 1)
ENDIF()
# Headers file are located here: # Headers file are located here:
INCLUDE_DIRECTORIES( INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}/codec ${CMAKE_CURRENT_SOURCE_DIR}/codec
${CMAKE_CURRENT_SOURCE_DIR}/libjp3dvm ${CMAKE_CURRENT_SOURCE_DIR}/libopenjpeg3d
)
SUBDIRS(
libjp3dvm
codec
) )
SUBDIRS(codec)

25
INSTALL Normal file
View File

@ -0,0 +1,25 @@
How to build and install openjpeg3d binaries
==========================================
REQUIREMENT : cmake (see www.cmake.org)
Type:
cmake .
make
If you are root:
make install
make clean
else:
sudo make install
make clean
Binaries are located in the 'bin' directory.
Main available cmake flags:
* To specify the install path: '-DCMAKE_INSTALL_PREFIX=/path'
* To build the shared libraries and links the executables against it: '-DBUILD_SHARED_LIBS:bool=on' (default: 'ON')
Note: when using this option, static libraries are not built and executables are dynamically linked.

View File

@ -1,108 +0,0 @@
#jp3d Makefile
include ../config.nix
TARGET = openjp3dvm
COMPILERFLAGS = -O3 -Wall -ffast-math -std=c99 -fPIC
SRCS = ./libjp3dvm/bio.c ./libjp3dvm/cio.c ./libjp3dvm/dwt.c \
./libjp3dvm/event.c ./libjp3dvm/jp3d.c ./libjp3dvm/jp3d_lib.c \
./libjp3dvm/volume.c ./libjp3dvm/mct.c ./libjp3dvm/mqc.c \
./libjp3dvm/openjpeg.c ./libjp3dvm/pi.c ./libjp3dvm/raw.c \
./libjp3dvm/t1.c ./libjp3dvm/t1_3d.c ./libjp3dvm/t2.c \
./libjp3dvm/tcd.c ./libjp3dvm/tgt.c
INCLS = ./libjp3dvm/t1_3d.h ./libjp3dvm/bio.h ./libjp3dvm/cio.h \
./libjp3dvm/dwt.h ./libjp3dvm/event.h ./libjp3dvm/fix.h \
./libjp3dvm/int.h ./libjp3dvm/jp3d.h ./libjp3dvm/jp3d_lib.h \
./libjp3dvm/volume.h ./libjp3dvm/mct.h ./libjp3dvm/mqc.h \
./libjp3dvm/openjpeg3d.h ./libjp3dvm/pi.h ./libjp3dvm/raw.h \
./libjp3dvm/t1.h ./libjp3dvm/t2.h ./libjp3dvm/tcd.h \
./libjp3dvm/tgt.h ./libjp3dvm/opj_includes.h
INCLUDE = -I.. -Ilibjp3dvm
INSTALL_LIBDIR = $(prefix)/lib
headerdir = openjpeg3d-$(JP3D_MAJOR).$(JP3D_MINOR)
INSTALL_INCLUDE = $(prefix)/include/$(headerdir)
# Converts cr/lf to just lf
DOS2UNIX = dos2unix
LIBRARIES = -lstdc++
MODULES = $(SRCS:.c=.o)
CFLAGS = $(COMPILERFLAGS) $(INCLUDE)
LIBNAME = lib$(TARGET)
ifeq ($(ENABLE_SHARED),yes)
SHAREDLIB = $(LIBNAME).so.$(JP3D_MAJOR).$(JP3D_MINOR).$(JP3D_BUILD)
else
STATICLIB = $(LIBNAME).a
endif
default: all
all: Jp3dVM
make -C codec -f Makefile.nix all
install -d ../bin
ifeq ($(ENABLE_SHARED),yes)
install -m 755 $(SHAREDLIB) ../bin
(cd ../bin && \
ln -sf $(SHAREDLIB) $(LIBNAME).so.$(JP3D_MAJOR).$(JP3D_MINOR))
(cd ../bin && \
ln -sf $(LIBNAME).so.$(JP3D_MAJOR).$(JP3D_MINOR) $(LIBNAME).so)
else
install -m 644 $(STATICLIB) ../bin
endif
dos2unix:
@$(DOS2UNIX) $(SRCS) $(INCLS)
Jp3dVM: $(STATICLIB) $(SHAREDLIB)
.c.o:
$(CC) $(CFLAGS) -c $< -o $@
ifeq ($(ENABLE_SHARED),yes)
$(SHAREDLIB): $(MODULES)
$(CC) -s -shared -Wl,-soname,$(LIBNAME) -o $@ $(MODULES) $(LIBRARIES)
else
$(STATICLIB): $(MODULES)
$(AR) r $@ $(MODULES)
endif
install: Jp3dVM
install -d '$(DESTDIR)$(INSTALL_LIBDIR)'
ifeq ($(ENABLE_SHARED),yes)
install -m 755 -o root -g root $(SHAREDLIB) '$(DESTDIR)$(INSTALL_LIBDIR)'
(cd $(DESTDIR)$(INSTALL_LIBDIR) && \
ln -sf $(SHAREDLIB) $(LIBNAME).so.$(JP3D_MAJOR).$(JP3D_MINOR) )
(cd $(DESTDIR)$(INSTALL_LIBDIR) && \
ln -sf $(LIBNAME).so.$(JP3D_MAJOR).$(JP3D_MINOR) $(LIBNAME).so )
else
install -m 644 -o root -g root $(STATICLIB) '$(DESTDIR)$(INSTALL_LIBDIR)'
(cd $(DESTDIR)$(INSTALL_LIBDIR) && ranlib $(STATICLIB))
endif
install -d $(DESTDIR)$(INSTALL_INCLUDE)
rm -f $(DESTDIR)$(INSTALL_INCLUDE)/openjpeg3d.h
install -m 644 -o root -g root libjp3dvm/openjpeg3d.h \
$(DESTDIR)$(INSTALL_INCLUDE)/openjpeg3d.h
(cd $(DESTDIR)$(prefix)/include && \
ln -sf $(headerdir)/openjpeg3d.h openjpeg3d.h)
make -C codec -f Makefile.nix install
uninstall:
ifeq ($(ENABLE_SHARED),yes)
(cd $(DESTDIR)$(INSTALL_LIBDIR) && \
rm -f $(LIBNAME).so $(LIBNAME).so.$(JP3D_MAJOR).$(JP3D_MINOR) $(SHAREDLIB))
else
rm -f $(DESTDIR)$(INSTALL_LIBDIR)/$(STATICLIB)
endif
rm -f $(DESTDIR)$(prefix)/include/openjpeg3d.h
rm -rf $(DESTDIR)$(INSTALL_INCLUDE)
make -C codec -f Makefile.nix uninstall
clean:
rm -f core u2dtmp* $(MODULES) $(STATICLIB) $(SHAREDLIB)
make -C codec -f Makefile.nix clean

View File

@ -19,52 +19,18 @@ If you find some bugs or if you have problems using the encoder/decoder, please
====================================================== ======================================================
- After decompressing the zip file provided, you should find - After decompressing the zip file provided, you should find
at least the following files in the created 'jp3d_vm' directory: at least the following files in the created 'openjpeg3d' directory:
* libjp3dvm - This directory contains all library related code * libopenjpeg3d - This directory contains all library related code
* codec - This directory contains all codec related code * codec - This directory contains all codec related code
* tcltk - This directory contains the API scripts * tcltk - This directory contains the API scripts
* README - The file you are reading * README - The file you are reading
* LICENCE - Copyright statement of the JP3D VM software * LICENSE - Copyright statement of the JP3D VM software
2.1. Compiling the source code in Windows 2.1. Compilation
------------------------------------------- -----------------
This version has been compiled with Visual Studio 2003 using see INSTALL file for compilation and installation instructions
the projects included in the distribution:
* LibJp3dVM.vcproj - Creates the library with all the JP3D functionalities
* jp3d_vm_enc.vcproj - Test encoder
* jp3d_vm_dec.vcproj - Test decoder
2.2. Compiling the source code in Unix-like systems
-------------------------------------------
Library compilation
------------------------
This version of the library has been tested under the following OS:
- Fedora Core
The installation process is as simple as this :
1) Enter the 'jp3d_vm' directory
2) Build the distribution :
make
make install
3) Clean all files produced during the build process
make clean
Codec compilation
------------------------
Once you've built the library, you should compile the JP3D codec.
1) Go to the 'codec' directory
2) Build the encoder and decoder programs:
gcc convert.c volume_to_jp3d.c -o jp3d_vm_enc -I ../libjp3dvm/ -lm -ljp3dvm
gcc convert.c jp3d_to_volume.c -o jp3d_vm_dec -I ../libjp3dvm/ -lm -ljp3dvm
Note: You should add '-L ../libjp3dvm/' to those lines if you
did not use the 'install' target (and the 'clean' target neither...).
3. Running the JP3D VM 3. Running the JP3D VM
==================================================== ====================================================

View File

@ -4,25 +4,6 @@
SET(common_SRCS SET(common_SRCS
convert.c convert.c
) )
# Then check if getopt is present:
INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
SET(DONT_HAVE_GETOPT 1)
IF(UNIX) #I am pretty sure only *nix sys have this anyway
CHECK_INCLUDE_FILE("getopt.h" CMAKE_HAVE_GETOPT_H)
# Seems like we need the contrary:
IF(CMAKE_HAVE_GETOPT_H)
SET(DONT_HAVE_GETOPT 0)
ENDIF(CMAKE_HAVE_GETOPT_H)
ENDIF(UNIX)
# If not getopt was found then add it to the lib:
IF(DONT_HAVE_GETOPT)
ADD_DEFINITIONS(-DDONT_HAVE_GETOPT)
SET(common_SRCS
${common_SRCS}
getopt.c
)
ENDIF(DONT_HAVE_GETOPT)
IF(WIN32) IF(WIN32)
IF(BUILD_SHARED_LIBS) IF(BUILD_SHARED_LIBS)
@ -35,13 +16,14 @@ ENDIF(WIN32)
# Loop over all executables: # Loop over all executables:
FOREACH(exe jp3d_to_volume volume_to_jp3d) FOREACH(exe jp3d_to_volume volume_to_jp3d)
ADD_EXECUTABLE(${exe} ${exe}.c ${common_SRCS}) ADD_EXECUTABLE(${exe} ${exe}.c ${common_SRCS})
TARGET_LINK_LIBRARIES(${exe} ${OPENJPEG_LIBRARY_NAME}_JP3D) # ${TIFF_LIBRARIES}) TARGET_LINK_LIBRARIES(${exe} ${OPENJPEG3D_LIBRARY_NAME})
# On unix you need to link to the math library: # On unix you need to link to the math library:
IF(UNIX) IF(UNIX)
TARGET_LINK_LIBRARIES(${exe} m) TARGET_LINK_LIBRARIES(${exe} m)
ENDIF(UNIX) ENDIF(UNIX)
# Install exe # Install exe
INSTALL_TARGETS(/bin/ ${exe}) INSTALL(TARGETS ${exe}
EXPORT OpenJPEG3DTargets
DESTINATION ${OPENJPEG3D_INSTALL_BIN_DIR} COMPONENT Applications
)
ENDFOREACH(exe) ENDFOREACH(exe)

View File

@ -1,37 +0,0 @@
#jp3d/codec/Makefile
include ../../config.nix
INSTALL_BIN = $(prefix)/bin
CFLAGS = -Wall -I. -I../libjp3dvm -lstdc++ # -g -p -pg
#USERLIBS = -lm
ifeq ($(ENABLE_SHARED),yes)
ELIB = ../libopenjp3dvm.so.$(JP3D_MAJOR).$(JP3D_MINOR).$(JP3D_BUILD)
else
ELIB = ../libopenjp3dvm.a
endif
all: jp3d_to_volume volume_to_jp3d
install -d ../../bin
install jp3d_to_volume volume_to_jp3d ../../bin
jp3d_to_volume: jp3d_to_volume.c $(ELIB)
$(CC) $(CFLAGS) getopt.c convert.c jp3d_to_volume.c \
-o jp3d_to_volume $(ELIB) $(USERLIBS)
volume_to_jp3d: volume_to_jp3d.c $(ELIB)
$(CC) $(CFLAGS) getopt.c convert.c volume_to_jp3d.c \
-o volume_to_jp3d $(ELIB) $(USERLIBS)
clean:
rm -f jp3d_to_volume volume_to_jp3d
install: all
install -d $(DESTDIR)$(INSTALL_BIN)
install -m 755 -o root -g root jp3d_to_volume $(DESTDIR)$(INSTALL_BIN)
install -m 755 -o root -g root volume_to_jp3d $(DESTDIR)$(INSTALL_BIN)
uninstall:
rm -f $(DESTDIR)$(INSTALL_BIN)/jp3d_to_volume
rm -f $(DESTDIR)$(INSTALL_BIN)/volume_to_jp3d

View File

@ -31,7 +31,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "../libjp3dvm/openjpeg3d.h" #include "openjpeg3d.h"
#ifdef _WIN32 #ifdef _WIN32
#include "windirent.h" #include "windirent.h"
#else #else

View File

@ -33,7 +33,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <math.h> #include <math.h>
#include "../libjp3dvm/openjpeg3d.h" #include "openjpeg3d.h"
#include "getopt.h" #include "getopt.h"
#include "convert.h" #include "convert.h"

View File

@ -32,7 +32,7 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include "../libjp3dvm/openjpeg3d.h" #include "openjpeg3d.h"
#include "getopt.h" #include "getopt.h"
#include "convert.h" #include "convert.h"

View File

@ -1,39 +0,0 @@
IF(UNIX OR CYGWIN)
ADD_DEFINITIONS(-O3)
ELSEIF(MINGW)
ADD_DEFINITIONS(-Os)
ELSEIF(WIN32)
ADD_DEFINITIONS(/Os)
ENDIF(UNIX OR CYGWIN)
#
INCLUDE_REGULAR_EXPRESSION("^.*$")
# Defines the source code for the library
SET(JP3DVM_SRCS
bio.c cio.c dwt.c event.c jp3d.c jp3d_lib.c mct.c mqc.c openjpeg.c pi.c raw.c t1.c t1_3d.c t2.c tcd.c tgt.c volume.c
)
# Build the library
IF(WIN32)
IF(BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DOPJ_EXPORTS)
ELSE(BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DOPJ_STATIC)
ENDIF(BUILD_SHARED_LIBS)
ENDIF(WIN32)
ADD_LIBRARY(${OPENJPEG_LIBRARY_NAME}_JP3D ${JP3DVM_SRCS})
SET_TARGET_PROPERTIES(${OPENJPEG_LIBRARY_NAME}_JP3D
PROPERTIES
VERSION 1.3.0
SOVERSION 1)
# Install library
INSTALL(TARGETS ${OPENJPEG_LIBRARY_NAME}_JP3D
DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries
)
# Install includes files
INSTALL(FILES openjpeg3d.h
DESTINATION ${OPENJPEG_INSTALL_INCLUDE_DIR}/openjpeg3d-1.3
)
INSTALL(CODE
"EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink openjpeg3d-1.3/openjpeg3d.h \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${OPENJPEG_INSTALL_INCLUDE_DIR}/openjpeg3d.h)")

12
libopenjpeg3d.pc.cmake Normal file
View File

@ -0,0 +1,12 @@
prefix=@CMAKE_INSTALL_PREFIX@
bindir=@OPENJPEG3D_INSTALL_BIN_DIR@
datadir=@OPENJPEG3D_INSTALL_DATA_DIR@
libdir=@OPENJPEG3D_INSTALL_LIB_DIR@
includedir=@OPENJPEG3D_INSTALL_INCLUDE_DIR@
Name: openjpeg3d
Description: JPEG2000 files library
URL: http://www.openjpeg.org/
Version: @OPENJPEG3D_VERSION@
Libs: -L${libdir} -lopenjpeg3d
Cflags: -I${includedir}

View File

@ -0,0 +1,37 @@
INCLUDE_REGULAR_EXPRESSION("^.*$")
# Defines the source code for the library
SET(OPENJPEG3D_SRCS
bio.c cio.c dwt.c event.c jp3d.c jp3d_lib.c mct.c mqc.c openjpeg.c pi.c raw.c t1.c t1_3d.c t2.c tcd.c tgt.c volume.c
)
# Build the library
IF(WIN32)
IF(BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DOPJ_EXPORTS)
ELSE(BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DOPJ_STATIC)
ENDIF(BUILD_SHARED_LIBS)
ENDIF(WIN32)
ADD_LIBRARY(${OPENJPEG3D_LIBRARY_NAME} ${OPENJPEG3D_SRCS})
IF(UNIX)
TARGET_LINK_LIBRARIES(${OPENJPEG3D_LIBRARY_NAME} m)
ENDIF(UNIX)
SET_TARGET_PROPERTIES(${OPENJPEG3D_LIBRARY_NAME} PROPERTIES ${OPENJPEG3D_LIBRARY_PROPERTIES})
# Install library
INSTALL(TARGETS ${OPENJPEG3D_LIBRARY_NAME}
EXPORT OpenJPEG3DTargets
DESTINATION ${OPENJPEG3D_INSTALL_LIB_DIR}
COMPONENT Libraries
)
# Install includes files
INSTALL(FILES openjpeg3d.h
DESTINATION ${OPENJPEG3D_INSTALL_INCLUDE_DIR}/${subdir}
COMPONENT Headers
)
INSTALL(CODE
"EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink ${subdir}/openjpeg3d.h \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${OPENJPEG3D_INSTALL_INCLUDE_DIR}/openjpeg3d.h)")

View File

@ -1,8 +1,8 @@
namespace eval VMDecoder { namespace eval VMDecoder {
variable var variable var
variable JP3Ddecoder "../bin/jp3d_vm_dec.exe" variable JP3Ddecoder "../bin/jp3d_to_volume.exe"
#variable JP3Ddecoder "jp3d_vm_dec.exe" #variable JP3Ddecoder "jp3d_to_volume.exe"
} }

View File

@ -1,7 +1,7 @@
namespace eval VMEncoder { namespace eval VMEncoder {
variable var variable var
variable JP3Dencoder "../bin/jp3d_vm_enc.exe" variable JP3Dencoder "../bin/volume_to_jp3d.exe"
} }
proc VMEncoder::create { nb } { proc VMEncoder::create { nb } {