Explorar el Código

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

customisations
alemart hace 11 meses
padre
commit
b4c82dacd4
Se han modificado 3 ficheros con 26 adiciones y 15 borrados
  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 Ver fichero

@@ -1,16 +1,20 @@
1 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 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 Ver fichero

@@ -592,7 +592,7 @@ AFRAME.registerComponent('ar-camera-source', ARComponent({
592 592
 
593 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 596
         'resolution': { type: 'string', default: 'md' },
597 597
 
598 598
         /** facing mode: "environment" | "user" */
@@ -741,7 +741,7 @@ AFRAME.registerComponent('ar-image-tracker', ARComponent({
741 741
 
742 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 745
         'resolution': { type: 'string', default: 'sm+' },
746 746
 
747 747
     },
@@ -836,7 +836,7 @@ AFRAME.registerComponent('ar-viewport', ARComponent({
836 836
 
837 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 840
         'resolution': { type: 'string', default: 'lg' },
841 841
 
842 842
         /** viewport style: "best-fit" | "stretch" | "inline" */

+ 8
- 1
src/utils/resolution.ts Ver fichero

@@ -25,7 +25,7 @@ import { SpeedySize } from 'speedy-vision/types/core/speedy-size';
25 25
 import { IllegalArgumentError } from './errors';
26 26
 
27 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 30
 /** Reference heights when in landscape mode, measured in pixels */
31 31
 const REFERENCE_HEIGHT: { readonly [R in Resolution]: number } = {
@@ -37,6 +37,13 @@ const REFERENCE_HEIGHT: { readonly [R in Resolution]: number } = {
37 37
     'md+': 360,
38 38
     'lg' : 480,
39 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…
Cancelar
Guardar