}
}
+void ScaledPixelBuffer::setScaleFilter(unsigned int scaleFilterID_) {
+ if (scaleFilterID == scaleFilterID_ || scaleFilterID_ > scaleFilterMaxNumber) return;
+
+ scaleFilterID = scaleFilterID_;
+
+ if (src_width && src_height && scaled_width && scaled_height && pf.depth > 0) {
+ freeWeightTabs();
+ scaleFilters.makeWeightTabs(scaleFilterID, src_width, scaled_width, &xWeightTabs);
+ scaleFilters.makeWeightTabs(scaleFilterID, src_height, scaled_height, &yWeightTabs);
+ if (scale != 100) scaleRect(Rect(0, 0, src_width, src_height));
+ }
+}
+
inline void ScaledPixelBuffer::rgbFromPixel(U32 p, int &r, int &g, int &b) {
r = (((p >> pf.redShift ) & pf.redMax ) * 255 + pf.redMax /2) / pf.redMax;
g = (((p >> pf.greenShift) & pf.greenMax) * 255 + pf.greenMax/2) / pf.greenMax;
// Set the new scale, in percent
virtual void setScale(int scale);
+ // Set/get the scale method
+ virtual void setScaleFilter(unsigned int scaleFilterID);
+ unsigned int getScaleFilterID() const { return scaleFilterID; }
+
// Scale rect from the source image buffer to the destination buffer
// using the current interpolation method
virtual void scaleRect(const Rect& r);
InvalidateRect(frameHandle, 0, FALSE);
}
+void DesktopWindow::setDesktopScaleFilter(unsigned int scaleFilterID) {
+ if (scaleFilterID == getDesktopScaleFilterID() || scaleFilterID > scaleFilterMaxNumber) return;
+ buffer->setScaleFilter(scaleFilterID);
+ InvalidateRect(frameHandle, 0, FALSE);
+}
+
void DesktopWindow::convertCursorToBuffer() {
if (memcmp(&(cursor.getPF()), &(buffer->getPF()), sizeof(PixelBuffer)) == 0) return;
internalSetCursor = true;
bool isAutoScaling() const { return autoScaling; }
void setDesktopScale(int scale);
int getDesktopScale() const { return buffer->getScale(); }
+ void setDesktopScaleFilter(unsigned int scaleFilterID);
+ unsigned int getDesktopScaleFilterID() const { return buffer->getScaleFilterID(); }
void fitBufferToWindow(bool repaint = true);
void printScale();