メイン・コンテンツまでスキップ

DisplayTransformation

Defines transformations from display space to framebuffer space. The display might be (considered) in portrait mode from 0,0 to 272,480, while the actual framebuffer is from 0,0 to 480,272. This class handles the transformations.

Public Functions

voidtransformDisplayToFrameBuffer(float & x, float & y)
Transform x,y from display to framebuffer coordinates.
voidtransformDisplayToFrameBuffer(float & x, float & y, const Rect & in)
Transform x,y from coordinates relative to the in rect to framebuffer coordinates.
voidtransformDisplayToFrameBuffer(int16_t & x, int16_t & y)
Transform x,y from display to framebuffer coordinates.
voidtransformDisplayToFrameBuffer(int16_t & x, int16_t & y, const Rect & in)
Transform x,y from coordinates relative to the in rect to framebuffer coordinates.
voidtransformDisplayToFrameBuffer(Rect & r)
Transform rectangle from display to framebuffer coordinates.
voidtransformDisplayToFrameBuffer(Rect & r, const Rect & in)
Transform rectangle r from coordinates relative to the in rect to framebuffer coordinates.
voidtransformFrameBufferToDisplay(int16_t & x, int16_t & y)
Transform x,y from framebuffer to display coordinates.
voidtransformFrameBufferToDisplay(Rect & r)
Transform rectangle from framebuffer to display coordinates.

Public Functions Documentation

transformDisplayToFrameBuffer

static void transformDisplayToFrameBuffer(float &x ,
float &y
)

Transform x,y from display to framebuffer coordinates.

Parameters:
xthe x part to translate.
ythe y part to translate.

transformDisplayToFrameBuffer

static void transformDisplayToFrameBuffer(float &x ,
float &y ,
const Rect &in
)

Transform x,y from coordinates relative to the in rect to framebuffer coordinates.

Transform x,y from coordinates relative to the in rect to framebuffer coordinates.

Parameters:
xthe x part to translate.
ythe y part to translate.
inthe rectangle defining the coordinate space.

transformDisplayToFrameBuffer

static void transformDisplayToFrameBuffer(int16_t &x ,
int16_t &y
)

Transform x,y from display to framebuffer coordinates.

Parameters:
xthe x part to translate.
ythe y part to translate.

transformDisplayToFrameBuffer

static void transformDisplayToFrameBuffer(int16_t &x ,
int16_t &y ,
const Rect &in
)

Transform x,y from coordinates relative to the in rect to framebuffer coordinates.

Transform x,y from coordinates relative to the in rect to framebuffer coordinates.

Parameters:
xthe x part to translate.
ythe y part to translate.
inthe rectangle defining the coordinate space.

transformDisplayToFrameBuffer

Transform rectangle from display to framebuffer coordinates.

Parameters:
rthe rectangle to translate.

transformDisplayToFrameBuffer

static void transformDisplayToFrameBuffer(Rect &r ,
const Rect &in
)

Transform rectangle r from coordinates relative to the in rect to framebuffer coordinates.

Transform rectangle r from coordinates relative to the in rect to framebuffer coordinates.

Parameters:
rthe rectangle to translate.
inthe rectangle defining the coordinate space.

transformFrameBufferToDisplay

static void transformFrameBufferToDisplay(int16_t &x ,
int16_t &y
)

Transform x,y from framebuffer to display coordinates.

Parameters:
xthe x part to translate.
ythe y part to translate.

transformFrameBufferToDisplay

Transform rectangle from framebuffer to display coordinates.

Parameters:
rthe rectangle to translate.