summaryrefslogtreecommitdiffstats
path: root/common/rfb/ScaledPixelBuffer.cxx
diff options
context:
space:
mode:
authorgeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>2006-07-29 10:27:19 +0000
committergeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>2006-07-29 10:27:19 +0000
commitd4344bec2cc1c16a4727ee795187f444bb7d21f5 (patch)
tree8a490afb18c4882e20558aa044c4f5c85bd03349 /common/rfb/ScaledPixelBuffer.cxx
parentb85a0d6292605ef85a6720ed09bd292e88449286 (diff)
downloadtigervnc-d4344bec2cc1c16a4727ee795187f444bb7d21f5.tar.gz
tigervnc-d4344bec2cc1c16a4727ee795187f444bb7d21f5.zip
ScaledPixelBuffer class code improvements. Remove scale
parameter. Now we set the scale using setScaleRatio. It improve the accuracy of scaling operation. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@639 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'common/rfb/ScaledPixelBuffer.cxx')
-rw-r--r--common/rfb/ScaledPixelBuffer.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/common/rfb/ScaledPixelBuffer.cxx b/common/rfb/ScaledPixelBuffer.cxx
index e459b39b..e590580a 100644
--- a/common/rfb/ScaledPixelBuffer.cxx
+++ b/common/rfb/ScaledPixelBuffer.cxx
@@ -29,14 +29,14 @@ using namespace rfb;
ScaledPixelBuffer::ScaledPixelBuffer(U8 **src_data_, int src_width_,
int src_height_, int scale, PixelFormat pf_)
- : scaled_data(0), scale_ratio(1), scale(100) {
+ : scaled_data(0), scale_ratio(1) {
setSourceBuffer(src_data_, src_width_, src_height_);
setPF(pf_);
}
ScaledPixelBuffer::ScaledPixelBuffer()
- : src_data(0), src_width(0), src_height(0), scale_ratio(1), scale(100),
+ : src_data(0), src_width(0), src_height(0), scale_ratio(1),
pf(PixelFormat(32,24,0,1,255,255,255,0,8,16)), scaled_data(0) {
}
@@ -55,10 +55,9 @@ void ScaledPixelBuffer::setPF(const PixelFormat &pf_) {
pf = pf_;
}
-void ScaledPixelBuffer::setScale(int scale_) {
- if (scale != scale_) {
- scale = scale_;
- scale_ratio = double(scale) / 100;
+void ScaledPixelBuffer::setScaleRatio(double scale_ratio_) {
+ if (scale_ratio != scale_ratio_) {
+ scale_ratio = scale_ratio_;
calculateScaledBufferSize();
}
}