EBST_CAM
Loading...
Searching...
No Matches
Direct2dViewer_c.cpp File Reference

Wrapper for Direct2dViewer.cpp to provide a C API. More...

#include "Direct2dViewer_c.h"
#include "Direct2dViewer.h"

Functions

void * Direct2dViewer_new ()
 Initialize members.
 
void Direct2dViewer_delete (void *D2dV)
 Release resources.
 
void Direct2dViewer_start2dViewer (void *D2dV, HWND hWndParent, void *bitmapAddr, UINT width, UINT height)
 Starts 2d viewer with a initial bitmap. Use this to start 2d viewer. Call constructor before.
 
void Direct2dViewer_showNewBitmap (void *D2dV, void *addr, UINT width, UINT height)
 Show a new bitmap in 2d viewer.
 
void Direct2dViewer_repaintWindow (void *D2dV)
 Reload the displayed bitmap in 2d viewer.
 
HWND Direct2dViewer_getWindowHandler (void *D2dV)
 Returns the window handler of 2d viewer.
 
void Direct2dViewer_setGammaValue (void *D2dV, UINT16 white, UINT16 black)
 Set gamma value.
 
UINT16 Direct2dViewer_getGammaWhite (void *D2dV)
 return gamma value white
 
UINT16 Direct2dViewer_getGammaBlack (void *D2dV)
 return gamma value black
 

Detailed Description

Wrapper for Direct2dViewer.cpp to provide a C API.

Inspired by this tutorial to call cpp methods from c: https://bytes.com/topic/c/insights/921728-calling-c-class-methods-c

Author
Florian Hahn
Date
30.09.2019

Function Documentation

◆ Direct2dViewer_delete()

void Direct2dViewer_delete ( void * D2dV)

Release resources.

Parameters
[in]D2dVHandle of Direct2dViewer instance.

◆ Direct2dViewer_getGammaBlack()

UINT16 Direct2dViewer_getGammaBlack ( void * D2dV)

return gamma value black

Parameters
[in]D2dVHandle of Direct2dViewer instance.

◆ Direct2dViewer_getGammaWhite()

UINT16 Direct2dViewer_getGammaWhite ( void * D2dV)

return gamma value white

Parameters
[in]D2dVHandle of Direct2dViewer instance.

◆ Direct2dViewer_getWindowHandler()

HWND Direct2dViewer_getWindowHandler ( void * D2dV)

Returns the window handler of 2d viewer.

Parameters
[in]D2dVHandle of Direct2dViewer instance.

◆ Direct2dViewer_new()

void * Direct2dViewer_new ( )

Initialize members.

Returns
Handle of new Direct2dViewer instance.

◆ Direct2dViewer_repaintWindow()

void Direct2dViewer_repaintWindow ( void * D2dV)

Reload the displayed bitmap in 2d viewer.

Parameters
[in]D2dVHandle of Direct2dViewer instance.

◆ Direct2dViewer_setGammaValue()

void Direct2dViewer_setGammaValue ( void * D2dV,
UINT16 white,
UINT16 black )

Set gamma value.

Parameters
[in]whiteset value for maximum brightness. Default: 0xFFFF (16 bit), 0x3FFF (14 bit)
[in]blackset value for minimum brightness. Default: 0
[in]D2dVHandle of Direct2dViewer instance.

◆ Direct2dViewer_showNewBitmap()

void Direct2dViewer_showNewBitmap ( void * D2dV,
void * addr,
UINT width,
UINT height )

Show a new bitmap in 2d viewer.

Parameters
addrAddress to first byte of bitmap data.
widthWidth of bitmap.
heightHeight of bitmap.
[in]D2dVHandle of Direct2dViewer instance.

◆ Direct2dViewer_start2dViewer()

void Direct2dViewer_start2dViewer ( void * D2dV,
HWND hWndParent,
void * bitmapAddr,
UINT width,
UINT height )

Starts 2d viewer with a initial bitmap. Use this to start 2d viewer. Call constructor before.

Parameters
[in]hWndParentWindow handler of parent window.
[in]bitmapAddrAddress to first byte of bitmap data.
[in]widthWidth of bitmap.
[in]heightHeight of bitmap.
[in]D2dVHandle of Direct2dViewer instance.