Skip to content
Commit 3a4eebdd authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

core: Rework OutputTransform::combine()

The naive way to combine output transforms is not great, especially
because of the for loop.

The output transform kind enums have the following bit pattern:

- rotate-0:   000
- rotate-90:  001
- rotate-180: 010
- rotate-270: 011
- flip-0:     100
- flip-90:    101
- flip-180:   110
- flip-270:   111

`(rotate-a + rotate-b) & 0x3` can be used to combine two rotation
transforms. The rotatation is clockwise.

If the first transform is a flip transform, then we should rotate
counter-clockwise, i.e. `(rotate-a - rotate-b) & 0x3`.
parent 50346b6e
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment