changeset 839:dfb13218f8ca jpeg

jpeg
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 03 Jun 2014 17:55:44 +0200
parents a4d2be5154a9
children 256e1530eb0f
files CMakeLists.txt Resources/CMake/DcmtkConfiguration.cmake UnitTestsSources/JpegLossless.cpp
diffstat 3 files changed, 67 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/CMakeLists.txt	Mon Jun 02 13:01:02 2014 +0200
+++ b/CMakeLists.txt	Tue Jun 03 17:55:44 2014 +0200
@@ -18,6 +18,7 @@
 SET(DCMTK_DICTIONARY_DIR "" CACHE PATH "Directory containing the DCMTK dictionaries \"dicom.dic\" and \"private.dic\" (only when using system version of DCMTK)") 
 SET(ALLOW_DOWNLOADS OFF CACHE BOOL "Allow CMake to download packages")
 SET(UNIT_TESTS_WITH_HTTP_CONNEXIONS ON CACHE BOOL "Allow unit tests to make HTTP requests")
+SET(ENABLE_JPEG_LOSSLESS CACHE BOOL "Enable JPEG Lossless decompression")
 
 # Advanced parameters to fine-tune linking against system libraries
 SET(USE_SYSTEM_JSONCPP ON CACHE BOOL "Use the system version of JsonCpp")
@@ -164,6 +165,13 @@
   )
 
 
+if (ENABLE_JPEG_LOSSLESS)
+  list(APPEND ORTHANC_UNIT_TESTS_SOURCES
+    UnitTestsSources/JpegLossless.cpp
+    )
+endif()
+
+
 
 #####################################################################
 ## Inclusion of third-party dependencies
@@ -201,6 +209,13 @@
 endif()
 
 
+if (ENABLE_JPEG_LOSSLESS)
+  add_definitions(-DORTHANC_JPEG_LOSSLESS_ENABLED=1)
+else()
+  add_definitions(-DORTHANC_JPEG_LOSSLESS_ENABLED=0)
+endif()
+
+
 
 #####################################################################
 ## Autogeneration of files
--- a/Resources/CMake/DcmtkConfiguration.cmake	Mon Jun 02 13:01:02 2014 +0200
+++ b/Resources/CMake/DcmtkConfiguration.cmake	Tue Jun 03 17:55:44 2014 +0200
@@ -49,6 +49,16 @@
   AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmdata/libsrc DCMTK_SOURCES)
   AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/ofstd/libsrc DCMTK_SOURCES)
 
+  if (ENABLE_JPEG_LOSSLESS)
+    AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpls/libsrc DCMTK_SOURCES)
+    AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpls/libcharls DCMTK_SOURCES)
+    include_directories(
+      ${DCMTK_SOURCES_DIR}/dcmjpls/include
+      ${DCMTK_SOURCES_DIR}/dcmjpls/libcharls
+      )
+  endif()
+
+
   # Source for the logging facility of DCMTK
   AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/oflog/libsrc DCMTK_SOURCES)
   if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/UnitTestsSources/JpegLossless.cpp	Tue Jun 03 17:55:44 2014 +0200
@@ -0,0 +1,42 @@
+/**
+ * Orthanc - A Lightweight, RESTful DICOM Store
+ * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege,
+ * Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * In addition, as a special exception, the copyright holders of this
+ * program give permission to link the code of its release with the
+ * OpenSSL project's "OpenSSL" library (or with modified versions of it
+ * that use the same license as the "OpenSSL" library), and distribute
+ * the linked executables. You must obey the GNU General Public License
+ * in all respects for all of the code used other than "OpenSSL". If you
+ * modify file(s) with this exception, you may extend this exception to
+ * your version of the file(s), but you are not obligated to do so. If
+ * you do not wish to do so, delete this exception statement from your
+ * version. If you delete this exception statement from all source files
+ * in the program, then also delete it here.
+ * 
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+
+#include "PrecompiledHeadersUnitTests.h"
+#include "gtest/gtest.h"
+
+#include <dcmjpls/djdecode.h>
+
+using namespace Orthanc;
+
+TEST(JpegLossless, Basic)
+{
+}