![누군가 xrandr --scale이 어떻게 작동하는지 설명해 주시겠습니까?](https://rvso.com/image/231063/%EB%88%84%EA%B5%B0%EA%B0%80%20xrandr%20--scale%EC%9D%B4%20%EC%96%B4%EB%96%BB%EA%B2%8C%20%EC%9E%91%EB%8F%99%ED%95%98%EB%8A%94%EC%A7%80%20%EC%84%A4%EB%AA%85%ED%95%B4%20%EC%A3%BC%EC%8B%9C%EA%B2%A0%EC%8A%B5%EB%8B%88%EA%B9%8C%3F.png)
문서에서:
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.
해보자:
타이핑을 하면 --xrandr --output eDP 1.2x1.2
화면이 약 20% 정도 작아집니다. (이것이 확인됩니다.)
내가 입력하면 --xrandr --output eDP 0.8x0.8
화면이 엄청나게 커지고 20%보다 훨씬 더 확대됩니다(이것은 문서를 위조합니다).
입력하면 --xrandr --output eDP 1x1
더 커집니다! 확대되고 있습니다. 이러한 변환은 상대적으로 적용되는 것 같습니다... 하지만 그렇다면 1x1은 완전히 정적으로 유지해야 합니까?
입력하면 --xrandr --output eDP 1.5x1.5
다시 작아집니다.하지만 여전히 그보다 더 크다--scale 1.2x1.2
, 상대적 스케일링에 대한 추가 증거.
입력해도 --xrandr --output eDP 1.5x1.5
아무 일도 일어나지 않습니다. 잠깐만요. 이러한 변환이 상대적으로 적용되지 않는다는 의미인가요?
내가 입력하면 --xrandr --output eDP 2x2
기본적으로 기본 크기로 돌아갑니다... 이는 2배 크기가 아닙니다! (원본 크기는 1x 스케일에서 1920x1080입니다).
--scale
의 약어도 다음 --transform
과 같이 설명됩니다.
--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).
따라서 `xrandr --output eDP --scale 1.5x1.5 라고 쓰면 다음과 같은 변환 행렬이 생성됩니다.
M =
1.5 0 0
0 1.5 0
0 0 1
여기서 내적을 나타내기 위해 *를 사용하고 있으며 (x,y)는 일부 좌표입니다.
따라서 이는 다음과 같습니다.
w' = (0x + 0y + 1) = 1
x' = (1.5x + 0y + 1) / w' = 1.5x
y' = (0x + 1.5y + 1) / w' = 1.5y
이는 마지막 x, y 좌표 afaik에서 선형 및 상대 변환을 수반합니다! 하지만 기다려,문서에 따르면 척도 값 > 1로 가정되는 경우압박 붕대(x,y)에 1.5를 곱하기 때문에 출력이 실제로 확장되는 것처럼 보입니다.
이것이 의미하는 바가 있다면 저는 두 개의 모니터를 사용하고 있습니다. 이것이 다른 모니터 화면 공간에 어떤 영향을 미치는지조차 이해하지 못합니다.
답변1
나는 당신을 도우려고 노력합니다. 어제 문서를 읽었는데 이해하기 어려웠습니다.
저는 이 그림을 아래에 그렸습니다.
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 및 y(모니터 출력 모드의 픽셀)
그래픽 버퍼에 있는 화면 이미지의 x' 및 y'(픽셀)
모니터가 하나 있습니다. 예를 들어 각도 10도, 배율 1.2 -> cos 10 x 1.2 = 1.1818, sin 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
그 후 xrandr 호출 결과xrandr
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은 그래픽 버퍼의 이미지여야 합니다
(2176 x cos 10 + 930 x sin 10) / 1.2 = 1920
하지만 그림의 화면(노란색)은 잘 모르겠습니다!
버퍼 상단 픽셀의 이미지와 모니터 화면 하단 사이의 거리는
2176 x sin 10 + 1080 x 1,2=1674
이지만 이는 빈 모니터를 포함하지만 이미지가 모니터를 초과하는 경우 그림은 다음과 같을 것입니다. 오른쪽.
다음을 사용하여 이전 설정으로 돌아갈 수 있습니다.
xrandr --output "DVI-D-0" --transform 1,0,0,0,1,0,0,0,1
열려 있는 모든 파일을 저장했습니다. 입력이 잘못되어 모니터에 신호가 없어서 두 번이나 충돌이 발생하여 다시 시작해야 했습니다!