Add optimised buffer conversion
Handles the common cases when the target or source are in
the preferred 888 format.
If one of the buffers is not 888, then it must also be properly
aligned (which is commonly the case). Performance is now in many
cases on par with PixelTransformer.
diff --git a/common/rfb/PixelFormat.h b/common/rfb/PixelFormat.h
index b18045f..113b8ee 100644
--- a/common/rfb/PixelFormat.h
+++ b/common/rfb/PixelFormat.h
@@ -90,6 +90,29 @@
void updateState(void);
bool isSane(void);
+ private:
+ // Preprocessor generated, optimised methods
+
+ void directBufferFromBufferFrom888(rdr::U8* dst, const PixelFormat &srcPF,
+ const rdr::U8* src, int w, int h,
+ int dstStride, int srcStride) const;
+ void directBufferFromBufferFrom888(rdr::U16* dst, const PixelFormat &srcPF,
+ const rdr::U8* src, int w, int h,
+ int dstStride, int srcStride) const;
+ void directBufferFromBufferFrom888(rdr::U32* dst, const PixelFormat &srcPF,
+ const rdr::U8* src, int w, int h,
+ int dstStride, int srcStride) const;
+
+ void directBufferFromBufferTo888(rdr::U8* dst, const PixelFormat &srcPF,
+ const rdr::U8* src, int w, int h,
+ int dstStride, int srcStride) const;
+ void directBufferFromBufferTo888(rdr::U8* dst, const PixelFormat &srcPF,
+ const rdr::U16* src, int w, int h,
+ int dstStride, int srcStride) const;
+ void directBufferFromBufferTo888(rdr::U8* dst, const PixelFormat &srcPF,
+ const rdr::U32* src, int w, int h,
+ int dstStride, int srcStride) const;
+
public:
int bpp;
int depth;