Skip to content

mirror_y

Alexandre Marcireau edited this page May 31, 2018 · 8 revisions

In header "../third_party/tarsier/source/mirror_y.hpp"

tarsier::mirror_y inverts the y coordinate.

namespace tarsier {
    template <typename Event, typename HandleEvent>
    class mirror_y {
        public:
        mirror_y(uint16_t height, HandleEvent handle_event)

        /// operator() handles an event.
        virtual void operator()(Event event);
    };
}
  • Event is the input type. It must have at least the property y.
  • The expression handle_event(event), where event is an Event object, must be valid.
  • height is the maximum y coordinate plus one (if y is in the integer range [0, 239], height must be 240).

Event must be specified when using make_mirror_y:

struct event {
    uint16_t y;
};

auto mirror_y = tarsier::make_mirror_y<event>(
    239,
    [](event event) {
        // do something with event
    });
Clone this wiki locally