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);
} else {
scaling = false;
}
- ScaledPixelBuffer::setScale(scale_);
+ ScaledPixelBuffer::setScaleRatio(scale_ratio_);
recreateScaledBuffer();
if (scaling) {
scaleRect(Rect(0, 0, src_width, src_height));
virtual void setPF(const PixelFormat &pf);
virtual void setSize(int w, int h);
- virtual void setScale(int scale);
+ virtual void setScale(int scale) { setScaleRatio(double(scale)/100.0); };
+ virtual void setScaleRatio(double scale_ratio);
Rect getRect() const { return ScaledPixelBuffer::getRect(); }
Rect getRect(const Point& pos) const { return ScaledPixelBuffer::getRect(pos); }