diff options
Diffstat (limited to 'common/rfb/Cursor.cxx')
-rw-r--r-- | common/rfb/Cursor.cxx | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/common/rfb/Cursor.cxx b/common/rfb/Cursor.cxx index 94844144..e094e4ed 100644 --- a/common/rfb/Cursor.cxx +++ b/common/rfb/Cursor.cxx @@ -26,14 +26,15 @@ #include <stdexcept> +#include <core/LogWriter.h> + #include <rfb/Cursor.h> -#include <rfb/LogWriter.h> using namespace rfb; -static LogWriter vlog("Cursor"); +static core::LogWriter vlog("Cursor"); -Cursor::Cursor(int width, int height, const Point& hotspot, +Cursor::Cursor(int width, int height, const core::Point& hotspot, const uint8_t* data_) : width_(width), height_(height), hotspot_(hotspot) { @@ -215,9 +216,9 @@ std::vector<uint8_t> Cursor::getMask() const void Cursor::crop() { - Rect busy = Rect(0, 0, width_, height_); - busy = busy.intersect(Rect(hotspot_.x, hotspot_.y, - hotspot_.x+1, hotspot_.y+1)); + core::Rect busy(0, 0, width_, height_); + busy = busy.intersect({hotspot_.x, hotspot_.y, + hotspot_.x+1, hotspot_.y+1}); int x, y; uint8_t *data_ptr = data; for (y = 0; y < height(); y++) { @@ -255,9 +256,10 @@ RenderedCursor::RenderedCursor() { } -const uint8_t* RenderedCursor::getBuffer(const Rect& _r, int* stride) const +const uint8_t* RenderedCursor::getBuffer(const core::Rect& _r, + int* stride) const { - Rect r; + core::Rect r; r = _r.translate(offset.negate()); if (!r.enclosed_by(buffer.getRect())) @@ -267,10 +269,10 @@ const uint8_t* RenderedCursor::getBuffer(const Rect& _r, int* stride) const } void RenderedCursor::update(PixelBuffer* framebuffer, - Cursor* cursor, const Point& pos) + Cursor* cursor, const core::Point& pos) { - Point rawOffset, diff; - Rect clippedRect; + core::Point rawOffset, diff; + core::Rect clippedRect; const uint8_t* data; int stride; @@ -282,7 +284,7 @@ void RenderedCursor::update(PixelBuffer* framebuffer, setSize(framebuffer->width(), framebuffer->height()); rawOffset = pos.subtract(cursor->hotspot()); - clippedRect = Rect(0, 0, cursor->width(), cursor->height()) + clippedRect = core::Rect(0, 0, cursor->width(), cursor->height()) .translate(rawOffset) .intersect(framebuffer->getRect()); offset = clippedRect.tl; @@ -313,7 +315,7 @@ void RenderedCursor::update(PixelBuffer* framebuffer, else if (fg[3] == 0xff) { memcpy(rgb, fg, 3); } else { - buffer.getImage(bg, Rect(x, y, x+1, y+1)); + buffer.getImage(bg, {x, y, x+1, y+1}); format.rgbFromBuffer(rgb, bg, 1); // FIXME: Gamma aware blending for (int i = 0;i < 3;i++) { @@ -323,7 +325,7 @@ void RenderedCursor::update(PixelBuffer* framebuffer, } format.bufferFromRGB(bg, rgb, 1); - buffer.imageRect(Rect(x, y, x+1, y+1), bg); + buffer.imageRect({x, y, x+1, y+1}, bg); } } } |