aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb/EncodeManager.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/rfb/EncodeManager.h')
-rw-r--r--common/rfb/EncodeManager.h34
1 files changed, 13 insertions, 21 deletions
diff --git a/common/rfb/EncodeManager.h b/common/rfb/EncodeManager.h
index f8201c34..f2fd4ca4 100644
--- a/common/rfb/EncodeManager.h
+++ b/common/rfb/EncodeManager.h
@@ -1,6 +1,6 @@
/* Copyright (C) 2000-2003 Constantin Kaplinsky. All Rights Reserved.
* Copyright (C) 2011 D. R. Commander. All Rights Reserved.
- * Copyright 2014-2018 Pierre Ossman for Cendio AB
+ * Copyright 2014-2022 Pierre Ossman for Cendio AB
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -22,7 +22,8 @@
#include <vector>
-#include <rdr/types.h>
+#include <stdint.h>
+
#include <rfb/PixelBuffer.h>
#include <rfb/Region.h>
#include <rfb/Timer.h>
@@ -82,12 +83,12 @@ namespace rfb {
void writeSubRect(const Rect& rect, const PixelBuffer *pb);
- bool checkSolidTile(const Rect& r, const rdr::U8* colourValue,
+ bool checkSolidTile(const Rect& r, const uint8_t* colourValue,
const PixelBuffer *pb);
- void extendSolidAreaByBlock(const Rect& r, const rdr::U8* colourValue,
+ void extendSolidAreaByBlock(const Rect& r, const uint8_t* colourValue,
const PixelBuffer *pb, Rect* er);
void extendSolidAreaByPixel(const Rect& r, const Rect& sr,
- const rdr::U8* colourValue,
+ const uint8_t* colourValue,
const PixelBuffer *pb, Rect* er);
PixelBuffer* preparePixelBuffer(const Rect& rect,
@@ -97,22 +98,13 @@ namespace rfb {
struct RectInfo *info, int maxColours);
protected:
- // Preprocessor generated, optimised methods
- inline bool checkSolidTile(const Rect& r, rdr::U8 colourValue,
- const PixelBuffer *pb);
- inline bool checkSolidTile(const Rect& r, rdr::U16 colourValue,
+ // Templated, optimised methods
+ template<class T>
+ inline bool checkSolidTile(const Rect& r, const T,
const PixelBuffer *pb);
- inline bool checkSolidTile(const Rect& r, rdr::U32 colourValue,
- const PixelBuffer *pb);
-
- inline bool analyseRect(int width, int height,
- const rdr::U8* buffer, int stride,
- struct RectInfo *info, int maxColours);
- inline bool analyseRect(int width, int height,
- const rdr::U16* buffer, int stride,
- struct RectInfo *info, int maxColours);
+ template<class T>
inline bool analyseRect(int width, int height,
- const rdr::U32* buffer, int stride,
+ const T* buffer, int stride,
struct RectInfo *info, int maxColours);
protected:
@@ -147,10 +139,10 @@ namespace rfb {
virtual ~OffsetPixelBuffer() {}
void update(const PixelFormat& pf, int width, int height,
- const rdr::U8* data_, int stride);
+ const uint8_t* data_, int stride);
private:
- virtual rdr::U8* getBufferRW(const Rect& r, int* stride);
+ virtual uint8_t* getBufferRW(const Rect& r, int* stride);
};
OffsetPixelBuffer offsetPixelBuffer;