camera: add Morpho DNR support

-- Use to Morpho DNR (Digital Noise Reduction) for low-ligth conditions (under
   50lux).
-- Remove logspam

Bug: 7131846
Bug: 7138612
Change-Id: Ie8b66ddb0307ec5f779d60033eae766ed12b13ed
Signed-off-by: Iliyan Malchev <malchev@google.com>
diff --git a/camera/QCameraHWI.cpp b/camera/QCameraHWI.cpp
index cc88f8a..eec8adb 100755
--- a/camera/QCameraHWI.cpp
+++ b/camera/QCameraHWI.cpp
@@ -24,6 +24,8 @@
 #include <cutils/properties.h>
 #include <fcntl.h>
 #include <sys/mman.h>
+#include <string.h>
+#include <dlfcn.h>
 
 #include "QCameraHAL.h"
 #include "QCameraHWI.h"
@@ -282,6 +284,13 @@
         return;
     }
     mCameraState = CAMERA_STATE_READY;
+    libdnr = dlopen("libmorpho_noise_reduction.so", RTLD_NOW);
+    if (libdnr) {
+        ALOGD("Open MM camera DL libmorpho_noise_reduction loaded at %p & %p ", libdnr);
+        *(void **)&LINK_morpho_DNR_ProcessFrame = dlsym(libdnr, "LINK_mm_camera_morpho_noise_reduction");
+    }
+    else
+        ALOGE("failed to open libmorpho_noise_reduction");
 
     ALOGI("QCameraHardwareInterface: X");
 }
@@ -332,6 +341,11 @@
         QCameraStream_Snapshot::deleteInstance (mStreamSnap);
         mStreamSnap = NULL;
     }
+    if (libdnr != NULL) {
+         dlclose(libdnr);
+         libdnr = NULL;
+         ALOGD("closed libmorpho_noise_reduction.so");
+    }
 
     if (mStreamLiveSnap){
         QCameraStream_Snapshot::deleteInstance (mStreamLiveSnap);
@@ -1389,7 +1403,7 @@
 
 status_t QCameraHardwareInterface::autoFocusMoveEvent(cam_ctrl_status_t *status, app_notify_cb_t *app_cb)
 {
-    ALOGI("autoFocusMoveEvent: E");
+    ALOGV("autoFocusMoveEvent: E");
     int ret = NO_ERROR;
 
     isp3a_af_mode_t afMode = getAutoFocusMode(mParameters);
@@ -1412,7 +1426,7 @@
             ALOGE("%s:Unknown AF Move Status received (%d) received",__func__,*status);
         }
     }
-    ALOGI("autoFocusMoveEvent: X");
+    ALOGV("autoFocusMoveEvent: X");
     return ret;
 }
 
@@ -1473,7 +1487,7 @@
       app_cb->argm_notify.ext2 = 0;
       app_cb->argm_notify.cookie =  mCallbackCookie;
 
-      ALOGD("Auto foucs state =%d", *status);
+      ALOGV("Auto focus state =%d", *status);
       if(*status==CAM_CTRL_SUCCESS) {
         app_cb->argm_notify.ext1 = true;
       }
diff --git a/camera/QCameraHWI.h b/camera/QCameraHWI.h
index c689b70..2bc8abc 100644
--- a/camera/QCameraHWI.h
+++ b/camera/QCameraHWI.h
@@ -45,6 +45,7 @@
 #include "QCameraStream.h"
 #include "QCamera_Intf.h"
 
+#include "hdr/include/morpho_noise_reduction_ext.h"
 //Error codes
 #define  NOT_FOUND -1
 #define MAX_ZOOM_RATIOS 62
@@ -800,6 +801,8 @@
     camera_size_type* mVideoSizes;
     const camera_size_type * mPictureSizesPtr;
     HAL_camera_state_type_t mCameraState;
+    void *libdnr;
+    int (*LINK_morpho_DNR_ProcessFrame)(unsigned char* yuvImage, int width, int height, int y_level, int c_level);
 
      /* Temporary - can be removed after Honeycomb*/
 #ifdef USE_ION
diff --git a/camera/QCameraHWI_Still.cpp b/camera/QCameraHWI_Still.cpp
old mode 100755
new mode 100644
index 580f368..7acd8fd
--- a/camera/QCameraHWI_Still.cpp
+++ b/camera/QCameraHWI_Still.cpp
@@ -1832,6 +1832,7 @@
     int buf_index = 0;
     common_crop_t crop;
     int rc = NO_ERROR;
+    int cur_lux_idx = 0;
 
     camera_notify_callback         notifyCb;
     camera_data_callback           dataCb, jpgDataCb;
@@ -1910,7 +1911,34 @@
             return BAD_VALUE;
         }
         memcpy(frame, recvd_frame, sizeof(mm_camera_ch_data_buf_t));
+        rc = cam_config_get_parm(mCameraId, MM_CAMERA_PARM_LUX_IDX, &cur_lux_idx);
 
+        if (cur_lux_idx > 370) {
+            static int input_width = 0, input_height = 0;
+            static int ret = 0;
+            unsigned char *dnr_buffer;
+            input_width = mPictureWidth;
+            input_height = mPictureHeight;
+
+            ALOGV("%s: received frame %d * %d", __func__, input_width, input_height);
+            {
+                dnr_buffer = (uint8_t *)malloc(input_width*input_height*3/2);
+                if (dnr_buffer == NULL)
+                    ALOGV("dnr_buffer alloc fail");
+                ALOGV("dnr_buffer allocated size : %d", input_width*input_height*3/2);
+                memcpy(dnr_buffer, (uint8_t *)frame->snapshot.main.frame->buffer, input_width*input_height*3/2);
+                ALOGV("dnr_buffer memcpy completed.");
+            }
+            ALOGV("[DNR] DNR Processing Start.... %d * %d\n", mPictureWidth, mPictureHeight);
+            ret = NO_ERROR;
+            if (mHalCamCtrl->LINK_morpho_DNR_ProcessFrame)
+                ret = (int)mHalCamCtrl->LINK_morpho_DNR_ProcessFrame(dnr_buffer, mPictureWidth, mPictureHeight, 1, 1); //bright->normal->dark
+            ALOGV("[DNR] DNR Processing result.... ret = %d\n", ret);
+            memcpy((uint8_t *)recvd_frame->snapshot.main.frame->buffer, (uint8_t *)dnr_buffer, mPictureWidth*mPictureHeight*3/2);
+            ALOGV("[DNR] DNR Processing END....\n");
+            if(dnr_buffer)
+                free(dnr_buffer);
+        }
         //mStopCallbackLock.lock();
 
         // only in ZSL mode and Wavelet Denoise is enabled, we will send frame to deamon to do WDN
diff --git a/camera/QCamera_Intf.h b/camera/QCamera_Intf.h
index d7514e2..13ecc63 100644
--- a/camera/QCamera_Intf.h
+++ b/camera/QCamera_Intf.h
@@ -470,6 +470,7 @@
 #ifdef FAST_AF
     MM_CAMERA_PARM_CAF_TYPE,
 #endif
+    MM_CAMERA_PARM_LUX_IDX,
     MM_CAMERA_PARM_MAX
 } mm_camera_parm_type_t;
 
@@ -619,6 +620,7 @@
 #ifdef FAST_AF
   CAMERA_SET_PARM_CAF_TYPE,
 #endif
+  CAMERA_GET_PARM_LUX_IDX,
   CAMERA_CTRL_PARM_MAX
 } cam_ctrl_type;
 
diff --git a/camera/hdr/include/morpho_api.h b/camera/hdr/include/morpho_api.h
new file mode 100644
index 0000000..565e29f
--- /dev/null
+++ b/camera/hdr/include/morpho_api.h
@@ -0,0 +1,23 @@
+/**

+ * @file     morpho_api.h

+ * @brief    APIŠÖ”’è‹`‚̃}ƒNƒ

+ * @version  1.0.0

+ * @date     Tue Sep 21 17:37:35 2010

+ *

+ * Copyright (C) 2006-2012 Morpho, Inc.

+ */

+

+#ifndef MORPHO_API_H

+#define MORPHO_API_H

+

+/** 

+ * APIŠÖ”‚ð’è‹`‚·‚é‚Æ‚«‚ÉŽg—p.

+ * Windows‚ÅDLL‚ðì¬‚·‚éÛ“™‚ɏ‘‚«Š·‚¦‚邱‚ƂŐ؂è‘Ö‚¦‰Â”\

+ */

+#if defined(MORPHO_DLL) && defined(_WIN32)

+#define MORPHO_API(type) __declspec(dllexport) extern type

+#else

+#define MORPHO_API(type) extern type

+#endif

+

+#endif /* #ifndef MORPHO_API_H */

diff --git a/camera/hdr/include/morpho_easy_hdr.h b/camera/hdr/include/morpho_easy_hdr.h
new file mode 100644
index 0000000..a941762
--- /dev/null
+++ b/camera/hdr/include/morpho_easy_hdr.h
@@ -0,0 +1,769 @@
+/*******************************************************************

+ * morpho_easy_hdr.h

+ * [CP932/CRLF] { ‚  •„†‰»•ûŽ®Ž©“®”»’è—p }

+ *------------------------------------------------------------------

+ * Copyright (C) 2010-2012 Morpho,Inc.

+ *******************************************************************/

+

+#ifndef MORPHO_EASY_HDR_H

+#define MORPHO_EASY_HDR_H

