diff options
author | Pierre Ossman <ossman@cendio.se> | 2022-09-10 13:48:53 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2023-02-01 21:15:36 +0100 |
commit | baca73d03217a1c219d9c4f024ffcd39f85fd322 (patch) | |
tree | 0220df8a75d80575157701be539c48b47ef2fb6a /common/rfb/RREDecoder.h | |
parent | bf0fb9129d397f7bbb27ba784890cd9c2102d839 (diff) | |
download | tigervnc-baca73d03217a1c219d9c4f024ffcd39f85fd322.tar.gz tigervnc-baca73d03217a1c219d9c4f024ffcd39f85fd322.zip |
Use templates for optimized code
Avoid preprocessor magic and instead rely on templating to generate
optimized functions for performance critical code.
Diffstat (limited to 'common/rfb/RREDecoder.h')
-rw-r--r-- | common/rfb/RREDecoder.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/common/rfb/RREDecoder.h b/common/rfb/RREDecoder.h index b8ec18f6..05acbc24 100644 --- a/common/rfb/RREDecoder.h +++ b/common/rfb/RREDecoder.h @@ -1,4 +1,5 @@ /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved. + * 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,6 +23,8 @@ namespace rfb { + class PixelFormat; + class RREDecoder : public Decoder { public: RREDecoder(); @@ -31,6 +34,12 @@ namespace rfb { virtual void decodeRect(const Rect& r, const void* buffer, size_t buflen, const ServerParams& server, ModifiablePixelBuffer* pb); + private: + template<class T> + inline T readPixel(rdr::InStream* is); + template<class T> + void rreDecode(const Rect& r, rdr::InStream* is, + const PixelFormat& pf, ModifiablePixelBuffer* pb); }; } #endif |