![¿Alguien puede explicar cómo funciona xrandr --scale?](https://rvso.com/image/231063/%C2%BFAlguien%20puede%20explicar%20c%C3%B3mo%20funciona%20xrandr%20--scale%3F.png)
De los documentos:
Changes the dimensions of the output picture. If the y value is
omitted, the x value will be used for both dimensions. Values
larger than 1 lead to a compressed screen (screen dimension big‐
ger than the dimension of the output mode), and values less than
1 lead to a zoom in on the output. This option is actually a
shortcut version of the --transform option.
Intentemos:
Cuando escribo, --xrandr --output eDP 1.2x1.2
la pantalla se reduce aproximadamente un 20 % (esto se comprueba)
Cuando escribo, --xrandr --output eDP 0.8x0.8
la pantalla se vuelve absolutamente enorme, mucho más ampliada que el 20% (esto falsifica los documentos)
¡Cuando escribo --xrandr --output eDP 1x1
se vuelve aún más grande! Se está acercando. Parece que estas transformaciones se están aplicando relativamente... pero si este es el caso, ¿1x1 debería mantenerlo totalmente estático?
Cuando escribo, --xrandr --output eDP 1.5x1.5
se vuelve más pequeño.pero sigue siendo más grande que--scale 1.2x1.2
, evidencia adicional de escala relativa.
Cuando escribo --xrandr --output eDP 1.5x1.5
no pasa nada. Espera, ¿significa eso que estas transformaciones no se aplican relativamente?
Cuando escribo, --xrandr --output eDP 2x2
básicamente vuelve a su tamaño original... ¡que no está en una escala de 2x! (el tamaño original es 1920x1080 a escala 1x).
También lo --scale
es una abreviatura de --transform
, que se describe como:
--transform a,b,c,d,e,f,g,h,i
Specifies a transformation matrix to apply on the output. A bi‐
linear filter is selected automatically unless the --filter pa‐
rameter is also specified. The mathematical form corresponds
to:
a b c
d e f
g h i
The transformation is based on homogeneous coordinates. The ma‐
trix multiplied by the coordinate vector of a pixel of the out‐
put gives the transformed coordinate vector of a pixel in the
graphic buffer. More precisely, the vector (x y) of the output
pixel is extended to 3 values (x y w), with 1 as the w coordi‐
nate and multiplied against the matrix. The final device coordi‐
nates of the pixel are then calculated with the so-called ho‐
mogenic division by the transformed w coordinate. In other
words, the device coordinates (x' y') of the transformed pixel
are:
x' = (ax + by + c) / w' and
y' = (dx + ey + f) / w' ,
with w' = (gx + hy + i) .
Typically, a and e corresponds to the scaling on the X and Y
axes, c and f corresponds to the translation on those axes, and
g, h, and i are respectively 0, 0 and 1. The matrix can also be
used to express more complex transformations such as keystone
correction, or rotation. For a rotation of an angle T, this
formula can be used:
cos T -sin T 0
sin T cos T 0
0 0 1
As a special argument, instead of passing a matrix, one can pass
the string none, in which case the default values are used (a
unit matrix without filter).
Entonces, si escribo `xrandr --output eDP --scale 1.5x1.5 esto estaría creando una matriz de transformación como:
M =
1.5 0 0
0 1.5 0
0 0 1
donde estoy usando * para indicar el producto escalar, y (x,y) son algunas coordenadas
Entonces esto sería igual a:
w' = (0x + 0y + 1) = 1
x' = (1.5x + 0y + 1) / w' = 1.5x
y' = (0x + 1.5y + 1) / w' = 1.5y
¡Esto implica una transformación lineal y relativa desde las últimas coordenadas x, y que yo sepa! Pero espera,si según los documentos, se supone que los valores de escala> 1comprimirlas salidas, esto parece que en realidad está expandiendo las salidas ya que (x,y) se multiplica por 1,5.
Estoy usando dos monitores si esto significa algo, ni siquiera voy a explicar cómo afecta el espacio de la pantalla del otro monitor.
Respuesta1
Intento ayudarte; ayer leí la documentación y fue difícil de entender.
Hice esta pintura a continuación.
x'=x cos T + y -sin T + c | a b c
y'=x sin T + y cos T + f | d e f | g=0, h=0, i=1
x e y en píxeles del modo de salida en su monitor
x' e y' en píxeles de la imagen de la pantalla en el búfer gráfico
Tengo un monitor: por ejemplo, ángulo de 10 grados, escala 1,2 -> cos 10 x 1,2 = 1,1818, sen 10 x 1,2 = 0,2084
xrandr --output "DVI-D-0" --transform 1.1818,-0.2084,0,0.2084,1.1818,0,0,0,1
salida de llamar a xrandr después de esoxrandr
Screen 0: minimum 8 x 8, current 2270 x 1677, maximum 32767 x 32767
DVI-D-0 connected primary 2176x930+0+0 (normal left inverted right x axis y axis) 531mm x 299mm
1920x1080 60.00*+
1680x1050 59.95
1600x1200 60.00
1440x900 59.89
1280x1024 75.02 60.02
1280x960 60.00
1152x864 75.00
1024x768 75.03 70.07 60.00
800x600 75.00 72.19 60.32 56.25
640x480 75.00 72.81 59.94
HDMI-0 disconnected (normal left inverted right x axis y axis)
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
2176x930 debe ser una imagen en el búfer gráfico
(2176 x cos 10 + 930 x sin 10) / 1,2 = 1920
¡Pero no estoy seguro de la pantalla (amarilla) en la pintura!
La distancia entre la imagen en el píxel superior del buffer y la parte inferior de la pantalla del monitor sería:
2176 x sin 10 + 1080 x 1,2=1674
pero eso incluye el monitor en blanco, pero si la imagen excede el monitor, apuesto a que la pintura es bien.
puedes volver a la configuración anterior con:
xrandr --output "DVI-D-0" --transform 1,0,0,0,1,0,0,0,1
guarde todos los archivos que tenga abiertos, dos veces me bloqueé y mi monitor no tenía señal debido a una mala entrada y tuve que reiniciar.