Added point filtering option to the software capture source as well, useful for up/downscaling of emulators and other low resolution fixed pixel 2D stuff.

This commit is contained in:
paibox 2013-03-19 12:02:44 +01:00
parent 351b4089f0
commit ee68ba6924
5 changed files with 23 additions and 2 deletions

View File

@ -18,7 +18,6 @@
#include "DShowPlugin.h"
#include <D3D10.h>
DWORD STDCALL PackPlanarThread(ConvertData *data);

2
OBS.rc
View File

@ -234,6 +234,8 @@ BEGIN
RTEXT "Gamma",IDC_STATIC,4,147,90,8
CONTROL "",IDC_GAMMA,"msctls_trackbar32",TBS_BOTH | WS_TABSTOP,97,139,216,26
LTEXT ".numbers!",IDC_GAMMAVAL,318,147,66,8
CONTROL "Sources.SoftwareCaptureSource.PointFiltering",IDC_POINTFILTERING,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,162,250,10
GROUPBOX "Sources.SoftwareCaptureSource.RegionCapture",IDC_STATIC,7,174,308,67
CONTROL "Sources.SoftwareCaptureSource.RegionCapture",IDC_REGIONCAPTURE,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,185,130,10,WS_EX_RIGHT

View File

@ -42,7 +42,7 @@ class DesktopImageSource : public ImageSource
UINT warningID;
bool bUseColorKey;
bool bUseColorKey, bUsePointFiltering;
DWORD keyColor;
UINT keySimilarity, keyBlend;
@ -467,6 +467,14 @@ public:
alphaIgnoreShader->SetFloat(hGamma, fGamma);
}
if(bUsePointFiltering) {
SamplerState *sampler;
SamplerInfo samplerinfo;
samplerinfo.filter = GS_FILTER_POINT;
sampler = CreateSamplerState(samplerinfo);
LoadSamplerState(sampler, 0);
}
if(bCompatibilityMode)
DrawSpriteEx(lastRendered, (opacity255<<24) | 0xFFFFFF,
pos.x, pos.y+size.y, pos.x+size.x, pos.y,
@ -519,6 +527,8 @@ public:
bCaptureMouse = data->GetInt(TEXT("captureMouse"), 1);
bCaptureLayered = data->GetInt(TEXT("captureLayered"), 0);
bool bNewUsePointFiltering = data->GetInt(TEXT("usePointFiltering"), 0) != 0;
int x = data->GetInt(TEXT("captureX"));
int y = data->GetInt(TEXT("captureY"));
int cx = data->GetInt(TEXT("captureCX"), 32);
@ -578,6 +588,7 @@ public:
bClientCapture = bNewClientCapture;
bCompatibilityMode = bNewCompatibleMode;
bUsePointFiltering = bNewUsePointFiltering;
captureRect.left = x;
captureRect.top = y;
@ -645,6 +656,7 @@ public:
keyColor = data->GetInt(TEXT("keyColor"), 0xFFFFFFFF);
keySimilarity = data->GetInt(TEXT("keySimilarity"), 10);
keyBlend = data->GetInt(TEXT("keyBlend"), 0);
bUsePointFiltering = data->GetInt(TEXT("usePointFiltering"), 0) != 0;
bUseColorKey = bNewUseColorKey;
@ -1346,6 +1358,9 @@ INT_PTR CALLBACK ConfigDesktopSourceProc(HWND hwnd, UINT message, WPARAM wParam,
DWORD keyColor = data->GetInt(TEXT("keyColor"), 0xFFFFFFFF);
UINT similarity = data->GetInt(TEXT("keySimilarity"), 10);
UINT blend = data->GetInt(TEXT("keyBlend"), 0);
BOOL bUsePointFiltering = data->GetInt(TEXT("usePointFiltering"), 0);
SendMessage(GetDlgItem(hwnd, IDC_POINTFILTERING), BM_SETCHECK, bUsePointFiltering ? BST_CHECKED : BST_UNCHECKED, 0);
SendMessage(GetDlgItem(hwnd, IDC_USECOLORKEY), BM_SETCHECK, bUseColorKey ? BST_CHECKED : BST_UNCHECKED, 0);
CCSetColor(GetDlgItem(hwnd, IDC_COLOR), keyColor);
@ -1793,6 +1808,7 @@ INT_PTR CALLBACK ConfigDesktopSourceProc(HWND hwnd, UINT message, WPARAM wParam,
BOOL bCaptureMouse = SendMessage(GetDlgItem(hwnd, IDC_CAPTUREMOUSE), BM_GETCHECK, 0, 0) == BST_CHECKED;
BOOL bCaptureLayered = SendMessage(GetDlgItem(hwnd, IDC_CAPTURELAYERED), BM_GETCHECK, 0, 0) == BST_CHECKED;
BOOL bCompatibilityMode = SendMessage(GetDlgItem(hwnd, IDC_COMPATIBILITYMODE), BM_GETCHECK, 0, 0) == BST_CHECKED;
BOOL bUsePointFiltering = SendMessage(GetDlgItem(hwnd, IDC_POINTFILTERING), BM_GETCHECK, 0, 0) == BST_CHECKED;
//---------------------------------
@ -1818,6 +1834,8 @@ INT_PTR CALLBACK ConfigDesktopSourceProc(HWND hwnd, UINT message, WPARAM wParam,
data->SetInt(TEXT("compatibilityMode"), bCompatibilityMode);
data->SetInt(TEXT("usePointFiltering"), bUsePointFiltering);
data->SetInt(TEXT("captureX"), posX);
data->SetInt(TEXT("captureY"), posY);
data->SetInt(TEXT("captureCX"), sizeX);

View File

@ -67,6 +67,7 @@
#define IDC_SIZEY 1034
#define IDC_GAMMA 1035
#define IDC_USECUSTOM 1036
#define IDC_POINTFILTERING 1036
#define IDC_USEMONITOR 1037
#define IDC_DISABLEAERO 1038
#define IDC_DISABLEMIC 1040

View File

@ -233,6 +233,7 @@ Sources.SoftwareCaptureSource.Monitor "Monitor:"
Sources.SoftwareCaptureSource.MonitorCapture "Monitor Capture"
Sources.SoftwareCaptureSource.MonitorCaptureTooltip "Disable aero in video settings to maximize FPS"
Sources.SoftwareCaptureSource.MouseCapture "Capture mouse cursor"
Sources.SoftwareCaptureSource.PointFiltering "Use point filtering"
Sources.SoftwareCaptureSource.Position "Position:"
Sources.SoftwareCaptureSource.RegionCapture "Sub-Region"
Sources.SoftwareCaptureSource.RegionWindowText "Press Enter, Esc, or click outside this rectangle when complete."