|
3 | 3 | # Test of the raster attributes aspect ratio in a Sixel image.
|
4 | 4 |
|
5 | 5 | # If an image includes a raster attributes command, the first two parameters
|
6 |
| -# define numerator and denominator of the pixel aspect ratio. On a genuine |
7 |
| -# VT340, this ratio is rounded up to the nearest integer value. For example. |
8 |
| -# 3:2 is 1.5, which rounds up to 2 (i.e. an aspect ratio of 2:1). |
| 6 | +# define the numerator and denominator of the pixel aspect ratio. On a genuine |
| 7 | +# VT340, this ratio is rounded up to the nearest integer value, with a minimum |
| 8 | +# value of 1. For example, 3:2 is 1.5, which rounds up to 2 (i.e. an aspect |
| 9 | +# ratio of 2:1). If the denominator is zero, the aspect ratio is ignored, and |
| 10 | +# will fall back to the value determined by the initial macro parameter. |
9 | 11 |
|
10 | 12 | CSI=$'\e[' # Control Sequence Introducer
|
11 | 13 | DCS=$'\eP' # Device Control String
|
@@ -49,13 +51,13 @@ range_test() {
|
49 | 51 | done
|
50 | 52 | }
|
51 | 53 |
|
52 |
| -aspect_ratio_test 8 '' 2 |
53 |
| -aspect_ratio_test 18 '0;0' 2 |
54 |
| -aspect_ratio_test 28 '0;1' 2 |
55 |
| -aspect_ratio_test 38 '1;3' 10 |
56 |
| -aspect_ratio_test 48 '3;2' 5 |
57 |
| -aspect_ratio_test 58 '7;4' 5 |
58 |
| -aspect_ratio_test 68 '37;4' 1 |
| 54 | +aspect_ratio_test 8 '' 2 # a blank AR falls back to the macro parameter value (5:1) |
| 55 | +aspect_ratio_test 18 '0;0' 2 # a zero denominator also falls back to 5:1 |
| 56 | +aspect_ratio_test 28 '0;1' 10 # 0:1 = 0, but the minimum is 1:1 |
| 57 | +aspect_ratio_test 38 '1;3' 10 # 1:3 = 0.333, which rounds up to 1:1 |
| 58 | +aspect_ratio_test 48 '3;2' 5 # 3:2 = 1.5, which rounds up to 2:1 |
| 59 | +aspect_ratio_test 58 '7;4' 5 # 7:4 = 1.75, which rounds up to 2:1 |
| 60 | +aspect_ratio_test 68 '37;4' 1 # 37:4 = 9.25, which rounds up to 10:1 |
59 | 61 |
|
60 | 62 | range_test
|
61 | 63 |
|
|
0 commit comments