diff options
author | george82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519> | 2006-07-29 10:29:41 +0000 |
---|---|---|
committer | george82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519> | 2006-07-29 10:29:41 +0000 |
commit | bf0adb358b0be339ca35fb0b984582883ba043da (patch) | |
tree | 17aa845afc738f017854189aa2fba28d023c0140 /win/rfb_win32/ScaledDIBSectionBuffer.cxx | |
parent | d4344bec2cc1c16a4727ee795187f444bb7d21f5 (diff) | |
download | tigervnc-bf0adb358b0be339ca35fb0b984582883ba043da.tar.gz tigervnc-bf0adb358b0be339ca35fb0b984582883ba043da.zip |
ScaledDIBSectionBuffer class code improvements. 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@640 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'win/rfb_win32/ScaledDIBSectionBuffer.cxx')
-rw-r--r-- | win/rfb_win32/ScaledDIBSectionBuffer.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/win/rfb_win32/ScaledDIBSectionBuffer.cxx b/win/rfb_win32/ScaledDIBSectionBuffer.cxx index 7f14cceb..700e90b3 100644 --- a/win/rfb_win32/ScaledDIBSectionBuffer.cxx +++ b/win/rfb_win32/ScaledDIBSectionBuffer.cxx @@ -37,12 +37,12 @@ ScaledDIBSectionBuffer::~ScaledDIBSectionBuffer() { if (src_buffer) delete src_buffer; } -void ScaledDIBSectionBuffer::setScale(int scale_) { - if (scale_ == getScale()) return; +void ScaledDIBSectionBuffer::setScaleRatio(double scale_ratio_) { + if (scale_ratio == scale_ratio_) return; if (format.depth != 24) throw rfb::UnsupportedPixelFormatException(); - if (scale_ != 100) { + if (scale_ratio_ != 1) { scaling = true; if (!src_buffer) { src_buffer = new ManagedPixelBuffer(format, src_width, src_height); @@ -52,7 +52,7 @@ void ScaledDIBSectionBuffer::setScale(int scale_) { } else { scaling = false; } - ScaledPixelBuffer::setScale(scale_); + ScaledPixelBuffer::setScaleRatio(scale_ratio_); recreateScaledBuffer(); if (scaling) { scaleRect(Rect(0, 0, src_width, src_height)); |