+

+/*******************************************************************/

+

+#include "morpho_api.h"

+#include "morpho_error.h"

+#include "morpho_image_data.h"

+#include "morpho_rect_int.h"

+

+/*******************************************************************/

+

+#define MORPHO_EASY_HDR_VER "Morpho EasyHDR Ver.2.0.1 2012/07/18"

+

+/*-----------------------------------------------------------------*/

+

+/* (input-limitaion) */

+

+#define MORPHO_EASY_HDR_MIN_IMAGE_WIDTH    100

+#define MORPHO_EASY_HDR_MAX_IMAGE_WIDTH   8192

+#define MORPHO_EASY_HDR_MIN_IMAGE_HEIGHT   100

+#define MORPHO_EASY_HDR_MAX_IMAGE_HEIGHT  8192

+#define MORPHO_EASY_HDR_MIN_NIMAGES   2

+#define MORPHO_EASY_HDR_MAX_NIMAGES  10

+

+/*-----------------------------------------------------------------*/

+

+/* (parameter) */

+

+#define MORPHO_EASY_HDR_DISABLED 0

+#define MORPHO_EASY_HDR_ENABLED  1

+

+#define MORPHO_EASY_HDR_IMAGE_ALIGNMENT_DEFAULT  MORPHO_EASY_HDR_ENABLED

+

+#define MORPHO_EASY_HDR_GHOST_REMOVAL_DEFAULT  MORPHO_EASY_HDR_ENABLED

+

+#define MORPHO_EASY_HDR_AUTO_SCALING_DEFAULT  MORPHO_EASY_HDR_ENABLED

+

+#define MORPHO_EASY_HDR_FACE_DETECTION_DEFAULT  MORPHO_EASY_HDR_ENABLED

+

+#define MORPHO_EASY_HDR_FAIL_SOFT_MERGING_DEFAULT  MORPHO_EASY_HDR_ENABLED

+

+#define MORPHO_EASY_HDR_GHOST_DETECTION_SENSITIVITY_LEVEL_MIN      0

+#define MORPHO_EASY_HDR_GHOST_DETECTION_SENSITIVITY_LEVEL_MAX     10

+#define MORPHO_EASY_HDR_GHOST_DETECTION_SENSITIVITY_LEVEL_DEFAULT  7

+

+#define MORPHO_EASY_HDR_MERGE_SMOOTHNESS_LEVEL_MIN      0

+#define MORPHO_EASY_HDR_MERGE_SMOOTHNESS_LEVEL_MAX     10

+#define MORPHO_EASY_HDR_MERGE_SMOOTHNESS_LEVEL_DEFAULT  6

+

+#define MORPHO_EASY_HDR_MERGE_PARAM_MIN        0

+#define MORPHO_EASY_HDR_MERGE_PARAM_MAX      255

+#define MORPHO_EASY_HDR_MERGE_PARAM1_DEFAULT   0

+#define MORPHO_EASY_HDR_MERGE_PARAM2_DEFAULT 128

+#define MORPHO_EASY_HDR_MERGE_PARAM3_DEFAULT   0

+#define MORPHO_EASY_HDR_MERGE_PARAM4_DEFAULT 255

+

+#define MORPHO_EASY_HDR_RELIABLE_RECT_RATE_THRESHOLD_MIN       0

+#define MORPHO_EASY_HDR_RELIABLE_RECT_RATE_THRESHOLD_MAX     100

+#define MORPHO_EASY_HDR_RELIABLE_RECT_RATE_THRESHOLD_DEFAULT  80

+

+#define MORPHO_EASY_HDR_GHOST_RATE_THRESHOLD_MIN       0

+#define MORPHO_EASY_HDR_GHOST_RATE_THRESHOLD_MAX     100

+#define MORPHO_EASY_HDR_GHOST_RATE_THRESHOLD_DEFAULT  90

+

+#define MORPHO_EASY_HDR_CC_OFFSET_MIN          0

+#define MORPHO_EASY_HDR_CC_OFFSET_MAX        255

+#define MORPHO_EASY_HDR_CC_Y_OFFSET_DEFAULT    0

+#define MORPHO_EASY_HDR_CC_C_OFFSET_DEFAULT    0

+

+#define MORPHO_EASY_HDR_CC_GAIN_MIN        100

+#define MORPHO_EASY_HDR_CC_GAIN_MAX       2000

+#define MORPHO_EASY_HDR_CC_Y_GAIN_DEFAULT 1000

+#define MORPHO_EASY_HDR_CC_C_GAIN_DEFAULT 1000

+

+#define MORPHO_EASY_HDR_CC_GAMMA_MIN        100

+#define MORPHO_EASY_HDR_CC_GAMMA_MAX       2000

+#define MORPHO_EASY_HDR_CC_Y_GAMMA_DEFAULT 1000

+#define MORPHO_EASY_HDR_CC_C_GAMMA_DEFAULT 1000

+

+/*-----------------------------------------------------------------*/

+

+/* (merge-status) */

+

+#define MORPHO_EASY_HDR_OK                             0x00000000

+#define MORPHO_EASY_HDR_ERROR_IMAGE_ALIGNMENT_FAILURE  0x00000001

+#define MORPHO_EASY_HDR_ERROR_EXP_ESTIMATION_FAILURE   0x00000002

+#define MORPHO_EASY_HDR_ERROR_MOSTLY_GHOST             0x00000004

+#define MORPHO_EASY_HDR_ERROR_INTERNAL                 0x80000000

+

+/*******************************************************************/

+

+typedef struct _morpho_EasyHDR morpho_EasyHDR;

+typedef struct _morpho_EasyHDR_Callback morpho_EasyHDR_Callback;

+

+/*-----------------------------------------------------------------*/

+

+/** EasyHDR */

+struct _morpho_EasyHDR

+{

+    void *p; /**< “à•”\‘¢‘̂ւ̃|ƒCƒ“ƒ^ */

+};

+

+/** EasyHDR Callback (for multi-thread processing) */

+struct _morpho_EasyHDR_Callback

+{

+    void *p; /**< ƒR[ƒ‹ƒoƒbƒNŠÖ”‚Ì‘æˆêˆø”‚Æ‚µ‚Ä“n‚³‚ê‚é’l */

+

+    void * (* thread_create )(void *p, int index, void *(*start_routine)(void *arg), void *arg);

+    int    (* thread_destroy)(void *p, void *thread);

+    int    (* thread_join   )(void *p, void *thread, void **value_ptr);

+

+    void * (* mutex_create )(void *p);

+    int    (* mutex_destroy)(void *p, void *mutex);

+    int    (* mutex_lock   )(void *p, void *mutex);

+    int    (* mutex_trylock)(void *p, void *mutex);

+    int    (* mutex_unlock )(void *p, void *mutex);

+

+    void * (* cond_create   )(void *p);

+    int    (* cond_destroy  )(void *p, void *cond);

+    int    (* cond_wait     )(void *p, void *cond, void *lock);

+    int    (* cond_signal   )(void *p, void *cond);

+    int    (* cond_broadcast)(void *p, void *cond);

+};

+

+/*******************************************************************/

+

+#ifdef __cplusplus

+extern "C"

