wlroots/include/wlr/util/transform.h
Simon Ser 2eb225236e util/transform: add wlr_output_transform_coords()
We hand-roll this in multiple places.
2023-11-23 11:07:34 +01:00

34 lines
880 B
C

/*
* This an unstable interface of wlroots. No guarantees are made regarding the
* future consistency of this API.
*/
#ifndef WLR_USE_UNSTABLE
#error "Add -DWLR_USE_UNSTABLE to enable unstable wlroots features"
#endif
#ifndef WLR_UTIL_TRANSFORM_H
#define WLR_UTIL_TRANSFORM_H
#include <wayland-server-protocol.h>
/**
* Returns the transform that, when composed with `tr`, gives
* `WL_OUTPUT_TRANSFORM_NORMAL`.
*/
enum wl_output_transform wlr_output_transform_invert(
enum wl_output_transform tr);
/**
* Returns a transform that, when applied, has the same effect as applying
* sequentially `tr_a` and `tr_b`.
*/
enum wl_output_transform wlr_output_transform_compose(
enum wl_output_transform tr_a, enum wl_output_transform tr_b);
/**
* Applies a transform to coordinates.
*/
void wlr_output_transform_coords(enum wl_output_transform tr, int *x, int *y);
#endif