8 #include "PlusConfigure.h" 15 #define SAFE_RELEASE(x) { if (x) x->Release(); x = NULL; } 20 this->ImageWindowHandle = NULL;
34 m_mixer_control = NULL;
36 m_b_power_ctrl = NULL;
38 m_b_dynrange_ctrl = NULL;
39 m_b_frequency_ctrl = NULL;
40 m_b_focus_ctrl = NULL;
41 m_usg_control_change_cpnt = NULL;
42 m_usg_control_change_cpnt_cookie = 0;
43 m_usg_device_change_cpnt = NULL;
44 m_usg_device_change_cpnt_cookie = 0;
57 static LRESULT CALLBACK
ImageWindowProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
60 return DefWindowProc(hwnd, iMsg, wParam, lParam) ;
72 HINSTANCE hInst = GetModuleHandle(NULL);
75 wndclass.cbSize =
sizeof(wndclass);
76 wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_BYTEALIGNCLIENT;
78 wndclass.cbClsExtra = 0;
79 wndclass.cbWndExtra = 0;
80 wndclass.hInstance = hInst;
81 wndclass.hIcon = NULL;
82 wndclass.hCursor = NULL;
83 wndclass.hbrBackground = (HBRUSH) GetStockObject(BLACK_BRUSH);
84 wndclass.lpszMenuName = NULL;
85 wndclass.lpszClassName = TEXT(
"TelemedImageWindow");
86 wndclass.hIconSm = NULL;
87 RegisterClassEx(&wndclass);
89 this->ImageWindowHandle = CreateWindow(TEXT(
"TelemedImageWindow"), TEXT(
"Ultrasound"),
90 WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, 0, 0,
92 m_MaximumFrameSize[1] + 2 * GetSystemMetrics(SM_CYFIXEDFRAME) + GetSystemMetrics(SM_CYBORDER) + GetSystemMetrics(SM_CYSIZE),
93 NULL, NULL, hInst, NULL);
95 if (this->ImageWindowHandle == NULL)
97 LOG_ERROR(
"Failed to create capture window");
101 SetWindowLongPtr(this->ImageWindowHandle, GWLP_USERDATA, (LONG)
this);
104 HDC hdc = GetDC(this->ImageWindowHandle) ;
106 GetClientRect(this->ImageWindowHandle, &rect) ;
107 int cx = rect.right - rect.left;
108 int cy = rect.bottom - rect.top;
109 this->DataHandle = CreateCompatibleBitmap(hdc, cx, cy);
110 GetObject(this->DataHandle,
sizeof(BITMAP), (LPVOID) &this->Bitmap) ;
112 size_t toAllocate = (this->Bitmap.bmWidth + 16) * (this->Bitmap.bmHeight + 4);
113 this->MemoryBitmapBuffer.resize(toAllocate, 0);
123 ReleaseUsgControls(
true);
125 if (this->ImageWindowHandle)
127 LOG_DEBUG(
"DestroyWindow(this->ImageWindowHandle)");
128 DestroyWindow(this->ImageWindowHandle);
129 this->ImageWindowHandle = NULL;
130 UnregisterClass(TEXT(
"TelemedImageWindow"), GetModuleHandle(NULL));
137 std::cout <<
"TelemedUltrasound::FreezeDevice(" << freeze <<
")" << std::endl;
138 if (m_data_view == NULL) {
return; }
141 m_data_view->put_ScanState(SCAN_STATE_FREEZE);
145 m_data_view->put_ScanState(SCAN_STATE_RUN);
188 GetObject(hBitmap,
sizeof(DIBSECTION), &ds);
193 LPRGBQUAD prgb = NULL;
194 LPBITMAPINFO pbmi = NULL;
195 if (ds.dsBmih.biCompression == BI_BITFIELDS)
198 pbmi = (LPBITMAPINFO)malloc(
sizeof(BITMAPINFOHEADER) + (3 *
sizeof(
DWORD)) + (256 *
sizeof(RGBQUAD)));
201 return (LPBITMAPINFO)NULL;
203 CopyMemory(&(pbmi->bmiHeader), &(ds.dsBmih),
sizeof(BITMAPINFOHEADER) + (3 *
sizeof(
DWORD)));
204 prgb = (LPRGBQUAD) & (pbmi->bmiColors[3]);
209 pbmi = (LPBITMAPINFO)malloc(
sizeof(BITMAPINFOHEADER) + (256 *
sizeof(RGBQUAD)));
212 return (LPBITMAPINFO)NULL;
214 CopyMemory(&(pbmi->bmiHeader), &(ds.dsBmih),
sizeof(BITMAPINFOHEADER));
215 prgb = pbmi->bmiColors;
222 if ((ds.dsBm.bmBitsPixel * ds.dsBm.bmPlanes) <= 8)
225 HDC hMemDC = CreateCompatibleDC(NULL);
226 HBITMAP hOldBitmap = (HBITMAP)SelectObject(hMemDC, hBitmap);
227 GetDIBColorTable(hMemDC, 0, 1 << (ds.dsBm.bmBitsPixel * ds.dsBm.bmPlanes), prgb);
228 SelectObject(hMemDC, hOldBitmap);
234 const int PALETTE_SIZE = 256;
235 for (
int i = 0;
i < PALETTE_SIZE;
i++)
238 prgb[
i].rgbGreen =
i;
240 prgb[
i].rgbReserved = 0;
242 pbmi->bmiHeader.biClrUsed = PALETTE_SIZE;
248 #define BYTESPERLINE(Width, BPP) ((WORD)((((DWORD)(Width) * (DWORD)(BPP) + 31) >> 5)) << 2) 253 if (m_data_view == NULL || m_mixer_control == NULL)
268 m_mixer_control->GetCurrentBitmap((LONG*)&bmp);
283 h = abs(pbmi->bmiHeader.biHeight);
284 pitch =
BYTESPERLINE(abs(pbmi->bmiHeader.biWidth), pbmi->bmiHeader.biBitCount);
291 int cbBuffer = pitch * h;
296 unsigned char* pBuffer = NULL;
309 if (!GetObject(bmp,
sizeof(DIBSECTION), &ds))
311 LOG_ERROR(
"Failed to get pointer to bitmap");
315 LPBYTE
src = (LPBYTE)ds.dsBm.bmBits;
317 memcpy(pBuffer,
src, pitch * h);
325 void TelemedUltrasound::CreateUsgControl(
IUsgDataView* data_view,
const IID& type_id,
ULONG scan_mode,
ULONG stream_id,
void** ctrl)
328 if (data_view == NULL)
332 data_view->GetControlObj(&type_id, scan_mode, stream_id, &ctrl2);
335 HRESULT hr = ctrl2->QueryInterface(type_id, (
void**)ctrl);
348 IUnknown* tmp_obj = NULL;
354 IConnectionPointContainer* cpc = NULL;
358 if (m_usgfw2 == NULL)
369 hr = m_usgfw2->QueryInterface(IID_IConnectionPointContainer, (
void**)&cpc);
379 m_usg_device_change_cpnt = NULL;
380 m_usg_device_change_cpnt_cookie = 0;
385 if (m_usg_device_change_cpnt != NULL)
387 hr = m_usg_device_change_cpnt->Advise((IUnknown*)((
IUsgDeviceChangeSink*)
this), &m_usg_device_change_cpnt_cookie);
396 m_usgfw2->get_ProbesCollection(&tmp_obj);
399 probes_collection = NULL;
404 if ((hr != S_OK) || (probes_collection == NULL))
406 probes_collection = NULL;
411 LONG probes_count = 0;
412 probes_collection->get_Count(&probes_count);
413 if (probes_count == 0)
415 probes_collection->Release();
416 probes_collection = NULL;
422 if (probeId >= probes_count || probeId < 0)
425 LOG_WARNING(
"Attempted to connect to non-existant US probe with ID " << probeId <<
". There are only " << probes_count <<
" probes connected. Connecting to default probe with ID 0.");
428 probes_collection->Item(probeId, &tmp_obj);
429 probes_collection->Release();
430 probes_collection = NULL;
436 hr = tmp_obj->QueryInterface(
IID_IProbe, (
void**)&m_probe);
438 if ((hr != S_OK) || (m_probe == NULL))
445 m_usgfw2->CreateDataView(m_probe, &m_data_view);
446 if (m_data_view == NULL)
451 m_data_view->put_ScanState(SCAN_STATE_STOP);
454 m_data_view->GetScanModeObj(SCAN_MODE_B, &
mode);
461 mode->GetMixerControl(SCAN_MODE_B, 0, &m_mixer_control);
464 if (m_mixer_control == NULL)
470 m_data_view->put_ScanMode(SCAN_MODE_B);
473 m_mixer_control->SetOutputWindow((LONG)this->ImageWindowHandle);
482 m_mixer_control->SetOutputRect(&rect1);
485 tagPALETTEENTRY clr1;
490 m_mixer_control->put_BkColor(clr1);
494 CreateUsgControl(m_data_view,
IID_IUsgDepth, SCAN_MODE_B, 0, (
void**)&tmp_obj);
506 CreateUsgControl(m_data_view,
IID_IUsgPower, SCAN_MODE_B, 0, (
void**)&tmp_obj);
513 m_b_power_ctrl = NULL;
518 CreateUsgControl(m_data_view,
IID_IUsgGain, SCAN_MODE_B, 0, (
void**)&tmp_obj);
520 { m_b_gain_ctrl = (
IUsgGain*)tmp_obj; }
522 { m_b_gain_ctrl = NULL; }
533 m_b_dynrange_ctrl = NULL;
545 m_b_frequency_ctrl = NULL;
550 CreateUsgControl(m_data_view,
IID_IUsgFocus, SCAN_MODE_B, 0, (
void**)&tmp_obj);
557 m_b_focus_ctrl = NULL;
563 hr = m_data_view->QueryInterface(IID_IConnectionPointContainer, (
void**)&cpc);
577 m_usg_control_change_cpnt = NULL;
578 m_usg_control_change_cpnt_cookie = 0;
583 if (m_usg_control_change_cpnt != NULL)
585 hr = m_usg_control_change_cpnt->Advise((IUnknown*)((
IUsgCtrlChangeCommon*)
this), &m_usg_control_change_cpnt_cookie);
589 m_data_view->put_ScanState(SCAN_STATE_RUN);
595 ReleaseUsgControls(
false);
608 wchar_t guid_string[37];
610 guid_string,
sizeof(guid_string) /
sizeof(guid_string[0]),
611 L
"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
612 guid.Data1, guid.Data2, guid.Data3,
613 guid.Data4[0], guid.Data4[1], guid.Data4[2],
614 guid.Data4[3], guid.Data4[4], guid.Data4[5],
615 guid.Data4[6], guid.Data4[7]);
620 LPCWSTR TelemedUltrasound::GetInterfaceNameByGuid(BSTR ctrlGUID)
622 std::wstring ctrlGUIDws(ctrlGUID, SysStringLen(ctrlGUID));
678 LPCWSTR TelemedUltrasound::GetModeNameById(LONG scanMode)
680 if (scanMode == SCAN_MODE_UNKNOWN) {
return L
"UNKNOWN"; }
681 if (scanMode == SCAN_MODE_B) {
return L
"B"; }
682 if (scanMode == SCAN_MODE_M) {
return L
"M"; }
683 if (scanMode == SCAN_MODE_A) {
return L
"A"; }
684 if (scanMode == SCAN_MODE_PW) {
return L
"PW"; }
685 if (scanMode == SCAN_MODE_BM) {
return L
"BM"; }
686 if (scanMode == SCAN_MODE_BA) {
return L
"BA"; }
687 if (scanMode == SCAN_MODE_BPW) {
return L
"BPW"; }
688 if (scanMode == SCAN_MODE_CFM) {
return L
"CFM"; }
689 if (scanMode == SCAN_MODE_BCFM) {
return L
"BCFM"; }
690 if (scanMode == SCAN_MODE_BCFM_PW) {
return L
"BCFM_PW"; }
691 if (scanMode == SCAN_MODE_PDI) {
return L
"PDI"; }
692 if (scanMode == SCAN_MODE_BPDI) {
return L
"BPDI"; }
693 if (scanMode == SCAN_MODE_BPDI_PW) {
return L
"BPDI_PW"; }
694 if (scanMode == SCAN_MODE_DPDI) {
return L
"DPDI"; }
695 if (scanMode == SCAN_MODE_BDPDI) {
return L
"BDPDI"; }
696 if (scanMode == SCAN_MODE_BDPDI_PW) {
return L
"BDPDI_PW"; }
697 if (scanMode == SCAN_MODE_B2) {
return L
"B2"; }
698 if (scanMode == SCAN_MODE_PWAUDIO) {
return L
"PWAUDIO"; }
699 if (scanMode == SCAN_MODE_3D) {
return L
"3D"; }
700 if (scanMode == SCAN_MODES_CUSTOM) {
return L
"CUSTOM"; }
709 std::wstring ctrlGUIDws(ctrlGUID, SysStringLen(ctrlGUID));
724 std::wstring interfaceName = GetInterfaceNameByGuid(ctrlGUID);
726 if (!interfaceName.empty())
770 else if (riid == IID_IDispatch)
772 *ppv = (IDispatch*)
this;
776 {
return E_NOINTERFACE; }
805 return DISP_E_BADINDEX;
818 HRESULT
TelemedUltrasound::Invoke(DISPID dispIdMember,
const IID& riid, LCID lcid,
WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult, EXCEPINFO* pExcepInfo, UINT* puArgErr)
821 if ((dispIdMember >= 1) && (dispIdMember <= 6) && (pDispParams->cArgs == 2))
823 IUnknown* unkn = NULL;
828 p1 = pDispParams->rgvarg;
831 if (
p->vt == (VT_BYREF | VT_UI4))
838 if (
p->vt == VT_UNKNOWN)
840 unkn = (IUnknown*)(
p->punkVal);
843 if (dispIdMember == 1)
847 else if (dispIdMember == 2)
851 else if (dispIdMember == 3)
855 else if (dispIdMember == 4)
859 else if (dispIdMember == 5)
863 else if (dispIdMember == 6)
870 else if ((dispIdMember == 2) && (pDispParams->cArgs == 6))
872 BSTR ctrlGUID = NULL;
881 p1 = pDispParams->rgvarg;
904 ctrlGUID =
p->bstrVal;
917 void TelemedUltrasound::ReleaseUsgControls(
bool release_usgfw2)
919 if (m_data_view != NULL)
921 m_data_view->put_ScanState(SCAN_STATE_STOP);
923 if (m_usg_control_change_cpnt != NULL)
925 m_usg_control_change_cpnt->Unadvise(m_usg_control_change_cpnt_cookie);
926 m_usg_control_change_cpnt_cookie = 0;
941 if (m_usg_device_change_cpnt != NULL)
943 m_usg_device_change_cpnt->Unadvise(m_usg_device_change_cpnt_cookie);
944 m_usg_device_change_cpnt_cookie = 0;
955 if (m_depth_ctrl == NULL)
957 LOG_ERROR(
"TelemedUltrasound::GetDepthMm failed: not connected to device");
961 if (m_depth_ctrl->get_Current(&val) != S_OK)
963 LOG_ERROR(
"TelemedUltrasound::GetDepthMm failed: failed to retrieve parameter value");
973 if (m_depth_ctrl == NULL)
975 LOG_ERROR(
"TelemedUltrasound::SetDepthMm failed: not connected to hardware interface");
979 LONG currentDepthMm = 0;
980 if (m_depth_ctrl->get_Current(¤tDepthMm) != S_OK)
982 LOG_ERROR(
"TelemedUltrasound::SetDepthMm failed: failed to get value from device");
986 if (fabs(depthMm - currentDepthMm) > 0.1)
988 currentDepthMm = depthMm;
989 m_depth_ctrl->put_Current(currentDepthMm);
997 if (m_b_frequency_ctrl == NULL)
999 LOG_ERROR(
"TelemedUltrasound::GetFrequencyMHz failed: not connected to device");
1003 if (m_b_frequency_ctrl->get_Current(&val) != S_OK)
1005 LOG_ERROR(
"TelemedUltrasound::GetFrequencyMHz failed: failed to retrieve parameter value");
1008 freqMhz = (double)(val.nFrequency) / 1000000.0;
1015 if (m_b_frequency_ctrl == NULL)
1017 LOG_ERROR(
"TelemedUltrasound::SetFrequencyMHz failed: not connected to device");
1022 m_b_frequency_ctrl->get_Current(&val_cur);
1024 int val_requested_nFrequency = freqMhz * 1000000.0;
1025 if (val_cur.nFrequency == val_requested_nFrequency)
1031 m_b_frequency_ctrl->get_Values(&usg_values);
1032 if (usg_values == NULL)
1034 LOG_ERROR(
"TelemedUltrasound::SetFrequencyMHz failed: failed to retrieve valid parameter values");
1039 LONG val_closest_index = -1;
1040 LONG val_closest_nFrequency = 0;
1042 usg_values->get_Count(&val_count);
1043 for (LONG i1 = 0; i1 < val_count; i1++)
1046 usg_values->Item(i1, &item);
1047 if (item.vt == VT_RECORD)
1050 val = *((FREQUENCY3*)item.pvRecord);
1051 if ((val_cur.nThiMode == val.nThiMode) &&
1052 (val_closest_index < 0 || abs(val.nFrequency - val_requested_nFrequency) < abs(val_closest_nFrequency - val_requested_nFrequency)))
1055 val_closest_index = i1;
1056 val_closest_nFrequency = val.nFrequency;
1059 VariantClear(&item);
1064 if (val_closest_index >= 0)
1067 usg_values->Item(val_closest_index, &item);
1068 if (item.vt == VT_RECORD)
1070 val_cur = *((FREQUENCY3*)item.pvRecord);
1072 m_b_frequency_ctrl->put_Current(val_cur);
1073 VariantClear(&item);
1077 LOG_ERROR(
"TelemedUltrasound::SetFrequencyMHz failed: failed to find a suitable frequency setting");
1088 if (m_b_gain_ctrl == NULL)
1090 LOG_ERROR(
"TelemedUltrasound::SetGainPercent failed: not connected to hardware interface");
1093 LONG currentGainPercent = 0;
1094 m_b_gain_ctrl->get_Current(¤tGainPercent);
1095 if (fabs(gainPercent - currentGainPercent) > 0.1)
1097 currentGainPercent = gainPercent;
1098 m_b_gain_ctrl->put_Current(currentGainPercent);
1106 if (m_b_gain_ctrl == NULL)
1108 LOG_ERROR(
"TelemedUltrasound::GetGainPercent failed: not connected to hardware interface");
1111 LONG currentGainPercent = 0;
1112 if (m_depth_ctrl->get_Current(¤tGainPercent) != S_OK)
1114 LOG_ERROR(
"TelemedUltrasound::GetGainPercent failed: failed to get value from device");
1117 gainPercent = currentGainPercent;
1124 if (m_b_power_ctrl == NULL)
1126 LOG_ERROR(
"TelemedUltrasound::SetPowerDb failed: not connected to hardware interface");
1129 LONG currentPowerDb = 0;
1130 m_b_power_ctrl->get_Current(¤tPowerDb);
1131 if (fabs(powerDb - currentPowerDb) > 0.1)
1133 currentPowerDb = powerDb;
1134 m_b_power_ctrl->put_Current(currentPowerDb);
1142 if (m_b_power_ctrl == NULL)
1144 LOG_ERROR(
"TelemedUltrasound::GetPowerDb failed: not connected to hardware interface");
1147 LONG currentPowerDb = 0;
1148 if (m_b_power_ctrl->get_Current(¤tPowerDb) != S_OK)
1150 LOG_ERROR(
"TelemedUltrasound::GetPowerDb failed: failed to get value from device");
1153 powerDb = currentPowerDb;
1160 double focusDepth = focusDepthPercent / 100;
1162 if (m_b_focus_ctrl == NULL)
1164 LOG_ERROR(
"TelemedUltrasound::SetFocusDepthPercent failed: not connected to hardware interface");
1167 int focus_mode = FOCUS_MODE_MULTI;
1169 LONG focal_zones_count;
1170 m_b_focus_ctrl->put_CurrentMode(focus_mode);
1171 m_b_focus_ctrl->put_FocusSet(focus_mode, focus_set);
1172 m_b_focus_ctrl->GetFocalZonesCount(focus_mode, focus_set, &focal_zones_count);
1175 arr =
new LONG[focal_zones_count];
1176 for (
int i = 0;
i < focal_zones_count;
i++)
1180 float zone_width = 1.0 / focal_zones_count;
1181 int enabled_zone = focusDepth / zone_width;
1182 arr[enabled_zone] = 1;
1183 m_b_focus_ctrl->SetFocusState(focus_mode, focus_set, focal_zones_count,
arr);
1191 if (m_b_focus_ctrl == NULL)
1193 LOG_ERROR(
"TelemedUltrasound::GetFocusDepthPercent failed: not connected to hardware interface");
1197 m_b_focus_ctrl->get_CurrentMode(&focus_mode);
1199 m_b_focus_ctrl->get_FocusSet(focus_mode, &focus_set);
1200 LONG focal_zones_count;
1201 m_b_focus_ctrl->GetFocalZonesCount(focus_mode, focus_set, &focal_zones_count);
1204 double focusDepth = 0;
1205 arr =
new LONG[focal_zones_count];
1206 m_b_focus_ctrl->GetFocusState(focus_mode, focus_set, focal_zones_count,
arr);
1207 for (
int i = 0;
i < focal_zones_count;
i++)
1211 focusDepth = ((float)
i) / focal_zones_count;
1215 focusDepthPercent = focusDepth * 100;
1222 if (m_b_power_ctrl == NULL)
1224 LOG_ERROR(
"TelemedUltrasound::DynRangeDb failed: not connected to hardware interface");
1227 LONG currentDynRangeDb = 0;
1228 m_b_dynrange_ctrl->get_Current(¤tDynRangeDb);
1229 if (fabs(dynRangeDb - currentDynRangeDb) > 0.1)
1231 currentDynRangeDb = dynRangeDb;
1232 m_b_dynrange_ctrl->put_Current(currentDynRangeDb);
1240 if (m_b_power_ctrl == NULL)
1242 LOG_ERROR(
"TelemedUltrasound::DynRangeDb failed: not connected to hardware interface");
1245 LONG currentDynRangeDb = 0;
1246 if (m_b_dynrange_ctrl->get_Current(¤tDynRangeDb) != S_OK)
1248 LOG_ERROR(
"TelemedUltrasound::DynRangeDb failed: failed to get value from device");
1251 dynRangeDb = currentDynRangeDb;
1286 ReleaseUsgControls(
false);
virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo)
STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
EXTERN_C const IID IID_IUsgCineStream
PlusStatus GetFocusDepthPercent(double &focusDepthPercent)
PlusStatus SetPowerDb(double powerDb)
virtual HRESULT STDMETHODCALLTYPE OnBeamformerArrive(IUnknown *pUsgBeamformer, ULONG *reserved)
EXTERN_C const IID IID_IProbe
virtual HRESULT STDMETHODCALLTYPE OnBeamformerStateChanged(IUnknown *pUsgBeamformer, ULONG *reserved)
virtual HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, const IID &riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
const char int const char const char * src
EXTERN_C const IID IID_IUsgLineDensity
unsigned char * CaptureFrame()
EXTERN_C const IID IID_IUsgDopplerColorThreshold
EXTERN_C const IID IID_IUsgClearView
EXTERN_C const IID IID_IUsgCtrlChangeCommon
interface IUsgCtrlChangeCommon IUsgCtrlChangeCommon
EXTERN_C const IID IID_IUsgDopplerSignalScale
EXTERN_C const IID IID_IUsgDepth
EXTERN_C const IID IID_IUsgTgc
void FreezeDevice(bool freeze)
EXTERN_C const IID IID_IUsgCollection
EXTERN_C const IID IID_IUsgSpatialFilter
EXTERN_C const IID IID_IUsgDeviceChangeSink
EXTERN_C const IID IID_IUsgCompoundFrames
EXTERN_C const IID IID_IUsgViewArea
interface IUsgDeviceChangeSink IUsgDeviceChangeSink
PlusStatus GetPowerDb(double &powerDb)
interface IUsgDynamicRange IUsgDynamicRange
EXTERN_C const IID IID_IUsgDopplerColorPriority
virtual HRESULT STDMETHODCALLTYPE OnControlChangedBSTR(BSTR ctrlGUID, LONG scanMode, LONG streamId, IUsgControl *pControlObject, LONG dispId, LONG flags)
EXTERN_C const IID IID_IUsgMixerControl
EXTERN_C const IID IID_IUsgFocus
interface IUsgGain IUsgGain
EXTERN_C const IID IID_IUsgSweepSpeed
EXTERN_C const IID IID_IUsgGain
EXTERN_C const IID IID_IUsgDopplerSignalSmooth
interface IUsgDataView IUsgDataView
interface IUsgCollection IUsgCollection
interface IUsgDepth IUsgDepth
EXTERN_C const IID IID_IUsgFrameAvg
STDMETHODIMP_(ULONG) TelemedUltrasound
PlusStatus SetFocusDepthPercent(double focusDepthPercent)
virtual HRESULT STDMETHODCALLTYPE OnProbeStateChanged(IUnknown *pUsgProbe, ULONG *reserved)
EXTERN_C const IID IID_IUsgDopplerPRF
PlusStatus GetGainPercent(double &gainPercent)
PlusStatus GetDepthMm(double &depthMm)
virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(const IID &riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgdispid)
EXTERN_C const IID IID_IUsgDopplerCorrectionAngle
EXTERN_C const IID IID_IUsgRejection2
EXTERN_C const IID IID_IUsgViewAngle
PlusStatus GetDynRangeDb(double &dynRangeDb)
EXTERN_C const IID IID_IUsgDynamicRange
#define BYTESPERLINE(Width, BPP)
EXTERN_C const IID IID_IUsgDopplerColorMap
FrameSizeType m_FrameSize
void SetMaximumFrameSize(const FrameSizeType &maxFrameSize)
EXTERN_C const IID IID_IUsgSweepMode
EXTERN_C const IID IID_IUsgPalette
LPBITMAPINFO DSGetBITMAPINFOForDIBSection(HBITMAP hBitmap)
EXTERN_C const CLSID CLSID_Usgfw2
PlusStatus GetFrequencyMhz(double &freqMHz)
EXTERN_C const IID IID_IUsgProbeFrequency2
EXTERN_C const IID IID_IUsgScanType
EXTERN_C const IID IID_IUsgDopplerPacketSize
interface IUsgScanMode IUsgScanMode
EXTERN_C const IID IID_IUsgScanLineProperties
EXTERN_C const IID IID_IUsgCineSink
PlusStatus SetDepthMm(double depthMm)
EXTERN_C const IID IID_IUsgBioeffectsIndices
EXTERN_C const IID IID_IUsgImageProperties
EXTERN_C const IID IID_IUsgProbeFrequency3
const char int const char int flags
virtual ~TelemedUltrasound()
interface IUsgPower IUsgPower
interface IUsgControl IUsgControl
EXTERN_C const IID IID_IUsg3dVolumeDensity
PlusStatus Connect(int probeId=0)
EXTERN_C const IID IID_IUsgDopplerWindow
virtual HRESULT STDMETHODCALLTYPE OnProbeArrive(IUnknown *pUsgProbe, ULONG *reserved)
virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT itinfo, LCID lcid, ITypeInfo **pptinfo)
EXTERN_C const IID IID_IUsgPower
EXTERN_C const IID IID_IUsgAudioVolume
PlusStatus SetGainPercent(double gainPercent)
std::wstring GuidToWstring(const GUID &guid)
EXTERN_C const IID IID_IUsgPulsesNumber
EXTERN_C const IID IID_IUsg3dVolumeSize
interface IUsgProbeFrequency3 IUsgProbeFrequency3
interface IUsgValues IUsgValues
static LRESULT CALLBACK ImageWindowProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
void CreateUsgControls(int probeId=0)
EXTERN_C const IID IID_IUsgScanLineSelector
EXTERN_C const IID IID_IUsgDopplerColorTransparency
virtual HRESULT STDMETHODCALLTYPE OnProbeRemove(IUnknown *pUsgProbe, ULONG *reserved)
EXTERN_C const IID IID_IUsgDopplerBaseLine
EXTERN_C const IID IID_IUsgSteeringAngle
EXTERN_C const IID IID_IUsgImageOrientation
EXTERN_C const IID IID_IUsgfw2
EXTERN_C const IID IID_IUsgImageEnhancement
virtual HRESULT STDMETHODCALLTYPE OnBeamformerRemove(IUnknown *pUsgBeamformer, ULONG *reserved)
virtual HRESULT STDMETHODCALLTYPE OnControlChanged(REFIID riidCtrl, ULONG scanMode, LONG streamId, IUsgControl *pControlObj, LONG dispId, LONG flags)
interface IUsgFocus IUsgFocus
PlusStatus SetDynRangeDb(double dynRangeDb)
EXTERN_C const IID IID_IUsgDopplerSpectralAvg
PlusStatus SetFrequencyMhz(double freqMHz)
FrameSizeType m_MaximumFrameSize
std::vector< unsigned char > m_FrameBuffer
EXTERN_C const IID IID_IUsgDopplerSampleVolume
EXTERN_C const IID IID_IUsgDopplerSteerAngle
EXTERN_C const IID IID_IUsgDopplerWallFilter
EXTERN_C const IID IID_IUsgCompoundAngle