+{

+#endif

+

+/*-----------------------------------------------------------------*/

+

+/**

+ * ƒo[ƒWƒ‡ƒ“•¶Žš—ñ‚ðŽæ“¾

+ *

+ * @return ƒo[ƒWƒ‡ƒ“•¶Žš—ñ(MORPHO_EASY_HDR_VER)

+ */

+MORPHO_API(char const *)

+morpho_EasyHDR_getVersion(void);

+

+/*-----------------------------------------------------------------*/

+

+/**

+ * •K—v‚ȃƒ‚ƒŠƒTƒCƒY‚ðŽæ“¾

+ *

+ * @param[in]  max_width   “ü—͉摜‚̍ő啝

+ * @param[in]  max_height  “ü—͉摜‚̍ő卂‚³

+ * @param[in]  format      ‰æ‘œƒtƒH[ƒ}ƒbƒg•¶Žš—ñ

+ *

+ * @return •K—v‚ȃƒ‚ƒŠƒTƒCƒY(byte)

+ */

+MORPHO_API(int)

+morpho_EasyHDR_getBufferSize(

+    int max_width,

+    int max_height,

+    char const *format);

+

+/**

+ * ‰Šú‰»

+ *

+ * Žg—pƒXƒŒƒbƒh”‚É0ˆÈ‰º‚Ì’l‚ðÝ’肵‚½ê‡A

+ * •ªŠ„ŽÀs‚ðs‚¤B

+ *

+ * Žg—pƒXƒŒƒbƒh”‚É1ˆÈã‚Ì’l‚ðÝ’肵‚½ê‡A

+ * ˆêŠ‡ŽÀs‚ðs‚¤B

+ *

+ * Žg—pƒXƒŒƒbƒh”‚É2ˆÈã‚Ì’l‚ðÝ’肵‚½ê‡A

+ * ƒ}ƒ‹ƒ`ƒXƒŒƒbƒh‚É‚æ‚é•À—ñŽÀs(ˆêŠ‡ŽÀs)‚ðs‚¤B

+ * callback ‚É“KØ‚È’l‚ðÝ’è‚·‚é•K—v‚ ‚èB

+ *

+ * yŽÀsó‘Ô‚Ì‘JˆÚz

+ *     ?_UNKNOWN ¨ 0_INITIALIZED

+ *

+ * @param[in,out]  p            EasyHDR ƒCƒ“ƒXƒ^ƒ“ƒX

+ * @param[out]     buffer       EasyHDR‚ÉŠ„‚è“–‚Ă郁ƒ‚ƒŠ‚ւ̃|ƒCƒ“ƒ^

+ * @param[in]      buffer_size  EasyHDR‚ÉŠ„‚è“–‚Ă郁ƒ‚ƒŠ‚̃TƒCƒY

+ * @param[in]      nthreads     Žg—pƒXƒŒƒbƒh” (ƒRƒA”)

+ * @param[in]      callback     ƒR[ƒ‹ƒoƒbƒNŠÖ”ŒQ

+ *

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_EasyHDR_initialize(

+    morpho_EasyHDR *p,

+    void *buffer,

+    int buffer_size,

+    int nthreads,

+    morpho_EasyHDR_Callback const *callback);

+

+/**

+ * ƒNƒŠ[ƒ“ƒAƒbƒv

+ * initialize() ŽÀsŒã‚ÉŽÀs‰Â”\

+ *

+ * @param[in,out]  p  EasyHDR ƒCƒ“ƒXƒ^ƒ“ƒX

+ *

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_EasyHDR_finalize(

+    morpho_EasyHDR *p);

+

+/*-----------------------------------------------------------------*/

+

+/**

+ * ‡¬‚ÌŠJŽnEŽÀs

+ * setImageFormat() ŽÀsŒã‚ÉŽÀs‰Â”\

+ *

+ * yŽÀsó‘Ô‚Ì‘JˆÚ (ˆêŠ‡ŽÀsŽž)z

+ *     0_INITIALIZED ¨ (1_PROCESSING) ¨ 0_INITIALIZED (ˆ—Š®—¹)

+ *                                     ¨ 2_SUSPENDED   (suspend()ŒÄ‚яo‚µ)

+ *

+ * yŽÀsó‘Ô‚Ì‘JˆÚ (•ªŠ„ŽÀsŽž)z

+ *     0_INITIALIZED ¨ 3_PAUSED      (ˆ—’†)

+ *                   ¨ 0_INITIALIZED (ˆ—Š®—¹)

+ *

+ * @param[in,out]  p             EasyHDR ƒCƒ“ƒXƒ^ƒ“ƒX

+ * @param[out]     output_image  Œ‹‰Ê‰æ‘œ (u1–‡–ځv‚Ì“ü—͉摜‚ðŽw’è‰Â”\)

+ * @param[in,out]  input_images  “ü—͉摜ŒQ (ƒGƒ“ƒWƒ“‚É‚æ‚Á‚ď‘‚«Š·‚¦‚ç‚ê‚é)

+ * @param[in]      nimages       “ü—͉摜‚̐”

+ *

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_EasyHDR_merge(

+    morpho_EasyHDR *p,

+    morpho_ImageData *output_image,

+    morpho_ImageData *input_images[],

+    int nimages);

+

+/*-----------------------------------------------------------------*/

+

+/**

+ * ‡¬‚ÌŒp‘±ŽÀs

+ *

+ * merge() ŽÀsŒã‚ÉŽÀs‰Â”\

+ *

+ * •ªŠ„ŽÀsŽž(initialize() ‚Å nthreads ‚É 0 ‚ðŽw’肵‚½‚Æ‚«)‚Ì‚Ý—LŒø

+ *

+ * yŽÀsó‘Ô‚Ì‘JˆÚ (•ªŠ„ŽÀsŽž)z

+ *     3_PAUSED ¨ 3_PAUSED      (ˆ—’†)

+ *              ¨ 0_INITIALIZED (ˆ—Š®—¹)

+ *

+ * @param[in,out]  p  EasyHDR ƒCƒ“ƒXƒ^ƒ“ƒX

+ *

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_EasyHDR_process(

+    morpho_EasyHDR *p);

+

+/*-----------------------------------------------------------------*/

+

+/**

+ * ‡¬‚Ì’†’f (•ÊƒRƒ“ƒeƒLƒXƒg‚©‚ç‚̌Ăяo‚µ‚É‚æ‚é)

+ * merge() ŽÀs’†‚ÉŽÀs‰Â”\

+ *

+ * yŽÀsó‘Ô‚Ì‘JˆÚ (ˆêŠ‡ŽÀsŽž)z

+ *     1_PROCESSING ¨ 2_SUSPENDED

+ *

+ * @param[in,out]  p  EasyHDR ƒCƒ“ƒXƒ^ƒ“ƒX

+ *

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_EasyHDR_suspend(

+    morpho_EasyHDR *p);

+

+/**

+ * ‡¬‚̍ĊJ

+ * suspend() ŽÀsŒã‚ÉŽÀs‰Â”\

+ *

+ * yŽÀsó‘Ô‚Ì‘JˆÚ (ˆêŠ‡ŽÀsŽž)z

+ *     2_SUSPENDED ¨ (1_PROCESSING) ¨ 0_INITIALIZED (ˆ—Š®—¹)

+ *                                   ¨ 2_SUSPENDED   (suspend()ŒÄ‚яo‚µ)

+ *

+ * @param[in,out]  p  EasyHDR ƒCƒ“ƒXƒ^ƒ“ƒX

+ *

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_EasyHDR_resume(

+    morpho_EasyHDR *p);

+

+/*-----------------------------------------------------------------*/

+

+/**

+ * ‰æ‘œƒtƒH[ƒ}ƒbƒg‚̐ݒè

+ * initialize() ŽÀsŒã‚ÉŽÀs‰Â”\

+ *

+ * @param[in,out]  p       EasyHDR ƒCƒ“ƒXƒ^ƒ“ƒX

+ * @param[in]      format  ‰æ‘œƒtƒH[ƒ}ƒbƒg‚ð‚ ‚ç‚í‚·•¶Žš—ñ

+ *

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_EasyHDR_setImageFormat(

+    morpho_EasyHDR *p,

+    char const *format);

+

+/**

+ * ‰æ‘œƒtƒH[ƒ}ƒbƒg‚̎擾

+ * setImageFormat() ŽÀsŒã‚ÉŽÀs‰Â”\

+ *

+ * @param[in,out]  p            EasyHDR ƒCƒ“ƒXƒ^ƒ“ƒX

+ * @param[out]     buffer       ‰æ‘œƒtƒH[ƒ}ƒbƒg‚ð‚ ‚ç‚í‚·•¶Žš—ñ‚ªŠi”[‚³‚ê‚éƒoƒbƒtƒ@

+ * @param[in]      buffer_size  ƒoƒbƒtƒ@‚̃TƒCƒY(I’[•¶ŽšŠÜ‚Þ)

+ *

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_EasyHDR_getImageFormat(

+    morpho_EasyHDR *p,

+    char *buffer,

+    int buffer_size);

+

+/*-----------------------------------------------------------------*/

+

+/**

+ * ˆÊ’u‡‚킹(Žè‚Ô‚ê•â³)‚Ì—L–³‚̐ݒè

+ * initialize() ŽÀsŒã‚ÉŽÀs‰Â”\

+ *

+ * value:

+ *   MOR_EASY_HDR_ENABLED  : ˆÊ’u‡‚킹‚ ‚è

+ *   MOR_EASY_HDR_DISABLED : ˆÊ’u‡‚킹‚È‚µ

+ *

+ * @param[in,out]  p      EasyHDR ƒCƒ“ƒXƒ^ƒ“ƒX

+ * @param[in]      value  Ý’è’l

+ *

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_EasyHDR_setImageAlignmentStatus(

+    morpho_EasyHDR *p,

+    int value);

+

+/**

+ * ˆÊ’u‡‚킹(Žè‚Ô‚ê•â³)‚Ì—L–³‚̎擾

+ * initialize() ŽÀsŒã‚ÉŽÀs‰Â”\

+ *

+ * @param[in,out]  p      EasyHDR ƒCƒ“ƒXƒ^ƒ“ƒX

+ * @param[out]     value  Ý’è’lŠi”[æ

+ *

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_EasyHDR_getImageAlignmentStatus(

+    morpho_EasyHDR *p,

+    int *value);

+

+/*-----------------------------------------------------------------*/

+

+/**

+ * ƒS[ƒXƒgœ‹Ž(”íŽÊ‘Ì‚Ô‚ê•â³)‚Ì—L–³‚̐ݒè

+ * initialize() ŽÀsŒã‚ÉŽÀs‰Â”\

+ *

+ * value:

+ *   MOR_EASY_HDR_ENABLED  : ƒS[ƒXƒgœ‹Ž‚ ‚è

+ *   MOR_EASY_HDR_DISABLED : ƒS[ƒXƒgœ‹Ž‚È‚µ

+ *

+ * @param[in,out]  p      EasyHDR ƒCƒ“ƒXƒ^ƒ“ƒX

+ * @param[in]      value  Ý’è’l

+ *

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_EasyHDR_setGhostRemovalStatus(

+    morpho_EasyHDR *p,

+    int value);

+

+/**

+ * ƒS[ƒXƒgœ‹Ž(”íŽÊ‘Ì‚Ô‚ê•â³)‚Ì—L–³‚̎擾

+ * initialize() ŽÀsŒã‚ÉŽÀs‰Â”\

+ *

+ * @param[in,out]  p      EasyHDR ƒCƒ“ƒXƒ^ƒ“ƒX

+ * @param[out]     value  Ý’è’lŠi”[æ

+ *

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_EasyHDR_getGhostRemovalStatus(

+    morpho_EasyHDR *p,

+    int *value);

+

+/*-----------------------------------------------------------------*/

+

+/**

+ * Ž©“®Šg‘å(ƒNƒŠƒbƒsƒ“ƒO)‚Ì—L–³‚̐ݒè

+ * initialize() ŽÀsŒã‚ÉŽÀs‰Â”\

+ *

+ * value:

+ *   MOR_EASY_HDR_ENABLED  : Ž©“®Šg‘å‚ ‚è

+ *   MOR_EASY_HDR_DISABLED : Ž©“®Šg‘å‚È‚µ

+ *

+ * @param[in,out]  p      EasyHDR ƒCƒ“ƒXƒ^ƒ“ƒX

+ * @param[in]      value  Ý’è’l

+ *

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_EasyHDR_setAutoScalingStatus(

+    morpho_EasyHDR *p,

+    int value);

+

+/**

+ * Ž©“®Šg‘å(ƒNƒŠƒbƒsƒ“ƒO)‚Ì—L–³‚̎擾

+ * initialize() ŽÀsŒã‚ÉŽÀs‰Â”\

+ *

+ * @param[in,out]  p      EasyHDR ƒCƒ“ƒXƒ^ƒ“ƒX

+ * @param[out]     value  Ý’è’lŠi”[æ

+ *

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_EasyHDR_getAutoScalingStatus(

+    morpho_EasyHDR *p,

+    int *value);

+

+/*-----------------------------------------------------------------*/

+

+/**

+ * ŠçŒŸo•â³‚Ì—L–³‚̐ݒè

+ * initialize() ŽÀsŒã‚ÉŽÀs‰Â”\

+ *

+ * value:

+ *   MOR_EASY_HDR_ENABLED  : ŠçŒŸo•â³‚ ‚è

+ *   MOR_EASY_HDR_DISABLED : ŠçŒŸo•â³‚È‚µ

+ *

+ * @param[in,out]  p      EasyHDR ƒCƒ“ƒXƒ^ƒ“ƒX

+ * @param[in]      value  Ý’è’l

+ *

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_EasyHDR_setFaceDetectionStatus(

+    morpho_EasyHDR *p,

+    int value);

+

+/**

+ * ŠçŒŸo•â³‚Ì—L–³‚̎擾

+ * initialize() ŽÀsŒã‚ÉŽÀs‰Â”\

+ *

+ * @param[in,out]  p      EasyHDR ƒCƒ“ƒXƒ^ƒ“ƒX

+ * @param[out]     value  Ý’è’lŠi”[æ

+ *

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_EasyHDR_getFaceDetectionStatus(

+    morpho_EasyHDR *p,

+    int *value);

+

+/*-----------------------------------------------------------------*/

+

+/**

+ * Fail-soft-merging ‚Ì—L–³‚̐ݒè

+ * initialize() ŽÀsŒã‚ÉŽÀs‰Â”\

+ *

+ * value:

+ *   MOR_EASY_HDR_ENABLED  : Fail-soft-merging ‚ ‚è

+ *   MOR_EASY_HDR_DISABLED : Fail-soft-merging ‚È‚µ

+ *

+ * @param[in,out]  p      EasyHDR ƒCƒ“ƒXƒ^ƒ“ƒX

+ * @param[in]      value  Ý’è’l

+ *

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_EasyHDR_setFailSoftMergingStatus(

+    morpho_EasyHDR *p,

+    int value);

+

+/**

+ * Fail-soft-merging ‚Ì—L–³‚̎擾

+ * initialize() ŽÀsŒã‚ÉŽÀs‰Â”\

+ *

+ * @param[in,out]  p      EasyHDR ƒCƒ“ƒXƒ^ƒ“ƒX

+ * @param[out]     value  Ý’è’lŠi”[æ

+ *

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_EasyHDR_getFailSoftMergingStatus(

+    morpho_EasyHDR *p,

+    int *value);

+

+/*-----------------------------------------------------------------*/

+

+/**

+ * ƒS[ƒXƒg”»’芴“xƒŒƒxƒ‹‚̐ݒè

+ * initialize() ŽÀsŒã‚ÉŽÀs‰Â”\

+ *

+ * @param[in,out]  p      EasyHDR ƒCƒ“ƒXƒ^ƒ“ƒX

+ * @param[in]      value  Ý’è’l

+ *

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_EasyHDR_setGhostDetectionSensitivityLevel(

+    morpho_EasyHDR *p,

+    int value);

+

+/**

+ * ƒS[ƒXƒg”»’芴“xƒŒƒxƒ‹‚̎擾

+ * initialize() ŽÀsŒã‚ÉŽÀs‰Â”\

+ *

+ * @param[in,out]  p      EasyHDR ƒCƒ“ƒXƒ^ƒ“ƒX

+ * @param[out]     value  Ý’è’lŠi”[æ

+ *

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_EasyHDR_getGhostDetectionSensitivityLevel(

+    morpho_EasyHDR *p,

+    int *value);

+

+/*-----------------------------------------------------------------*/

+

+/**

+ * ‡¬‚È‚ß‚ç‚©‚³‚̐ݒè

+ * initialize() ŽÀsŒã‚ÉŽÀs‰Â”\

+ *

+ * @param[in,out]  p      EasyHDR ƒCƒ“ƒXƒ^ƒ“ƒX

+ * @param[in]      value  Ý’è’l

+ *

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_EasyHDR_setMergeSmoothnessLevel(

+    morpho_EasyHDR *p,

+    int value);

+

+/**

+ * ‡¬‚È‚ß‚ç‚©‚³‚̎擾

+ * initialize() ŽÀsŒã‚ÉŽÀs‰Â”\

+ *

+ * @param[in,out]  p      EasyHDR ƒCƒ“ƒXƒ^ƒ“ƒX

+ * @param[out]     value  Ý’è’lŠi”[æ

+ *

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_EasyHDR_getMergeSmoothnessLevel(

+    morpho_EasyHDR *p,

+    int *value);

+

+/*-----------------------------------------------------------------*/

+

+/**

+ * ‡¬ƒpƒ‰ƒ[ƒ^‚̐ݒè

+ * initialize() ŽÀsŒã‚ÉŽÀs‰Â”\

+ *

+ * @param[in,out]  p       EasyHDR ƒCƒ“ƒXƒ^ƒ“ƒX

+ * @param[in]      value1  Ý’è’l

+ * @param[in]      value2  Ý’è’l

+ * @param[in]      value3  Ý’è’l

+ * @param[in]      value4  Ý’è’l

+ *

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_EasyHDR_setMergeParameters(

+    morpho_EasyHDR *p,

+    int value1,

+    int value2,

+    int value3,

+    int value4);

+

+/**

+ * ‡¬ƒpƒ‰ƒ[ƒ^‚̎擾

+ * initialize() ŽÀsŒã‚ÉŽÀs‰Â”\

+ *

+ * @param[in,out]  p       EasyHDR ƒCƒ“ƒXƒ^ƒ“ƒX

+ * @param[out]     value1  Ý’è’lŠi”[æ

+ * @param[out]     value2  Ý’è’lŠi”[æ

+ * @param[out]     value3  Ý’è’lŠi”[æ

+ * @param[out]     value4  Ý’è’lŠi”[æ

+ *

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_EasyHDR_getMergeParameters(

+    morpho_EasyHDR *p,

+    int *value1,

+    int *value2,

+    int *value3,

+    int *value4);

+

+/*-----------------------------------------------------------------*/

+

+/**

+ * —LŒø—̈æ臒l‚̐ݒè

+ * initialize() ŽÀsŒã‚ÉŽÀs‰Â”\

+ *

+ * @param[in,out]  p     EasyHDR ƒCƒ“ƒXƒ^ƒ“ƒX

+ * @param[in]      rate  Ý’è’l (’†‰› rate % ‹éŒ`)

+ *

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_EasyHDR_setReliableRectRateThreshold(

+    morpho_EasyHDR *p,

+    int rate);

+

+/**

+ * —LŒø—̈æ臒l‚̎擾

+ * initialize() ŽÀsŒã‚ÉŽÀs‰Â”\

+ *

+ * @param[in,out]  p     EasyHDR ƒCƒ“ƒXƒ^ƒ“ƒX

+ * @param[out]     rate  Ý’è’lŠi”[æ

+ *

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_EasyHDR_getReliableRectRateThreshold(

+    morpho_EasyHDR *p,

+    int *rate);

+

+/**

+ * —LŒø—̈æ‚̎擾

+ * initialize() ŽÀsŒã‚ÉŽÀs‰Â”\

+ * (—LŒø‚È’l‚ªƒZƒbƒg‚³‚ê‚é‚Ì‚Í merge() Œã)

+ *

+ * @param[in,out]  p     EasyHDR ƒCƒ“ƒXƒ^ƒ“ƒX

+ * @param[out]     rect  Ý’è’lŠi”[æ

+ *

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_EasyHDR_getReliableRect(

+    morpho_EasyHDR *p,

+    morpho_RectInt *rect);

+

+/*-----------------------------------------------------------------*/

+

+/**

+ * ƒS[ƒXƒgŠ„‡è‡’l‚̐ݒè

+ * initialize() ŽÀsŒã‚ÉŽÀs‰Â”\

+ *

+ * @param[in,out]  p     EasyHDR ƒCƒ“ƒXƒ^ƒ“ƒX

+ * @param[in]      rate  Ý’è’l

+ *

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_EasyHDR_setGhostRateThreshold(

+    morpho_EasyHDR *p,

+    int rate);

+

+/**

+ * ƒS[ƒXƒgŠ„‡è‡’l‚̎擾

+ * initialize() ŽÀsŒã‚ÉŽÀs‰Â”\

+ *

+ * @param[in,out]  p     EasyHDR ƒCƒ“ƒXƒ^ƒ“ƒX

+ * @param[out]     rate  Ý’è’lŠi”[æ

+ *

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_EasyHDR_getGhostRateThreshold(

+    morpho_EasyHDR *p,

+    int *rate);

+

+/*-----------------------------------------------------------------*/

+

+/**

+ * F•â³ƒpƒ‰ƒ[ƒ^‚̐ݒè

+ * initialize() ŽÀsŒã‚ÉŽÀs‰Â”\

+ *

+ * @param[in,out]  p         EasyHDR ƒCƒ“ƒXƒ^ƒ“ƒX

+ * @param[in]      y_offset  Ý’è’l

+ * @param[in]      y_gain    Ý’è’l

+ * @param[in]      y_gamma   Ý’è’l

+ * @param[in]      c_offset  Ý’è’l

+ * @param[in]      c_gain    Ý’è’l

+ * @param[in]      c_gamma   Ý’è’l

+ *

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_EasyHDR_setColorCorrectionParameters(

+    morpho_EasyHDR *p,

+    int y_offset,

+    int y_gain,

+    int y_gamma,

+    int c_offset,

+    int c_gain,

+    int c_gamma);

+

+/**

+ * F•â³ƒpƒ‰ƒ[ƒ^‚̎擾

+ * initialize() ŽÀsŒã‚ÉŽÀs‰Â”\

+ *

+ * @param[in,out]  p         EasyHDR ƒCƒ“ƒXƒ^ƒ“ƒX

+ * @param[out]     y_offset  Ý’è’lŠi”[æ

+ * @param[out]     y_gain    Ý’è’lŠi”[æ

+ * @param[out]     y_gamma   Ý’è’lŠi”[æ

+ * @param[out]     c_offset  Ý’è’lŠi”[æ

+ * @param[out]     c_gain    Ý’è’lŠi”[æ

+ * @param[out]     c_gamma   Ý’è’lŠi”[æ

+ *

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_EasyHDR_getColorCorrectionParameters(

+    morpho_EasyHDR *p,

+    int *y_offset,

+    int *y_gain,

+    int *y_gamma,

+    int *c_offset,

+    int *c_gain,

+    int *c_gamma);

+

+/*-----------------------------------------------------------------*/

+

+/**

+ * ‡¬ƒXƒe[ƒ^ƒX‚̎擾

+ * initialize() ŽÀsŒã‚ÉŽÀs‰Â”\

+ *

+ * ƒXƒe[ƒ^ƒXƒR[ƒh

+ *   MORPHO_EASY_HDR_OK

+ *   MORPHO_EASY_HDR_ERROR_*

+ *

+ * @param[in,out]  p  EasyHDR ƒCƒ“ƒXƒ^ƒ“ƒX

+ *

+ * @return ƒXƒe[ƒ^ƒXƒR[ƒh (MORPHO_EASMORPHO_EASY_HDR_ERROR_

+ */

+MORPHO_API(int)

+morpho_EasyHDR_getMergeStatus(

+    morpho_EasyHDR *p);

+

+/*-----------------------------------------------------------------*/

+

+/**

+ * ƒTƒ€ƒlƒCƒ‹‚̍쐬 (o—͉摜‚̏k¬)

+ * morpho_EasyHDR_setImageFormat() ŽÀsŒã‚ÉŽÀs‰Â”\

+ *

+ * @param[in,out]  p                EasyHDR ƒCƒ“ƒXƒ^ƒ“ƒX

+ * @param[out]     thumbnail_image  o—͉摜

+ * @param[in]      output_image     “ü—͉摜

+ *

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_EasyHDR_makeThumbnail(

+    morpho_EasyHDR *p,

+    morpho_ImageData *thumbnail_image,

+    morpho_ImageData const *output_image);

+

+/*-----------------------------------------------------------------*/

+

+#ifdef __cplusplus

+} /* extern "C" */

