Browse Source

Add resolutions: xl, xl+, xxl, xxl+

customisations
alemart 11 months ago
parent
commit
b4c82dacd4
3 changed files with 26 additions and 15 deletions
  1. 15
    11
      docs/api/resolution.md
  2. 3
    3
      plugins/aframe-with-encantar.js
  3. 8
    1
      src/utils/resolution.ts

+ 15
- 11
docs/api/resolution.md View File

1
 # Resolution
1
 # Resolution
2
 
2
 
3
-A `Resolution` is a setting defined by a string. It is mapped to a size measured in pixels according to special rules. You may use it to change the resolution in pixels of a video captured by a webcam, or to adjust the resolution in pixels of the videos that are processed by a tracker for example.
3
+A `Resolution` is a setting defined by a string. It is mapped to a size measured in pixels according to special rules. You may use it, for example, to change the resolution of a video captured by a webcam, to adjust the resolution of a video when it is processed by a tracker, or to set the resolution of the virtual scene when it is rendered.
4
 
4
 
5
 The table below shows examples of how resolution strings are converted to pixels:
5
 The table below shows examples of how resolution strings are converted to pixels:
6
 
6
 
7
-| Resolution string | 16:9 landscape | 16:10 landscape | 4:3 landscape |
8
-| ----------------- | -------------- | --------------- | ------------- |
9
-| `"xs"` | 212x120 | 192x120 | 160x120 |
10
-| `"xs+"` | 284x160 | 256x160 | 212x160 |
11
-| `"sm"` | 356x200 | 320x200 | 266x200 | 
12
-| `"sm+"` | 426x240 | 384x240 | 320x240 |
13
-| `"md"` | 568x320 | 512x320 | 426x320 |
14
-| `"md+"` | 640x360 | 576x360 | 480x360 |
15
-| `"lg"` | 852x480 | 768x480 | 640x480 |
16
-| `"lg+"` | 1066x600 | 960x600 | 800x600 |
7
+| Resolution | 16:9 landscape | 16:10 landscape | 4:3 landscape | Notes |
8
+| ---------- | -------------- | --------------- | ------------- | ----- |
9
+| `"xs"` | 212x120 | 192x120 | 160x120 | |
10
+| `"xs+"` | 284x160 | 256x160 | 212x160 | |
11
+| `"sm"` | 356x200 | 320x200 | 266x200 | |
12
+| `"sm+"` | 426x240 | 384x240 | 320x240 | |
13
+| `"md"` | 568x320 | 512x320 | 426x320 | |
14
+| `"md+"` | 640x360 | 576x360 | 480x360 | |
15
+| `"lg"` | 852x480 | 768x480 | 640x480 | 480p |
16
+| `"lg+"` | 1066x600 | 960x600 | 800x600 | |
17
+| `"xl"` | 1280x720 | 1152x720 | 960x720 | 720p |
18
+| `"xl+"` | 1364x768 | 1228x768 | 1024x768 | |
19
+| `"xxl"` | 1600x900 | 1440x900 | 1200x900 | |
20
+| `"xxl+"` | 1706x960 | 1536x960 | 1280x960 | 960p |

+ 3
- 3
plugins/aframe-with-encantar.js View File

592
 
592
 
593
     schema: {
593
     schema: {
594
 
594
 
595
-        /** video resolution: "xs" | "xs+" | "sm" | "sm+" | "md" | "md+" | "lg" | "lg+" */
595
+        /** video resolution: "xs" | "xs+" | "sm" | "sm+" | "md" | "md+" | "lg" | "lg+" | "xl" | "xl+" | "xxl" | "xxl+" */
596
         'resolution': { type: 'string', default: 'md' },
596
         'resolution': { type: 'string', default: 'md' },
597
 
597
 
598
         /** facing mode: "environment" | "user" */
598
         /** facing mode: "environment" | "user" */
741
 
741
 
742
     schema: {
742
     schema: {
743
 
743
 
744
-        /** resolution of the tracker: "xs" | "xs+" | "sm" | "sm+" | "md" | "md+" | "lg" | "lg+" */
744
+        /** resolution of the tracker: "xs" | "xs+" | "sm" | "sm+" | "md" | "md+" | "lg" | "lg+" | "xl" | "xl+" | "xxl" | "xxl+" */
745
         'resolution': { type: 'string', default: 'sm+' },
745
         'resolution': { type: 'string', default: 'sm+' },
746
 
746
 
747
     },
747
     },
836
 
836
 
837
     schema: {
837
     schema: {
838
 
838
 
839
-        /** viewport resolution: "xs" | "xs+" | "sm" | "sm+" | "md" | "md+" | "lg" | "lg+" */
839
+        /** viewport resolution: "xs" | "xs+" | "sm" | "sm+" | "md" | "md+" | "lg" | "lg+" | "xl" | "xl+" | "xxl" | "xxl+" */
840
         'resolution': { type: 'string', default: 'lg' },
840
         'resolution': { type: 'string', default: 'lg' },
841
 
841
 
842
         /** viewport style: "best-fit" | "stretch" | "inline" */
842
         /** viewport style: "best-fit" | "stretch" | "inline" */

+ 8
- 1
src/utils/resolution.ts View File

25
 import { IllegalArgumentError } from './errors';
25
 import { IllegalArgumentError } from './errors';
26
 
26
 
27
 /** Resolution type */
27
 /** Resolution type */
28
-export type Resolution = 'xs' | 'xs+' | 'sm' | 'sm+' | 'md' | 'md+' | 'lg' | 'lg+';
28
+export type Resolution = 'xs' | 'xs+' | 'sm' | 'sm+' | 'md' | 'md+' | 'lg' | 'lg+' | 'xl' | 'xl+' | 'xxl' | 'xxl+';
29
 
29
 
30
 /** Reference heights when in landscape mode, measured in pixels */
30
 /** Reference heights when in landscape mode, measured in pixels */
31
 const REFERENCE_HEIGHT: { readonly [R in Resolution]: number } = {
31
 const REFERENCE_HEIGHT: { readonly [R in Resolution]: number } = {
37
     'md+': 360,
37
     'md+': 360,
38
     'lg' : 480,
38
     'lg' : 480,
39
     'lg+': 600,
39
     'lg+': 600,
40
+    'xl' : 720, // should we define an alias, "hd"?
41
+    'xl+': 768,
42
+    'xxl': 900,
43
+    'xxl+':960,
44
+    //'ul-': 1024,
45
+    //'ul': 1080, // what should we call this? xxxl? ul? (ultra large?)
46
+    //'ul+': 1200,
40
 };
47
 };
41
 
48
 
42
 /**
49
 /**

Loading…
Cancel
Save