summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-06-08 07:23:35 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-06-08 07:23:35 +0000
commitba90150f439f16e1717bc8972468328da4ffac76 (patch)
tree211083d03a6f3266ed4ceeaf451e2fe9133cb0c8
parent4cab2e0b76d7457785ec48afafcafbfbaddf9957 (diff)
parent00d504d2d3d14a8a11113993aa9c28ff61541d36 (diff)
downloadmedia-pie-release-2.tar.gz
Snap for 4829593 from 00d504d2d3d14a8a11113993aa9c28ff61541d36 to pi-releaseandroid-wear-9.0.0_r9android-wear-9.0.0_r8android-wear-9.0.0_r7android-wear-9.0.0_r6android-wear-9.0.0_r5android-wear-9.0.0_r4android-wear-9.0.0_r34android-wear-9.0.0_r33android-wear-9.0.0_r32android-wear-9.0.0_r31android-wear-9.0.0_r30android-wear-9.0.0_r3android-wear-9.0.0_r29android-wear-9.0.0_r28android-wear-9.0.0_r27android-wear-9.0.0_r26android-wear-9.0.0_r25android-wear-9.0.0_r24android-wear-9.0.0_r23android-wear-9.0.0_r22android-wear-9.0.0_r21android-wear-9.0.0_r20android-wear-9.0.0_r2android-wear-9.0.0_r19android-wear-9.0.0_r18android-wear-9.0.0_r17android-wear-9.0.0_r16android-wear-9.0.0_r15android-wear-9.0.0_r14android-wear-9.0.0_r13android-wear-9.0.0_r12android-wear-9.0.0_r11android-wear-9.0.0_r10android-wear-9.0.0_r1android-vts-9.0_r9android-vts-9.0_r8android-vts-9.0_r7android-vts-9.0_r6android-vts-9.0_r5android-vts-9.0_r4android-vts-9.0_r19android-vts-9.0_r18android-vts-9.0_r17android-vts-9.0_r16android-vts-9.0_r15android-vts-9.0_r14android-vts-9.0_r13android-vts-9.0_r12android-vts-9.0_r11android-vts-9.0_r10android-security-9.0.0_r62android-cts-9.0_r9android-cts-9.0_r8android-cts-9.0_r7android-cts-9.0_r6android-cts-9.0_r5android-cts-9.0_r4android-cts-9.0_r3android-cts-9.0_r20android-cts-9.0_r2android-cts-9.0_r19android-cts-9.0_r18android-cts-9.0_r17android-cts-9.0_r16android-cts-9.0_r15android-cts-9.0_r14android-cts-9.0_r13android-cts-9.0_r12android-cts-9.0_r11android-cts-9.0_r10android-cts-9.0_r1android-9.0.0_r9android-9.0.0_r8android-9.0.0_r7android-9.0.0_r61android-9.0.0_r60android-9.0.0_r6android-9.0.0_r59android-9.0.0_r58android-9.0.0_r57android-9.0.0_r56android-9.0.0_r55android-9.0.0_r54android-9.0.0_r53android-9.0.0_r52android-9.0.0_r51android-9.0.0_r50android-9.0.0_r5android-9.0.0_r49android-9.0.0_r48android-9.0.0_r3android-9.0.0_r2android-9.0.0_r18android-9.0.0_r17android-9.0.0_r10android-9.0.0_r1security-pi-releasepie-vts-releasepie-s2-releasepie-release-2pie-releasepie-r2-s2-releasepie-r2-s1-releasepie-r2-releasepie-cts-release
Change-Id: I09cd97e053c3f1198778a2643743fc7880171f8d
-rw-r--r--camera/docs/images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.pngbin31494 -> 21736 bytes
-rw-r--r--camera/docs/images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.pngbin22690 -> 15510 bytes
-rw-r--r--camera/docs/images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.pngbin21822 -> 15016 bytes
-rw-r--r--camera/docs/images/camera2/metadata/android.tonemap.curveRed/rec709_tonemap.pngbin32384 -> 22992 bytes
-rw-r--r--camera/docs/images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.pngbin32315 -> 22087 bytes
-rwxr-xr-xcamera/docs/metadata-generate5
-rw-r--r--camera/docs/plots.py211
7 files changed, 216 insertions, 0 deletions
diff --git a/camera/docs/images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png b/camera/docs/images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png
index a02fd893..f739fa2b 100644
--- a/camera/docs/images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png
+++ b/camera/docs/images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png
Binary files differ
diff --git a/camera/docs/images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png b/camera/docs/images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png
index c309ac5e..4b45e3aa 100644
--- a/camera/docs/images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png
+++ b/camera/docs/images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png
Binary files differ
diff --git a/camera/docs/images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png b/camera/docs/images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png
index 414fad49..748d1a29 100644
--- a/camera/docs/images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png
+++ b/camera/docs/images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png
Binary files differ
diff --git a/camera/docs/images/camera2/metadata/android.tonemap.curveRed/rec709_tonemap.png b/camera/docs/images/camera2/metadata/android.tonemap.curveRed/rec709_tonemap.png
index c147a872..6e436baa 100644
--- a/camera/docs/images/camera2/metadata/android.tonemap.curveRed/rec709_tonemap.png
+++ b/camera/docs/images/camera2/metadata/android.tonemap.curveRed/rec709_tonemap.png
Binary files differ
diff --git a/camera/docs/images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png b/camera/docs/images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png
index 4ce2125f..9776874b 100644
--- a/camera/docs/images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png
+++ b/camera/docs/images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png
Binary files differ
diff --git a/camera/docs/metadata-generate b/camera/docs/metadata-generate
index 6999da92..98ebd67a 100755
--- a/camera/docs/metadata-generate
+++ b/camera/docs/metadata-generate
@@ -36,6 +36,7 @@ fi
thisdir=$(cd "$(dirname "$0")"; pwd)
fwkdir="$ANDROID_BUILD_TOP/frameworks/base/core/java/android/hardware/camera2/"
fwkdir_html="$ANDROID_BUILD_TOP/frameworks/base/docs/html/reference"
+ndkdir_html="$ANDROID_BUILD_TOP/frameworks/native/docs"
hidldir="$ANDROID_BUILD_TOP/hardware/interfaces/camera/metadata"
ctsdir="$ANDROID_BUILD_TOP/cts/tests/camera/src/android/hardware/camera2/cts"
outdir="$ANDROID_PRODUCT_OUT/obj/ETC/system-media-camera-docs_intermediates"
@@ -183,6 +184,7 @@ function copy_directory() {
echo "ERROR: Failed to copy $(relpath "$src") to $(relpath "$dst")" >& 2
else
echo "OK: Copied $(relpath "$src") to $(relpath "$dst")"
+ out_files+=$'\n'" $dst"
fi
return $retval
@@ -238,6 +240,9 @@ gen_file camera_device_info.mako ./camera_device_info.proto || exit 1
# Copy ./images directory into javadoc directory
copy_directory "images" "$fwkdir_html" || exit 1
+# Copy ./images directory into ndk doc directory
+copy_directory "images" "$ndkdir_html" || exit 1
+
echo ""
echo "===================================================="
echo "Successfully generated all metadata source files"
diff --git a/camera/docs/plots.py b/camera/docs/plots.py
new file mode 100644
index 00000000..fb4e9643
--- /dev/null
+++ b/camera/docs/plots.py
@@ -0,0 +1,211 @@
+#!/bin/ipython
+
+import argparse
+import numpy as np
+import matplotlib.pyplot as plt
+import sys
+
+## general defines
+
+linecolor = "#%x%x%x" % ( 217, 234, 211 )
+markercolor = "#%x%x%x" % ( 217/2, 234/2, 211/2 )
+
+# Draw pretty plot
+def doc_plot(fig, x, y):
+
+ plt.figure(fig.number)
+ fig.clear()
+
+ lines, = plt.plot(x,y)
+ lines.set_color(linecolor)
+ lines.set_linewidth(4)
+ lines.set_marker('o')
+ lines.set_markeredgecolor(markercolor)
+ lines.set_markersize(6)
+ lines.set_markeredgewidth(2)
+
+ axes = fig.get_axes()[0]
+ axes.set_aspect(1)
+ axes.set_ybound(0,1)
+ axes.set_xbound(0,1)
+ axes.grid(True)
+ axes.xaxis.label.set_text(r'$P_{IN}$')
+ axes.xaxis.label.set_fontsize(14)
+ axes.yaxis.label.set_text(r'$P_{OUT}$')
+ axes.yaxis.label.set_fontsize(14)
+
+# Print out interleaved coefficients for HAL3 tonemap curve tags
+def doc_coeff(x,y):
+ coeffs = np.vstack((x, y)).reshape(-1,order='F')
+ coeff_str = "[ "
+ for val in coeffs[:-1]:
+ coeff_str += "%0.4f, " % val
+
+ coeff_str += "%0.4f ]" % coeffs[-1]
+
+ print coeff_str
+
+def doc_map(fig, imgMap, index):
+ plt.figure(fig.number)
+ fig.clear()
+ plt.imshow(imgMap - 1, interpolation='nearest')
+ for x in range(0, np.size(imgMap, 1)):
+ for y in range(0, np.size(imgMap, 0)):
+ plt.text(x,y, imgMap[y,x,index], color='white')
+
+ axes = fig.get_axes()[0]
+ axes.set_xticks(range(0, np.size(imgMap, 1)))
+ axes.set_yticks(range(0, np.size(imgMap, 0)))
+
+## Check arguments
+
+parser = argparse.ArgumentParser(description='Draw plots for camera HAL3.x implementation spec doc')
+parser.add_argument('--save_figures', default=False, action='store_true',
+ help='Save figures as pngs')
+
+args = parser.parse_args()
+
+## Linear mapping
+
+x_lin = np.linspace(0,1,2)
+y_lin = x_lin
+
+lin_fig = plt.figure(1)
+doc_plot(lin_fig, x_lin, y_lin)
+
+lin_title = 'Linear tonemapping curve'
+plt.title(lin_title)
+print lin_title
+doc_coeff(x_lin, y_lin)
+
+if args.save_figures:
+ plt.savefig('linear_tonemap.png',bbox_inches='tight')
+
+## Inverse mapping
+
+x_inv = x_lin
+y_inv = 1 - x_lin
+
+inv_fig = plt.figure(2)
+doc_plot(inv_fig, x_inv, y_inv)
+
+inv_title = 'Inverting tonemapping curve'
+plt.title(inv_title)
+print inv_title
+doc_coeff(x_inv, y_inv)
+
+if args.save_figures:
+ plt.savefig('inverse_tonemap.png',bbox_inches='tight')
+
+## Gamma 1/2.2
+
+x_gamma = np.linspace(0, 1, 16);
+
+y_gamma = x_gamma**(1/2.2)
+
+gamma_fig = plt.figure(3)
+doc_plot(gamma_fig, x_gamma, y_gamma)
+
+gamma_title = r'$\gamma=1/2.2$ tonemapping curve'
+plt.title(gamma_title)
+print gamma_title
+doc_coeff(x_gamma, y_gamma)
+
+if args.save_figures:
+ plt.savefig('gamma_tonemap.png',bbox_inches='tight')
+
+## sRGB curve
+
+x_srgb = x_gamma
+y_srgb = np.where(x_srgb <= 0.0031308, x_srgb * 12.92, 1.055*x_srgb**(1/2.4)-0.055)
+
+srgb_fig = plt.figure(4)
+doc_plot(srgb_fig, x_srgb, y_srgb)
+
+srgb_title = 'sRGB tonemapping curve'
+plt.title(srgb_title)
+print srgb_title
+doc_coeff(x_srgb, y_srgb)
+
+if args.save_figures:
+ plt.savefig('srgb_tonemap.png',bbox_inches='tight')
+
+## Sample lens shading map
+
+shadingMapSize = np.array([3, 4])
+shadingMap1 = np.array(
+ [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2, 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
+ 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0, 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
+ 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2, 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ])
+redMap = shadingMap1[0::4].reshape(shadingMapSize)
+greenEMap = shadingMap1[1::4].reshape(shadingMapSize)
+greenOMap = shadingMap1[2::4].reshape(shadingMapSize)
+blueMap = shadingMap1[3::4].reshape(shadingMapSize)
+
+rgbMap = np.dstack( (redMap, (greenEMap + greenOMap) / 2, blueMap) )
+redMap = np.dstack( (redMap, np.zeros(shadingMapSize), np.zeros(shadingMapSize) ) )
+greenEMap = np.dstack( (np.zeros(shadingMapSize), greenEMap, np.zeros(shadingMapSize) ) )
+greenOMap = np.dstack( (np.zeros(shadingMapSize), greenOMap, np.zeros(shadingMapSize) ) )
+blueMap = np.dstack( (np.zeros(shadingMapSize), np.zeros(shadingMapSize), blueMap ) )
+
+redImg = plt.figure(5)
+doc_map(redImg, redMap, 0)
+plt.title('Red lens shading map')
+
+if args.save_figures:
+ plt.savefig('red_shading.png',bbox_inches='tight')
+
+greenEImg = plt.figure(6)
+doc_map(greenEImg, greenEMap, 1)
+plt.title('Green (even rows) lens shading map')
+
+if args.save_figures:
+ plt.savefig('green_e_shading.png',bbox_inches='tight')
+
+greenOImg = plt.figure(7)
+doc_map(greenOImg, greenOMap, 1)
+plt.title('Green (odd rows) lens shading map')
+
+if args.save_figures:
+ plt.savefig('green_o_shading.png',bbox_inches='tight')
+
+blueImg = plt.figure(8)
+doc_map(blueImg, blueMap, 2)
+plt.title('Blue lens shading map')
+
+if args.save_figures:
+ plt.savefig('blue_shading.png',bbox_inches='tight')
+
+rgbImg = plt.figure(9)
+
+rgbImg.clear()
+plt.imshow(1/rgbMap,interpolation='bicubic')
+
+axes = rgbImg.get_axes()[0]
+axes.set_xticks(range(0, np.size(rgbMap, 1)))
+axes.set_yticks(range(0, np.size(rgbMap, 0)))
+
+plt.title('Image of uniform white wall (inverse shading map)')
+
+if args.save_figures:
+ plt.savefig('inv_shading.png',bbox_inches='tight')
+
+# Rec. 709
+x_rec709 = x_gamma
+y_rec709 = np.where(x_rec709 <= 0.018, x_rec709 * 4.500, 1.099*x_rec709**0.45-0.099)
+
+rec709_fig = plt.figure(10)
+doc_plot(rec709_fig, x_rec709, y_rec709)
+
+rec709_title = 'Rec. 709 tonemapping curve'
+plt.title(rec709_title)
+print rec709_title
+doc_coeff(x_rec709, y_rec709)
+
+if args.save_figures:
+ plt.savefig('rec709_tonemap.png',bbox_inches='tight')
+
+
+# Show figures
+
+plt.show()