+#endif

+

+/*******************************************************************/

+

+#endif /* !MORPHO_EASY_HDR_H */

+

+/*******************************************************************/

+/* [EOF] */

diff --git a/camera/hdr/include/morpho_easy_hdr_ext.h b/camera/hdr/include/morpho_easy_hdr_ext.h
new file mode 100644
index 0000000..2a4bd7c
--- /dev/null
+++ b/camera/hdr/include/morpho_easy_hdr_ext.h
@@ -0,0 +1,19 @@
+#ifndef MORPHO_EASY_HDR_EXT_H
+#define MORPHO_EASY_HDR_EXT_H
+
+#include "morpho_easy_hdr.h"
+/*
+return == 0 : OK
+return != 0 : NG (Please print the return value to check Error types)
+*/
+MORPHO_API(int)
+LINK_mm_camera_HDR(
+    unsigned char* yuvInput01,
+    unsigned char* yuvInput02,
+    unsigned char* yuvInput03,
+    unsigned char* pHDROutImage,
+    int width,
+    int height,
+    int indoor);
+
+#endif //MORPHO_EASY_HDR_EXT_H
diff --git a/camera/hdr/include/morpho_error.h b/camera/hdr/include/morpho_error.h
new file mode 100644
index 0000000..148216f
--- /dev/null
+++ b/camera/hdr/include/morpho_error.h
@@ -0,0 +1,29 @@
+/**

+ * @file     morpho_error.h

+ * @brief    ƒGƒ‰[ƒR[ƒh‚Ì’è‹`

+ * @version  1.0.0

+ * @date     2008-06-09

+ *

+ * Copyright (C) 2006-2012 Morpho, Inc.

+ */

