Commit 830fb791 authored by Mark Harman's avatar Mark Harman

Add option for whether to save base images and xml debug data for panorama.

parent f8e7a12f
......@@ -114,9 +114,10 @@ public class ImageSaver extends Thread {
enum SaveBase {
SAVEBASE_NONE,
SAVEBASE_FIRST,
SAVEBASE_ALL
SAVEBASE_ALL,
SAVEBASE_ALL_PLUS_DEBUG // for PANORAMA
}
final SaveBase save_base; // whether to save the base images, for process_type HDR or AVERAGE
final SaveBase save_base; // whether to save the base images, for process_type HDR, AVERAGE or PANORAMA
/* jpeg_images: for jpeg (may be null otherwise).
* If process_type==HDR, this should be 1 or 3 images, and the images are combined/converted to a HDR image (if there's only 1
* image, this uses fake HDR or "DRO").
......@@ -1537,7 +1538,7 @@ public class ImageSaver extends Thread {
Log.d(TAG, "panorama");
// save text file with gyro info
if( !request.image_capture_intent && request.save_base != Request.SaveBase.SAVEBASE_NONE ) {
if( !request.image_capture_intent && request.save_base == Request.SaveBase.SAVEBASE_ALL_PLUS_DEBUG ) {
/*final StringBuilder gyro_text = new StringBuilder();
gyro_text.append("Panorama gyro debug info\n");
gyro_text.append("n images: " + request.gyro_rotation_matrix.size() + ":\n");
......
......@@ -2763,19 +2763,27 @@ public class MyApplicationInterface extends BasicApplicationInterface {
first_image = n_capture_images == 1;
if( first_image ) {
ImageSaver.Request.SaveBase save_base = ImageSaver.Request.SaveBase.SAVEBASE_NONE;
String save_base_preference = "";
if( photo_mode == PhotoMode.NoiseReduction )
save_base_preference = sharedPreferences.getString(PreferenceKeys.NRSaveExpoPreferenceKey, "preference_nr_save_no");
else if( photo_mode == PhotoMode.Panorama )
save_base_preference = "preference_nr_save_all"; // TODO
switch( save_base_preference ) {
case "preference_nr_save_single":
save_base = ImageSaver.Request.SaveBase.SAVEBASE_FIRST;
break;
case "preference_nr_save_all":
save_base = ImageSaver.Request.SaveBase.SAVEBASE_ALL;
break;
if( photo_mode == PhotoMode.NoiseReduction ) {
String save_base_preference = sharedPreferences.getString(PreferenceKeys.NRSaveExpoPreferenceKey, "preference_nr_save_no");
switch( save_base_preference ) {
case "preference_nr_save_single":
save_base = ImageSaver.Request.SaveBase.SAVEBASE_FIRST;
break;
case "preference_nr_save_all":
save_base = ImageSaver.Request.SaveBase.SAVEBASE_ALL;
break;
}
}
else if( photo_mode == PhotoMode.Panorama ) {
String save_base_preference = sharedPreferences.getString(PreferenceKeys.PanoramaSaveExpoPreferenceKey, "preference_panorama_save_no");
switch( save_base_preference ) {
case "preference_panorama_save_all":
save_base = ImageSaver.Request.SaveBase.SAVEBASE_ALL;
break;
case "preference_panorama_save_all_plus_debug":
save_base = ImageSaver.Request.SaveBase.SAVEBASE_ALL_PLUS_DEBUG;
break;
}
}
imageSaver.startImageBatch(true,
......
......@@ -376,6 +376,10 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared
Preference pref = findPreference("preference_panorama_crop");
PreferenceGroup pg = (PreferenceGroup) this.findPreference("preference_screen_photo_settings");
pg.removePreference(pref);
pref = findPreference("preference_panorama_save");
pg = (PreferenceGroup) this.findPreference("preference_screen_photo_settings");
pg.removePreference(pref);
}
final boolean supports_expo_bracketing = bundle.getBoolean("supports_expo_bracketing");
......
......@@ -91,6 +91,8 @@ public class PreferenceKeys {
public static final String PanoramaCropPreferenceKey = "preference_panorama_crop";
public static final String PanoramaSaveExpoPreferenceKey = "preference_panorama_save";
public static final String ExpoBracketingNImagesPreferenceKey = "preference_expo_bracketing_n_images";
public static final String ExpoBracketingStopsPreferenceKey = "preference_expo_bracketing_stops";
......
......@@ -917,4 +917,14 @@
<item>preference_panorama_crop_off</item>
<item>preference_panorama_crop_on</item>
</string-array>
<string-array name="preference_panorama_save_entries">
<item>@string/preference_panorama_save_no</item>
<item>@string/preference_panorama_save_all</item>
<item>@string/preference_panorama_save_all_plus_debug</item>
</string-array>
<string-array name="preference_panorama_save_values">
<item>preference_panorama_save_no</item>
<item>preference_panorama_save_all</item>
<item>preference_panorama_save_all_plus_debug</item>
</string-array>
</resources>
......@@ -872,6 +872,13 @@
<string name="panorama_info">To take a panorama image, hold your device in portrait orientation, and click to take a photo to start the panorama. Then rotate your device either left or right to move the centred white circle over the blue dot. After each new photo is taken, keep rotating your device to cover each new blue dot that appears in turn.\n\nClick the tick icon to save the panorama, or the cross icon to cancel.\n\nNote that panorama photos can take time to process and save.</string>
<string name="preference_panorama_save">Panorama original images</string>
<string name="preference_panorama_save_summary">Whether to save original images in panorama mode. Note this can make saving photos slower. Also allows the option to save an XML file which can be useful reporting problems with panorama.\n%s</string>
<string name="preference_panorama_save_no">Don\'t save original images</string>
<string name="preference_panorama_save_all">Save original images</string>
<string name="preference_panorama_save_all_plus_debug">Save original images plus debug XML</string>
<!-- There's no point translating the What's New text - it'll be updated constantly, and change each version -->
<string name="whats_new_text">
[This dialog is shown when Open Camera is updated. You can disable it under
......
......@@ -773,6 +773,16 @@
android:defaultValue="preference_panorama_crop_on"
/>
<!-- if we move this to another PreferenceGroup, we should update code to remove this Preference -->
<ListPreference
android:key="preference_panorama_save"
android:title="@string/preference_panorama_save"
android:summary="@string/preference_panorama_save_summary"
android:entries="@array/preference_panorama_save_entries"
android:entryValues="@array/preference_panorama_save_values"
android:defaultValue="preference_panorama_save_no"
/>
<!-- if we move this to another PreferenceGroup, we should update code to remove this Preference -->
<ListPreference
android:key="preference_expo_bracketing_stops"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment