Visual Servoing Platform  version 3.6.1 under development (2024-07-27)
vpWin32API.h
1 /*
2  * ViSP, open source Visual Servoing Platform software.
3  * Copyright (C) 2005 - 2024 by Inria. All rights reserved.
4  *
5  * This software is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  * See the file LICENSE.txt at the root directory of this source
10  * distribution for additional information about the GNU GPL.
11  *
12  * For using ViSP with software that can not be combined with the GNU
13  * GPL, please contact Inria about acquiring a ViSP Professional
14  * Edition License.
15  *
16  * See https://visp.inria.fr for more information.
17  *
18  * This software was developed at:
19  * Inria Rennes - Bretagne Atlantique
20  * Campus Universitaire de Beaulieu
21  * 35042 Rennes Cedex
22  * France
23  *
24  * If you have questions regarding the use of this file, please contact
25  * Inria at visp@inria.fr
26  *
27  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29  *
30  * Description:
31  * GDI renderer for windows 32 display
32  */
33 
34 #ifndef VP_WIN32_API_H
35 #define VP_WIN32_API_H
36 
37 #include <visp3/core/vpConfig.h>
38 
39 #if (defined(VISP_HAVE_GDI) || defined(VISP_HAVE_D3D9))
40 
41 // Include WinSock2.h before windows.h to ensure that winsock.h is not
42 // included by windows.h since winsock.h and winsock2.h are incompatible
43 #include <WinSock2.h>
44 #include <string>
45 #include <windows.h>
46 
48 
49 DWORD vpProcessErrors(const std::string &api_name);
50 void vpSelectObject(HWND hWnd, HDC hDC, HDC hDCMem, HGDIOBJ h);
51 void vpPrepareImageWithPen(CRITICAL_SECTION *CriticalSection, HWND hWnd, HBITMAP bmp, COLORREF color,
52  unsigned int thickness, int style, HDC &hDCScreen, HDC &hDCMem, HPEN &hPen);
53 void vpEnterCriticalSection(LPCRITICAL_SECTION lpCriticalSection);
54 void vpLeaveCriticalSection(LPCRITICAL_SECTION lpCriticalSection);
55 BOOL vpReleaseSemaphore(HANDLE hSemaphore, LONG IReleaseCount, LPLONG lpPreviousCount);
56 BOOL vpLineTo(HDC hdc, int nXEnd, int nYEnd);
57 BOOL vpMoveToEx(HDC hdc, int X, int Y, LPPOINT lpPoint);
58 BOOL vpBitBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HDC hdcSrc, int nXSrc, int nYSrc,
59  DWORD dwRop);
60 BOOL vpInvalidateRect(HWND hWnd, const RECT *lpRect, BOOL bErase);
61 COLORREF vpSetPixel(HDC hdc, int X, int Y, COLORREF crColor);
62 HBITMAP vpCreateBitmap(int nWidth, int nHeight, UINT cPlanes, UINT cBitsPerPel, const VOID *lpvBits);
63 
64 END_VISP_NAMESPACE
65 #endif
66 #endif