+

+#ifndef MORPHO_ERROR_H

+#define MORPHO_ERROR_H

+

+/** ƒGƒ‰[ƒR[ƒh .*/

+#define MORPHO_OK                   (0x00000000)  /**< ¬Œ÷ */

+#define MORPHO_DOPROCESS            (0x00000001)  /**< ˆ—’† */

+#define MORPHO_CANCELED             (0x00000002)  /**< ƒLƒƒƒ“ƒZƒ‹‚³‚ꂽ */

+#define MORPHO_SUSPENDED            (0x00000008)  /**< ’†’f‚³‚ꂽ */

+

+#define MORPHO_ERROR_GENERAL_ERROR  (0x80000000)  /**< ˆê”Ê“I‚ȃGƒ‰[. */

+#define MORPHO_ERROR_PARAM          (0x80000001)  /**< ˆø”‚ª•s³. */

+#define MORPHO_ERROR_STATE          (0x80000002)  /**< “à•”ó‘Ô‚âŠÖ”ŒÄo‡˜‚ª•s³. */

+#define MORPHO_ERROR_MALLOC         (0x80000004)  /**< ƒƒ‚ƒŠƒAƒƒP[ƒVƒ‡ƒ“ƒGƒ‰[. */

+#define MORPHO_ERROR_IO             (0x80000008)  /**< “üo—̓Gƒ‰[. */

+#define MORPHO_ERROR_UNSUPPORTED    (0x80000010)  /**< ‹@”\‚ðƒTƒ|[ƒg‚µ‚Ä‚¢‚È‚¢. */

+#define MORPHO_ERROR_NOTFOUND       (0x80000020)  /**< ŒŸõ‘ΏۂªŒ©‚‚©‚ç‚È‚¢ */

+#define MORPHO_ERROR_INTERNAL       (0x80000040)  /**< “à•”ƒGƒ‰[. */

+#define MORPHO_ERROR_UNKNOWN        (0xC0000000)  /**< ã‹LˆÈŠO‚̃Gƒ‰[. */

+

+#endif /* #ifndef MORPHO_ERROR_H */

diff --git a/camera/hdr/include/morpho_get_image_size.h b/camera/hdr/include/morpho_get_image_size.h
new file mode 100644
index 0000000..b0f538f
--- /dev/null
+++ b/camera/hdr/include/morpho_get_image_size.h
@@ -0,0 +1,89 @@
+/**

+ * @file     morpho_get_image_size.h

+ * @brief    ‰æ‘œ‚É•K—v‚ȃƒ‚ƒŠƒTƒCƒY‚ðŽæ“¾‚·‚éŠÖ”

+ * @version  1.0.0

+ * @date     2008-07-01

+ *

+ * Copyright (C) 2006-2012 Morpho, Inc.

+ */

+

+#ifndef MORPHO_GET_IMAGE_SIZE_H

+#define MORPHO_GET_IMAGE_SIZE_H

+

+#include "morpho_api.h"

+

+#ifdef __cplusplus

