ScaledPixelBuffer::ScaledPixelBuffer(U8 **src_data_, int src_width_,
int src_height_, int scale_, PixelFormat pf_)
- : scale(scale_), scale_ratio_x(1), scale_ratio_y(1), scaleFilterID(scaleFilterBicubic),
+ : scale(scale_), scale_ratio_x(1), scale_ratio_y(1), scaleFilterID(scaleFilterBilinear),
xWeightTabs(0), yWeightTabs(0), scaled_data(0), raccum(0), gaccum(0), baccum(0) {
setSourceBuffer(src_data_, src_width_, src_height_);
ScaledPixelBuffer::ScaledPixelBuffer()
: src_width(0), src_height(0), scaled_width(0), scaled_height(0), scale(100),
- scale_ratio_x(1), scale_ratio_y(1), scaleFilterID(scaleFilterBicubic),
+ scale_ratio_x(1), scale_ratio_y(1), scaleFilterID(scaleFilterBilinear),
xWeightTabs(0), yWeightTabs(0), src_data(0), scaled_data(0), raccum(0),
gaccum(0), baccum(0) {
memset(&pf, 0, sizeof(pf));
window->setDisableWinKeys(options.disableWinKeys);
window->setShowToolbar(options.showToolbar);
window->printScale();
- window->setDesktopScaleFilter(options.scaleFilter);
if (options.autoScaling) {
window->setAutoScaling(true);
} else {
static IntParameter scale("Scale",
"Scale local copy of the remote desktop, in percent",
100);
-static IntParameter scaleFilter("ScaleFilter",
- "Filter used for the remote desktop scaling. "
- "0 = Nearest Neighbor, 1 = Bilinear, 2 = Bicubic, 3 = Sinc.",
- rfb::defaultScaleFilter);
CConnOptions::CConnOptions()
: useLocalCursor(::useLocalCursor), useDesktopResize(::useDesktopResize),
emulate3(::emulate3), monitor(::monitor.getData()), showToolbar(::showToolbar),
customCompressLevel(::customCompressLevel), compressLevel(::compressLevel),
noJpeg(::noJpeg), qualityLevel(::qualityLevel), passwordFile(::passwordFile.getData()),
-autoReconnect(::autoReconnect), autoScaling(::autoScaling), scale(::scale), scaleFilter(::scaleFilter)
+autoReconnect(::autoReconnect), autoScaling(::autoScaling), scale(::scale)
{
if (autoSelect) {
preferredEncoding = encodingZRLE;
autoScaling = atoi(value.buf);
} else if (stricmp(name.buf, "Scale") == 0) {
scale = atoi(value.buf);
- } else if (stricmp(name.buf, "ScaleFilter") == 0) {
- int scaleFilterID = atoi(value.buf);
- if (scaleFilterID > rfb::scaleFilterMaxNumber || scaleFilterID < 0 ) {
- scaleFilter = rfb::defaultScaleFilter;
- } else scaleFilter = scaleFilterID;
}
}
}
fprintf(f, "QualityLevel=%d\n", qualityLevel);
fprintf(f, "AutoScaling=%d\n", (int)autoScaling);
fprintf(f, "Scale=%d\n", scale);
- fprintf(f, "ScaleFilter=%d\n", scaleFilter);
fclose(f); f=0;
setConfigFileName(filename);
key.setInt(_T("QualityLevel"), qualityLevel);
key.setBool(_T("AutoScaling"), autoScaling);
key.setInt(_T("Scale"), scale);
- key.setInt(_T("ScaleFilter"), scaleFilter);
}
qualityLevel = o.qualityLevel;
autoScaling = o.autoScaling;
scale = o.scale;
- scaleFilter = o.scaleFilter;
return *this;
}
bool acceptBell;
bool autoScaling;
int scale;
- unsigned int scaleFilter;
CharArray userName;
void setUserName(const char* user);
PlainPasswd password;
} else {
SetDlgItemInt(handle, IDC_COMBO_SCALE, dlg->options.scale, FALSE);
}
- HWND hScaleFilterCombo = GetDlgItem(handle, IDC_COMBO_SCALE_FILTER);
- SendMessage(hScaleFilterCombo, CB_RESETCONTENT, 0, 0);
- ScaleFilters scaleFilters;
- for (i = 0; i <= rfb::scaleFilterMaxNumber; i++) {
- SendMessage(hScaleFilterCombo, CB_ADDSTRING, (WPARAM)0, (LPARAM)(int FAR*)scaleFilters[i].name);
- }
- SendMessage(hScaleFilterCombo, CB_SETCURSEL, (WPARAM)dlg->options.scaleFilter, (LPARAM)0);
- if (dlg->options.scale == 100 && !dlg->options.autoScaling) enableItem(IDC_COMBO_SCALE_FILTER, 0);
}
virtual bool onOk() {
dlg->options.shared = isItemChecked(IDC_CONN_SHARED);
dlg->options.autoScaling = true;
}
}
- int scaleFilterID = SendMessage(GetDlgItem(handle, IDC_COMBO_SCALE_FILTER), CB_GETCURSEL, 0, 0);
- if (scaleFilterID != rfb::scaleFilterBilinear && scaleFilterID != rfb::scaleFilterBicubic) {
- MsgBox(handle, "Now supported only bilinear and bicubic scale filters.", MB_OK);
- } else {
- dlg->options.scaleFilter = SendMessage(GetDlgItem(handle, IDC_COMBO_SCALE_FILTER), CB_GETCURSEL, 0, 0);
- }
((ViewerOptions*)propSheet)->setChanged();
return true;
}
} else {
GetDlgItemText(handle, IDC_COMBO_SCALE, scaleStr, 20);
}
- if (strcmp(scaleStr, "100") == 0) enableItem(IDC_COMBO_SCALE_FILTER, 0);
- else enableItem(IDC_COMBO_SCALE_FILTER, 1);
return true;
}
}
#define IDC_STATIC_SCALE 1097
#define IDC_COMBO_SCALE 1098
#define IDC_STATIC_PERCENT 1099
-#define IDC_COMBO_SCALE_FILTER 1100
-#define IDC_SCALE_FILTER 1101
#define ID_TOOLBAR 40002
#define ID_CLOSE 40003
#define ID_OPTIONS 40004
WS_TABSTOP,106,25,103,15
COMBOBOX IDC_COMBO_SCALE,138,40,42,134,CBS_DROPDOWN | CBS_SORT |
WS_VSCROLL | WS_TABSTOP
- COMBOBOX IDC_COMBO_SCALE_FILTER,138,70,71,113,CBS_DROPDOWNLIST |
- WS_VSCROLL | WS_TABSTOP
LTEXT "Scale by:",IDC_STATIC_SCALE,106,40,32,15,SS_CENTERIMAGE
LTEXT "%",IDC_STATIC_PERCENT,185,40,24,15,SS_CENTERIMAGE
- LTEXT "With filter:",IDC_SCALE_FILTER,138,55,71,15,
- SS_CENTERIMAGE
END
IDD_INPUTS DIALOG DISCARDABLE 0, 0, 186, 162