summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKinan Hakim <kinan@google.com>2015-12-18 14:42:01 +0100
committerKinan Hakim <kinan@google.com>2015-12-22 17:48:51 +0000
commit327c6d5fa60ff1df8a421499edff3c6445a9d2e6 (patch)
treef191d3ab4a5ac67c41c004df98ba8348470dc858
parent6e09dfbee0b1643a5cb2b32d0399c1a0c69551a0 (diff)
downloaddng_sdk-327c6d5fa60ff1df8a421499edff3c6445a9d2e6.tar.gz
Add Android.mk and exclude xmp.
Change-Id: Idbe400dbff847ee4ee0faeededc7132473f1d6af
-rw-r--r--Android.mk102
-rw-r--r--README.version6
-rw-r--r--source/RawEnvironment.h16
-rw-r--r--source/dng_host.cpp7
-rw-r--r--source/dng_host.h4
-rw-r--r--source/dng_image_writer.cpp27
-rw-r--r--source/dng_negative.cpp38
-rw-r--r--source/dng_negative.h16
-rw-r--r--source/dng_validate.cpp15
-rw-r--r--source/dng_xmp.cpp2
-rw-r--r--source/dng_xmp.h4
-rw-r--r--source/dng_xmp_sdk.h3
12 files changed, 240 insertions, 0 deletions
diff --git a/Android.mk b/Android.mk
new file mode 100644
index 0000000..628c45a
--- /dev/null
+++ b/Android.mk
@@ -0,0 +1,102 @@
+LOCAL_PATH := $(call my-dir)
+
+# dng sdk shared library for target
+# ========================================================
+
+include $(CLEAR_VARS)
+
+dng_sdk_files := \
+ source/dng_1d_function.cpp \
+ source/dng_1d_table.cpp \
+ source/dng_abort_sniffer.cpp \
+ source/dng_area_task.cpp \
+ source/dng_bad_pixels.cpp \
+ source/dng_bottlenecks.cpp \
+ source/dng_camera_profile.cpp \
+ source/dng_color_space.cpp \
+ source/dng_color_spec.cpp \
+ source/dng_date_time.cpp \
+ source/dng_exceptions.cpp \
+ source/dng_exif.cpp \
+ source/dng_file_stream.cpp \
+ source/dng_filter_task.cpp \
+ source/dng_fingerprint.cpp \
+ source/dng_gain_map.cpp \
+ source/dng_globals.cpp \
+ source/dng_host.cpp \
+ source/dng_hue_sat_map.cpp \
+ source/dng_ifd.cpp \
+ source/dng_image.cpp \
+ source/dng_image_writer.cpp \
+ source/dng_info.cpp \
+ source/dng_iptc.cpp \
+ source/dng_jpeg_image.cpp \
+ source/dng_jpeg_memory_source.cpp \
+ source/dng_lens_correction.cpp \
+ source/dng_linearization_info.cpp \
+ source/dng_lossless_jpeg.cpp \
+ source/dng_matrix.cpp \
+ source/dng_memory.cpp \
+ source/dng_memory_stream.cpp \
+ source/dng_misc_opcodes.cpp \
+ source/dng_mosaic_info.cpp \
+ source/dng_mutex.cpp \
+ source/dng_negative.cpp \
+ source/dng_opcode_list.cpp \
+ source/dng_opcodes.cpp \
+ source/dng_orientation.cpp \
+ source/dng_parse_utils.cpp \
+ source/dng_pixel_buffer.cpp \
+ source/dng_point.cpp \
+ source/dng_preview.cpp \
+ source/dng_pthread.cpp \
+ source/dng_rational.cpp \
+ source/dng_read_image.cpp \
+ source/dng_rect.cpp \
+ source/dng_ref_counted_block.cpp \
+ source/dng_reference.cpp \
+ source/dng_render.cpp \
+ source/dng_resample.cpp \
+ source/dng_safe_arithmetic.cpp \
+ source/dng_shared.cpp \
+ source/dng_simple_image.cpp \
+ source/dng_spline.cpp \
+ source/dng_stream.cpp \
+ source/dng_string.cpp \
+ source/dng_string_list.cpp \
+ source/dng_tag_types.cpp \
+ source/dng_temperature.cpp \
+ source/dng_tile_iterator.cpp \
+ source/dng_tone_curve.cpp \
+ source/dng_utils.cpp \
+ source/dng_xy_coord.cpp \
+ source/dng_xmp.cpp
+
+LOCAL_MODULE := libdng_sdk
+LOCAL_MODULE_TAGS := optional
+LOCAL_SRC_FILES := $(dng_sdk_files)
+
+LOCAL_CFLAGS := -DUNIX_ENV=1 -DqDNGBigEndian=0 -DqDNGThreadSafe=1 -DqDNGUseLibJPEG=1 -DqDNGUseXMP=0 -DqDNGValidate=0 -DqDNGValidateTarget=1 -DqAndroid=1 -fexceptions -Wsign-compare -Wno-reorder -Wframe-larger-than=20000 -frtti
+
+LOCAL_SANITIZE := unsigned-integer-overflow signed-integer-overflow
+
+LOCAL_SHARED_LIBRARIES := libz libjpeg
+
+include $(BUILD_SHARED_LIBRARY)
+
+# dng sdk unittests for target
+# ========================================================
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := dng_validate
+LOCAL_MODULE_TAGS := optional
+LOCAL_SRC_FILES := \
+ $(dng_sdk_files) \
+ source/dng_validate.cpp
+
+LOCAL_CFLAGS := -DUNIX_ENV=1 -DqDNGBigEndian=0 -DqDNGThreadSafe=1 -DqDNGUseLibJPEG=1 -DqDNGUseXMP=0 -DqDNGValidate=1 -DqDNGValidateTarget=1 -DqAndroid=1 -fexceptions -Wsign-compare -Wno-reorder -Wframe-larger-than=20000 -frtti
+
+LOCAL_SHARED_LIBRARIES := libz libjpeg
+
+include $(BUILD_EXECUTABLE)
diff --git a/README.version b/README.version
new file mode 100644
index 0000000..e54deae
--- /dev/null
+++ b/README.version
@@ -0,0 +1,6 @@
+URL: http://download.adobe.com/pub/adobe/dng/dng_sdk_1_4.zip
+Version: 1.4.0
+License: BSD like License
+License File: LICENSE
+BugComponent: 25788014
+Owners: ebrauer, kinan, mboehme
diff --git a/source/RawEnvironment.h b/source/RawEnvironment.h
new file mode 100644
index 0000000..3613cd4
--- /dev/null
+++ b/source/RawEnvironment.h
@@ -0,0 +1,16 @@
+// Define preprocessor constants that control platform-specific conditional
+// compilation. The constants qMacOS and qWinOS must be defined on all
+// platforms. Other constants, such as qLinux, only need to be defined if we're
+// actually compiling for that platform.
+#if defined(__linux__)
+#define qMacOS 0
+#define qWinOS 0
+#define qLinux 1
+#elif defined(__APPLE__)
+#define qMacOS 1
+#define qWinOS 0
+#elif defined(_WIN32)
+#define qMacOS 0
+#define qWinOS 1
+#endif
+
diff --git a/source/dng_host.cpp b/source/dng_host.cpp
index 6581f90..d36572c 100644
--- a/source/dng_host.cpp
+++ b/source/dng_host.cpp
@@ -29,7 +29,10 @@
#include "dng_resample.h"
#include "dng_shared.h"
#include "dng_simple_image.h"
+
+#if qDNGUseXMP
#include "dng_xmp.h"
+#endif
/*****************************************************************************/
@@ -268,6 +271,8 @@ dng_exif * dng_host::Make_dng_exif ()
/*****************************************************************************/
+#if qDNGUseXMP
+
dng_xmp * dng_host::Make_dng_xmp ()
{
@@ -284,6 +289,8 @@ dng_xmp * dng_host::Make_dng_xmp ()
}
+#endif
+
/*****************************************************************************/
dng_shared * dng_host::Make_dng_shared ()
diff --git a/source/dng_host.h b/source/dng_host.h
index 357cd7e..dc526d2 100644
--- a/source/dng_host.h
+++ b/source/dng_host.h
@@ -346,7 +346,11 @@ class dng_host
/// Factory method for dng_xmp class. Can be used to customize allocation or
/// to ensure a derived class is used instead of dng_xmp.
+ #if qDNGUseXMP
+
virtual dng_xmp * Make_dng_xmp ();
+
+ #endif
/// Factory method for dng_shared class. Can be used to customize allocation
/// or to ensure a derived class is used instead of dng_shared.
diff --git a/source/dng_image_writer.cpp b/source/dng_image_writer.cpp
index b70ba62..049d7c3 100644
--- a/source/dng_image_writer.cpp
+++ b/source/dng_image_writer.cpp
@@ -40,7 +40,10 @@
#include "dng_tag_codes.h"
#include "dng_tag_values.h"
#include "dng_utils.h"
+
+#if qDNGUseXMP
#include "dng_xmp.h"
+#endif
#include "zlib.h"
@@ -80,6 +83,8 @@ static void SpoolAdobeData (dng_stream &stream,
TempBigEndian tempEndian (stream);
+ #if qDNGUseXMP
+
if (metadata && metadata->GetXMP ())
{
@@ -133,6 +138,8 @@ static void SpoolAdobeData (dng_stream &stream,
}
+ #endif
+
if (preview)
{
@@ -538,6 +545,8 @@ tag_xmp::tag_xmp (const dng_xmp *xmp)
{
+ #if qDNGUseXMP
+
if (xmp)
{
@@ -554,6 +563,8 @@ tag_xmp::tag_xmp (const dng_xmp *xmp)
}
+ #endif
+
}
/******************************************************************************/
@@ -4758,6 +4769,8 @@ void dng_image_writer::WriteImage (dng_host &host,
/*****************************************************************************/
+#if qDNGUseXMP
+
static void CopyString (const dng_xmp &oldXMP,
dng_xmp &newXMP,
const char *ns,
@@ -4889,6 +4902,8 @@ static void CopyBoolean (const dng_xmp &oldXMP,
}
+
+#endif
/*****************************************************************************/
void dng_image_writer::CleanUpMetadata (dng_host &host,
@@ -4898,6 +4913,8 @@ void dng_image_writer::CleanUpMetadata (dng_host &host,
const char *software)
{
+ #if qDNGUseXMP
+
if (metadata.GetXMP () && metadata.GetExif ())
{
@@ -5230,6 +5247,8 @@ void dng_image_writer::CleanUpMetadata (dng_host &host,
}
+ #endif
+
}
/*****************************************************************************/
@@ -5474,6 +5493,8 @@ void dng_image_writer::WriteTIFFWithProfile (dng_host &host,
// XMP metadata.
+ #if qDNGUseXMP
+
tag_xmp tagXMP (metadata.Get () ? metadata->GetXMP () : NULL);
if (tagXMP.Count ())
@@ -5481,6 +5502,8 @@ void dng_image_writer::WriteTIFFWithProfile (dng_host &host,
mainIFD.Add (&tagXMP);
}
+ #endif
+
// IPTC metadata.
tag_iptc tagIPTC (metadata.Get () ? metadata->IPTCData () : NULL,
@@ -6484,6 +6507,8 @@ void dng_image_writer::WriteDNG (dng_host &host,
// XMP metadata.
+ #if qDNGUseXMP
+
tag_xmp tagXMP (metadata->GetXMP ());
if (tagXMP.Count ())
@@ -6493,6 +6518,8 @@ void dng_image_writer::WriteDNG (dng_host &host,
}
+ #endif
+
// Exif tags.
exif_tag_set exifSet (mainIFD,
diff --git a/source/dng_negative.cpp b/source/dng_negative.cpp
index c858ff2..ed106d7 100644
--- a/source/dng_negative.cpp
+++ b/source/dng_negative.cpp
@@ -43,7 +43,9 @@
#include "dng_tag_values.h"
#include "dng_tile_iterator.h"
#include "dng_utils.h"
+#if qDNGUseXMP
#include "dng_xmp.h"
+#endif
/*****************************************************************************/
@@ -139,7 +141,13 @@ dng_metadata::dng_metadata (dng_host &host)
, fOriginalExif ()
, fIPTCBlock ()
, fIPTCOffset (kDNGStreamInvalidOffset)
+
+ #if qDNGUseXMP
+
, fXMP (host.Make_dng_xmp ())
+
+ #endif
+
, fEmbeddedXMPDigest ()
, fXMPinSidecar (false)
, fXMPisNewer (false)
@@ -187,7 +195,13 @@ dng_metadata::dng_metadata (const dng_metadata &rhs,
, fOriginalExif (CloneAutoPtr (rhs.fOriginalExif))
, fIPTCBlock (CloneAutoPtr (rhs.fIPTCBlock, allocator))
, fIPTCOffset (rhs.fIPTCOffset)
+
+ #if qDNGUseXMP
+
, fXMP (CloneAutoPtr (rhs.fXMP))
+
+ #endif
+
, fEmbeddedXMPDigest (rhs.fEmbeddedXMPDigest)
, fXMPinSidecar (rhs.fXMPinSidecar)
, fXMPisNewer (rhs.fXMPisNewer)
@@ -224,7 +238,11 @@ void dng_metadata::ApplyOrientation (const dng_orientation &orientation)
fBaseOrientation += orientation;
+
+ #if qDNGUseXMP
fXMP->SetOrientation (fBaseOrientation);
+
+ #endif
}
@@ -505,6 +523,8 @@ dng_fingerprint dng_metadata::IPTCDigest (bool includePadding) const
/******************************************************************************/
+#if qDNGUseXMP
+
void dng_metadata::RebuildIPTC (dng_memory_allocator &allocator,
bool padForTIFF)
{
@@ -631,6 +651,8 @@ void dng_metadata::SetEmbeddedXMP (dng_host &host,
}
+#endif
+
/*****************************************************************************/
void dng_metadata::SynchronizeMetadata ()
@@ -643,6 +665,8 @@ void dng_metadata::SynchronizeMetadata ()
}
+ #if qDNGUseXMP
+
fXMP->ValidateMetadata ();
fXMP->IngestIPTC (*this, fXMPisNewer);
@@ -651,6 +675,8 @@ void dng_metadata::SynchronizeMetadata ()
fXMP->SyncOrientation (*this, fXMPinSidecar);
+ #endif
+
}
/*****************************************************************************/
@@ -660,7 +686,9 @@ void dng_metadata::UpdateDateTime (const dng_date_time_info &dt)
fExif->UpdateDateTime (dt);
+#if qDNGUseXMP
fXMP->UpdateDateTime (dt);
+#endif
}
@@ -675,8 +703,12 @@ void dng_metadata::UpdateDateTimeToNow ()
UpdateDateTime (dt);
+ #if qDNGUseXMP
+
fXMP->UpdateMetadataDate (dt);
+ #endif
+
}
/*****************************************************************************/
@@ -688,7 +720,9 @@ void dng_metadata::UpdateMetadataDateTimeToNow ()
CurrentDateTimeAndZone (dt);
+ #if qDNGUseXMP
fXMP->UpdateMetadataDate (dt);
+ #endif
}
@@ -3341,6 +3375,8 @@ void dng_negative::PostParse (dng_host &host,
// XMP metadata.
+ #if qDNGUseXMP
+
if (shared.fXMPCount)
{
@@ -3366,6 +3402,8 @@ void dng_negative::PostParse (dng_host &host,
}
+ #endif
+
// Color info.
if (!IsMonochrome ())
diff --git a/source/dng_negative.h b/source/dng_negative.h
index f0ee76c..6cec4e0 100644
--- a/source/dng_negative.h
+++ b/source/dng_negative.h
@@ -247,8 +247,12 @@ class dng_metadata
// XMP data.
+ #if qDNGUseXMP
+
AutoPtr<dng_xmp> fXMP;
+ #endif
+
// If there a valid embedded XMP block, has is its digest? NULL if no valid
// embedded XMP.
@@ -397,6 +401,8 @@ class dng_metadata
// API for XMP metadata:
+ #if qDNGUseXMP
+
bool SetXMP (dng_host &host,
const void *buffer,
uint32 count,
@@ -442,6 +448,8 @@ class dng_metadata
void ResetXMPSidecarNewer (dng_xmp * newXMP, bool inSidecar, bool isNewer );
+ #endif
+
// Synchronize metadata sources.
void SynchronizeMetadata ();
@@ -491,6 +499,8 @@ const E & dng_metadata::Exif () const
/*****************************************************************************/
+#if qDNGUseXMP
+
template< class X >
X & dng_metadata::XMP ()
{
@@ -509,6 +519,8 @@ const X & dng_metadata::XMP () const
return dynamic_cast< const X & > (*xmp);
}
+#endif
+
/*****************************************************************************/
/// \brief Main class for holding DNG image data and associated metadata.
@@ -1928,6 +1940,8 @@ class dng_negative
// API for XMP metadata:
+ #if qDNGUseXMP
+
bool SetXMP (dng_host &host,
const void *buffer,
uint32 count,
@@ -1975,6 +1989,8 @@ class dng_negative
return Metadata ().HaveValidEmbeddedXMP ();
}
+ #endif
+
// API for source MIMI type.
void SetSourceMIMI (const char *s)
diff --git a/source/dng_validate.cpp b/source/dng_validate.cpp
index 83bc4f9..aa7c33a 100644
--- a/source/dng_validate.cpp
+++ b/source/dng_validate.cpp
@@ -48,8 +48,11 @@
#include "dng_tag_codes.h"
#include "dng_tag_types.h"
#include "dng_tag_values.h"
+
+#if qDNGUseXMP
#include "dng_xmp.h"
#include "dng_xmp_sdk.h"
+#endif
/*****************************************************************************/
@@ -452,6 +455,8 @@ static dng_error_code dng_validate (const char *filename)
// not keep any Camera Raw settings in the XMP around when
// writing rendered files.
+ #if qDNGUseXMP
+
if (negative->GetXMP ())
{
@@ -460,6 +465,8 @@ static dng_error_code dng_validate (const char *filename)
}
+ #endif
+
// Write TIF file.
dng_file_stream stream2 (gDumpTIF.Get (), true);
@@ -855,8 +862,12 @@ int main (int argc, char *argv [])
fprintf (stderr, "*** No file specified\n");
return 1;
}
+
+ #if qDNGUseXMP
dng_xmp_sdk::InitializeSDK ();
+
+ #endif
int result = 0;
@@ -873,7 +884,11 @@ int main (int argc, char *argv [])
}
+ #if qDNGUseXMP
+
dng_xmp_sdk::TerminateSDK ();
+
+ #endif
return result;
diff --git a/source/dng_xmp.cpp b/source/dng_xmp.cpp
index e761007..aaed238 100644
--- a/source/dng_xmp.cpp
+++ b/source/dng_xmp.cpp
@@ -12,6 +12,7 @@
/* $Author: tknoll $ */
/*****************************************************************************/
+#if qDNGUseXMP
#include "dng_xmp.h"
@@ -4412,4 +4413,5 @@ void dng_xmp::DocOpsUpdateMetadata (const char *srcMIMI)
#endif
+#endif
/*****************************************************************************/
diff --git a/source/dng_xmp.h b/source/dng_xmp.h
index fc898fa..9ef960b 100644
--- a/source/dng_xmp.h
+++ b/source/dng_xmp.h
@@ -16,6 +16,8 @@
#ifndef __dng_xmp__
#define __dng_xmp__
+#if qDNGUseXMP
+
/*****************************************************************************/
#include "dng_classes.h"
@@ -398,6 +400,8 @@ class dng_xmp
};
+#endif
+
/*****************************************************************************/
#endif
diff --git a/source/dng_xmp_sdk.h b/source/dng_xmp_sdk.h
index c6ff6f0..462d22d 100644
--- a/source/dng_xmp_sdk.h
+++ b/source/dng_xmp_sdk.h
@@ -23,6 +23,8 @@
#include "dng_flags.h"
#include "dng_types.h"
+#if qDNGUseXMP
+
/*****************************************************************************/
extern const char *XMP_NS_TIFF;
@@ -231,6 +233,7 @@ class dng_xmp_sdk
};
+#endif
/*****************************************************************************/
#endif