+extern "C" {

+#endif

+

+/**

+ * •‚ƍ‚‚³‚ƃtƒH[ƒ}ƒbƒg–¼‚©‚çA‰æ‘œ‚ðŠi”[‚·‚é‚Ì‚É•K—v‚ȃƒ‚ƒŠƒTƒCƒY‚𓾂é.

+ *

+ * @param width       •

+ * @param height      ‚‚³

+ * @param p_format    ‰æ‘œƒtƒH[ƒ}ƒbƒg•¶Žš—ñ

+ * @return            ‰æ‘œ‚É•K—v‚ȃƒ‚ƒŠƒTƒCƒY

+ */

+#define morpho_getImageSize mor_noise_reduction_IF_getImageSize

+

+MORPHO_API(int)

+morpho_getImageSize(int width, int height, const char *p_format);

+

+/**

+ * Y‰æ‘œƒf[ƒ^ƒTƒCƒY‚ðŽæ“¾.

+ *

+ * @param width       •

+ * @param height      ‚‚³

+ * @param p_format    ‰æ‘œƒtƒH[ƒ}ƒbƒg•¶Žš—ñ

+ * @return            Y‰æ‘œƒf[ƒ^ƒTƒCƒY

+ */

+#define morpho_getImageSizeY mor_noise_reduction_IF_getImageSizeY

+

+MORPHO_API(int)

+morpho_getImageSizeY(int width, int height, const char *p_format);

+

+/**

+ * U‰æ‘œƒf[ƒ^ƒTƒCƒY‚ðŽæ“¾.

+ *

+ * @param width       •

+ * @param height      ‚‚³

+ * @param p_format    ‰æ‘œƒtƒH[ƒ}ƒbƒg•¶Žš—ñ

+ * @return            U‰æ‘œƒf[ƒ^ƒTƒCƒY

+ */

+#define morpho_getImageSizeU mor_noise_reduction_IF_getImageSizeU

+

+MORPHO_API(int)

+morpho_getImageSizeU(int width, int height, const char *p_format);

+

+/**

+ * V‰æ‘œƒf[ƒ^ƒTƒCƒY‚ðŽæ“¾.

+ *

+ * @param width       •

+ * @param height      ‚‚³

+ * @param p_format    ‰æ‘œƒtƒH[ƒ}ƒbƒg•¶Žš—ñ

+ * @return            V‰æ‘œƒf[ƒ^ƒTƒCƒY

+ */

+#define morpho_getImageSizeV mor_noise_reduction_IF_getImageSizeV

+

+MORPHO_API(int)

+morpho_getImageSizeV(int width, int height, const char *p_format);

+

+/**

+ * UV‰æ‘œƒf[ƒ^ƒTƒCƒY‚ðŽæ“¾.

+ *

+ * @param width       •

+ * @param height      ‚‚³

+ * @param p_format    ‰æ‘œƒtƒH[ƒ}ƒbƒg•¶Žš—ñ

+ * @return            UV‰æ‘œƒf[ƒ^ƒTƒCƒY

+ */

+#define morpho_getImageSizeUV mor_noise_reduction_IF_getImageSizeUV

+

+MORPHO_API(int)

+morpho_getImageSizeUV(int width, int height, const char *p_format);

+

+

+#ifdef __cplusplus

+} /* extern "C" { */

+#endif

+

+#endif /* MORPHO_GET_IMAGE_SIZE_H */

diff --git a/camera/hdr/include/morpho_hdr_checker.h b/camera/hdr/include/morpho_hdr_checker.h
new file mode 100644
index 0000000..662cfc1
--- /dev/null
+++ b/camera/hdr/include/morpho_hdr_checker.h
@@ -0,0 +1,155 @@
+/*******************************************************************

+ * morpho_hdr_checker.h

+ * [CP932/CRLF] { ‚  •„†‰»•ûŽ®Ž©“®”»’è—p }

+ *------------------------------------------------------------------

+ * Copyright (C) 2011-2012 Morpho,Inc.

+ *******************************************************************/

+

+#ifndef MORPHO_HDR_CHECKER_H

+#define MORPHO_HDR_CHECKER_H

+

+/*******************************************************************/

+

+#include "morpho_api.h"

+#include "morpho_error.h"

+#include "morpho_image_data.h"

+

+/*******************************************************************/

+

+#define MORPHO_HDR_CHECKER_VER "Morpho DR Checker Ver.1.1.0 2012/1/17"

+

+/*-----------------------------------------------------------------*/

+

+#define MORPHO_HDR_CHECKER_MIN_IMAGE_WIDTH     2

+#define MORPHO_HDR_CHECKER_MAX_IMAGE_WIDTH  8192

+#define MORPHO_HDR_CHECKER_MIN_IMAGE_HEIGHT    2

+#define MORPHO_HDR_CHECKER_MAX_IMAGE_HEIGHT 8192

+

+/*******************************************************************/

+

+typedef struct _morpho_HDRChecker morpho_HDRChecker;

+

+/* HDRŽw•W•]‰¿Ší */

+struct _morpho_HDRChecker

+{

+    void *p; /**< “à•”\‘¢‘̂ւ̃|ƒCƒ“ƒ^ */

+};

+

+/* ”’”ò‚сE•‚‚Ԃꔻ’è‚Ì•qŠ´“x */

+typedef enum {

+    MORPHO_HDR_CHECKER_SENSITIVITY_SENSITIVE,

+    MORPHO_HDR_CHECKER_SENSITIVITY_NORMAL,

+    MORPHO_HDR_CHECKER_SENSITIVITY_INSENSITIVE,

+} MORPHO_HDR_CHECKER_SENSITIVITY;

+

+/*******************************************************************/

+

+#ifdef __cplusplus

+extern "C" {

+#endif

+

+/**

+ * ƒo[ƒWƒ‡ƒ“•¶Žš—ñ‚ðŽæ“¾

+ *

+ * @return ƒo[ƒWƒ‡ƒ“•¶Žš—ñ(MORPHO_EASY_HDR_VER)

+ */

+MORPHO_API(const char*)

+morpho_HDRChecker_getVersion(void);

+

+/**

+ * •K—v‚ȃƒ‚ƒŠƒTƒCƒY‚ðŽæ“¾

+ *

+ * @param[in] width  “ü—͉摜‚Ì•

+ * @param[in] height “ü—͉摜‚̍‚‚³

+ * @param[in] format “ü—͉摜‚̃tƒH[ƒ}ƒbƒg

+ * @return •K—v‚ȃƒ‚ƒŠƒTƒCƒY(byte)

+ */

+MORPHO_API(int)

+morpho_HDRChecker_getBufferSize(

+    int width,

+    int height,

+    const char *format);

+

+/**

+ * ‰Šú‰»

+ *

+ * @param[in,out] p           HDRCheckerƒCƒ“ƒXƒ^ƒ“ƒX

+ * @param[in]     buffer      HDRChecker‚ÉŠ„‚è“–‚Ă郁ƒ‚ƒŠ‚ւ̃|ƒCƒ“ƒ^

+ * @param[in]     buffer_size HDRChecker‚ÉŠ„‚è“–‚Ă郁ƒ‚ƒŠ‚̃TƒCƒY

+ * @param[in]     width       “ü—͉摜‚Ì•

+ * @param[in]     height      “ü—͉摜‚̍‚‚³

+ * @param[in]     format      “ü—͉摜‚̃tƒH[ƒ}ƒbƒg

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_HDRChecker_initialize(

+    morpho_HDRChecker * const p,

+    void * const buffer,

+    const int buffer_size,

+    const int width,

+    const int height,

+    const char *format);

+

+/**

+ * ƒNƒŠ[ƒ“ƒAƒbƒv

+ * initialize()ŽÀsŒã‚ÉŽÀs‰Â”\

+ *

+ * @param[in,out] p HDRCheckerƒCƒ“ƒXƒ^ƒ“ƒX

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_HDRChecker_finalize(

+    morpho_HDRChecker *p);

+

+/*-----------------------------------------------------------------*/

+

+/**

+ * HDRŽw•WŒvŽZ‚Ì•qŠ´«‚̐ݒè

+ * initialize()ŽÀsŒã‚ÉŽÀs‰Â”\

+ *

+ * @param[in,out] p           HDRCheckerƒCƒ“ƒXƒ^ƒ“ƒX

+ * @param[in]     sensitivity •qŠ´«(MORPHO_HDR_CHECKER_SENSITIVIY—ñ‹“‘Ì‚ÅŽw’è)

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_HDRChecker_setSensitivity(

+    morpho_HDRChecker * const p,

+    MORPHO_HDR_CHECKER_SENSITIVITY sensitivity);

+

+/**

+ * HDRŽw•WŒvŽZ‚Ì•qŠ´«‚̎擾

+ * initialize()ŽÀsŒã‚ÉŽÀs‰Â”\

+ *

+ * @param[in,out] p           HDRCheckerƒCƒ“ƒXƒ^ƒ“ƒX

+ * @param[out]    sensitivity •qŠ´«‚ւ̃|ƒCƒ“ƒ^

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_HDRChecker_getSensitivity(

+    morpho_HDRChecker * const p,

+    MORPHO_HDR_CHECKER_SENSITIVITY *sensitivity);

+

+/**

+ * HDRŽw•W‚Ì•]‰¿

+ * initialize()ŽÀsŒã‚ÉŽÀs‰Â”\

+ *

+ * @param[in,out] p      HDRCheckerƒCƒ“ƒXƒ^ƒ“ƒX

+ * @param[out]    result •]‰¿Œ‹‰Ê‚ðŠi”[‚·‚é”z—ñ(—v‘f”4‚Ì”z—ñ)

+ *                       —v‘f‚ª”ñƒ[ƒ‚̏ꍇ‚ɑΉž‚·‚鉺‹L‚̘Io‚̉摜‚ª•K—v‚Æ”»’è

+ *                       {+2, +1, -1, -2}‚̏‡‚É”»’茋‰Ê‚ªŠi”[‚³‚ê‚é

+ * @param[in]     input_image “ü—͉摜

+ * @return ƒGƒ‰[ƒR[ƒh (see morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_HDRChecker_evaluate(

+    morpho_HDRChecker * const p,

+    int * const result,

+    const morpho_ImageData * const input_image);

+

+/*-----------------------------------------------------------------*/

+

+#ifdef __cplusplus

+}

