}
void ScaledPixelBuffer::setPF(const PixelFormat &pf_) {
- if (pf_.depth != 24) {
- throw rfb::Exception("rfb::ScaledPixelBuffer support only the true colour pixel format.");
- }
+ if (pf_.depth != 24) throw rfb::UnsupportedPixelFormatException();
pf = pf_;
}
// interpolation.
#include <rdr/types.h>
+#include <rdr/Exception.h>
#include <rfb/Rect.h>
#include <rfb/PixelFormat.h>
namespace rfb {
+ struct UnsupportedPixelFormatException : public Exception {
+ UnsupportedPixelFormatException(const char* s="Now supported only true colour pixel data in the scaling mode.")
+ : Exception(s) {}
+ };
+
class ScaledPixelBuffer {
public:
ScaledPixelBuffer(U8 **data, int width, int height, int scale, PixelFormat pf);