xref: /aosp_15_r20/system/media/camera/docs/html.mako (revision b9df5ad1c9ac98a7fefaac271a55f7ae3db05414)
1## -*- coding: utf-8 -*-
2<!DOCTYPE html>
3<html>
4<!-- Copyright (C) 2012 The Android Open Source Project
5
6     Licensed under the Apache License, Version 2.0 (the "License");
7     you may not use this file except in compliance with the License.
8     You may obtain a copy of the License at
9
10          http://www.apache.org/licenses/LICENSE-2.0
11
12     Unless required by applicable law or agreed to in writing, software
13     distributed under the License is distributed on an "AS IS" BASIS,
14     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15     See the License for the specific language governing permissions and
16     limitations under the License.
17-->
18<head>
19  <!-- automatically generated from html.mako. do NOT edit directly -->
20  <meta charset="utf-8" />
21  <title>Android Camera HAL3.4 Properties</title>
22  <style type="text/css">
23     body { background-color: #f7f7f7; font-family: Roboto, sans-serif;}
24     h1 { color: #333333; }
25     h2 { color: #333333; }
26     a:link { color: #258aaf; text-decoration: none}
27     a:hover { color: #459aaf; text-decoration: underline }
28     a:visited { color: #154a5f; text-decoration: none}
29    .section { color: #eeeeee; font-size: 1.5em; font-weight: bold; background-color: #888888; padding: 0.5em 0em 0.5em 0.5em; border-width: thick thin thin thin; border-color: #111111 #777777 #777777 #777777}
30    .kind { color: #eeeeee; font-size: 1.2em; font-weight: bold; padding-left: 1.5em; background-color: #aaaaaa }
31    .entry { background-color: #f0f0f0 }
32    .entry_cont { background-color: #f0f0f0 }
33    .entries_header { background-color: #dddddd; text-align: center}
34
35    /* toc style */
36    .toc_section_header { font-size:1.3em;  }
37    .toc_kind_header { font-size:1.2em;  }
38    .toc_deprecated { text-decoration:line-through; }
39
40    /* table column sizes */
41    table { border-collapse:collapse; table-layout: fixed; width: 100%; word-wrap: break-word }
42    td,th { border: 1px solid; border-color: #aaaaaa; padding-left: 0.5em; padding-right: 0.5em }
43    .th_name { width: 20% }
44    .th_units { width: 10% }
45    .th_tags { width: 5% }
46    .th_details { width: 25% }
47    .th_type { width: 17% }
48    .th_description { width: 20% }
49    .th_range { width: 8% }
50    .th_hal_version { width: 5% }
51    td { font-size: 0.9em; }
52
53    /* hide the first thead, we need it there only to enforce column sizes */
54    .thead_dummy { visibility: hidden; }
55
56    /* Entry flair */
57    .entry_name { color: #333333; padding-left:1.0em; font-size:1.1em; font-family: monospace; vertical-align:top; }
58    .entry_name_deprecated { text-decoration:line-through; }
59
60    /* Entry type flair */
61    .entry_type_name { font-size:1.1em; color: #669900; font-weight: bold;}
62    .entry_type_name_enum:after { color: #669900; font-weight: bold; content:" (enum)" }
63    .entry_type_visibility { font-weight: bolder; padding-left:1em}
64    .entry_type_synthetic { font-weight: bolder; color: #996600; }
65    .entry_type_hwlevel { font-weight: bolder; color: #000066; }
66    .entry_type_deprecated { font-weight: bolder; color: #4D4D4D; }
67    .entry_type_enum_name { font-family: monospace; font-weight: bolder; }
68    .entry_type_enum_notes:before { content:" - " }
69    .entry_type_enum_notes>p:first-child { display:inline; }
70    .entry_type_enum_value:before { content:" = " }
71    .entry_type_enum_value { font-family: monospace; }
72    .entry ul { margin: 0 0 0 0; list-style-position: inside; padding-left: 0.5em; }
73    .entry ul li { padding: 0 0 0 0; margin: 0 0 0 0;}
74    .entry_range_deprecated { font-weight: bolder; }
75
76    /* Entry tags flair */
77    .entry_tags ul { list-style-type: none; }
78
79    /* Entry details (full docs) flair */
80    .entry_details_header { font-weight: bold; background-color: #dddddd;
81      text-align: center; font-size: 1.1em; margin-left: 0em; margin-right: 0em; }
82
83    /* Entry spacer flair */
84    .entry_spacer { background-color: transparent; border-style: none; height: 0.5em; }
85
86    /* TODO: generate abbr element for each tag link? */
87    /* TODO for each x.y.z try to link it to the entry */
88
89  </style>
90
91  <style>
92
93    {
94      /* broken...
95         supposedly there is a bug in chrome that it lays out tables before
96         it knows its being printed, so the page-break-* styles are ignored
97         */
98        tr { page-break-after: always; page-break-inside: avoid; }
99    }
100
101  </style>
102</head>
103
104<%!
105  import re
106  from metadata_helpers import md
107  from metadata_helpers import IMAGE_SRC_METADATA
108  from metadata_helpers import filter_tags
109  from metadata_helpers import filter_links
110  from metadata_helpers import wbr
111
112  # insert line breaks after every two \n\n
113  def br(text):
114    return re.sub(r"(\r?\n)(\r?\n)", r"\1<br>\2<br>", text)
115
116  # Convert node name "x.y.z" of kind w to an HTML anchor of form
117  # <a href="#w_x.y.z">x.y.z</a>
118  def html_anchor(node):
119    return '<a href="#%s_%s">%s</a>' % (node.kind, node.name, node.name)
120
121  # Convert target "xxx.yyy#zzz" to a HTML reference to Android public developer
122  # docs with link name from shortname.
123  def html_link(target, target_ndk, shortname):
124    if shortname == '':
125      lastdot = target.rfind('.')
126      if lastdot == -1:
127        shortname = target
128      else:
129        shortname = target[lastdot + 1:]
130
131    target = target.replace('.','/')
132    if target.find('#') != -1:
133      target = target.replace('#','.html#')
134    else:
135      target = target + '.html'
136
137    # Work around html links with inner classes.
138    target = target.replace('CaptureRequest/Builder', 'CaptureRequest.Builder')
139    target = target.replace('Build/VERSION', 'Build.VERSION')
140
141    return '<a href="https://developer.android.com/reference/%s">%s</a>' % (target, shortname)
142
143  # Render as markdown, and do HTML-doc-specific rewrites
144  def md_html(text):
145    return md(text, IMAGE_SRC_METADATA)
146
147  # linkify tag names such as "android.x.y.z" into html anchors
148  def linkify_tags(metadata):
149    def linkify_filter(text):
150      tagged_text = filter_tags(text, metadata, html_anchor)
151      return filter_links(tagged_text, html_link)
152    return linkify_filter
153
154  # Number of rows an entry will span
155  def entry_cols(prop):
156    cols = 1
157    if prop.details: cols = cols + 2
158    if prop.hal_details: cols = cols + 2
159    return cols
160%>
161
162<body>
163  <h1>Android Camera HAL3.2 Properties</h1>
164\
165<%def name="insert_toc_body(node)">
166  % for nested in node.namespaces:
167${    insert_toc_body(nested)}
168  % endfor
169  % for entry in node.merged_entries:
170            <li
171    % if entry.deprecated:
172                class="toc_deprecated"
173    % endif
174            >${html_anchor(entry)}</li>
175  % endfor
176</%def>
177
178  <h2>Table of Contents</h2>
179  <ul class="toc">
180    <li><a href="#tag_index" class="toc_section_header">Tags</a></li>
181% for root in metadata.outer_namespaces:
182  % for section in root.sections:
183    <li>
184      <span class="toc_section_header"><a href="#section_${section.name}">${section.name}</a></span>
185      <ul class="toc_section">
186      % for kind in section.merged_kinds: # dynamic,static,controls
187        <li>
188          <span class="toc_kind_header">${kind.name}</span>
189          <ul class="toc_section">\
190${          insert_toc_body(kind)}\
191          </ul>
192        </li>
193      % endfor
194      </ul> <!-- toc_section -->
195    </li>
196  % endfor
197% endfor
198  </ul>
199
200
201  <h1>Properties</h1>
202  <table class="properties">
203
204    <thead class="thead_dummy">
205      <tr>
206        <th class="th_name">Property Name</th>
207        <th class="th_type">Type</th>
208        <th class="th_description">Description</th>
209        <th class="th_units">Units</th>
210        <th class="th_range">Range</th>
211        <th class="th_hal_version">HIDL HAL version</th>
212        <th class="th_tags">Tags</th>
213      </tr>
214    </thead> <!-- so that the first occurrence of thead is not
215                         above the first occurrence of tr -->
216% for root in metadata.outer_namespaces:
217<!-- <namespace name="${root.name}"> -->
218  % for section in root.sections:
219  <tr><td colspan="7" id="section_${section.name}" class="section">${section.name}</td></tr>
220
221    % if section.description is not None:
222      <tr class="description"><td>${section.description}</td></tr>
223    % endif
224
225    % for kind in section.merged_kinds: # dynamic,static,controls
226      <tr><td colspan="7" class="kind">${kind.name}</td></tr>
227
228      <thead class="entries_header">
229        <tr>
230          <th class="th_name">Property Name</th>
231          <th class="th_type">Type</th>
232          <th class="th_description">Description</th>
233          <th class="th_units">Units</th>
234          <th class="th_range">Range</th>
235          <th class="th_hal_version">Initial HIDL HAL version</th>
236          <th class="th_tags">Tags</th>
237        </tr>
238      </thead>
239
240      <tbody>
241
242        <%def name="insert_body(node)">
243            % for nested in node.namespaces:
244                ${insert_namespace(nested)}
245            % endfor
246
247            % for entry in node.merged_entries:
248                ${insert_entry(entry)}
249            % endfor
250        </%def>
251
252        <%def name="insert_namespace(namespace)">
253            ${insert_body(namespace)}
254        </%def>
255
256        <%def name="insert_entry(prop)">
257          <tr class="entry" id="${prop.kind}_${prop.name}">
258            <td class="entry_name
259              % if prop.deprecated:
260                entry_name_deprecated
261              % endif
262             " rowspan="${entry_cols(prop)}">
263              ${prop.name | wbr}
264            </td>
265            <td class="entry_type">
266              % if prop.enum:
267                <span class="entry_type_name entry_type_name_enum">${prop.type}</span>
268              % else:
269                <span class="entry_type_name">${prop.type}</span>
270              % endif
271              % if prop.container is not None:
272                <span class="entry_type_container">x</span>
273              % endif
274
275              % if prop.container == 'array':
276                <span class="entry_type_array">
277                  ${" x ".join(prop.container_sizes)}
278                </span>
279              % elif prop.container == 'tuple':
280                <ul class="entry_type_tuple">
281                % for val in prop.tuple_values:
282                  <li>${val}</li>
283                % endfor
284                </ul>
285              % endif
286              <span class="entry_type_visibility"> [${prop.applied_visibility}${" as %s" %prop.typedef.name if prop.typedef else ""}]</span>
287
288              % if prop.synthetic:
289              <span class="entry_type_synthetic">[synthetic] </span>
290              % endif
291
292              % if prop.hwlevel:
293              <span class="entry_type_hwlevel">[${prop.hwlevel}] </span>
294              % endif
295
296              % if prop.deprecated:
297              <span class="entry_type_deprecated">[deprecated] </span>
298              % endif
299
300              % if prop.type_notes is not None:
301                <div class="entry_type_notes">${prop.type_notes | wbr}</div>
302              % endif
303
304              % if prop.enum:
305                <ul class="entry_type_enum">
306                  % for value in prop.enum.values:
307                  <li>
308                    <span class="entry_type_enum_name">${value.name} (v${value.hal_major_version}.${value.hal_minor_version})</span>
309                  % if value.deprecated:
310                    <span class="entry_type_enum_deprecated">[deprecated]</span>
311                  % endif:
312                  % if value.optional:
313                    <span class="entry_type_enum_optional">[optional]</span>
314                  % endif:
315                  % if value.applied_visibility != 'public':
316                    <span class="entry_type_enum_hidden">[${value.visibility}]</span>
317                  % endif:
318                  % if value.id is not None:
319                    <span class="entry_type_enum_value">${value.id}</span>
320                  % endif
321                  % if value.notes is not None:
322                    <span class="entry_type_enum_notes">${value.notes | md_html, linkify_tags(metadata), wbr}</span>
323                  % endif
324                  </li>
325                  % endfor
326                </ul>
327              % endif
328
329            </td> <!-- entry_type -->
330
331            <td class="entry_description">
332            % if prop.description is not None:
333              ${prop.description | md_html, linkify_tags(metadata), wbr}
334            % endif
335            </td>
336
337            <td class="entry_units">
338            % if prop.units is not None:
339              ${prop.units | wbr}
340            % endif
341            </td>
342
343            <td class="entry_range">
344            % if prop.deprecated:
345              <p><span class="entry_range_deprecated">Deprecated</span>. Do not use.</p>
346            % endif
347            % if prop.range is not None:
348              ${prop.range | md_html, linkify_tags(metadata), wbr}
349            % endif
350            </td>
351
352            <td class="entry_hal_version">
353              ${"%d.%d" % (prop.hal_major_version, prop.hal_minor_version) | md_html, linkify_tags(metadata), wbr}
354            </td>
355
356            <td class="entry_tags">
357            % if next(prop.tags, None):
358              <ul class="entry_tags">
359              % for tag in prop.tags:
360                  <li><a href="#tag_${tag.id}">${tag.id}</a></li>
361              % endfor
362              </ul>
363            % endif
364            </td>
365
366          </tr>
367          % if prop.details is not None:
368          <tr class="entries_header">
369            <th class="th_details" colspan="6">Details</th>
370          </tr>
371          <tr class="entry_cont">
372            <td class="entry_details" colspan="6">
373              ${prop.details | md_html, linkify_tags(metadata), wbr}
374            </td>
375          </tr>
376          % endif
377
378          % if prop.hal_details is not None:
379          <tr class="entries_header">
380            <th class="th_details" colspan="6">HAL Implementation Details</th>
381          </tr>
382          <tr class="entry_cont">
383            <td class="entry_details" colspan="6">
384              ${prop.hal_details | md_html, linkify_tags(metadata), wbr}
385            </td>
386          </tr>
387          % endif
388
389          <tr class="entry_spacer"><td class="entry_spacer" colspan="7"></td></tr>
390           <!-- end of entry -->
391        </%def>
392
393        ${insert_body(kind)}
394
395      <!-- end of kind -->
396      </tbody>
397    % endfor # for each kind
398
399  <!-- end of section -->
400  % endfor
401<!-- </namespace> -->
402% endfor
403  </table>
404
405  <div class="tags" id="tag_index">
406    <h2>Tags</h2>
407    <ul>
408    % for tag in metadata.tags:
409      <li id="tag_${tag.id}">${tag.id} - ${tag.description}
410        <ul class="tags_entries">
411        % for prop in tag.entries:
412          <li>${html_anchor(prop)} (${prop.kind})</li>
413        % endfor
414        </ul>
415      </li> <!-- tag_${tag.id} -->
416    % endfor
417    </ul>
418  </div>
419
420  [ <a href="#">top</a> ]
421
422</body>
423</html>
424