[trunk] FolderReorgProposal task: rename MJ2/JPIP CLI tools
Update issue 177
This commit is contained in:
parent
95f06f0591
commit
d84b16caf9
|
@ -6,9 +6,9 @@ include_directories(
|
||||||
)
|
)
|
||||||
|
|
||||||
# Tool to embed metadata into JP2 file
|
# Tool to embed metadata into JP2 file
|
||||||
add_executable(addXMLinJP2 addXMLinJP2.c)
|
add_executable(opj_jpip_addxml opj_jpip_addxml.c)
|
||||||
# Install exe
|
# Install exe
|
||||||
install(TARGETS addXMLinJP2
|
install(TARGETS opj_jpip_addxml
|
||||||
EXPORT OpenJPEGTargets
|
EXPORT OpenJPEGTargets
|
||||||
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
|
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
|
||||||
)
|
)
|
||||||
|
@ -42,12 +42,18 @@ endif()
|
||||||
|
|
||||||
set(EXES
|
set(EXES
|
||||||
opj_dec_server
|
opj_dec_server
|
||||||
jpip_to_jp2
|
opj_jpip_transcode
|
||||||
jpip_to_j2k
|
opj_jpip_test
|
||||||
test_index
|
|
||||||
)
|
)
|
||||||
foreach(exe ${EXES})
|
foreach(exe ${EXES})
|
||||||
add_executable(${exe} ${exe}.c)
|
if(${exe} STREQUAL "opj_jpip_transcode")
|
||||||
|
add_executable(${exe} ${exe}.c
|
||||||
|
jpip_to_jp2.c
|
||||||
|
jpip_to_j2k.c
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
add_executable(${exe} ${exe}.c)
|
||||||
|
endif()
|
||||||
target_link_libraries(${exe} openjpip_local)
|
target_link_libraries(${exe} openjpip_local)
|
||||||
install(TARGETS ${exe}
|
install(TARGETS ${exe}
|
||||||
EXPORT OpenJPEGTargets
|
EXPORT OpenJPEGTargets
|
||||||
|
@ -61,36 +67,6 @@ find_package(Java 1.5 COMPONENTS Development) # javac, jar
|
||||||
# Only build the java viewer if dev is found:
|
# Only build the java viewer if dev is found:
|
||||||
if(Java_Development_FOUND AND Java_JAVAC_EXECUTABLE)
|
if(Java_Development_FOUND AND Java_JAVAC_EXECUTABLE)
|
||||||
set(jflags $ENV{JFLAGS})
|
set(jflags $ENV{JFLAGS})
|
||||||
# 1. opj_viewer
|
|
||||||
# build dep list:
|
|
||||||
file(GLOB java1_srcs "opj_viewer/src/*.java")
|
|
||||||
|
|
||||||
# make sure target javac dir exists:
|
|
||||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/classes1)
|
|
||||||
# Build java
|
|
||||||
add_custom_command(
|
|
||||||
OUTPUT ${LIBRARY_OUTPUT_PATH}/opj_viewer.jar
|
|
||||||
COMMAND ${Java_JAVAC_EXECUTABLE} ${jflags}
|
|
||||||
${java1_srcs} -d ${CMAKE_CURRENT_BINARY_DIR}/classes1
|
|
||||||
COMMAND ${Java_JAR_EXECUTABLE} cfm ${LIBRARY_OUTPUT_PATH}/opj_viewer.jar
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/opj_viewer/dist/manifest.txt -C
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/classes1 .
|
|
||||||
DEPENDS ${java1_srcs}
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/opj_viewer/dist/manifest.txt
|
|
||||||
COMMENT "javac *.java; jar cvf -> opj_viewer.jar"
|
|
||||||
)
|
|
||||||
|
|
||||||
# name the target
|
|
||||||
add_custom_target(OPJViewerJar ALL
|
|
||||||
DEPENDS ${LIBRARY_OUTPUT_PATH}/opj_viewer.jar
|
|
||||||
COMMENT "building opj_viewer.jar"
|
|
||||||
)
|
|
||||||
|
|
||||||
install(FILES ${LIBRARY_OUTPUT_PATH}/opj_viewer.jar
|
|
||||||
DESTINATION ${OPENJPEG_INSTALL_SHARE_DIR} COMPONENT JavaModule
|
|
||||||
)
|
|
||||||
|
|
||||||
# 2. opj_viewer_xerces
|
|
||||||
# search for package org.apache.xerces.parsers
|
# search for package org.apache.xerces.parsers
|
||||||
find_file(APACHE_XERCES_JAR
|
find_file(APACHE_XERCES_JAR
|
||||||
NAMES xerces-j2.jar xercesImpl.jar
|
NAMES xerces-j2.jar xercesImpl.jar
|
||||||
|
@ -99,6 +75,7 @@ if(Java_Development_FOUND AND Java_JAVAC_EXECUTABLE)
|
||||||
)
|
)
|
||||||
mark_as_advanced(APACHE_XERCES_JAR)
|
mark_as_advanced(APACHE_XERCES_JAR)
|
||||||
|
|
||||||
|
# Decide to build the simple viewer or the xerces one:
|
||||||
if(EXISTS ${APACHE_XERCES_JAR})
|
if(EXISTS ${APACHE_XERCES_JAR})
|
||||||
configure_file(
|
configure_file(
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/opj_viewer_xerces/dist/manifest.txt.in
|
${CMAKE_CURRENT_SOURCE_DIR}/opj_viewer_xerces/dist/manifest.txt.in
|
||||||
|
@ -123,11 +100,11 @@ if(Java_Development_FOUND AND Java_JAVAC_EXECUTABLE)
|
||||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/classes2)
|
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/classes2)
|
||||||
# Build java
|
# Build java
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${LIBRARY_OUTPUT_PATH}/opj_viewer_xerces.jar
|
OUTPUT ${LIBRARY_OUTPUT_PATH}/opj_jpip_viewer.jar
|
||||||
COMMAND ${Java_JAVAC_EXECUTABLE} ${jflags}
|
COMMAND ${Java_JAVAC_EXECUTABLE} ${jflags}
|
||||||
-classpath ${APACHE_XERCES_JAR}
|
-classpath ${APACHE_XERCES_JAR}
|
||||||
${java2_srcs} -d ${CMAKE_CURRENT_BINARY_DIR}/classes2
|
${java2_srcs} -d ${CMAKE_CURRENT_BINARY_DIR}/classes2
|
||||||
COMMAND ${Java_JAR_EXECUTABLE} cfm ${LIBRARY_OUTPUT_PATH}/opj_viewer_xerces.jar
|
COMMAND ${Java_JAR_EXECUTABLE} cfm ${LIBRARY_OUTPUT_PATH}/opj_jpip_viewer.jar
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/opj_viewer_xerces/dist/manifest.txt
|
${CMAKE_CURRENT_BINARY_DIR}/opj_viewer_xerces/dist/manifest.txt
|
||||||
-C ${CMAKE_CURRENT_BINARY_DIR}/classes2 .
|
-C ${CMAKE_CURRENT_BINARY_DIR}/classes2 .
|
||||||
DEPENDS ${java2_srcs}
|
DEPENDS ${java2_srcs}
|
||||||
|
@ -137,11 +114,40 @@ if(Java_Development_FOUND AND Java_JAVAC_EXECUTABLE)
|
||||||
|
|
||||||
# name the target
|
# name the target
|
||||||
add_custom_target(OPJViewerXercesJar ALL
|
add_custom_target(OPJViewerXercesJar ALL
|
||||||
DEPENDS ${LIBRARY_OUTPUT_PATH}/opj_viewer_xerces.jar
|
DEPENDS ${LIBRARY_OUTPUT_PATH}/opj_jpip_viewer.jar
|
||||||
COMMENT "building opj_viewer_xerces.jar"
|
COMMENT "building opj_jpip_viewer.jar (xerces)"
|
||||||
)
|
)
|
||||||
|
|
||||||
install(FILES ${LIBRARY_OUTPUT_PATH}/opj_viewer_xerces.jar
|
install(FILES ${LIBRARY_OUTPUT_PATH}/opj_jpip_viewer.jar
|
||||||
|
DESTINATION ${OPENJPEG_INSTALL_SHARE_DIR} COMPONENT JavaModule
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
# opj_viewer (simple, no xerces)
|
||||||
|
# build dep list:
|
||||||
|
file(GLOB java1_srcs "opj_viewer/src/*.java")
|
||||||
|
|
||||||
|
# make sure target javac dir exists:
|
||||||
|
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/classes1)
|
||||||
|
# Build java
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT ${LIBRARY_OUTPUT_PATH}/opj_jpip_viewer.jar
|
||||||
|
COMMAND ${Java_JAVAC_EXECUTABLE} ${jflags}
|
||||||
|
${java1_srcs} -d ${CMAKE_CURRENT_BINARY_DIR}/classes1
|
||||||
|
COMMAND ${Java_JAR_EXECUTABLE} cfm ${LIBRARY_OUTPUT_PATH}/opj_jpip_viewer.jar
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/opj_viewer/dist/manifest.txt -C
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/classes1 .
|
||||||
|
DEPENDS ${java1_srcs}
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/opj_viewer/dist/manifest.txt
|
||||||
|
COMMENT "javac *.java; jar cvf -> opj_jpip_viewer.jar"
|
||||||
|
)
|
||||||
|
|
||||||
|
# name the target
|
||||||
|
add_custom_target(OPJViewerJar ALL
|
||||||
|
DEPENDS ${LIBRARY_OUTPUT_PATH}/opj_jpip_viewer.jar
|
||||||
|
COMMENT "building opj_jpip_viewer.jar (no xerces found)"
|
||||||
|
)
|
||||||
|
|
||||||
|
install(FILES ${LIBRARY_OUTPUT_PATH}/opj_jpip_viewer.jar
|
||||||
DESTINATION ${OPENJPEG_INSTALL_SHARE_DIR} COMPONENT JavaModule
|
DESTINATION ${OPENJPEG_INSTALL_SHARE_DIR} COMPONENT JavaModule
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "openjpip.h"
|
#include "openjpip.h"
|
||||||
|
|
||||||
int main(int argc,char *argv[])
|
int jpip_to_j2k(int argc,char *argv[])
|
||||||
{
|
{
|
||||||
jpip_dec_param_t *dec;
|
jpip_dec_param_t *dec;
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "openjpip.h"
|
#include "openjpip.h"
|
||||||
|
|
||||||
int main(int argc,char *argv[])
|
int jpip_to_jp2(int argc,char *argv[])
|
||||||
{
|
{
|
||||||
jpip_dec_param_t *dec;
|
jpip_dec_param_t *dec;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
/*
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||||
|
* Copyright (c) 2002-2011, Professor Benoit Macq
|
||||||
|
* Copyright (c) 2012, Mathieu Malaterre
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! \file
|
||||||
|
* \brief opj_jpip_transcode is a program to convert JPT- JPP- stream to J2K/JP2 file
|
||||||
|
*
|
||||||
|
* \section impinst Implementing instructions
|
||||||
|
* This program takes two arguments. \n
|
||||||
|
* -# Input JPT or JPP file
|
||||||
|
* -# Output J2K file\n
|
||||||
|
* % ./opj_jpip_transcode input.jpt output.j2k
|
||||||
|
* or
|
||||||
|
* % ./jpip_to_j2k input.jpp output.j2k
|
||||||
|
*/
|
||||||
|
extern int jpip_to_j2k(int argc,char *argv[]);
|
||||||
|
extern int jpip_to_jp2(int argc,char *argv[]);
|
||||||
|
|
||||||
|
int main(int argc,char *argv[])
|
||||||
|
{
|
||||||
|
/* MM: FIXME */
|
||||||
|
return jpip_to_jp2(argc,argv);
|
||||||
|
}
|
|
@ -44,52 +44,25 @@ include_directories(
|
||||||
${LCMS_INCLUDE_DIRNAME}
|
${LCMS_INCLUDE_DIRNAME}
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(frames_to_mj2
|
foreach(exe
|
||||||
frames_to_mj2.c
|
opj_mj2_wrap
|
||||||
${common_SRCS}
|
opj_mj2_extract
|
||||||
${OPJ_SRCS}
|
opj_mj2_decompress
|
||||||
${MJ2_SRCS}
|
opj_mj2_compress
|
||||||
)
|
)
|
||||||
target_link_libraries(frames_to_mj2 ${LCMS_LIBNAME} openmj2)
|
add_executable(${exe}
|
||||||
|
${exe}.c
|
||||||
if(UNIX)
|
|
||||||
target_link_libraries(frames_to_mj2 m)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_executable(mj2_to_frames
|
|
||||||
mj2_to_frames.c
|
|
||||||
${common_SRCS}
|
${common_SRCS}
|
||||||
${OPJ_SRCS}
|
${OPJ_SRCS}
|
||||||
${MJ2_SRCS}
|
${MJ2_SRCS}
|
||||||
${OPENJPEG_SOURCE_DIR}/src/bin/common/color.c
|
${OPENJPEG_SOURCE_DIR}/src/bin/common/color.c
|
||||||
)
|
)
|
||||||
target_link_libraries(mj2_to_frames ${LCMS_LIBNAME})
|
target_link_libraries(${exe} ${LCMS_LIBNAME} openmj2)
|
||||||
|
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
target_link_libraries(mj2_to_frames m)
|
target_link_libraries(${exe} m)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(extract_j2k_from_mj2
|
install(TARGETS ${exe}
|
||||||
extract_j2k_from_mj2.c
|
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR})
|
||||||
${OPJ_SRCS}
|
endforeach()
|
||||||
${MJ2_SRCS}
|
|
||||||
)
|
|
||||||
target_link_libraries(extract_j2k_from_mj2 ${LCMS_LIBNAME} openmj2)
|
|
||||||
|
|
||||||
if(UNIX)
|
|
||||||
target_link_libraries(extract_j2k_from_mj2 m)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_executable(wrap_j2k_in_mj2
|
|
||||||
wrap_j2k_in_mj2.c
|
|
||||||
${OPJ_SRCS}
|
|
||||||
${MJ2_SRCS}
|
|
||||||
)
|
|
||||||
target_link_libraries(wrap_j2k_in_mj2 ${LCMS_LIBNAME})
|
|
||||||
|
|
||||||
if(UNIX)
|
|
||||||
target_link_libraries(wrap_j2k_in_mj2 m)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
install(TARGETS frames_to_mj2 mj2_to_frames extract_j2k_from_mj2 wrap_j2k_in_mj2
|
|
||||||
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR})
|
|
||||||
|
|
|
@ -776,7 +776,9 @@ int main(int argc, char **argv)
|
||||||
cio_write(cio, JP2_JP2C, 4); // JP2C
|
cio_write(cio, JP2_JP2C, 4); // JP2C
|
||||||
|
|
||||||
/* encode the image */
|
/* encode the image */
|
||||||
|
#if 0 /* MM: FIXME */
|
||||||
bSuccess = opj_encode(cinfo, cio, img, NULL);
|
bSuccess = opj_encode(cinfo, cio, img, NULL);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!bSuccess) {
|
if (!bSuccess) {
|
||||||
opj_cio_close(cio);
|
opj_cio_close(cio);
|
|
@ -177,7 +177,9 @@ int main(int argc, char *argv[]) {
|
||||||
/* open a byte stream */
|
/* open a byte stream */
|
||||||
cio = opj_cio_open((opj_common_ptr)dinfo, frame_codestream, sample->sample_size-8);
|
cio = opj_cio_open((opj_common_ptr)dinfo, frame_codestream, sample->sample_size-8);
|
||||||
|
|
||||||
|
#if 0 /* MM: FIXME */
|
||||||
img = opj_decode(dinfo, cio); // Decode J2K to image
|
img = opj_decode(dinfo, cio); // Decode J2K to image
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef WANT_SYCC_TO_RGB
|
#ifdef WANT_SYCC_TO_RGB
|
||||||
if(img->color_space == CLRSPC_SYCC)
|
if(img->color_space == CLRSPC_SYCC)
|
|
@ -89,7 +89,9 @@ static int test_image(const char *fname, mj2_cparameters_t *cp)
|
||||||
|
|
||||||
cio = opj_cio_open((opj_common_ptr)dinfo, src, src_len);
|
cio = opj_cio_open((opj_common_ptr)dinfo, src, src_len);
|
||||||
|
|
||||||
|
#if 0 /* MM: FIXME */
|
||||||
image = opj_decode(dinfo, cio);
|
image = opj_decode(dinfo, cio);
|
||||||
|
#endif
|
||||||
|
|
||||||
free(src); cio->buffer = NULL;
|
free(src); cio->buffer = NULL;
|
||||||
opj_cio_close(cio);
|
opj_cio_close(cio);
|
|
@ -1,6 +1,7 @@
|
||||||
set(OPENMJ2_LIBRARY_NAME openmj2)
|
set(OPENMJ2_LIBRARY_NAME openmj2)
|
||||||
set(OPENMJ2_SRCS
|
set(OPENMJ2_SRCS
|
||||||
mj2.c
|
mj2.c
|
||||||
|
mj2_convert.c
|
||||||
)
|
)
|
||||||
|
|
||||||
# Build the library
|
# Build the library
|
||||||
|
|
Loading…
Reference in New Issue