~emersion/drmdb

ref: df9bdc153f09704085d6a98dd5625575d2e8f9d5 drmdb/public/formats.html -rw-r--r-- 1.4 KiB View raw
df9bdc15Simon Ser Add tooltip with format/modifier hex code in /formats 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{{template "head" "Formats"}}

<div style="margin: 0">
  <h1>DRM database formats</h1>

  <p><a href="/">Back to index</a></p>

  <h2 id="in-formats">Input formats</h2>

  {{define "pct-cell"}}
      <td style="color: {{pctColor .}};">{{printf "%.0f%%" .}}</td>
  {{end}}

  <table>
      <thead>
          <tr>
              <th rowspan="2">Modifier</th>
              <th rowspan="2">Format</th>
              <th colspan="{{len .Planes}}">Planes</th>
              <th colspan="{{len .Drivers}}">Drivers</th>
          </tr>
          <tr>
              {{range $plane, $_ := .Planes}}
              <th><a href="?plane={{printf "%d" $plane}}">{{$plane.String}}</a></th>
              {{end}}
              {{range $drv, $_ := .Drivers}}
              <th><a href="?driver={{$drv}}">{{$drv}}</a></th>
              {{end}}
          </tr>
      </thead>
      <tbody>
          {{range .Formats}}
          <tr>
              {{$row := .}}
              <td class="pre" title="{{printf "0x%X" .Modifier}}">{{.Modifier}}</td>
              <td class="pre" title="{{printf "0x%X" .Format}}">{{.Format}}</td>
              {{range $plane, $total := $.Planes}}
              {{template "pct-cell" (pct (index $row.Planes $plane) $total)}}
              {{end}}
              {{range $drv, $total := $.Drivers}}
              {{template "pct-cell" (pct (index $row.Drivers $drv) $total)}}
              {{end}}
          </tr>
          {{end}}
      </tbody>
  </table>
</div>