├── .gitignore ├── MotionCam-Android ├── settings.gradle ├── MotionCam │ ├── .gitignore │ ├── src │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── motioncam │ │ │ │ ├── CameraCaptureManager.java │ │ │ │ ├── processor │ │ │ │ ├── NativeBitmapListener.java │ │ │ │ ├── NativeProcessorProgressListener.java │ │ │ │ ├── NativeDngConverterListener.java │ │ │ │ ├── ContainerMetadata.java │ │ │ │ └── NativeProcessor.java │ │ │ │ ├── camera │ │ │ │ ├── NativeCameraRawPreviewListener.java │ │ │ │ ├── VideoRecordingStats.java │ │ │ │ ├── NativeCameraSessionListener.java │ │ │ │ ├── CameraStartupSettings.java │ │ │ │ ├── NativeCameraInfo.java │ │ │ │ ├── NativeCameraManager.java │ │ │ │ ├── NativeCameraBuffer.java │ │ │ │ └── PostProcessSettings.java │ │ │ │ ├── SettingsActivity.java │ │ │ │ ├── ConvertVideoActivity.java │ │ │ │ ├── worker │ │ │ │ └── State.java │ │ │ │ ├── DenoiseSettings.java │ │ │ │ ├── CameraOverlayTask.java │ │ │ │ ├── PostProcessActivity.java │ │ │ │ └── ui │ │ │ │ └── BitmapDrawView.java │ │ │ ├── res │ │ │ ├── mipmap-hdpi │ │ │ │ ├── icon.png │ │ │ │ └── icon_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── icon.png │ │ │ │ └── icon_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── icon.png │ │ │ │ └── icon_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── icon.png │ │ │ │ └── icon_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── icon.png │ │ │ │ └── icon_round.png │ │ │ ├── drawable-hdpi │ │ │ │ ├── outline_cancel_black_18.png │ │ │ │ ├── outline_cancel_black_24.png │ │ │ │ ├── outline_cancel_black_36.png │ │ │ │ ├── outline_cancel_black_48.png │ │ │ │ ├── sharp_save_alt_white_18.png │ │ │ │ ├── sharp_save_alt_white_24.png │ │ │ │ ├── sharp_save_alt_white_36.png │ │ │ │ ├── sharp_save_alt_white_48.png │ │ │ │ └── ic_processing_notification.png │ │ │ ├── drawable-mdpi │ │ │ │ ├── outline_cancel_black_18.png │ │ │ │ ├── outline_cancel_black_24.png │ │ │ │ ├── outline_cancel_black_36.png │ │ │ │ ├── outline_cancel_black_48.png │ │ │ │ ├── sharp_save_alt_white_18.png │ │ │ │ ├── sharp_save_alt_white_24.png │ │ │ │ ├── sharp_save_alt_white_36.png │ │ │ │ ├── sharp_save_alt_white_48.png │ │ │ │ └── ic_processing_notification.png │ │ │ ├── drawable-xhdpi │ │ │ │ ├── outline_cancel_black_18.png │ │ │ │ ├── outline_cancel_black_24.png │ │ │ │ ├── outline_cancel_black_36.png │ │ │ │ ├── outline_cancel_black_48.png │ │ │ │ ├── sharp_save_alt_white_18.png │ │ │ │ ├── sharp_save_alt_white_24.png │ │ │ │ ├── sharp_save_alt_white_36.png │ │ │ │ ├── sharp_save_alt_white_48.png │ │ │ │ └── ic_processing_notification.png │ │ │ ├── drawable-xxhdpi │ │ │ │ ├── outline_cancel_black_18.png │ │ │ │ ├── outline_cancel_black_24.png │ │ │ │ ├── outline_cancel_black_36.png │ │ │ │ ├── outline_cancel_black_48.png │ │ │ │ ├── sharp_save_alt_white_18.png │ │ │ │ ├── sharp_save_alt_white_24.png │ │ │ │ ├── sharp_save_alt_white_36.png │ │ │ │ ├── sharp_save_alt_white_48.png │ │ │ │ └── ic_processing_notification.png │ │ │ ├── drawable-xxxhdpi │ │ │ │ ├── sharp_save_alt_white_18.png │ │ │ │ ├── sharp_save_alt_white_24.png │ │ │ │ ├── sharp_save_alt_white_36.png │ │ │ │ └── sharp_save_alt_white_48.png │ │ │ ├── xml │ │ │ │ ├── paths.xml │ │ │ │ └── camera_activity_scene.xml │ │ │ ├── values │ │ │ │ ├── integers.xml │ │ │ │ ├── dimens.xml │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ ├── drawable │ │ │ │ ├── camera_settings_background.xml │ │ │ │ ├── recording_timer_background.xml │ │ │ │ ├── saving_progress_bg.xml │ │ │ │ ├── seekbar_tick_mark.xml │ │ │ │ ├── selected_text_background.xml │ │ │ │ ├── exposure_square.xml │ │ │ │ ├── focus_circle.xml │ │ │ │ ├── selected_text_background_active.xml │ │ │ │ ├── preview_image_border.xml │ │ │ │ ├── baseline_add_24.xml │ │ │ │ ├── chevron_down.xml │ │ │ │ ├── chevron_up.xml │ │ │ │ ├── capture_btn.xml │ │ │ │ ├── baseline_circle_24.xml │ │ │ │ ├── capture_btn_default.xml │ │ │ │ ├── expand_btn.xml │ │ │ │ ├── tint_gradient.xml │ │ │ │ ├── temperature_gradient.xml │ │ │ │ ├── capture_btn_pressed.xml │ │ │ │ ├── baseline_photo_24.xml │ │ │ │ ├── up_arrow_24.xml │ │ │ │ ├── outline_arrow_back_24.xml │ │ │ │ ├── baseline_cancel_24.xml │ │ │ │ ├── selectable_text.xml │ │ │ │ ├── sharp_save_alt_24.xml │ │ │ │ ├── minus_circle_outline.xml │ │ │ │ ├── lock_open.xml │ │ │ │ ├── plus_circle_outline.xml │ │ │ │ ├── lock.xml │ │ │ │ ├── baseline_open_in_new_20.xml │ │ │ │ ├── baseline_open_in_new_24.xml │ │ │ │ ├── baseline_brightness_7_24.xml │ │ │ │ ├── outline_cancel_24.xml │ │ │ │ ├── baseline_settings_brightness_24.xml │ │ │ │ ├── outline_autorenew_24.xml │ │ │ │ ├── outline_photo_camera_24.xml │ │ │ │ ├── round_camera_enhance_24.xml │ │ │ │ ├── round_save_24.xml │ │ │ │ ├── baseline_wb_sunny_24.xml │ │ │ │ ├── baseline_photo_camera_24.xml │ │ │ │ ├── baseline_tonality_24.xml │ │ │ │ ├── baseline_share_24.xml │ │ │ │ ├── all_inclusive.xml │ │ │ │ ├── round_iso_24.xml │ │ │ │ ├── round_filter_center_focus_24.xml │ │ │ │ ├── progress_circular.xml │ │ │ │ ├── round_settings_24.xml │ │ │ │ └── round_shutter_speed_24.xml │ │ │ ├── layout │ │ │ │ ├── preview.xml │ │ │ │ ├── simple_list_item.xml │ │ │ │ ├── settings_activity.xml │ │ │ │ ├── post_process_activity.xml │ │ │ │ ├── convert_video_activity.xml │ │ │ │ ├── preview_list_item.xml │ │ │ │ ├── camera_selector.xml │ │ │ │ └── first_time_activity.xml │ │ │ └── drawable-anydpi │ │ │ │ └── ic_processing_notification.xml │ │ │ ├── cpp │ │ │ ├── camera │ │ │ │ ├── RawPreviewListener.h │ │ │ │ ├── Exceptions.h │ │ │ │ ├── Logger.h │ │ │ │ ├── CameraSessionState.h │ │ │ │ ├── CameraSessionListener.h │ │ │ │ ├── NativeClBuffer.h │ │ │ │ ├── ClHelper.h │ │ │ │ ├── CaptureSessionManager.h │ │ │ │ ├── CameraSessionContext.h │ │ │ │ └── CameraDescription.h │ │ │ ├── JavaUtils.h │ │ │ ├── DngConverterListener.h │ │ │ ├── ImageProcessorListener.h │ │ │ ├── NativeRawPreviewListener.h │ │ │ ├── AudioRecorder.h │ │ │ ├── NativeCameraBridgeListener.h │ │ │ ├── DngConverterListener.cpp │ │ │ └── ImageProcessorListener.cpp │ │ │ └── AndroidManifest.xml │ └── proguard-rules.pro ├── .idea │ ├── caches │ │ ├── gradle_models.ser │ │ └── build_file_checksums.ser │ ├── encodings.xml │ ├── compiler.xml │ ├── modules.xml │ ├── gradle.xml │ └── jarRepositories.xml ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .gitignore ├── build.gradle ├── gradle.properties └── gradlew.bat └── libMotionCam ├── libMotionCam ├── libs │ └── libmotioncam-encoder.a ├── include │ └── motioncam │ │ ├── Logger.h │ │ ├── Measure.h │ │ ├── ImageProcessorProgress.h │ │ ├── AudioInterface.h │ │ ├── DngProcessorProgress.h │ │ ├── Math.h │ │ ├── Exceptions.h │ │ ├── Lock.h │ │ ├── Temperature.h │ │ ├── ImageOps.h │ │ ├── Color.h │ │ ├── RawEncoder.h │ │ ├── Types.h │ │ ├── RawImageBuffer.h │ │ ├── CameraPreview.h │ │ ├── RawCameraMetadata.h │ │ ├── Settings.h │ │ ├── CameraProfile.h │ │ ├── RawBufferStreamer.h │ │ ├── RawContainer.h │ │ └── RawContainerImpl_Legacy.h ├── generators │ └── Common.h └── source │ ├── Measure.cpp │ └── Logger.cpp ├── libMotionCam.xcodeproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── thirdparty ├── dng_sdk │ └── dng │ │ ├── dng_jpeg_memory_source.h │ │ ├── dng_jpeglib.h │ │ ├── RawEnvironment.h │ │ ├── dng_point.cpp │ │ ├── dng_globals.cpp │ │ ├── dng_fast_module.h │ │ ├── dng_uncopyable.h │ │ ├── dng_tag_types.h │ │ ├── dng_tag_types.cpp │ │ ├── dng_globals.h │ │ ├── dng_tone_curve.h │ │ ├── dng_bottlenecks.cpp │ │ ├── dng_tile_iterator.h │ │ ├── dng_lossless_jpeg.h │ │ ├── dng_string_list.h │ │ ├── dng_spline.h │ │ ├── dng_temperature.h │ │ ├── dng_file_stream.h │ │ ├── dng_jpeg_memory_source.cpp │ │ ├── dng_jpeg_image.h │ │ ├── dng_xy_coord.cpp │ │ ├── dng_sdk_limits.h │ │ ├── dng_simple_image.h │ │ └── dng_errors.h ├── json11 │ └── LICENSE ├── opencl │ └── CL │ │ ├── opencl.h │ │ └── cl_gl_ext.h ├── atomic_queue │ ├── LICENSE │ └── atomic_queue │ │ ├── barrier.h │ │ └── defs.h └── miniz │ └── LICENSE └── .gitignore /.gitignore: -------------------------------------------------------------------------------- 1 | tmp 2 | release 3 | -------------------------------------------------------------------------------- /MotionCam-Android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':MotionCam' 2 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /release 3 | -------------------------------------------------------------------------------- /MotionCam-Android/.idea/caches/gradle_models.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/.idea/caches/gradle_models.ser -------------------------------------------------------------------------------- /MotionCam-Android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /libMotionCam/libMotionCam/libs/libmotioncam-encoder.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/libMotionCam/libMotionCam/libs/libmotioncam-encoder.a -------------------------------------------------------------------------------- /MotionCam-Android/.idea/caches/build_file_checksums.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/.idea/caches/build_file_checksums.ser -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/java/com/motioncam/CameraCaptureManager.java: -------------------------------------------------------------------------------- 1 | package com.motioncam; 2 | 3 | public class CameraCaptureManager { 4 | } 5 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/mipmap-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/mipmap-hdpi/icon.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/mipmap-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/mipmap-mdpi/icon.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/mipmap-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/mipmap-xhdpi/icon.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/mipmap-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/mipmap-xxhdpi/icon.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/mipmap-xxxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/mipmap-xxxhdpi/icon.png -------------------------------------------------------------------------------- /MotionCam-Android/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/mipmap-hdpi/icon_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/mipmap-hdpi/icon_round.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/mipmap-mdpi/icon_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/mipmap-mdpi/icon_round.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/mipmap-xhdpi/icon_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/mipmap-xhdpi/icon_round.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/mipmap-xxhdpi/icon_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/mipmap-xxhdpi/icon_round.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/mipmap-xxxhdpi/icon_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/mipmap-xxxhdpi/icon_round.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-hdpi/outline_cancel_black_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-hdpi/outline_cancel_black_18.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-hdpi/outline_cancel_black_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-hdpi/outline_cancel_black_24.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-hdpi/outline_cancel_black_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-hdpi/outline_cancel_black_36.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-hdpi/outline_cancel_black_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-hdpi/outline_cancel_black_48.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-hdpi/sharp_save_alt_white_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-hdpi/sharp_save_alt_white_18.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-hdpi/sharp_save_alt_white_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-hdpi/sharp_save_alt_white_24.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-hdpi/sharp_save_alt_white_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-hdpi/sharp_save_alt_white_36.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-hdpi/sharp_save_alt_white_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-hdpi/sharp_save_alt_white_48.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-mdpi/outline_cancel_black_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-mdpi/outline_cancel_black_18.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-mdpi/outline_cancel_black_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-mdpi/outline_cancel_black_24.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-mdpi/outline_cancel_black_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-mdpi/outline_cancel_black_36.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-mdpi/outline_cancel_black_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-mdpi/outline_cancel_black_48.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-mdpi/sharp_save_alt_white_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-mdpi/sharp_save_alt_white_18.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-mdpi/sharp_save_alt_white_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-mdpi/sharp_save_alt_white_24.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-mdpi/sharp_save_alt_white_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-mdpi/sharp_save_alt_white_36.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-mdpi/sharp_save_alt_white_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-mdpi/sharp_save_alt_white_48.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-xhdpi/outline_cancel_black_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-xhdpi/outline_cancel_black_18.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-xhdpi/outline_cancel_black_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-xhdpi/outline_cancel_black_24.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-xhdpi/outline_cancel_black_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-xhdpi/outline_cancel_black_36.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-xhdpi/outline_cancel_black_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-xhdpi/outline_cancel_black_48.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-xhdpi/sharp_save_alt_white_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-xhdpi/sharp_save_alt_white_18.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-xhdpi/sharp_save_alt_white_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-xhdpi/sharp_save_alt_white_24.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-xhdpi/sharp_save_alt_white_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-xhdpi/sharp_save_alt_white_36.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-xhdpi/sharp_save_alt_white_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-xhdpi/sharp_save_alt_white_48.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-hdpi/ic_processing_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-hdpi/ic_processing_notification.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-mdpi/ic_processing_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-mdpi/ic_processing_notification.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-xxhdpi/outline_cancel_black_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-xxhdpi/outline_cancel_black_18.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-xxhdpi/outline_cancel_black_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-xxhdpi/outline_cancel_black_24.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-xxhdpi/outline_cancel_black_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-xxhdpi/outline_cancel_black_36.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-xxhdpi/outline_cancel_black_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-xxhdpi/outline_cancel_black_48.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-xxhdpi/sharp_save_alt_white_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-xxhdpi/sharp_save_alt_white_18.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-xxhdpi/sharp_save_alt_white_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-xxhdpi/sharp_save_alt_white_24.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-xxhdpi/sharp_save_alt_white_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-xxhdpi/sharp_save_alt_white_36.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-xxhdpi/sharp_save_alt_white_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-xxhdpi/sharp_save_alt_white_48.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-xxxhdpi/sharp_save_alt_white_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-xxxhdpi/sharp_save_alt_white_18.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-xxxhdpi/sharp_save_alt_white_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-xxxhdpi/sharp_save_alt_white_24.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-xxxhdpi/sharp_save_alt_white_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-xxxhdpi/sharp_save_alt_white_36.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-xxxhdpi/sharp_save_alt_white_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-xxxhdpi/sharp_save_alt_white_48.png -------------------------------------------------------------------------------- /MotionCam-Android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | CMakeFiles 11 | .cxx 12 | vcs.xml -------------------------------------------------------------------------------- /MotionCam-Android/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-xhdpi/ic_processing_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-xhdpi/ic_processing_notification.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-xxhdpi/ic_processing_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TadiT7/motioncam/HEAD/MotionCam-Android/MotionCam/src/main/res/drawable-xxhdpi/ic_processing_notification.png -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/xml/paths.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/values/integers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 536870912 4 | 5 | -------------------------------------------------------------------------------- /libMotionCam/libMotionCam.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/java/com/motioncam/processor/NativeBitmapListener.java: -------------------------------------------------------------------------------- 1 | package com.motioncam.processor; 2 | 3 | import android.graphics.Bitmap; 4 | 5 | public interface NativeBitmapListener { 6 | Bitmap createBitmap(int width, int height, int type); 7 | } 8 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/camera_settings_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/recording_timer_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/saving_progress_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/seekbar_tick_mark.xml: -------------------------------------------------------------------------------- 1 | 3 | 5 | 6 | -------------------------------------------------------------------------------- /MotionCam-Android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Mar 15 13:06:18 GMT 2022 2 | distributionBase=GRADLE_USER_HOME 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME 7 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/java/com/motioncam/camera/NativeCameraRawPreviewListener.java: -------------------------------------------------------------------------------- 1 | package com.motioncam.camera; 2 | 3 | import android.graphics.Bitmap; 4 | 5 | public interface NativeCameraRawPreviewListener { 6 | Bitmap onRawPreviewBitmapNeeded(int width, int height); 7 | void onRawPreviewUpdated(); 8 | } 9 | -------------------------------------------------------------------------------- /libMotionCam/libMotionCam/include/motioncam/Logger.h: -------------------------------------------------------------------------------- 1 | #ifndef Logger_hpp 2 | #define Logger_hpp 3 | 4 | #include 5 | 6 | namespace motioncam { 7 | namespace logger { 8 | void log(const std::string& str); 9 | void debug(const std::string& str); 10 | } 11 | } 12 | 13 | #endif /* Logger_hpp */ 14 | -------------------------------------------------------------------------------- /libMotionCam/libMotionCam.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/layout/preview.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/java/com/motioncam/processor/NativeProcessorProgressListener.java: -------------------------------------------------------------------------------- 1 | package com.motioncam.processor; 2 | 3 | 4 | public interface NativeProcessorProgressListener { 5 | String onPreviewSaved(String outputPath); 6 | boolean onProgressUpdate(int progress); 7 | void onCompleted(); 8 | void onError(String error); 9 | } 10 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/selected_text_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/java/com/motioncam/processor/NativeDngConverterListener.java: -------------------------------------------------------------------------------- 1 | package com.motioncam.processor; 2 | 3 | public interface NativeDngConverterListener { 4 | int onNeedFd(int frameNumber); 5 | boolean onProgressUpdate(int progress); 6 | void onCompleted(); 7 | void onAttemptingRecovery(); 8 | void onError(String error); 9 | } 10 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/exposure_square.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/focus_circle.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/selected_text_background_active.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/preview_image_border.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/baseline_add_24.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/chevron_down.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/chevron_up.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/capture_btn.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/baseline_circle_24.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/java/com/motioncam/camera/VideoRecordingStats.java: -------------------------------------------------------------------------------- 1 | package com.motioncam.camera; 2 | 3 | public class VideoRecordingStats { 4 | public final float fps; 5 | public final float memoryUse; 6 | public final long size; 7 | 8 | public VideoRecordingStats(float memoryUse, float fps, long size) { 9 | this.memoryUse = memoryUse; 10 | this.fps = fps; 11 | this.size = size; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/cpp/camera/RawPreviewListener.h: -------------------------------------------------------------------------------- 1 | #ifndef MOTIONCAM_ANDROID_RAWPREVIEWLISTENER_H 2 | #define MOTIONCAM_ANDROID_RAWPREVIEWLISTENER_H 3 | 4 | #include 5 | 6 | namespace motioncam { 7 | class RawPreviewListener { 8 | public: 9 | virtual void onPreviewGenerated(const void* data, const int len, const int width, const int height) = 0; 10 | }; 11 | } 12 | 13 | #endif //MOTIONCAM_ANDROID_RAWPREVIEWLISTENER_H 14 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/capture_btn_default.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 11 | 14 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/expand_btn.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/tint_gradient.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/temperature_gradient.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/capture_btn_pressed.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 9 | 12 | 13 | 16 | -------------------------------------------------------------------------------- /libMotionCam/libMotionCam/include/motioncam/Measure.h: -------------------------------------------------------------------------------- 1 | #ifndef Measure_hpp 2 | #define Measure_hpp 3 | 4 | #include 5 | #include 6 | 7 | namespace motioncam { 8 | 9 | class Measure { 10 | public: 11 | Measure(std::string reference); 12 | virtual ~Measure(); 13 | 14 | private: 15 | std::string mReference; 16 | std::chrono::steady_clock::time_point mTimestamp; 17 | }; 18 | } 19 | 20 | #endif /* Measure_hpp */ 21 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/java/com/motioncam/processor/ContainerMetadata.java: -------------------------------------------------------------------------------- 1 | package com.motioncam.processor; 2 | 3 | public class ContainerMetadata { 4 | public final float frameRate; 5 | public final int numFrames; 6 | public final int numSegments; 7 | 8 | public ContainerMetadata(float frameRate, int numFrames, int numSegments) { 9 | this.frameRate = frameRate; 10 | this.numFrames = numFrames; 11 | this.numSegments = numSegments; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /MotionCam-Android/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/baseline_photo_24.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /libMotionCam/libMotionCam/generators/Common.h: -------------------------------------------------------------------------------- 1 | #ifndef _COMMON_H_ 2 | #define _COMMON_H_ 3 | 4 | enum class RawFormat : int { 5 | RAW10 = 0, 6 | RAW12, 7 | RAW16, 8 | }; 9 | 10 | enum class SensorArrangement : int { 11 | RGGB = 0, 12 | GRBG, 13 | GBRG, 14 | BGGR 15 | }; 16 | 17 | // YUV conversion coefficients 18 | const float YUV_R = 0.299f; 19 | const float YUV_G = 0.587f; 20 | const float YUV_B = 0.114f; 21 | 22 | const int TONEMAP_LEVELS = 11; 23 | 24 | #endif // _COMMON_H_ 25 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/up_arrow_24.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/outline_arrow_back_24.xml: -------------------------------------------------------------------------------- 1 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/baseline_cancel_24.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/selectable_text.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/sharp_save_alt_24.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/minus_circle_outline.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/lock_open.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/plus_circle_outline.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /libMotionCam/libMotionCam/include/motioncam/ImageProcessorProgress.h: -------------------------------------------------------------------------------- 1 | #ifndef ImageProcessorProgress_h 2 | #define ImageProcessorProgress_h 3 | 4 | #include 5 | 6 | namespace motioncam { 7 | class ImageProcessorProgress { 8 | public: 9 | virtual std::string onPreviewSaved(const std::string& outputPath) const = 0; 10 | virtual bool onProgressUpdate(int progress) const = 0; 11 | virtual void onCompleted() const = 0; 12 | virtual void onError(const std::string& error) const = 0; 13 | }; 14 | } 15 | 16 | #endif /* ImageProcessorProgress_h */ 17 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/lock.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/baseline_open_in_new_20.xml: -------------------------------------------------------------------------------- 1 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/baseline_open_in_new_24.xml: -------------------------------------------------------------------------------- 1 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10dp 4 | 5dp 5 | 60dp 6 | 5dp 7 | 5dp 8 | 16dp 9 | 60dp 10 | 10dp 11 | 100dp 12 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/cpp/camera/Exceptions.h: -------------------------------------------------------------------------------- 1 | #ifndef MOTIONCAM_ANDROID_EXCEPTIONS_H 2 | #define MOTIONCAM_ANDROID_EXCEPTIONS_H 3 | 4 | #include 5 | #include 6 | 7 | class CameraSessionException : public std::runtime_error { 8 | public: 9 | CameraSessionException(const std::string& error) : std::runtime_error(error) { 10 | } 11 | }; 12 | 13 | 14 | class RawPreviewException : public std::runtime_error { 15 | public: 16 | RawPreviewException(const std::string& error) : std::runtime_error(error) { 17 | } 18 | }; 19 | 20 | #endif //MOTIONCAM_ANDROID_EXCEPTIONS_H 21 | -------------------------------------------------------------------------------- /libMotionCam/libMotionCam/include/motioncam/AudioInterface.h: -------------------------------------------------------------------------------- 1 | #ifndef AudioInterface_h 2 | #define AudioInterface_h 3 | 4 | #include 5 | #include 6 | 7 | namespace motioncam { 8 | class AudioInterface { 9 | public: 10 | virtual bool start(const int sampleRateHz, const int channels) = 0; 11 | virtual void stop() = 0; 12 | virtual const std::vector& getAudioData(uint32_t& outNumFrames) const = 0; 13 | 14 | virtual int getSampleRate() const = 0; 15 | virtual int getChannels() const = 0; 16 | }; 17 | } 18 | 19 | #endif /* AudioInterface_h */ 20 | -------------------------------------------------------------------------------- /libMotionCam/thirdparty/dng_sdk/dng/dng_jpeg_memory_source.h: -------------------------------------------------------------------------------- 1 | // Provides an implementation of jpeg_source_mgr for in-memory data sources. 2 | 3 | #ifndef __dng_jpeg_memory_source__ 4 | #define __dng_jpeg_memory_source__ 5 | 6 | #if qDNGUseLibJPEG 7 | 8 | #include "dng_tag_types.h" 9 | #include "dng_jpeglib.h" 10 | 11 | #include 12 | 13 | // Creates a jpeg_source_mgr for an in-memory data source based on the given 14 | // buffer with length 'size'. 15 | jpeg_source_mgr CreateJpegMemorySource(const uint8 *buffer, size_t size); 16 | 17 | #endif // qDNGUseLibJPEG 18 | 19 | #endif // __dng_jpeg_memory_source__ 20 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/baseline_brightness_7_24.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/layout/simple_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/outline_cancel_24.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/layout/settings_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/baseline_settings_brightness_24.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/layout/post_process_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /libMotionCam/libMotionCam/source/Measure.cpp: -------------------------------------------------------------------------------- 1 | #include "motioncam/Measure.h" 2 | #include "motioncam/Logger.h" 3 | 4 | namespace motioncam { 5 | Measure::Measure(std::string reference) : 6 | mReference(std::move(reference)), 7 | mTimestamp(std::chrono::steady_clock::now()) { 8 | 9 | logger::log(mReference); 10 | } 11 | 12 | Measure::~Measure() { 13 | auto now = std::chrono::steady_clock::now(); 14 | double durationMs = std::chrono::duration (now - mTimestamp).count(); 15 | logger::log(mReference + " - taken " + std::to_string(durationMs) + " ms"); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/cpp/camera/Logger.h: -------------------------------------------------------------------------------- 1 | #ifndef MOTIONCAM_ANDROID_LOGGER_H 2 | #define MOTIONCAM_ANDROID_LOGGER_H 3 | 4 | #include 5 | #include 6 | 7 | namespace motioncam { 8 | 9 | #define LOG_TAG "libMotionCam" 10 | 11 | #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__) 12 | #define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__) 13 | #define LOGW(...) __android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__) 14 | #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__) 15 | 16 | } 17 | 18 | #endif //MOTIONCAM_ANDROID_LOGGER_H 19 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/layout/convert_video_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /libMotionCam/thirdparty/dng_sdk/dng/dng_jpeglib.h: -------------------------------------------------------------------------------- 1 | // Convenience include file that includes jpeglib.h and jerror.h as well as the 2 | // standard include files required by them. 3 | #ifndef __dng_jpeglib__ 4 | #define __dng_jpeglib__ 5 | 6 | // jpeglib.h requires FILE and size_t to be defined before #including it (it 7 | // doesn't pull in the required headers for those definitions itself). 8 | #include 9 | #include 10 | 11 | // The standard libjpeg headers don't seem to contain an 'extern "C"' (so it's 12 | // required when including them from C++). 13 | extern "C" { 14 | #include "jpeglib.h" 15 | #include "jerror.h" 16 | } 17 | 18 | #endif // __dng_jpeglib__ 19 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/outline_autorenew_24.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /libMotionCam/thirdparty/dng_sdk/dng/RawEnvironment.h: -------------------------------------------------------------------------------- 1 | #ifndef __dng_RawEnvironment__ 2 | #define __dng_RawEnvironment__ 3 | 4 | // Define preprocessor constants that control platform-specific conditional 5 | // compilation. The constants qMacOS and qWinOS must be defined on all 6 | // platforms. Other constants, such as qLinux, only need to be defined if we're 7 | // actually compiling for that platform. 8 | #if defined(__linux__) 9 | #define qMacOS 0 10 | #define qWinOS 0 11 | #define qLinux 1 12 | #elif defined(__APPLE__) 13 | #define qMacOS 1 14 | #define qWinOS 0 15 | #elif defined(_WIN32) 16 | #define qMacOS 0 17 | #define qWinOS 1 18 | #endif 19 | 20 | #endif // __dng_RawEnvironment__ 21 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/outline_photo_camera_24.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/round_camera_enhance_24.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/round_save_24.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/baseline_wb_sunny_24.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /libMotionCam/libMotionCam/include/motioncam/DngProcessorProgress.h: -------------------------------------------------------------------------------- 1 | #ifndef DngProcessorProgress_h 2 | #define DngProcessorProgress_h 3 | 4 | #include 5 | 6 | namespace motioncam { 7 | class DngProcessorProgress { 8 | public: 9 | #if defined(__APPLE__) || defined(__ANDROID__) || defined(__linux__) 10 | virtual int onNeedFd(int frameNumber) = 0; 11 | #elif defined(_WIN32) 12 | virtual std::string onNeedFd(int frameNumber) = 0; 13 | #endif 14 | virtual bool onProgressUpdate(int progress) = 0; 15 | virtual void onAttemptingRecovery() = 0; 16 | virtual void onCompleted() = 0; 17 | virtual void onError(const std::string& error) = 0; 18 | }; 19 | } 20 | 21 | #endif // DngProcessorProgress_h 22 | -------------------------------------------------------------------------------- /libMotionCam/libMotionCam/include/motioncam/Math.h: -------------------------------------------------------------------------------- 1 | #ifndef Math_hpp 2 | #define Math_hpp 3 | 4 | #include 5 | #include 6 | 7 | namespace motioncam { 8 | namespace math { 9 | 10 | template 11 | inline static T clamp(T min, T x, T max) 12 | { 13 | return std::max(min, std::min(x, max)); 14 | } 15 | 16 | inline static float max(const cv::Vec3f& coord) { 17 | return std::max({coord[0], coord[1], coord[2]}); 18 | } 19 | 20 | inline static float max(const cv::Vec4f& coord) { 21 | return std::max({coord[0], coord[1], coord[2], coord[3]}); 22 | } 23 | } 24 | } 25 | 26 | #endif /* Math_hpp */ 27 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/baseline_photo_camera_24.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 13 | 14 | -------------------------------------------------------------------------------- /libMotionCam/libMotionCam/include/motioncam/Exceptions.h: -------------------------------------------------------------------------------- 1 | #ifndef Exceptions_hpp 2 | #define Exceptions_hpp 3 | 4 | #include 5 | #include 6 | 7 | namespace motioncam { 8 | 9 | class MotionCamException : public std::runtime_error { 10 | public: 11 | MotionCamException(const std::string& error) : runtime_error(error) {} 12 | }; 13 | 14 | class IOException : public MotionCamException { 15 | public: 16 | IOException(const std::string& error) : MotionCamException(error) {} 17 | }; 18 | 19 | class InvalidState : public MotionCamException { 20 | public: 21 | InvalidState(const std::string& error) : MotionCamException(error) {} 22 | }; 23 | } 24 | 25 | #endif /* Exceptions_hpp */ 26 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/java/com/motioncam/camera/NativeCameraSessionListener.java: -------------------------------------------------------------------------------- 1 | package com.motioncam.camera; 2 | 3 | public interface NativeCameraSessionListener { 4 | void onCameraStarted(); 5 | void onCameraDisconnected(); 6 | void onCameraError(int error); 7 | void onCameraSessionStateChanged(int state); 8 | void onCameraExposureStatus(int iso, long exposureTime); 9 | void onCameraAutoFocusStateChanged(int state, float focusDistance); 10 | void onCameraAutoExposureStateChanged(int state); 11 | void onCameraHdrImageCaptureProgress(int progress); 12 | void onCameraHdrImageCaptureFailed(); 13 | void onCameraHdrImageCaptureCompleted(); 14 | 15 | void onMemoryAdjusting(); 16 | void onMemoryStable(); 17 | } 18 | -------------------------------------------------------------------------------- /libMotionCam/libMotionCam/include/motioncam/Lock.h: -------------------------------------------------------------------------------- 1 | #ifndef Lock_h 2 | #define Lock_h 3 | 4 | #include 5 | #include "motioncam/Logger.h" 6 | 7 | namespace motioncam { 8 | 9 | class Lock { 10 | public: 11 | Lock(std::recursive_mutex& l, const std::string& name) : mLock(l), mName(name) { 12 | // logger::debug("- TRY LOCK " + mName + " -"); 13 | mLock.lock(); 14 | // logger::debug("- LOCKED " + mName + " -"); 15 | } 16 | 17 | ~Lock() { 18 | mLock.unlock(); 19 | // logger::debug("- UNLOCK " + mName + " -"); 20 | } 21 | 22 | private: 23 | const std::string& mName; 24 | std::recursive_mutex& mLock; 25 | }; 26 | } 27 | 28 | #endif /* Lock_h */ 29 | -------------------------------------------------------------------------------- /MotionCam-Android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | 5 | repositories { 6 | google() 7 | mavenCentral() 8 | jcenter() 9 | } 10 | dependencies { 11 | classpath 'com.android.tools.build:gradle:7.1.2' 12 | 13 | 14 | // NOTE: Do not place your application dependencies here; they belong 15 | // in the individual module build.gradle files 16 | } 17 | } 18 | 19 | allprojects { 20 | repositories { 21 | google() 22 | mavenCentral() 23 | jcenter() 24 | maven { url "https://jitpack.io" } 25 | } 26 | } 27 | 28 | task clean(type: Delete) { 29 | delete rootProject.buildDir 30 | } 31 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/cpp/JavaUtils.h: -------------------------------------------------------------------------------- 1 | #ifndef MOTIONCAM_ANDROID_JAVAUTILS_H 2 | #define MOTIONCAM_ANDROID_JAVAUTILS_H 3 | 4 | #include 5 | #include 6 | 7 | namespace motioncam { 8 | class JavaEnv { 9 | public: 10 | JavaEnv(JavaVM* javaVm); 11 | ~JavaEnv(); 12 | 13 | JNIEnv* getEnv() const { 14 | return mJniEnv; 15 | } 16 | 17 | private: 18 | JavaVM* mVm; 19 | JNIEnv* mJniEnv; 20 | bool mShouldDetach; 21 | }; 22 | 23 | jboolean CopyAlphaBitmap(JNIEnv* env, const Halide::Runtime::Buffer& src, jobject& dst); 24 | jboolean CopyBitmap(JNIEnv* env, const Halide::Runtime::Buffer& src, jobject& dst); 25 | } 26 | 27 | #endif //MOTIONCAM_ANDROID_JAVAUTILS_H 28 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/baseline_tonality_24.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/cpp/DngConverterListener.h: -------------------------------------------------------------------------------- 1 | #ifndef MOTIONCAM_ANDROID_DNGCONVERTERLISTENER_H 2 | #define MOTIONCAM_ANDROID_DNGCONVERTERLISTENER_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class DngConverterListener : public motioncam::DngProcessorProgress { 9 | public: 10 | DngConverterListener(_JNIEnv* env, _jobject* progressListener); 11 | ~DngConverterListener(); 12 | 13 | int onNeedFd(int frameNumber); 14 | bool onProgressUpdate(int progress); 15 | void onCompleted(); 16 | void onAttemptingRecovery(); 17 | void onError(const std::string& error); 18 | 19 | private: 20 | _JNIEnv * mEnv; 21 | _jobject *mProgressListenerRef; 22 | }; 23 | 24 | 25 | #endif //MOTIONCAM_ANDROID_DNGCONVERTERLISTENER_H 26 | -------------------------------------------------------------------------------- /libMotionCam/libMotionCam/include/motioncam/Temperature.h: -------------------------------------------------------------------------------- 1 | #ifndef Temperature_hpp 2 | #define Temperature_hpp 3 | 4 | #include "motioncam/Types.h" 5 | 6 | namespace motioncam { 7 | 8 | // 9 | // This code is adapted from the DNG SDK 10 | // 11 | class Temperature { 12 | public: 13 | Temperature(); 14 | Temperature(double temperature, double tint); 15 | Temperature(const XYCoord& xyCoord); 16 | 17 | double temperature() const { 18 | return mTemperature; 19 | } 20 | 21 | double tint() const { 22 | return mTint; 23 | } 24 | 25 | XYCoord getXyCoord() const; 26 | 27 | private: 28 | double mTemperature; 29 | double mTint; 30 | }; 31 | } 32 | 33 | #endif /* Temperature_hpp */ 34 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/java/com/motioncam/SettingsActivity.java: -------------------------------------------------------------------------------- 1 | package com.motioncam; 2 | 3 | import android.os.Bundle; 4 | 5 | import androidx.appcompat.app.AppCompatActivity; 6 | 7 | import com.motioncam.ui.SettingsFragment; 8 | 9 | public class SettingsActivity extends AppCompatActivity { 10 | @Override 11 | protected void onCreate(Bundle savedInstanceState) { 12 | super.onCreate(savedInstanceState); 13 | setContentView(R.layout.settings_activity); 14 | 15 | if (savedInstanceState == null) { 16 | SettingsFragment fragment = SettingsFragment.newInstance(); 17 | 18 | getSupportFragmentManager() 19 | .beginTransaction() 20 | .replace(R.id.container, fragment) 21 | .commitNow(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/baseline_share_24.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /libMotionCam/libMotionCam/source/Logger.cpp: -------------------------------------------------------------------------------- 1 | #include "motioncam/Logger.h" 2 | 3 | #include 4 | 5 | #ifdef __ANDROID__ 6 | #include 7 | #endif 8 | 9 | namespace motioncam { 10 | #ifdef __ANDROID__ 11 | static const char* ANDROID_TAG = "libMotionCam"; 12 | #endif 13 | 14 | namespace logger { 15 | void log(const std::string& str) { 16 | #ifdef __ANDROID__ 17 | __android_log_print(ANDROID_LOG_INFO, ANDROID_TAG, "%s", str.c_str()); 18 | #else 19 | std::cout << str << std::endl; 20 | #endif 21 | } 22 | 23 | void debug(const std::string& str) { 24 | #ifdef __ANDROID__ 25 | __android_log_print(ANDROID_LOG_DEBUG, ANDROID_TAG, "%s", str.c_str()); 26 | #else 27 | std::cout << str << std::endl; 28 | #endif 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | -keepattributes LineNumberTable,SourceFile 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/cpp/ImageProcessorListener.h: -------------------------------------------------------------------------------- 1 | #ifndef MOTIONCAM_ANDROID_IMAGEPROCESSORLISTENER_H 2 | #define MOTIONCAM_ANDROID_IMAGEPROCESSORLISTENER_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class ImageProcessListener : public motioncam::ImageProcessorProgress { 9 | public: 10 | ImageProcessListener(_JNIEnv * env, _jobject *progressListener); 11 | ~ImageProcessListener(); 12 | 13 | std::string onPreviewSaved(const std::string& outputPath) const override; 14 | bool onProgressUpdate(int progress) const override; 15 | void onCompleted() const override; 16 | void onError(const std::string& error) const override; 17 | 18 | private: 19 | _JNIEnv * mEnv; 20 | _jobject *mProgressListenerRef; 21 | }; 22 | 23 | #endif //MOTIONCAM_ANDROID_IMAGEPROCESSORLISTENER_H 24 | -------------------------------------------------------------------------------- /libMotionCam/.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## User settings 6 | xcuserdata/ 7 | 8 | ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) 9 | *.xcscmblueprint 10 | *.xccheckout 11 | 12 | ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) 13 | build/ 14 | DerivedData/ 15 | *.moved-aside 16 | *.pbxuser 17 | !default.pbxuser 18 | *.mode1v3 19 | !default.mode1v3 20 | *.mode2v3 21 | !default.mode2v3 22 | *.perspectivev3 23 | !default.perspectivev3 24 | 25 | ## Gcc Patch 26 | /*.gcno 27 | 28 | # Misc 29 | .DS_Store 30 | build 31 | libMotionCam/halide/ 32 | 33 | thirdparty/halide/ 34 | thirdparty/opencv/ 35 | thirdparty/exiv2/ 36 | thirdparty/expat/ 37 | thirdparty/zstd/ 38 | thirdparty/dlib/ 39 | thirdparty/pfor/ 40 | -------------------------------------------------------------------------------- /libMotionCam/libMotionCam/include/motioncam/ImageOps.h: -------------------------------------------------------------------------------- 1 | #ifndef ImageOps_hpp 2 | #define ImageOps_hpp 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "Math.h" 9 | 10 | namespace motioncam { 11 | 12 | float estimateNoise(cv::Mat& input, float p=0.5f); 13 | 14 | float findMedian(cv::Mat& input, float p=0.5f); 15 | float findMedian(std::vector nums); 16 | 17 | float calculateEnergy(cv::Mat& image); 18 | 19 | // Removing chromatic aberration by digital image processing 20 | // https://www.spiedigitallibrary.org/journals/optical-engineering/volume-49/issue-6/067002/Removing-chromatic-aberration-by-digital-image-processing/10.1117/1.3455506.short 21 | void defringe(Halide::Runtime::Buffer& output, Halide::Runtime::Buffer& input); 22 | } 23 | 24 | #endif /* ImageOps_hpp */ 25 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/cpp/NativeRawPreviewListener.h: -------------------------------------------------------------------------------- 1 | #ifndef MOTIONCAM_ANDROID_NATIVERAWPREVIEWLISTENER_H 2 | #define MOTIONCAM_ANDROID_NATIVERAWPREVIEWLISTENER_H 3 | 4 | #include 5 | #include 6 | 7 | #include "camera/RawPreviewListener.h" 8 | 9 | namespace motioncam { 10 | class NativeRawPreviewListener : public RawPreviewListener { 11 | 12 | public: 13 | NativeRawPreviewListener(JNIEnv *env, jobject listener); 14 | ~NativeRawPreviewListener(); 15 | 16 | void onPreviewGenerated(const void* data, const int len, const int width, const int height); 17 | 18 | private: 19 | JavaVM *mJavaVm; 20 | jobject mListenerInstance; 21 | jclass mListenerClass; 22 | jobject mBitmap; 23 | }; 24 | 25 | } // namespace motioncam 26 | 27 | #endif //MOTIONCAM_ANDROID_NATIVERAWPREVIEWLISTENER_H 28 | -------------------------------------------------------------------------------- /MotionCam-Android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | android.enableJetifier=true 13 | android.useAndroidX=true 14 | org.gradle.jvmargs=-Xmx1536m 15 | 16 | # When configured, Gradle will run in incubating parallel mode. 17 | # This option should only be used with decoupled projects. More details, visit 18 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 19 | # org.gradle.parallel=true 20 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable-anydpi/ic_processing_notification.xml: -------------------------------------------------------------------------------- 1 | 7 | 11 | 14 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/all_inclusive.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/round_iso_24.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /libMotionCam/libMotionCam/include/motioncam/Color.h: -------------------------------------------------------------------------------- 1 | #ifndef Color_hpp 2 | #define Color_hpp 3 | 4 | #include "Types.h" 5 | 6 | namespace motioncam { 7 | namespace color { 8 | extern const XYCoord D50XYCoord; 9 | 10 | enum Illuminant { 11 | StandardA, 12 | StandardB, 13 | StandardC, 14 | D50, 15 | D55, 16 | D65, 17 | D75 18 | }; 19 | 20 | XYZCoord XYToXYZ(const XYCoord& xy); 21 | XYCoord XYZToXY(const XYZCoord& xyz); 22 | 23 | XYCoord PCSToXY(); 24 | 25 | XYZCoord PCSToXYZ(); 26 | 27 | std::string IlluminantToString(const Illuminant illuminant); 28 | Illuminant IlluminantFromString(const std::string& illuminant); 29 | float IlluminantToTemperature(const Illuminant illuminant); 30 | } 31 | } 32 | 33 | #endif /* Color_hpp */ 34 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/round_filter_center_focus_24.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/java/com/motioncam/ConvertVideoActivity.java: -------------------------------------------------------------------------------- 1 | package com.motioncam; 2 | 3 | import android.os.Bundle; 4 | 5 | import androidx.appcompat.app.AppCompatActivity; 6 | 7 | import com.motioncam.ui.ConvertVideoFragment; 8 | 9 | public class ConvertVideoActivity extends AppCompatActivity { 10 | static { 11 | System.loadLibrary("native-camera-host"); 12 | } 13 | 14 | @Override 15 | protected void onCreate(Bundle savedInstanceState) { 16 | super.onCreate(savedInstanceState); 17 | setContentView(R.layout.convert_video_activity); 18 | 19 | if (savedInstanceState == null) { 20 | ConvertVideoFragment fragment = ConvertVideoFragment.newInstance(); 21 | 22 | getSupportFragmentManager() 23 | .beginTransaction() 24 | .replace(R.id.container, fragment) 25 | .commitNow(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /libMotionCam/thirdparty/dng_sdk/dng/dng_point.cpp: -------------------------------------------------------------------------------- 1 | /*****************************************************************************/ 2 | // Copyright 2006 Adobe Systems Incorporated 3 | // All Rights Reserved. 4 | // 5 | // NOTICE: Adobe permits you to use, modify, and distribute this file in 6 | // accordance with the terms of the Adobe license agreement accompanying it. 7 | /*****************************************************************************/ 8 | 9 | /* $Id: //mondo/dng_sdk_1_4/dng_sdk/source/dng_point.cpp#1 $ */ 10 | /* $DateTime: 2012/05/30 13:28:51 $ */ 11 | /* $Change: 832332 $ */ 12 | /* $Author: tknoll $ */ 13 | 14 | /*****************************************************************************/ 15 | 16 | #include "dng_point.h" 17 | 18 | /*****************************************************************************/ 19 | 20 | // Currently all inlined. 21 | 22 | /*****************************************************************************/ 23 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/layout/preview_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 17 | 18 | 25 | 26 | -------------------------------------------------------------------------------- /MotionCam-Android/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 22 | 23 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/java/com/motioncam/worker/State.java: -------------------------------------------------------------------------------- 1 | package com.motioncam.worker; 2 | 3 | public class State { 4 | public static final String PROGRESS_MODE_KEY = "mode"; 5 | public static final String PROGRESS_STATE_KEY = "state"; 6 | public static final String PROGRESS_PROGRESS_KEY = "progress"; 7 | public static final String PROGRESS_DELETED = "isDeleted"; 8 | public static final String PROGRESS_ERROR_KEY = "errorMessage"; 9 | public static final String PROGRESS_URI_KEY = "uri"; 10 | public static final String PROGRESS_NAME_KEY = "name"; 11 | public static final String PROGRESS_IMAGE_PATH = "imagePath"; 12 | public static final String PROGRESS_PREVIEW_PATH = "previewPath"; 13 | 14 | public static final int STATE_PREVIEW_CREATED = 1000; 15 | public static final int STATE_PROCESSING = 1001; 16 | public static final int STATE_COMPLETED = 1002; 17 | public static final int STATE_ERROR = 1003; 18 | } 19 | -------------------------------------------------------------------------------- /libMotionCam/thirdparty/dng_sdk/dng/dng_globals.cpp: -------------------------------------------------------------------------------- 1 | /*****************************************************************************/ 2 | // Copyright 2006 Adobe Systems Incorporated 3 | // All Rights Reserved. 4 | // 5 | // NOTICE: Adobe permits you to use, modify, and distribute this file in 6 | // accordance with the terms of the Adobe license agreement accompanying it. 7 | /*****************************************************************************/ 8 | 9 | /* $Id: //mondo/dng_sdk_1_4/dng_sdk/source/dng_globals.cpp#1 $ */ 10 | /* $DateTime: 2012/05/30 13:28:51 $ */ 11 | /* $Change: 832332 $ */ 12 | /* $Author: tknoll $ */ 13 | 14 | /*****************************************************************************/ 15 | 16 | #include "dng_globals.h" 17 | 18 | /*****************************************************************************/ 19 | 20 | #if qDNGValidate 21 | 22 | bool gVerbose = false; 23 | 24 | uint32 gDumpLineLimit = 100; 25 | 26 | #endif 27 | 28 | /*****************************************************************************/ 29 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/cpp/camera/CameraSessionState.h: -------------------------------------------------------------------------------- 1 | #ifndef MOTIONCAM_ANDROID_CAMERASESSIONSTATE_H 2 | #define MOTIONCAM_ANDROID_CAMERASESSIONSTATE_H 3 | 4 | namespace motioncam { 5 | enum class CameraCaptureSessionState : int { 6 | READY = 0, 7 | ACTIVE, 8 | CLOSED 9 | }; 10 | 11 | enum class CameraMode : int { 12 | AUTO, 13 | AUTO_USER_REGION, 14 | MANUAL 15 | }; 16 | 17 | enum class CaptureEvent : int { 18 | REPEAT = 0, 19 | HDR_CAPTURE 20 | }; 21 | 22 | enum class CameraFocusState : int { 23 | INACTIVE = 0, 24 | PASSIVE_SCAN, 25 | PASSIVE_FOCUSED, 26 | ACTIVE_SCAN, 27 | FOCUS_LOCKED, 28 | NOT_FOCUS_LOCKED, 29 | PASSIVE_UNFOCUSED 30 | }; 31 | 32 | enum class CameraExposureState : int { 33 | INACTIVE = 0, 34 | SEARCHING, 35 | CONVERGED, 36 | LOCKED, 37 | FLASH_REQUIRED, 38 | PRECAPTURE 39 | }; 40 | } 41 | 42 | #endif //MOTIONCAM_ANDROID_CAMERASESSIONSTATE_H 43 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/cpp/AudioRecorder.h: -------------------------------------------------------------------------------- 1 | #ifndef MOTIONCAM_ANDROID_AUDIORECORDER_H 2 | #define MOTIONCAM_ANDROID_AUDIORECORDER_H 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | class AudioRecorder : public motioncam::AudioInterface, public oboe::AudioStreamDataCallback { 10 | public: 11 | AudioRecorder(int audioDeviceId); 12 | ~AudioRecorder(); 13 | 14 | bool start(const int sampleRateHz, const int channels); 15 | void stop(); 16 | 17 | int getSampleRate() const; 18 | int getChannels() const; 19 | const std::vector& getAudioData(uint32_t& outNumFrames) const; 20 | 21 | private: 22 | void destroy(); 23 | 24 | oboe::DataCallbackResult onAudioReady(oboe::AudioStream *audioStream, void *audioData, int32_t numFrames); 25 | 26 | private: 27 | std::shared_ptr mActiveAudioStream; 28 | std::atomic mRunning; 29 | std::vector mAudioData; 30 | size_t mAudioDataOffset; 31 | int mSampleRate; 32 | int mChannelCount; 33 | int mAudioDeviceId; 34 | }; 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /libMotionCam/thirdparty/json11/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Dropbox, Inc. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /libMotionCam/thirdparty/opencl/CL/opencl.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2008-2020 The Khronos Group Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | ******************************************************************************/ 16 | 17 | #ifndef __OPENCL_H 18 | #define __OPENCL_H 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | 33 | #endif /* __OPENCL_H */ 34 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/progress_circular.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 15 | 16 | 21 | 22 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /libMotionCam/thirdparty/atomic_queue/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Maxim Egorushkin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /libMotionCam/libMotionCam/include/motioncam/RawEncoder.h: -------------------------------------------------------------------------------- 1 | #ifndef RawEncoder_h 2 | #define RawEncoder_h 3 | 4 | #include 5 | #include 6 | 7 | namespace motioncam { 8 | namespace encoder { 9 | enum PixelFormat { 10 | ANDROID_RAW10 = 0, 11 | ANDROID_RAW12, 12 | ANDROID_RAW16 13 | }; 14 | 15 | size_t encode(uint8_t* data, 16 | PixelFormat pixelFormat, 17 | const int xstart, 18 | const int xend, 19 | const int ystart, 20 | const int yend, 21 | const int rowStride); 22 | 23 | size_t encodeAndBin(uint8_t* data, 24 | PixelFormat pixelFormat, 25 | const int xstart, 26 | const int xend, 27 | const int ystart, 28 | const int yend, 29 | const int rowStride); 30 | 31 | size_t decode(uint16_t* output, const int width, const int height, const uint8_t* input, const size_t len); 32 | } 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /libMotionCam/libMotionCam/include/motioncam/Types.h: -------------------------------------------------------------------------------- 1 | #ifndef Types_h 2 | #define Types_h 3 | 4 | #include 5 | 6 | namespace motioncam { 7 | typedef cv::Vec2f XYCoord; 8 | typedef cv::Vec3f XYZCoord; 9 | 10 | enum class ColorFilterArrangment : int { 11 | RGGB = 0, 12 | GRBG, 13 | GBRG, 14 | BGGR, 15 | RGB, 16 | MONO, 17 | INVALID 18 | }; 19 | 20 | // This needs to match the generator input 21 | enum class PixelFormat : int { 22 | RAW10 = 0, 23 | RAW12, 24 | RAW16, 25 | YUV_420_888, 26 | INVALID 27 | }; 28 | 29 | enum class ScreenOrientation : int { 30 | PORTRAIT = 0, 31 | REVERSE_PORTRAIT, 32 | LANDSCAPE, 33 | REVERSE_LANDSCAPE, 34 | INVALID 35 | }; 36 | 37 | enum class RawType : int { 38 | ZSL, 39 | HDR, 40 | INVALID 41 | }; 42 | 43 | enum class CompressionType : int { 44 | UNCOMPRESSED, 45 | ZSTD, 46 | V8NZENC, 47 | P4NZENC, 48 | BITNZPACK, 49 | BITNZPACK_2, 50 | MOTIONCAM, 51 | INVALID 52 | }; 53 | } 54 | 55 | #endif /* Types_h */ 56 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/cpp/camera/CameraSessionListener.h: -------------------------------------------------------------------------------- 1 | #ifndef MOTIONCAM_ANDROID_CAMERASESSIONLISTENER_H 2 | #define MOTIONCAM_ANDROID_CAMERASESSIONLISTENER_H 3 | 4 | #include "CameraSession.h" 5 | #include 6 | 7 | namespace motioncam { 8 | 9 | class CameraSessionListener { 10 | public: 11 | virtual void onCameraStateChanged(const CameraCaptureSessionState state) = 0; 12 | virtual void onCameraStarted() = 0; 13 | virtual void onCameraDisconnected() = 0; 14 | virtual void onCameraError(const int error) = 0; 15 | virtual void onCameraExposureStatus(const int32_t iso, const int64_t exposureTime) = 0; 16 | virtual void onCameraAutoFocusStateChanged(const CameraFocusState state, const float focusDistance) = 0; 17 | virtual void onCameraAutoExposureStateChanged(const CameraExposureState state) = 0; 18 | virtual void onCameraHdrImageCaptureProgress(int progress) = 0; 19 | virtual void onCameraHdrImageCaptureCompleted() = 0; 20 | virtual void onCameraHdrImageCaptureFailed() = 0; 21 | virtual void onMemoryAdjusting() = 0; 22 | virtual void onMemoryStable() = 0; 23 | }; 24 | } 25 | 26 | #endif //MOTIONCAM_ANDROID_CAMERASESSIONLISTENER_H 27 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/round_settings_24.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #007ea7 4 | #003459 5 | #00a8e8 6 | 7 | #00171f 8 | #000000 9 | 10 | #ffffff 11 | #bfc0c0 12 | #ffffff 13 | 14 | #000000 15 | #FF0000 16 | #AA000000 17 | #ffffff 18 | #bfc0c0 19 | #888888 20 | 21 | #40FFFFFF 22 | 23 | #ac0c0c 24 | #207561 25 | 26 | #45565c 27 | 28 | #FFC20A 29 | #0C7BDC 30 | 31 | #FFFFFF 32 | #FFC20A 33 | 34 | -------------------------------------------------------------------------------- /libMotionCam/thirdparty/miniz/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2013-2014 RAD Game Tools and Valve Software 2 | Copyright 2010-2014 Rich Geldreich and Tenacious Software LLC 3 | 4 | All Rights Reserved. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/cpp/camera/NativeClBuffer.h: -------------------------------------------------------------------------------- 1 | #ifndef MOTIONCAM_ANDROID_NATIVECLBUFFER_H 2 | #define MOTIONCAM_ANDROID_NATIVECLBUFFER_H 3 | 4 | #ifdef GPU_CAMERA_PREVIEW 5 | 6 | #include 7 | 8 | #ifdef __ANDROID__ 9 | #define CL_TARGET_OPENCL_VERSION 120 10 | #include 11 | #else 12 | #include 13 | #endif 14 | 15 | namespace motioncam { 16 | class NativeClBuffer : public NativeBuffer { 17 | public: 18 | NativeClBuffer(size_t bufferLength); 19 | ~NativeClBuffer(); 20 | 21 | uint8_t* lock(bool write); 22 | void unlock(); 23 | 24 | uint64_t nativeHandle(); 25 | 26 | size_t len(); 27 | void allocate(size_t len); 28 | 29 | const std::vector& hostData(); 30 | void copyHostData(const std::vector& other); 31 | 32 | std::unique_ptr clone(); 33 | 34 | void shrink(size_t newSize); 35 | 36 | void release(); 37 | 38 | private: 39 | size_t mBufferLength; 40 | cl_mem mClBuffer; 41 | void* mLockedBuffer; 42 | std::vector mHostBuffer; 43 | }; 44 | } 45 | 46 | #endif //GPU_CAMERA_PREVIEW 47 | 48 | #endif //MOTIONCAM_ANDROID_NATIVECLBUFFER_H 49 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/java/com/motioncam/camera/CameraStartupSettings.java: -------------------------------------------------------------------------------- 1 | package com.motioncam.camera; 2 | 3 | public class CameraStartupSettings { 4 | public boolean useUserExposureSettings; 5 | public int iso; 6 | public long exposureTime; 7 | public int frameRate; 8 | public boolean ois; 9 | public boolean focusForVideo; 10 | 11 | public CameraStartupSettings( 12 | boolean useUserExposureSettings, 13 | int iso, 14 | long exposureTime, 15 | int frameRate, 16 | boolean ois, 17 | boolean focusForVideo) 18 | { 19 | this.useUserExposureSettings = useUserExposureSettings; 20 | this.iso = iso; 21 | this.exposureTime = exposureTime; 22 | this.frameRate = frameRate; 23 | this.ois = ois; 24 | this.focusForVideo = focusForVideo; 25 | } 26 | 27 | @Override 28 | public String toString() { 29 | return "CameraStartupSettings{" + 30 | "useUserExposureSettings=" + useUserExposureSettings + 31 | ", iso=" + iso + 32 | ", exposureTime=" + exposureTime + 33 | ", frameRate=" + frameRate + 34 | ", ois=" + ois + 35 | ", focusForVideo=" + focusForVideo + 36 | '}'; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/java/com/motioncam/DenoiseSettings.java: -------------------------------------------------------------------------------- 1 | package com.motioncam; 2 | 3 | public class DenoiseSettings { 4 | public int numMergeImages; 5 | 6 | @Override 7 | public String toString() { 8 | return "DenoiseSettings{" + 9 | "numMergeImages=" + numMergeImages + 10 | '}'; 11 | } 12 | 13 | private void estimateFromExposure(float ev, float shadows) { 14 | int mergeImages; 15 | 16 | if(ev > 7.99) { 17 | mergeImages = 4; 18 | } 19 | else if(ev > 5.99) { 20 | mergeImages = 6; 21 | } 22 | else if(ev > 3.99) { 23 | mergeImages = 8; 24 | } 25 | else if(ev > 0) { 26 | mergeImages = 12; 27 | } 28 | else { 29 | mergeImages = 12; 30 | } 31 | 32 | if(shadows > 7.99) { 33 | mergeImages += 4; 34 | } 35 | 36 | if(shadows > 15.99) { 37 | mergeImages += 2; 38 | } 39 | 40 | this.numMergeImages = Math.min(12, mergeImages); 41 | } 42 | 43 | public DenoiseSettings(float noiseProfile, float ev, float shadows) { 44 | estimateFromExposure(ev, shadows); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/layout/camera_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 16 | 17 | 28 | 29 | -------------------------------------------------------------------------------- /libMotionCam/thirdparty/dng_sdk/dng/dng_fast_module.h: -------------------------------------------------------------------------------- 1 | /*****************************************************************************/ 2 | // Copyright 2006-2007 Adobe Systems Incorporated 3 | // All Rights Reserved. 4 | // 5 | // NOTICE: Adobe permits you to use, modify, and distribute this file in 6 | // accordance with the terms of the Adobe license agreement accompanying it. 7 | /*****************************************************************************/ 8 | 9 | /* $Id: //mondo/dng_sdk_1_4/dng_sdk/source/dng_fast_module.h#1 $ */ 10 | /* $DateTime: 2012/05/30 13:28:51 $ */ 11 | /* $Change: 832332 $ */ 12 | /* $Author: tknoll $ */ 13 | 14 | /** \file 15 | * Include file to set optimization to highest level for performance-critical routines. 16 | * Normal files should have otpimization set to normal level to save code size as there is less 17 | * cache pollution this way. 18 | */ 19 | 20 | /*****************************************************************************/ 21 | 22 | // Include this file in modules that contain routines that should be as fast 23 | // as possible, even at the expense of slight code size increases. 24 | 25 | /*****************************************************************************/ 26 | 27 | #ifdef _MSC_VER 28 | #pragma optimize ("t", on) 29 | #endif 30 | 31 | /*****************************************************************************/ 32 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/cpp/NativeCameraBridgeListener.h: -------------------------------------------------------------------------------- 1 | #ifndef MOTIONCAM_ANDROID_NATIVECAMERABRIDGELISTENER_H 2 | #define MOTIONCAM_ANDROID_NATIVECAMERABRIDGELISTENER_H 3 | 4 | #include 5 | #include "camera/CameraSessionListener.h" 6 | 7 | namespace motioncam { 8 | class NativeCameraBridgeListener : public CameraSessionListener { 9 | public: 10 | NativeCameraBridgeListener(JNIEnv *env, jobject listener); 11 | ~NativeCameraBridgeListener(); 12 | 13 | void onCameraStateChanged(const CameraCaptureSessionState state); 14 | void onCameraError(int error); 15 | void onCameraStarted(); 16 | void onCameraDisconnected(); 17 | void onCameraExposureStatus(const int32_t iso, const int64_t exposureTime); 18 | void onCameraAutoFocusStateChanged(const CameraFocusState state, const float focusDistance); 19 | void onCameraAutoExposureStateChanged(const CameraExposureState state); 20 | void onCameraHdrImageCaptureProgress(int progress); 21 | void onCameraHdrImageCaptureCompleted(); 22 | void onCameraHdrImageCaptureFailed(); 23 | void onMemoryAdjusting(); 24 | void onMemoryStable(); 25 | 26 | private: 27 | JavaVM *mJavaVm; 28 | jobject mListenerInstance; 29 | jclass mListenerClass; 30 | }; 31 | } 32 | 33 | #endif //MOTIONCAM_ANDROID_NATIVECAMERABRIDGELISTENER_H 34 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/cpp/camera/ClHelper.h: -------------------------------------------------------------------------------- 1 | #ifndef MOTIONCAM_ANDROID_CLHELPER_H 2 | #define MOTIONCAM_ANDROID_CLHELPER_H 3 | 4 | #include 5 | 6 | #ifdef GPU_CAMERA_PREVIEW 7 | 8 | #ifdef __ANDROID__ 9 | #define CL_TARGET_OPENCL_VERSION 120 10 | #include 11 | #else 12 | #include 13 | #endif 14 | 15 | namespace motioncam { 16 | int CL_acquire(cl_context *ctx, cl_command_queue *q, bool create = true); 17 | int CL_release(); 18 | 19 | cl_mem CL_createBuffer(cl_context context, cl_mem_flags flags, size_t size, void* hostPtr, cl_int* errCode); 20 | cl_int CL_releaseMemObject(cl_mem mem); 21 | 22 | void* CL_enqueueMapBuffer( 23 | cl_command_queue command_queue, 24 | cl_mem buffer, 25 | cl_bool blocking_map, 26 | cl_map_flags map_flags, 27 | size_t offset, 28 | size_t size, 29 | cl_uint num_events_in_wait_list, 30 | const cl_event* event_wait_list, 31 | cl_event* event, 32 | cl_int* errcode_ret); 33 | 34 | cl_int CL_enqueueUnmapMemObject( 35 | cl_command_queue command_queue, 36 | cl_mem memobj, 37 | void* mapped_ptr, 38 | cl_uint num_events_in_wait_list, 39 | const cl_event* event_wait_list, 40 | cl_event* event); 41 | } 42 | 43 | #endif 44 | 45 | #endif //MOTIONCAM_ANDROID_CLHELPER_H 46 | -------------------------------------------------------------------------------- /libMotionCam/thirdparty/opencl/CL/cl_gl_ext.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2008-2020 The Khronos Group Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | ******************************************************************************/ 16 | 17 | #ifndef __OPENCL_CL_GL_EXT_H 18 | #define __OPENCL_CL_GL_EXT_H 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | #include 25 | 26 | /* 27 | * cl_khr_gl_event extension 28 | */ 29 | #define CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR 0x200D 30 | 31 | extern CL_API_ENTRY cl_event CL_API_CALL 32 | clCreateEventFromGLsyncKHR(cl_context context, 33 | cl_GLsync cl_GLsync, 34 | cl_int * errcode_ret) CL_EXT_SUFFIX__VERSION_1_1; 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | 40 | #endif /* __OPENCL_CL_GL_EXT_H */ 41 | -------------------------------------------------------------------------------- /libMotionCam/thirdparty/dng_sdk/dng/dng_uncopyable.h: -------------------------------------------------------------------------------- 1 | /*****************************************************************************/ 2 | // Copyright 2012 Adobe Systems Incorporated 3 | // All Rights Reserved. 4 | // 5 | // NOTICE: Adobe permits you to use, modify, and distribute this file in 6 | // accordance with the terms of the Adobe license agreement accompanying it. 7 | /*****************************************************************************/ 8 | 9 | /* $Id: //mondo/dng_sdk_1_4/dng_sdk/source/dng_uncopyable.h#1 $ */ 10 | /* $DateTime: 2012/09/05 12:31:51 $ */ 11 | /* $Change: 847652 $ */ 12 | /* $Author: tknoll $ */ 13 | 14 | /*****************************************************************************/ 15 | 16 | #ifndef __dng_uncopyable__ 17 | #define __dng_uncopyable__ 18 | 19 | /*****************************************************************************/ 20 | 21 | // Virtual base class to prevent object copies. 22 | 23 | class dng_uncopyable 24 | { 25 | 26 | protected: 27 | 28 | dng_uncopyable () 29 | { 30 | } 31 | 32 | ~dng_uncopyable () 33 | { 34 | } 35 | 36 | private: 37 | 38 | dng_uncopyable (const dng_uncopyable &); 39 | 40 | dng_uncopyable & operator= (const dng_uncopyable &); 41 | 42 | }; 43 | 44 | /*****************************************************************************/ 45 | 46 | #endif // __dng_uncopyable__ 47 | 48 | /*****************************************************************************/ 49 | -------------------------------------------------------------------------------- /libMotionCam/thirdparty/atomic_queue/atomic_queue/barrier.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4 -*- */ 2 | #ifndef BARRIER_H_INCLUDED 3 | #define BARRIER_H_INCLUDED 4 | 5 | // Copyright (c) 2019 Maxim Egorushkin. MIT License. See the full licence in file LICENSE. 6 | 7 | #include "defs.h" 8 | 9 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 10 | 11 | namespace atomic_queue { 12 | 13 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 14 | 15 | class Barrier { 16 | std::atomic counter_ = {}; 17 | 18 | public: 19 | void wait() noexcept { 20 | counter_.fetch_add(1, std::memory_order_acquire); 21 | while(counter_.load(std::memory_order_relaxed)) 22 | spin_loop_pause(); 23 | } 24 | 25 | void release(unsigned expected_counter) noexcept { 26 | while(expected_counter != counter_.load(std::memory_order_relaxed)) 27 | spin_loop_pause(); 28 | counter_.store(0, std::memory_order_release); 29 | } 30 | }; 31 | 32 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 33 | 34 | } // namespace atomic_queue 35 | 36 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 37 | 38 | #endif // BARRIER_H_INCLUDED 39 | -------------------------------------------------------------------------------- /libMotionCam/libMotionCam/include/motioncam/RawImageBuffer.h: -------------------------------------------------------------------------------- 1 | #ifndef RawImageBuffer_h 2 | #define RawImageBuffer_h 3 | 4 | #include "motioncam/Types.h" 5 | #include "motioncam/NativeBuffer.h" 6 | #include "motioncam/RawImageMetadata.h" 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | namespace motioncam { 13 | struct RawImageBuffer { 14 | 15 | RawImageBuffer(); 16 | RawImageBuffer(const json11::Json metadata); 17 | 18 | RawImageBuffer(std::unique_ptr buffer); 19 | RawImageBuffer(const RawImageBuffer& other); 20 | RawImageBuffer(RawImageBuffer&& other) noexcept; 21 | 22 | RawImageBuffer& operator=(const RawImageBuffer &obj); 23 | 24 | void shallowCopy(const RawImageBuffer &obj); 25 | 26 | std::unique_ptr data; 27 | RawImageMetadata metadata; 28 | PixelFormat pixelFormat; 29 | int width; 30 | int height; 31 | int originalWidth; 32 | int originalHeight; 33 | bool isBinned; 34 | int rowStride; 35 | bool isCompressed; 36 | CompressionType compressionType; 37 | uint64_t offset; 38 | 39 | void toJson(json11::Json::object& metadataJson) const; 40 | 41 | static std::vector GetLensShadingMap(const json11::Json& obj); 42 | 43 | private: 44 | void parse(const json11::Json& metadata); 45 | }; 46 | } 47 | 48 | #endif /* RawImageBuffer_h */ 49 | -------------------------------------------------------------------------------- /libMotionCam/thirdparty/dng_sdk/dng/dng_tag_types.h: -------------------------------------------------------------------------------- 1 | /*****************************************************************************/ 2 | // Copyright 2006 Adobe Systems Incorporated 3 | // All Rights Reserved. 4 | // 5 | // NOTICE: Adobe permits you to use, modify, and distribute this file in 6 | // accordance with the terms of the Adobe license agreement accompanying it. 7 | /*****************************************************************************/ 8 | 9 | /* $Id: //mondo/dng_sdk_1_4/dng_sdk/source/dng_tag_types.h#1 $ */ 10 | /* $DateTime: 2012/05/30 13:28:51 $ */ 11 | /* $Change: 832332 $ */ 12 | /* $Author: tknoll $ */ 13 | 14 | /*****************************************************************************/ 15 | 16 | #ifndef __dng_tag_types__ 17 | #define __dng_tag_types__ 18 | 19 | /*****************************************************************************/ 20 | 21 | #include "dng_types.h" 22 | 23 | /*****************************************************************************/ 24 | 25 | enum 26 | { 27 | ttByte = 1, 28 | ttAscii, 29 | ttShort, 30 | ttLong, 31 | ttRational, 32 | ttSByte, 33 | ttUndefined, 34 | ttSShort, 35 | ttSLong, 36 | ttSRational, 37 | ttFloat, 38 | ttDouble, 39 | ttIFD, 40 | ttUnicode, 41 | ttComplex 42 | }; 43 | 44 | /*****************************************************************************/ 45 | 46 | uint32 TagTypeSize (uint32 tagType); 47 | 48 | /*****************************************************************************/ 49 | 50 | #endif 51 | 52 | /*****************************************************************************/ 53 | -------------------------------------------------------------------------------- /libMotionCam/thirdparty/dng_sdk/dng/dng_tag_types.cpp: -------------------------------------------------------------------------------- 1 | /*****************************************************************************/ 2 | // Copyright 2006 Adobe Systems Incorporated 3 | // All Rights Reserved. 4 | // 5 | // NOTICE: Adobe permits you to use, modify, and distribute this file in 6 | // accordance with the terms of the Adobe license agreement accompanying it. 7 | /*****************************************************************************/ 8 | 9 | /* $Id: //mondo/dng_sdk_1_4/dng_sdk/source/dng_tag_types.cpp#1 $ */ 10 | /* $DateTime: 2012/05/30 13:28:51 $ */ 11 | /* $Change: 832332 $ */ 12 | /* $Author: tknoll $ */ 13 | 14 | /*****************************************************************************/ 15 | 16 | #include "dng_tag_types.h" 17 | 18 | /*****************************************************************************/ 19 | 20 | uint32 TagTypeSize (uint32 tagType) 21 | { 22 | 23 | switch (tagType) 24 | { 25 | 26 | case ttByte: 27 | case ttAscii: 28 | case ttSByte: 29 | case ttUndefined: 30 | { 31 | return 1; 32 | } 33 | 34 | case ttShort: 35 | case ttSShort: 36 | case ttUnicode: 37 | { 38 | return 2; 39 | } 40 | 41 | case ttLong: 42 | case ttSLong: 43 | case ttFloat: 44 | case ttIFD: 45 | { 46 | return 4; 47 | } 48 | 49 | case ttRational: 50 | case ttDouble: 51 | case ttSRational: 52 | case ttComplex: 53 | { 54 | return 8; 55 | } 56 | 57 | default: 58 | break; 59 | 60 | } 61 | 62 | return 0; 63 | 64 | } 65 | 66 | /*****************************************************************************/ 67 | -------------------------------------------------------------------------------- /MotionCam-Android/.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | 24 | 25 | 29 | 30 | 34 | 35 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/drawable/round_shutter_speed_24.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /libMotionCam/libMotionCam/include/motioncam/CameraPreview.h: -------------------------------------------------------------------------------- 1 | #ifndef CameraPreview_hpp 2 | #define CameraPreview_hpp 3 | 4 | #include 5 | 6 | namespace motioncam { 7 | struct RawCameraMetadata; 8 | struct RawImageBuffer; 9 | 10 | class CameraPreview { 11 | public: 12 | static void generate(const RawImageBuffer& rawBuffer, 13 | const RawCameraMetadata& cameraMetadata, 14 | const int downscaleFactor, 15 | const float shadingMapCorrection, 16 | Halide::Runtime::Buffer& inputBuffer, 17 | Halide::Runtime::Buffer& outputBuffer); 18 | 19 | static void generate(const RawImageBuffer& rawBuffer, 20 | const RawCameraMetadata& cameraMetadata, 21 | const int downscaleFactor, 22 | const float shadingMapCorrection, 23 | const bool flipped, 24 | const float shadows, 25 | const float contrast, 26 | const float saturation, 27 | const float blacks, 28 | const float whitePoint, 29 | const float temperatureOffset, 30 | const float tintOffset, 31 | const float tonemapVariance, 32 | Halide::Runtime::Buffer& inputBuffer, 33 | Halide::Runtime::Buffer& outputBuffer); 34 | }; 35 | } 36 | 37 | #endif /* CameraPreview_hpp */ 38 | -------------------------------------------------------------------------------- /libMotionCam/libMotionCam/include/motioncam/RawCameraMetadata.h: -------------------------------------------------------------------------------- 1 | #ifndef RawCameraMetadata_h 2 | #define RawCameraMetadata_h 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "motioncam/Types.h" 9 | #include "motioncam/Color.h" 10 | 11 | 12 | namespace motioncam { 13 | struct RawImageMetadata; 14 | 15 | struct RawCameraMetadata { 16 | RawCameraMetadata(const json11::Json& json); 17 | RawCameraMetadata(); 18 | 19 | ColorFilterArrangment sensorArrangment; 20 | 21 | cv::Mat colorMatrix1; 22 | cv::Mat colorMatrix2; 23 | 24 | cv::Mat calibrationMatrix1; 25 | cv::Mat calibrationMatrix2; 26 | 27 | cv::Mat forwardMatrix1; 28 | cv::Mat forwardMatrix2; 29 | 30 | color::Illuminant colorIlluminant1; 31 | color::Illuminant colorIlluminant2; 32 | 33 | std::vector apertures; 34 | std::vector focalLengths; 35 | 36 | const std::vector& getBlackLevel(const RawImageMetadata& bufferMetadata) const; 37 | const std::vector& getBlackLevel() const; 38 | 39 | const float getWhiteLevel(const RawImageMetadata& bufferMetadata) const; 40 | const float getWhiteLevel() const; 41 | 42 | void updateBayerOffsets(const std::vector& blackLevel, const float whiteLevel); 43 | void toJson(json11::Json::object& metadataJson); 44 | 45 | private: 46 | void parse(const json11::Json& metadata); 47 | 48 | float whiteLevel; 49 | std::vector blackLevel; 50 | }; 51 | } 52 | 53 | #endif /* RawCameraMetadata_h */ 54 | -------------------------------------------------------------------------------- /libMotionCam/thirdparty/dng_sdk/dng/dng_globals.h: -------------------------------------------------------------------------------- 1 | /*****************************************************************************/ 2 | // Copyright 2006 Adobe Systems Incorporated 3 | // All Rights Reserved. 4 | // 5 | // NOTICE: Adobe permits you to use, modify, and distribute this file in 6 | // accordance with the terms of the Adobe license agreement accompanying it. 7 | /*****************************************************************************/ 8 | 9 | /* $Id: //mondo/dng_sdk_1_4/dng_sdk/source/dng_globals.h#1 $ */ 10 | /* $DateTime: 2012/05/30 13:28:51 $ */ 11 | /* $Change: 832332 $ */ 12 | /* $Author: tknoll $ */ 13 | 14 | /** \file 15 | * Definitions of global variables controling DNG SDK behavior. Currenntly only used for validation control. 16 | */ 17 | 18 | /*****************************************************************************/ 19 | 20 | #ifndef __dng_globals__ 21 | #define __dng_globals__ 22 | 23 | /*****************************************************************************/ 24 | 25 | #include "dng_flags.h" 26 | #include "dng_types.h" 27 | 28 | /*****************************************************************************/ 29 | 30 | #if qDNGValidate 31 | 32 | /// When validation (qValidate) is turned on, this globale enables verbose output about DNG tags and other properties. 33 | 34 | extern bool gVerbose; 35 | 36 | /// When validation (qValidate) is turned on, and verbose mode (gVerbose) is enabled, limits the number of lines of text that are dumped for each tag. 37 | 38 | extern uint32 gDumpLineLimit; 39 | 40 | #endif 41 | 42 | /*****************************************************************************/ 43 | 44 | #endif 45 | 46 | /*****************************************************************************/ 47 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/java/com/motioncam/CameraOverlayTask.java: -------------------------------------------------------------------------------- 1 | package com.motioncam; 2 | 3 | import android.app.Activity; 4 | import android.graphics.Bitmap; 5 | 6 | import com.motioncam.camera.NativeCamera; 7 | import com.motioncam.databinding.CameraActivityBinding; 8 | 9 | import java.util.TimerTask; 10 | 11 | class CameraOverlayTask extends TimerTask { 12 | private final CameraActivityBinding mBinding; 13 | private final NativeCamera mNativeCamera; 14 | private final Activity mActivity; 15 | 16 | private Bitmap mWhiteLevel = null; 17 | private Bitmap mBlackLevel = null; 18 | 19 | // TODO: Move this 20 | final int TYPE_WHITE_LEVEL = 1; 21 | final int TYPE_BLACK_LEVEL = 2; 22 | 23 | public CameraOverlayTask(NativeCamera nativeCamera, CameraActivityBinding binding, Activity activity) { 24 | mNativeCamera = nativeCamera; 25 | mBinding = binding; 26 | mActivity = activity; 27 | } 28 | 29 | @Override 30 | public void run() { 31 | mNativeCamera.generateStats((width, height, type) -> { 32 | if (type == TYPE_WHITE_LEVEL) { 33 | if (mWhiteLevel == null) 34 | mWhiteLevel = Bitmap.createBitmap(width, height, Bitmap.Config.ALPHA_8); 35 | return mWhiteLevel; 36 | } else if (type == TYPE_BLACK_LEVEL) { 37 | if (mBlackLevel == null) 38 | mBlackLevel = Bitmap.createBitmap(width, height, Bitmap.Config.ALPHA_8); 39 | return mBlackLevel; 40 | } 41 | return null; 42 | }); 43 | 44 | mActivity.runOnUiThread(() -> { 45 | mBinding.cameraOverlayClipLow.setImageBitmap(mBlackLevel); 46 | mBinding.cameraOverlayClipHigh.setImageBitmap(mWhiteLevel); 47 | }); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/java/com/motioncam/camera/NativeCameraInfo.java: -------------------------------------------------------------------------------- 1 | package com.motioncam.camera; 2 | 3 | import java.util.Arrays; 4 | 5 | public class NativeCameraInfo { 6 | public final String cameraId; 7 | public final boolean isFrontFacing; 8 | public final int exposureCompRangeMin; 9 | public final int exposureCompRangeMax; 10 | public final int exposureCompStepNumerator; 11 | public final int exposureCompStepDenominator; 12 | public final int[] fpsRange; 13 | 14 | public NativeCameraInfo( 15 | String cameraId, 16 | boolean isFrontFacing, 17 | int exposureCompRangeMin, 18 | int exposureCompRangeMax, 19 | int exposureCompStepNumerator, 20 | int exposureCompStepDenominator, 21 | int[] fpsRange) 22 | { 23 | this.cameraId = cameraId; 24 | this.isFrontFacing = isFrontFacing; 25 | this.exposureCompRangeMin = exposureCompRangeMin; 26 | this.exposureCompRangeMax = exposureCompRangeMax; 27 | this.exposureCompStepNumerator = exposureCompStepNumerator; 28 | this.exposureCompStepDenominator = exposureCompStepDenominator; 29 | this.fpsRange = fpsRange; 30 | } 31 | 32 | @Override 33 | public String toString() { 34 | return "NativeCameraInfo{" + 35 | "cameraId='" + cameraId + '\'' + 36 | ", isFrontFacing=" + isFrontFacing + 37 | ", exposureCompRangeMin=" + exposureCompRangeMin + 38 | ", exposureCompRangeMax=" + exposureCompRangeMax + 39 | ", exposureCompStepNumerator=" + exposureCompStepNumerator + 40 | ", exposureCompStepDenominator=" + exposureCompStepDenominator + 41 | ", fpsRange=" + Arrays.toString(fpsRange) + 42 | '}'; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /libMotionCam/thirdparty/dng_sdk/dng/dng_tone_curve.h: -------------------------------------------------------------------------------- 1 | /*****************************************************************************/ 2 | // Copyright 2007 Adobe Systems Incorporated 3 | // All Rights Reserved. 4 | // 5 | // NOTICE: Adobe permits you to use, modify, and distribute this file in 6 | // accordance with the terms of the Adobe license agreement accompanying it. 7 | /*****************************************************************************/ 8 | 9 | /* $Id: //mondo/dng_sdk_1_4/dng_sdk/source/dng_tone_curve.h#2 $ */ 10 | /* $DateTime: 2012/07/31 22:04:34 $ */ 11 | /* $Change: 840853 $ */ 12 | /* $Author: tknoll $ */ 13 | 14 | /** \file 15 | * Representation of 1-dimensional tone curve. 16 | */ 17 | 18 | /*****************************************************************************/ 19 | 20 | #ifndef __dng_tone_curve__ 21 | #define __dng_tone_curve__ 22 | 23 | /*****************************************************************************/ 24 | 25 | #include "dng_classes.h" 26 | #include "dng_memory.h" 27 | #include "dng_point.h" 28 | 29 | /*****************************************************************************/ 30 | 31 | class dng_tone_curve 32 | { 33 | 34 | public: 35 | 36 | dng_std_vector fCoord; 37 | 38 | public: 39 | 40 | dng_tone_curve (); 41 | 42 | bool operator== (const dng_tone_curve &curve) const; 43 | 44 | bool operator!= (const dng_tone_curve &curve) const 45 | { 46 | return !(*this == curve); 47 | } 48 | 49 | void SetNull (); 50 | 51 | bool IsNull () const; 52 | 53 | void SetInvalid (); 54 | 55 | bool IsValid () const; 56 | 57 | void Solve (dng_spline_solver &solver) const; 58 | 59 | }; 60 | 61 | /*****************************************************************************/ 62 | 63 | #endif 64 | 65 | /*****************************************************************************/ 66 | -------------------------------------------------------------------------------- /libMotionCam/libMotionCam/include/motioncam/Settings.h: -------------------------------------------------------------------------------- 1 | #ifndef Settings_h 2 | #define Settings_h 3 | 4 | #include 5 | #include 6 | 7 | namespace json11 { 8 | class Json; 9 | } 10 | 11 | namespace motioncam { 12 | float getSetting(const json11::Json& json, const std::string& key, const float defaultValue); 13 | int getSetting(const json11::Json& json, const std::string& key, const int defaultValue); 14 | bool getSetting(const json11::Json& json, const std::string& key, const bool defaultValue); 15 | std::string getSetting(const json11::Json& json, const std::string& key, const std::string& defaultValue); 16 | 17 | struct PostProcessSettings { 18 | // Denoising 19 | int spatialDenoiseLevel; 20 | 21 | // Post processing 22 | float temperature; 23 | float tint; 24 | 25 | float gamma; 26 | float tonemapVariance; 27 | float shadows; 28 | float whitePoint; 29 | float contrast; 30 | float brightness; 31 | float sharpen0; 32 | float sharpen1; 33 | float pop; 34 | float blacks; 35 | float exposure; 36 | float clippedLows; 37 | float clippedHighs; 38 | 39 | float noiseSigma; 40 | float sceneLuminance; 41 | 42 | float saturation; 43 | float blues; 44 | float greens; 45 | 46 | int jpegQuality; 47 | bool flipped; 48 | bool dng; 49 | 50 | float gpsLatitude; 51 | float gpsLongitude; 52 | float gpsAltitude; 53 | std::string gpsTime; 54 | 55 | std::string captureMode; 56 | 57 | PostProcessSettings(); 58 | PostProcessSettings(const json11::Json& json); 59 | 60 | void toJson(std::map& json) const; 61 | }; 62 | } 63 | 64 | #endif /* Settings_h */ 65 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/java/com/motioncam/processor/NativeProcessor.java: -------------------------------------------------------------------------------- 1 | package com.motioncam.processor; 2 | 3 | import java.util.Objects; 4 | 5 | public class NativeProcessor { 6 | static public void closeFd(int fd) { 7 | CloseFd(fd); 8 | } 9 | 10 | public boolean processInMemory(String outputPath, NativeProcessorProgressListener listener) { 11 | return ProcessInMemory(outputPath, listener); 12 | } 13 | 14 | public void processFile(String inputPath, String outputPath, NativeProcessorProgressListener listener) { 15 | ProcessFile(inputPath, outputPath, listener); 16 | } 17 | 18 | public void processRawVideo(int fds[], int numFramesToMerge, boolean correctVignette, NativeDngConverterListener listener) { 19 | Objects.requireNonNull(fds); 20 | 21 | ProcessRawVideo(fds, numFramesToMerge, correctVignette, listener); 22 | } 23 | 24 | public ContainerMetadata getRawVideoMetadata(int fds[]) { 25 | Objects.requireNonNull(fds); 26 | 27 | return GetRawVideoMetadata(fds); 28 | } 29 | 30 | public boolean generateRawVideoPreview(final int fd, int numPreviews, NativeBitmapListener listener) { 31 | return GenerateRawVideoPreview(fd, numPreviews, listener); 32 | } 33 | 34 | native boolean ProcessInMemory(String outputPath, NativeProcessorProgressListener progressListener); 35 | native boolean ProcessFile(String inputPath, String outputPath, NativeProcessorProgressListener progressListener); 36 | 37 | native boolean ProcessRawVideo(int fds[], int numFramesToMerge, boolean correctVignette, NativeDngConverterListener progressListener); 38 | native ContainerMetadata GetRawVideoMetadata(int fds[]); 39 | native boolean GenerateRawVideoPreview(int fd, int numPreviews, NativeBitmapListener listener); 40 | 41 | static native void CloseFd(int fd); 42 | 43 | native String GetLastError(); 44 | } 45 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/java/com/motioncam/camera/NativeCameraManager.java: -------------------------------------------------------------------------------- 1 | package com.motioncam.camera; 2 | 3 | import android.util.Size; 4 | 5 | import java.io.Closeable; 6 | import java.io.IOException; 7 | 8 | public class NativeCameraManager implements Closeable { 9 | public NativeCameraManager() { 10 | CreateCameraManager(); 11 | } 12 | 13 | @Override 14 | public void close() throws IOException { 15 | DestroyCameraManager(); 16 | } 17 | 18 | public NativeCameraInfo[] getSupportedCameras() { 19 | return GetSupportedCameras(); 20 | } 21 | 22 | public Size getRawConfigurationOutput(NativeCameraInfo cameraInfo) { 23 | Size rawOutput = GetRawOutputSize(cameraInfo.cameraId); 24 | if(rawOutput == null) { 25 | throw new NativeCamera.CameraException("Failed to get RAW output size"); 26 | } 27 | 28 | return rawOutput; 29 | } 30 | 31 | public Size getPreviewConfigurationOutput(NativeCameraInfo cameraInfo, Size captureSize, Size displaySize) { 32 | Size previewOutput = GetPreviewOutputSize(cameraInfo.cameraId, captureSize, displaySize); 33 | if(previewOutput == null) { 34 | throw new NativeCamera.CameraException("Failed to get preview output size"); 35 | } 36 | 37 | return previewOutput; 38 | } 39 | 40 | public NativeCameraMetadata getMetadata(NativeCameraInfo cameraInfo) { 41 | return GetMetadata(cameraInfo.cameraId); 42 | } 43 | 44 | private native void CreateCameraManager(); 45 | private native void DestroyCameraManager(); 46 | 47 | private native NativeCameraInfo[] GetSupportedCameras(); 48 | private native NativeCameraMetadata GetMetadata(String cameraId); 49 | private native Size GetRawOutputSize(String cameraId); 50 | private native Size GetPreviewOutputSize(String cameraId, Size captureSize, Size displaySize); 51 | } 52 | -------------------------------------------------------------------------------- /libMotionCam/libMotionCam/include/motioncam/CameraProfile.h: -------------------------------------------------------------------------------- 1 | #ifndef CameraProfile_hpp 2 | #define CameraProfile_hpp 3 | 4 | #include "motioncam/Types.h" 5 | 6 | #include 7 | 8 | namespace json11 { 9 | class Json; 10 | } 11 | 12 | namespace motioncam { 13 | struct RawCameraMetadata; 14 | struct RawImageMetadata; 15 | class Temperature; 16 | 17 | // 18 | // Most of this code is adapted from the Adobe DNG SDK 19 | // 20 | 21 | class CameraProfile { 22 | public: 23 | CameraProfile(const RawCameraMetadata& metadata, const RawImageMetadata& imageMetadata); 24 | 25 | void temperatureFromVector(const cv::Vec3f& asShotVector, Temperature& outTemperature); 26 | void cameraToPcs(const Temperature& temperature, cv::Mat& outPcsToCamera, cv::Mat& outCameraToPcs, cv::Vec3f& outCameraWhite) const; 27 | 28 | static void pcsToSrgb(cv::Mat& outPcsToSrgb, cv::Mat& outSrgbToPcs); 29 | 30 | void cameraToSrgb(cv::Mat& cameraToSrgb) const; 31 | 32 | private: 33 | static cv::Mat normalizeForwardMatrix(const cv::Mat& forwardMatrix); 34 | static cv::Mat normalizeColorMatrix(const cv::Mat& colorMatrix); 35 | 36 | XYCoord cameraNeutralToXy(const cv::Vec3f& cameraNeutralVector) const; 37 | cv::Mat findXyzToCamera(const XYCoord& white, cv::Mat* outForwardMatrix, cv::Mat* outCameraCalibration) const; 38 | 39 | static cv::Mat mapWhiteMatrix(const XYCoord& white1, const XYCoord& white2) ; 40 | 41 | private: 42 | cv::Mat mColorMatrix1; 43 | cv::Mat mColorMatrix2; 44 | 45 | cv::Mat mCameraCalibration1; 46 | cv::Mat mCameraCalibration2; 47 | 48 | float mColorTemperature1; 49 | float mColorTemperature2; 50 | 51 | cv::Mat mForwardMatrix1; 52 | cv::Mat mForwardMatrix2; 53 | }; 54 | } 55 | 56 | #endif /* CameraProfile_hpp */ 57 | -------------------------------------------------------------------------------- /libMotionCam/thirdparty/dng_sdk/dng/dng_bottlenecks.cpp: -------------------------------------------------------------------------------- 1 | /*****************************************************************************/ 2 | // Copyright 2006-2009 Adobe Systems Incorporated 3 | // All Rights Reserved. 4 | // 5 | // NOTICE: Adobe permits you to use, modify, and distribute this file in 6 | // accordance with the terms of the Adobe license agreement accompanying it. 7 | /*****************************************************************************/ 8 | 9 | /* $Id: //mondo/dng_sdk_1_4/dng_sdk/source/dng_bottlenecks.cpp#1 $ */ 10 | /* $DateTime: 2012/05/30 13:28:51 $ */ 11 | /* $Change: 832332 $ */ 12 | /* $Author: tknoll $ */ 13 | 14 | /*****************************************************************************/ 15 | 16 | #include "dng_bottlenecks.h" 17 | 18 | #include "dng_reference.h" 19 | 20 | /*****************************************************************************/ 21 | 22 | dng_suite gDNGSuite = 23 | { 24 | RefZeroBytes, 25 | RefCopyBytes, 26 | RefSwapBytes16, 27 | RefSwapBytes32, 28 | RefSetArea8, 29 | RefSetArea16, 30 | RefSetArea32, 31 | RefCopyArea8, 32 | RefCopyArea16, 33 | RefCopyArea32, 34 | RefCopyArea8_16, 35 | RefCopyArea8_S16, 36 | RefCopyArea8_32, 37 | RefCopyArea16_S16, 38 | RefCopyArea16_32, 39 | RefCopyArea8_R32, 40 | RefCopyArea16_R32, 41 | RefCopyAreaS16_R32, 42 | RefCopyAreaR32_8, 43 | RefCopyAreaR32_16, 44 | RefCopyAreaR32_S16, 45 | RefRepeatArea8, 46 | RefRepeatArea16, 47 | RefRepeatArea32, 48 | RefShiftRight16, 49 | RefBilinearRow16, 50 | RefBilinearRow32, 51 | RefBaselineABCtoRGB, 52 | RefBaselineABCDtoRGB, 53 | RefBaselineHueSatMap, 54 | RefBaselineRGBtoGray, 55 | RefBaselineRGBtoRGB, 56 | RefBaseline1DTable, 57 | RefBaselineRGBTone, 58 | RefResampleDown16, 59 | RefResampleDown32, 60 | RefResampleAcross16, 61 | RefResampleAcross32, 62 | RefEqualBytes, 63 | RefEqualArea8, 64 | RefEqualArea16, 65 | RefEqualArea32, 66 | RefVignetteMask16, 67 | RefVignette16, 68 | RefVignette32, 69 | RefMapArea16 70 | }; 71 | 72 | /*****************************************************************************/ 73 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/cpp/camera/CaptureSessionManager.h: -------------------------------------------------------------------------------- 1 | #ifndef MOTIONCAM_ANDROID_CAPTURESESSIONMANAGER_H 2 | #define MOTIONCAM_ANDROID_CAPTURESESSIONMANAGER_H 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | 10 | namespace motioncam { 11 | struct CameraDescription; 12 | struct RawImageBuffer; 13 | class CameraSession; 14 | class RawImageConsumer; 15 | class DisplayDimension; 16 | class OutputConfiguration; 17 | class CameraSessionListener; 18 | class RawPreviewListener; 19 | 20 | class CaptureSessionManager { 21 | public: 22 | CaptureSessionManager(); 23 | 24 | static bool getPreviewConfiguration( 25 | const CameraDescription& cameraDesc, 26 | const DisplayDimension& captureSize, 27 | const DisplayDimension& displaySize, 28 | OutputConfiguration& outputConfiguration); 29 | 30 | static bool getRawConfiguration( 31 | const CameraDescription& cameraDesc, 32 | const bool preferRaw12, 33 | const bool preferRaw16, 34 | OutputConfiguration& rawConfiguration); 35 | 36 | std::shared_ptr getCameraDescription(const std::string& cameraId) const; 37 | std::vector getSupportedCameras() const; 38 | 39 | std::shared_ptr cameraManager() const; 40 | 41 | private: 42 | static bool isCameraSupported(const CameraDescription& cameraDescription); 43 | void enumerateCameras(); 44 | static void updateCameraMetadata(const std::shared_ptr& cameraChars, CameraDescription& cameraDescription); 45 | 46 | private: 47 | std::shared_ptr mCameraManager; 48 | std::vector> mCameras; 49 | std::map> mSupportedCameras; 50 | }; 51 | } 52 | 53 | #endif //MOTIONCAM_ANDROID_CAPTURESESSIONMANAGER_H 54 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/java/com/motioncam/PostProcessActivity.java: -------------------------------------------------------------------------------- 1 | package com.motioncam; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | 6 | import androidx.appcompat.app.AppCompatActivity; 7 | 8 | import com.motioncam.camera.NativeCamera; 9 | import com.motioncam.ui.PostProcessFragment; 10 | 11 | public class PostProcessActivity extends AppCompatActivity { 12 | public static final String INTENT_NATIVE_CAMERA_HANDLE = "nativeCameraHandle"; 13 | public static final String INTENT_NATIVE_CAMERA_ID = "nativeCameraId"; 14 | public static final String INTENT_NATIVE_CAMERA_FRONT_FACING = "nativeCameraFrontFacing"; 15 | 16 | @Override 17 | protected void onCreate(Bundle savedInstanceState) { 18 | super.onCreate(savedInstanceState); 19 | setContentView(R.layout.post_process_activity); 20 | 21 | // Create native camera from handle 22 | Intent intent = getIntent(); 23 | 24 | String nativeCameraId = null; 25 | boolean isCameraFrontFacing = false; 26 | 27 | if(intent != null) { 28 | nativeCameraId = intent.getStringExtra(INTENT_NATIVE_CAMERA_ID); 29 | isCameraFrontFacing = intent.getBooleanExtra(INTENT_NATIVE_CAMERA_FRONT_FACING, false); 30 | } 31 | else { 32 | Intent cameraIntent = new Intent(this, CameraActivity.class); 33 | startActivity(cameraIntent); 34 | 35 | finish(); 36 | } 37 | 38 | if (savedInstanceState == null) { 39 | Bundle args = new Bundle(); 40 | 41 | args.putString(PostProcessFragment.ARGUMENT_NATIVE_CAMERA_ID, nativeCameraId); 42 | args.putBoolean(PostProcessFragment.ARGUMENT_NATIVE_CAMERA_IS_FRONT_FACING, isCameraFrontFacing); 43 | 44 | PostProcessFragment fragment = PostProcessFragment.newInstance(); 45 | fragment.setArguments(args); 46 | 47 | getSupportFragmentManager().beginTransaction() 48 | .replace(R.id.container, fragment) 49 | .commitNow(); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/java/com/motioncam/camera/NativeCameraBuffer.java: -------------------------------------------------------------------------------- 1 | package com.motioncam.camera; 2 | 3 | public class NativeCameraBuffer implements Comparable { 4 | public enum ScreenOrientation { 5 | PORTRAIT(0, 0), 6 | REVERSE_PORTRAIT(1, 180), 7 | LANDSCAPE(2, 90), 8 | REVERSE_LANDSCAPE(3, -90); 9 | 10 | public final int value; 11 | public final int angle; 12 | 13 | ScreenOrientation(int value, int angle) { 14 | this.value = value; 15 | this.angle = angle; 16 | } 17 | 18 | public static ScreenOrientation FromInt(int screenOrientation) { 19 | for(ScreenOrientation orientation : ScreenOrientation.values()) { 20 | if(orientation.value == screenOrientation) 21 | return orientation; 22 | } 23 | 24 | // Default to landscape 25 | return LANDSCAPE; 26 | } 27 | 28 | public static ScreenOrientation FromAngle(int angle) { 29 | for(ScreenOrientation orientation : ScreenOrientation.values()) { 30 | if(orientation.angle == angle) 31 | return orientation; 32 | } 33 | 34 | // Default to landscape 35 | return LANDSCAPE; 36 | } 37 | } 38 | 39 | public final long timestamp; 40 | public final int iso; 41 | public final long exposureTime; 42 | public final ScreenOrientation screenOrientation; 43 | public final int width; 44 | public final int height; 45 | 46 | public NativeCameraBuffer(long timestamp, int iso, long exposureTime, int screenOrientation, int width, int height) { 47 | this.timestamp = timestamp; 48 | this.iso = iso; 49 | this.exposureTime = exposureTime; 50 | this.screenOrientation = ScreenOrientation.FromInt(screenOrientation); 51 | this.width = width; 52 | this.height = height; 53 | } 54 | 55 | @Override 56 | public int compareTo(NativeCameraBuffer o) { 57 | return Long.compare(this.timestamp, o.timestamp); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/cpp/DngConverterListener.cpp: -------------------------------------------------------------------------------- 1 | #include "DngConverterListener.h" 2 | 3 | DngConverterListener::DngConverterListener(_JNIEnv * env, _jobject *progressListener) : 4 | mEnv(env), mProgressListenerRef(env->NewGlobalRef(progressListener)) { 5 | } 6 | 7 | DngConverterListener::~DngConverterListener() { 8 | mEnv->DeleteGlobalRef(mProgressListenerRef); 9 | } 10 | 11 | int DngConverterListener::onNeedFd(int frameNumber) { 12 | struct _jmethodID *onNeedFd = mEnv->GetMethodID( 13 | mEnv->GetObjectClass(mProgressListenerRef), 14 | "onNeedFd", 15 | "(I)I"); 16 | 17 | return mEnv->CallIntMethod(mProgressListenerRef, onNeedFd, frameNumber); 18 | } 19 | 20 | bool DngConverterListener::onProgressUpdate(int progress) { 21 | struct _jmethodID *onProgressUpdate = mEnv->GetMethodID( 22 | mEnv->GetObjectClass(mProgressListenerRef), 23 | "onProgressUpdate", 24 | "(I)Z"); 25 | 26 | uint8_t result = mEnv->CallBooleanMethod(mProgressListenerRef, onProgressUpdate, progress); 27 | 28 | return result == 1; 29 | } 30 | 31 | void DngConverterListener::onCompleted() { 32 | struct _jmethodID *onCompletedMethod = mEnv->GetMethodID( 33 | mEnv->GetObjectClass(mProgressListenerRef), 34 | "onCompleted", 35 | "()V"); 36 | 37 | mEnv->CallVoidMethod(mProgressListenerRef, onCompletedMethod); 38 | } 39 | 40 | void DngConverterListener::onAttemptingRecovery() { 41 | struct _jmethodID *onAttemptingRecovery = mEnv->GetMethodID( 42 | mEnv->GetObjectClass(mProgressListenerRef), 43 | "onAttemptingRecovery", 44 | "()V"); 45 | 46 | mEnv->CallVoidMethod(mProgressListenerRef, onAttemptingRecovery); 47 | } 48 | 49 | void DngConverterListener::onError(const std::string& error) { 50 | struct _jmethodID *onErrorMethod = mEnv->GetMethodID( 51 | mEnv->GetObjectClass(mProgressListenerRef), 52 | "onError", 53 | "(Ljava/lang/String;)V"); 54 | 55 | mEnv->CallObjectMethod(mProgressListenerRef, onErrorMethod, mEnv->NewStringUTF(error.c_str())); 56 | } 57 | -------------------------------------------------------------------------------- /MotionCam-Android/MotionCam/src/main/res/layout/first_time_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 21 | 22 | 31 | 32 | 33 | 40 | 41 |