Beispiel #1
0
	/// WM_MOUSEMOVE
	int wmMouseMove(WORD /* i_keys */, int /* i_x */, int /* i_y */) {
		if (GetCapture() == m_hwnd) {
			PointWindow pw;
			CHECK_TRUE( GetCursorPos(&pw.m_p) );
			pw.m_hwnd = 0;
			CHECK_TRUE( GetWindowRect(GetDesktopWindow(), &pw.m_rc) );
			EnumWindows(windowFromPoint, (LPARAM)&pw);
			while (1) {
				HWND hwndParent = pw.m_hwnd;
				if (!EnumChildWindows(pw.m_hwnd, childWindowFromPoint, (LPARAM)&pw))
					break;
				if (hwndParent == pw.m_hwnd)
					break;
			}
			if (pw.m_hwnd != m_preHwnd) {
				if (m_preHwnd)
					invertFrame(m_preHwnd);
				m_preHwnd = pw.m_hwnd;
				invertFrame(m_preHwnd);
				SendMessage(GetParent(m_hwnd), WM_APP_targetNotify, 0,
							(LPARAM)m_preHwnd);
			}
			SetCursor(m_hCursor);
		}
		return 0;
	}
/*
  public callable function
  to apply image effects set the getters on this class
*/
cv::Mat VideoProcessing::process(cv::Mat &frame) {
    // save reference to the current frame, do NOT copy it into the memory
    this->frame = frame;

    if (picGreyscale == true) {
        convertFrame2Grey();
    }

    if (picInvert == true) {
        invertFrame();
    }

    if (picFlip == true) {
        flipFrame();
    }

    if (picRotateAngle != 0) {
        rotateFrame();
    }

    if (picEqualize == true) {
        equalizeFrame();
    }

    if (picSharpen == true) {
        sharpenFrame();
    }

    if (picCrop == true) {
        cropFrame();
    }


    return this->frame;
}
Beispiel #3
0
	/// WM_LBUTTONUP
	int wmLButtonUp(WORD /* i_keys */, int /* i_x */, int /* i_y */) {
		if (m_preHwnd)
			invertFrame(m_preHwnd);
		m_preHwnd = NULL;
		ReleaseCapture();
		CHECK_TRUE( InvalidateRect(m_hwnd, NULL, TRUE) );
		CHECK_TRUE( UpdateWindow(m_hwnd) );
		return 0;
	}