aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb
diff options
context:
space:
mode:
authorgeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>2006-05-29 13:52:55 +0000
committergeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>2006-05-29 13:52:55 +0000
commitf98083a51eaed20cb08137abede5d642b74b5b34 (patch)
treef432eeefa39802acef218ed38b70c8e6e2491882 /common/rfb
parente89d47fb19a0a0438b2b038f0e7ab005d72a9be2 (diff)
downloadtigervnc-f98083a51eaed20cb08137abede5d642b74b5b34.tar.gz
tigervnc-f98083a51eaed20cb08137abede5d642b74b5b34.zip
Added new exception rfb::UnsupportedPixelFormatException.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@598 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'common/rfb')
-rw-r--r--common/rfb/ScaledPixelBuffer.cxx4
-rw-r--r--common/rfb/ScaledPixelBuffer.h6
2 files changed, 7 insertions, 3 deletions
diff --git a/common/rfb/ScaledPixelBuffer.cxx b/common/rfb/ScaledPixelBuffer.cxx
index 5892a97b..e459b39b 100644
--- a/common/rfb/ScaledPixelBuffer.cxx
+++ b/common/rfb/ScaledPixelBuffer.cxx
@@ -51,9 +51,7 @@ void ScaledPixelBuffer::setSourceBuffer(U8 **src_data_, int w, int h) {
}
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_;
}
diff --git a/common/rfb/ScaledPixelBuffer.h b/common/rfb/ScaledPixelBuffer.h
index d69f0ac1..8af69579 100644
--- a/common/rfb/ScaledPixelBuffer.h
+++ b/common/rfb/ScaledPixelBuffer.h
@@ -23,6 +23,7 @@
// interpolation.
#include <rdr/types.h>
+#include <rdr/Exception.h>
#include <rfb/Rect.h>
#include <rfb/PixelFormat.h>
@@ -30,6 +31,11 @@ using namespace rdr;
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);