Alguém pode explicar como xrandr --scale funciona?

Alguém pode explicar como xrandr --scale funciona?

Dos 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.

Vamos tentar:

Quando digito, --xrandr --output eDP 1.2x1.2a tela fica menor em cerca de 20% (isso confere)

Quando digito, --xrandr --output eDP 0.8x0.8a tela fica absolutamente enorme, com muito mais zoom do que 20% (isso falsifica os documentos)

Quando digito --xrandr --output eDP 1x1fica ainda maior! Está aumentando o zoom. Parece que essas transformações estão sendo aplicadas de forma relativa... mas se for esse o caso, então 1x1 deveria mantê-lo totalmente estático?

Quando digito, --xrandr --output eDP 1.5x1.5fica menor novamente.mas ainda é maior que--scale 1.2x1.2, mais uma evidência de escala relativa.

Quando digito --xrandr --output eDP 1.5x1.5nada acontece. Espere – isso significa que essas transformações não são aplicadas relativamente?

Quando digito --xrandr --output eDP 2x2ele basicamente volta ao tamanho nativo... que não está na escala 2x! (o tamanho original é 1920x1080 em escala 1x).

O mesmo --scaleocorre com uma abreviatura de --transform, que é descrita 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).

Então, se eu escrever `xrandr --output eDP --scale 1.5x1.5 isso estaria criando uma matriz de transformação como:

M = 
  1.5  0    0
  0    1.5  0
  0    0    1

onde estou usando * para denotar o produto escalar e (x,y) são algumas coordenadas

Então isso seria igual a:

w' = (0x + 0y + 1) = 1
x' = (1.5x + 0y + 1) / w' = 1.5x
y' = (0x + 1.5y + 1) / w' = 1.5y

Isto implica uma transformação linear e relativa das últimas coordenadas x,y afaik! Mas espere,se de acordo com os documentos, os valores da escala> 1 devemcomprimiras saídas, parece que na verdade está expandindo as saídas, já que (x,y) está sendo multiplicado por 1,5.

Estou usando dois monitores, se isso significa alguma coisa, nem estou entrando em como isso afeta o espaço da tela do outro monitor

Responder1

Tento te ajudar - ontem li a documentação e ficou difícil de entender.
fiz essa pintura abaixo.

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

xey em pixels do modo de saída no seu monitor
x' e y' em pixels da imagem da tela no buffer gráfico

xrandr

Eu tenho um monitor: por exemplo, ângulo de 10 graus, 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

saída de chamar xrandr depois dissoxrandr

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 deve ser imagem no buffer gráfico
(2176 x cos 10 + 930 x sen 10) / 1,2 = 1920

mas não tenho certeza sobre a tela (amarela) da pintura!

A distância entre a imagem no pixel superior do buffer e a parte inferior da tela do monitor seria:
2176 x sen 10 + 1080 x 1,2 = 1674,
mas isso inclui o monitor em branco, mas se a imagem exceder o monitor, aposto que a pintura é certo.

você pode voltar à configuração antiga com:
xrandr --output "DVI-D-0" --transform 1,0,0,0,1,0,0,0,1

salve todos os arquivos que você abriu, duas vezes travei meu monitor não tinha sinal, por causa de entrada incorreta e tive que reiniciar!

informação relacionada