-
Notifications
You must be signed in to change notification settings - Fork 6
shift_y
Alexandre Marcireau edited this page May 31, 2018
·
3 revisions
In header "../third_party/tarsier/source/shift_y.hpp"
tarsier::shift_y
translates the y coordinate.
namespace tarsier {
template <typename Event, typename HandleEvent>
class shift_y {
public:
shift_x(uint16_t width, int32_t shift, HandleEvent handle_event);
/// operator() handles an event.
virtual void operator()(Event event);
};
}
-
Event
is the input type. It must have at least the propertyy
. - The expression
handle_event(event)
, whereevent
is anEvent
object, must be valid. -
height
is the maximum y coordinate plus one (ify
is in the integer range[0, 239]
,height
must be320
). -
shift
is the y coordinate translation. It can be positive (shift to the top) or negative (shift to the bottom).
Event
must be specified when using make_shift_y
:
struct event {
uint16_t y;
};
auto shift_y = tarsier::make_shift_y<event>(
239,
-10,
[](event event) {
// do something with event
});