+#endif

+

+#endif /* MORPHO_HDR_CHECKER_H */

diff --git a/camera/hdr/include/morpho_image_data.h b/camera/hdr/include/morpho_image_data.h
new file mode 100644
index 0000000..2fc05aa
--- /dev/null
+++ b/camera/hdr/include/morpho_image_data.h
@@ -0,0 +1,43 @@
+/**

+ * @file     morpho_image_data.h

+ * @brief    ‰æ‘œƒf[ƒ^‚̍\‘¢‘Ì’è‹`

+ * @version  1.0.0

+ * @date     2008-06-09

+ *

+ * Copyright (C) 2006-2012 Morpho, Inc.

+ */

+

+#ifndef MORPHO_IMAGE_DATA_H

+#define MORPHO_IMAGE_DATA_H

+

+#ifdef __cplusplus

+extern "C" {

+#endif

+

+typedef struct{

+    void * y;               /**< Y‰æ‘œ‚̐擪ƒ|ƒCƒ“ƒ^ */

+    void * u;               /**< U‰æ‘œ‚̐擪ƒ|ƒCƒ“ƒ^ */

+    void * v;               /**< V‰æ‘œ‚̐擪ƒ|ƒCƒ“ƒ^ */

+} morpho_ImageYuvPlanar;

+

+typedef struct{

+    void * y;               /**< Y‰æ‘œ‚̐擪ƒ|ƒCƒ“ƒ^ */

+    void * uv;              /**< UV‰æ‘œ‚̐擪ƒ|ƒCƒ“ƒ^ */

+} morpho_ImageYuvSemiPlanar;

+

+/** ‰æ‘œƒf[ƒ^. */

+typedef struct {

+    int width;              /**< • */

+    int height;             /**< ‚‚³ */

+    union{

+        void * p;           /**< ‰æ‘œƒf[ƒ^‚̐擪ƒ|ƒCƒ“ƒ^ */

+        morpho_ImageYuvPlanar planar;

+        morpho_ImageYuvSemiPlanar semi_planar;

+    } dat;

+} morpho_ImageData;

+

+#ifdef __cplusplus

+}

+#endif

+

+#endif /* #ifndef MORPHO_IMAGE_DATA_H */

diff --git a/camera/hdr/include/morpho_image_data_ex.h b/camera/hdr/include/morpho_image_data_ex.h
new file mode 100644
index 0000000..ef33f35
--- /dev/null
+++ b/camera/hdr/include/morpho_image_data_ex.h
@@ -0,0 +1,51 @@
+/**
+ * @file     morpho_image_data_ex.h
+ * @brief    画像データの構造体定義
+ * @version  1.0.0
+ * @date     2010-03-30
+ *
+ * Copyright (C) 2010-2011 Morpho, Inc.
+ */
+
+#ifndef MORPHO_IMAGE_DATA_EX_H
+#define MORPHO_IMAGE_DATA_EX_H
+
+#include "morpho_image_data.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct{
+    int y;
+    int u;
+    int v;
+} morpho_ImageYuvPlanarPitch;
+
+typedef struct{
+    int y;
+    int uv;
+} morpho_ImageYuvSemiPlanarPitch;
+
+/** 画像データ. */
+typedef struct {
+    int width;              /**< 幅 */
+    int height;             /**< 高さ */
+    union{
+        void *p;            /**< 画像データの先頭ポインタ */
+        morpho_ImageYuvPlanar planar;
+        morpho_ImageYuvSemiPlanar semi_planar;
+    } dat;
+    union{
+        int p;              /**< ラインの先頭から次のライン先頭までのバイト数 */
+        morpho_ImageYuvPlanarPitch planar;
+        morpho_ImageYuvSemiPlanarPitch semi_planar;
+    } pitch;
+} morpho_ImageDataEx;
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* #ifndef MORPHO_IMAGE_DATA_EX_H */
diff --git a/camera/hdr/include/morpho_motion_data.h b/camera/hdr/include/morpho_motion_data.h
new file mode 100644
index 0000000..4db78db
--- /dev/null
+++ b/camera/hdr/include/morpho_motion_data.h
@@ -0,0 +1,27 @@
+/**

+ * @file     morpho_motion_data.h

+ * @brief    “®‚«ƒf[ƒ^‚̍\‘¢‘Ì’è‹`

+ * @version  1.0.0

+ * @date     2008-06-09

+ *

+ * Copyright (C) 2006-2012 Morpho, Inc.

+ */

+

+#ifndef MORPHO_MOTION_DATA_H

+#define MORPHO_MOTION_DATA_H

+

+#ifdef __cplusplus

+extern "C" {

+#endif

+

+/** “®‚«ƒf[ƒ^. */

+typedef struct {

+    int v[6];  /**< “®‚«ƒf[ƒ^ */

+    int fcode; /**< ¬Œ÷:0 / Ž¸”s:0ˆÈŠOiŽ¸”s‚µ‚½Œ´ˆöj */

+} morpho_MotionData;

+

+#ifdef __cplusplus

+}

+#endif

+

+#endif /* #ifndef MORPHO_MOTION_DATA_H */

diff --git a/camera/hdr/include/morpho_noise_reduction.h b/camera/hdr/include/morpho_noise_reduction.h
new file mode 100644
index 0000000..886c2c1
--- /dev/null
+++ b/camera/hdr/include/morpho_noise_reduction.h
@@ -0,0 +1,204 @@
+//====================================================================

+// morpho_noise_reduction.h

+// [SJIS/CRLF] { ‚  •„†‰»•ûŽ®Ž©“®”»’è—p }

+//

+// Copyright(c) 2006-2012 Morpho,Inc.

+//====================================================================

+

+#ifndef MORPHO_NOISE_REDUCTION_H

+# define MORPHO_NOISE_REDUCTION_H

+

+//--------------------------------------------------------------------

+

+# include "morpho_api.h"

+# include "morpho_error.h"

+# include "morpho_image_data.h"

+# include "morpho_motion_data.h"

+# include "morpho_rect_int.h"

+

+//--------------------------------------------------------------------

+

+# ifdef __cplusplus

+extern "C" {

+# endif

+

+//====================================================================

+

+/** ƒo[ƒWƒ‡ƒ“•¶Žš—ñ */

+# define MORPHO_NOISE_REDUCTION_VERSION "Morpho Noise Reduction Ver.0.9.0 2012/08/09"

+

+//--------------------------------------------------------------------

+/** ƒmƒCƒYœ‹ŽŠí */

+typedef struct

+{

+    void *p; /**< “à•”\‘¢‘̂ւ̃|ƒCƒ“ƒ^ */

+} morpho_NoiseReduction;

+

+//--------------------------------------------------------------------

+

+/**

+ * ƒo[ƒWƒ‡ƒ“•¶Žš—ñ‚ðŽæ“¾

+ *

+ * @return ƒo[ƒWƒ‡ƒ“•¶Žš—ñ(MORPHO_IMAGE_STABILIZER_VERSION)

+ */

+MORPHO_API(const char *)

+morpho_NoiseReduction_getVersion(void);

+

+/**

+ * ƒmƒCƒYœ‹Žˆ—‚É•K—v‚ȃƒ‚ƒŠƒTƒCƒY‚ðŽæ“¾

+ * Žw’è‚Å‚«‚éƒtƒH[ƒ}ƒbƒg‚ÍTRM‚ðŽQÆB

+ *

+ * @param[in] width  “ü—͉摜‚Ì•

+ * @param[in] height “ü—͉摜‚̍‚‚³

+ * @param[in] format ‰æ‘œƒtƒH[ƒ}ƒbƒg•¶Žš—ñ

+ * @return •K—v‚ȃƒ‚ƒŠƒTƒCƒY(byte)

+ */

+MORPHO_API(int)

+morpho_NoiseReduction_getBufferSize(

+    int width,

+    int height,

+    const char *format);

+

+/**

+ * ƒmƒCƒYœ‹ŽŠí‚̏‰Šú‰»

+ *

+ * @param[out] reducer  ƒmƒCƒYœ‹ŽŠí

+ * @param[out] buffer      ƒmƒCƒYœ‹ŽŠí‚ÉŠ„‚è“–‚Ă郁ƒ‚ƒŠ‚ւ̃|ƒCƒ“ƒ^

+ * @param[in]  buffer_size ƒmƒCƒYœ‹ŽŠí‚ÉŠ„‚è“–‚Ă郁ƒ‚ƒŠ‚̃TƒCƒY.

+ * @return ƒGƒ‰[ƒR[ƒh(morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_NoiseReduction_initialize(

+    morpho_NoiseReduction *reducer,

+    void *buffer,

+    int buffer_size);

+

+/**

+ * ƒmƒCƒYœ‹ŽŠí‚̃NƒŠ[ƒ“ƒAƒbƒv

+ *

+ * @param[in,out] reducer ƒmƒCƒYœ‹ŽŠí

+ * @return ƒGƒ‰[ƒR[ƒh(morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_NoiseReduction_finalize(

+    morpho_NoiseReduction *reducer);

+

+/**

+ * ƒmƒCƒYœ‹Žˆ—: ˆ—ŠJŽn

+ * o—͉摜(output_image)‚Í1–‡–Ú‚Ì“ü—͉摜‚Æ“¯‚¶‚Å‚à—Ç‚¢

+ *

+ * @param[in,out] reducer    ƒmƒCƒYœ‹ŽŠí

+ * @param[out]    output_image  o—͉摜

+ * @return ƒGƒ‰[ƒR[ƒh(morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_NoiseReduction_start(

+    morpho_NoiseReduction *reducer,

+    morpho_ImageData *output_image);

+

+/**

+ * ƒmƒCƒYœ‹Žˆ—: ƒmƒCƒYœ‹Ž

+ *

+ * @param[in,out] reducer   ƒmƒCƒYœ‹ŽŠí

+ * @param[out]    input_image  o—͉摜

+ * @return ƒGƒ‰[ƒR[ƒh(morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_NoiseReduction_reduceNoise(

+    morpho_NoiseReduction *reducer,

+    morpho_ImageData *input_image);

+

+/**

+ * ‰æ‘œƒtƒH[ƒ}ƒbƒg‚ðŽæ“¾

+ * initialize()ŽÀsŒã‚Ɏ擾‰Â”\

+ * ƒoƒbƒtƒ@ƒTƒCƒY‚Í32ˆÈã‚Æ‚·‚邱‚Æ

+ *

+ * @param[in,out] reducer ƒmƒCƒYœ‹ŽŠí

+ * @param[out] format ‰æ‘œƒtƒH[ƒ}ƒbƒg•¶Žš—ñ‚ªŠi”[‚³‚ê‚é

+ * @param[in] buffer_size ƒoƒbƒtƒ@ƒTƒCƒY

+ * @return ƒGƒ‰[ƒR[ƒh(morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_NoiseReduction_getImageFormat(

+    morpho_NoiseReduction *reducer,

+    char *format,

+    const int buffer_size);

+

+/**

+ * ‹P“xƒmƒCƒYœ‹Ž‹­“xƒŒƒxƒ‹‚ðŽæ“¾

+ * initialize()ŽÀsŒã‚Ɏ擾‰Â”\

+ *

+ * @param[in,out] reducer ƒmƒCƒYœ‹ŽŠí

+ * @param[out] level ‹P“xƒmƒCƒYœ‹Ž‹­“xƒŒƒxƒ‹‚ªŠi”[‚³‚ê‚é

+ * @return ƒGƒ‰[ƒR[ƒh(morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_NoiseReduction_getLumaNoiseReductionLevel(

+    morpho_NoiseReduction *reducer,

+    int *level);

+

+/**

+ * ƒNƒƒ}ƒmƒCƒYœ‹Ž‹­“xƒŒƒxƒ‹‚ðŽæ“¾

+ * initialize()ŽÀsŒã‚Ɏ擾‰Â”\

+ *

+ * @param[in,out] reducer ƒmƒCƒYœ‹ŽŠí

+ * @param[out] level ƒNƒƒ}ƒmƒCƒYœ‹Ž‹­“xƒŒƒxƒ‹‚ªŠi”[‚³‚ê‚é

+ * @return ƒGƒ‰[ƒR[ƒh(morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_NoiseReduction_getChromaNoiseReductionLevel(

+    morpho_NoiseReduction *reducer,

+    int *level);

+

+/**

+ * ‰æ‘œƒtƒH[ƒ}ƒbƒg‚ðÝ’è

+ * initialize()ŽÀsŒã‚©‚Âstart()ŽÀs‘O‚ɐݒè‰Â”\

+ * Žw’è‚Å‚«‚éƒtƒH[ƒ}ƒbƒg‚ÍTRM‚ðŽQÆB

+ *

+ * @param[in,out] reducer ƒmƒCƒYœ‹ŽŠí

+ * @param[in] format ‰æ‘œƒtƒH[ƒ}ƒbƒg•¶Žš—ñ

+ * @return ƒGƒ‰[ƒR[ƒh(morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_NoiseReduction_setImageFormat(

+    morpho_NoiseReduction *reducer,

+    const char *format);

+

+/**

+ * ‹P“xƒmƒCƒYœ‹Ž‹­“xƒŒƒxƒ‹‚ðÝ’è

+ * initialize()ŽÀsŒã‚©‚Âstart()ŽÀs‘O‚ɐݒè‰Â”\

+ *

+ * @param[in,out] reducer ƒmƒCƒYœ‹ŽŠí

+ * @param[in] level ‹P“xƒmƒCƒYœ‹Ž‹­“xƒŒƒxƒ‹(0-7)

+ * @return ƒGƒ‰[ƒR[ƒh(morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_NoiseReduction_setLumaNoiseReductionLevel(

+    morpho_NoiseReduction *reducer,

+    int level);

+

+/**

+ * ƒNƒƒ}ƒmƒCƒYœ‹Ž‹­“xƒŒƒxƒ‹‚ðÝ’è

+ * initialize()ŽÀsŒã‚©‚Âstart()ŽÀs‘O‚ɐݒè‰Â”\

+ *

+ * @param[in,out] reducer ƒmƒCƒYœ‹ŽŠí

+ * @param[in] level ƒNƒƒ}ƒmƒCƒYœ‹Ž‹­“xƒŒƒxƒ‹(0-7)

+ * @return ƒGƒ‰[ƒR[ƒh(morpho_error.h)

+ */

+MORPHO_API(int)

+morpho_NoiseReduction_setChromaNoiseReductionLevel(

+    morpho_NoiseReduction *reducer,

+    int level);

+

+//====================================================================

+

+# ifdef __cplusplus

+} // extern "C"

+# endif

+

+//--------------------------------------------------------------------

+

+#endif // !MORPHO_IMAGE_STABILIZER3_H

+

+//====================================================================

+// [EOF]

diff --git a/camera/hdr/include/morpho_noise_reduction_ext.h b/camera/hdr/include/morpho_noise_reduction_ext.h
new file mode 100644
index 0000000..4f15934
--- /dev/null
+++ b/camera/hdr/include/morpho_noise_reduction_ext.h
@@ -0,0 +1,17 @@
+#ifndef MORPHO_NR_EXT_H
+#define MORPHO_NR_EXT_H
+
+#include "morpho_noise_reduction.h"
+/*
+return == 0 : OK
+return != 0 : NG (Please print the return value to check Error types)
+*/
+MORPHO_API(int)
+LINK_mm_camera_morpho_noise_reduction(
+    unsigned char* yuvImage,
+    int width,
+    int height,
+    int y_level,
+    int c_level);
+
+#endif //MORPHO_NR_EXT_H
diff --git a/camera/hdr/include/morpho_rect_int.h b/camera/hdr/include/morpho_rect_int.h
new file mode 100644
index 0000000..b3534a4
--- /dev/null
+++ b/camera/hdr/include/morpho_rect_int.h
@@ -0,0 +1,37 @@
+/**

+ * @file     morpho_rect_int.h

+ * @brief    ‹éŒ`ƒf[ƒ^‚̍\‘¢‘Ì’è‹`

+ * @version  1.0.0

+ * @date     2008-06-09

+ *

+ * Copyright (C) 2006-2012 Morpho, Inc.

+ */

+

+#ifndef MORPHO_RECT_INT_H

+#define MORPHO_RECT_INT_H

+

+#ifdef __cplusplus

+extern "C" {

+#endif

+

+/** ‹éŒ`ƒf[ƒ^. */

+typedef struct {

+    int sx; /**< left */

+    int sy; /**< top */

+    int ex; /**< right */

+    int ey; /**< bottom */

+} morpho_RectInt;

+

+/** ‹éŒ`—̈æ rect ‚̍¶ãÀ•W (l,t) ‚ƉE‰ºÀ•W (r,b) ‚ðÝ’è‚·‚é. */

+#define morpho_RectInt_setRect(rect,l,t,r,b) do { \

+	(rect)->sx=(l);\

+	(rect)->sy=(t);\

+	(rect)->ex=(r);\

+	(rect)->ey=(b);\

+    } while(0)

+

+#ifdef __cplusplus

+}

+#endif

+

+#endif /* #ifndef MORPHO_RECT_INT_H */

diff --git a/camera/mm-camera-interface/mm_camera.c b/camera/mm-camera-interface/mm_camera.c
index 5ba4996..12203e0 100644
--- a/camera/mm-camera-interface/mm_camera.c
+++ b/camera/mm-camera-interface/mm_camera.c
@@ -643,6 +643,10 @@
     case MM_CAMERA_PARM_VFE_OUTPUT_ENABLE:
         *((int *)parm->p_value) = my_obj->properties.vfe_output_enable;
         break;
+    case MM_CAMERA_PARM_LUX_IDX:
+        CDBG("%s: MM_CAMERA_PARM_LUX_IDX\n", __func__);
+        return mm_camera_send_native_ctrl_cmd(my_obj, CAMERA_GET_PARM_LUX_IDX,
+                     sizeof(int), (void *)parm->p_value);
     case MM_CAMERA_PARM_MAX_NUM_FACES_DECT:
         return mm_camera_send_native_ctrl_cmd(my_obj, CAMERA_GET_MAX_NUM_FACES_DECT,
                      sizeof(int), (void *)parm->p_value);