From eb7a548a785bbc35cb22c934ad7bbc51718cee1a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2024 00:52:44 +0000 Subject: [PATCH 1/3] Update secret-device-adapters-commit to latest --- secret-device-adapters-commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/secret-device-adapters-commit b/secret-device-adapters-commit index 3eecc584d..add1c4707 100644 --- a/secret-device-adapters-commit +++ b/secret-device-adapters-commit @@ -1 +1 @@ -fa7a9069a0a99f32f283de8767b452339afb7775 +574f3c801e6df2b0fa761298ddc32ac64dce58ce From a9bb2fe1fb654709deb364cfba812fd2f909364f Mon Sep 17 00:00:00 2001 From: Franz Reitner Date: Wed, 26 Jun 2024 14:44:12 +0200 Subject: [PATCH 2/3] FRE / excelitas pco gmbh / 26.06.2024 / added 48bit RGB --- DeviceAdapters/PCO_Generic/MicroManager.cpp | 77 ++++++++++++++++----- 1 file changed, 61 insertions(+), 16 deletions(-) diff --git a/DeviceAdapters/PCO_Generic/MicroManager.cpp b/DeviceAdapters/PCO_Generic/MicroManager.cpp index 38eb58c65..57ca48314 100644 --- a/DeviceAdapters/PCO_Generic/MicroManager.cpp +++ b/DeviceAdapters/PCO_Generic/MicroManager.cpp @@ -45,6 +45,7 @@ const char* g_CameraDeviceName = "pco_camera"; const char* g_PixelType_8bit = "8bit"; const char* g_PixelType_16bit = "16bit"; const char* g_PixelType_RGB32bit = "RGB 32bit"; +const char* g_PixelType_RGB48bit = "RGB 48bit"; const char* g_TimeStamp_No = "No stamp"; const char* g_TimeStamp_B = "Binary"; @@ -1008,8 +1009,10 @@ int CPCOCam::OnPixelType(MM::PropertyBase* pProp, MM::ActionType eAct) pixelDepth_ = 2; else if(pixType.compare(g_PixelType_8bit) == 0) pixelDepth_ = 1; - else if(pixType.compare(g_PixelType_RGB32bit) == 0) + else if (pixType.compare(g_PixelType_RGB32bit) == 0) pixelDepth_ = 4; + else if (pixType.compare(g_PixelType_RGB48bit) == 0) + pixelDepth_ = 6; else { return DEVICE_INTERNAL_INCONSISTENCY; @@ -1022,8 +1025,10 @@ int CPCOCam::OnPixelType(MM::PropertyBase* pProp, MM::ActionType eAct) pProp->Set(g_PixelType_8bit); else if(pixelDepth_ == 2) pProp->Set(g_PixelType_16bit); - else if(pixelDepth_ == 4) + else if (pixelDepth_ == 4) pProp->Set(g_PixelType_RGB32bit); + else if (pixelDepth_ == 6) + pProp->Set(g_PixelType_RGB48bit); else { return DEVICE_INTERNAL_INCONSISTENCY; @@ -1380,8 +1385,12 @@ int CPCOCam::Initialize() pixTypes.push_back(g_PixelType_16bit); pixTypes.push_back(g_PixelType_8bit); - if(m_pCamera->GetCCDCol(0)) + if (m_pCamera->GetCCDCol(0)) + { pixTypes.push_back(g_PixelType_RGB32bit); + //pixTypes.push_back(g_PixelType_RGB48bit); // Not possible up to now 07/22 + // Also GetImage does not convert to 48bit rgb, just 32bit rgb + } nRet = SetAllowedValues(MM::g_Keyword_PixelType, pixTypes); if(nRet != DEVICE_OK) @@ -1663,10 +1672,14 @@ unsigned CPCOCam::GetBitDepth() const { return m_pCamera->GetBitsPerPixel(); } - else if(img_.Depth() == 4) + else if (img_.Depth() == 4) { return 8; } + else if (img_.Depth() == 6) + { + return 16; + } else { return 0; // should not happen @@ -1746,9 +1759,9 @@ const unsigned char* CPCOCam::GetBuffer(int ibufnum) ppic8 += iadd; } } - else if(img_.Depth() == 4) + else if (img_.Depth() == 4) { - if(m_bDoAutoBalance) + if (m_bDoAutoBalance) { m_pCamera->SetLutMinMax(TRUE, TRUE); m_pCamera->AutoBalance(0, 0, 0, 0, 0); @@ -1757,28 +1770,60 @@ const unsigned char* CPCOCam::GetBuffer(int ibufnum) m_pCamera->Convert(ibufnum); iw = img_.Width(); ih = img_.Height(); - unsigned char *pchar; - unsigned char *ppic8, *ph; + unsigned char* pchar; + unsigned char* ppic8, * ph; int iadd; ppic8 = m_pCamera->GetPic8c(); iadd = (iw * 3) % 4; - if(iadd != 0) + if (iadd != 0) iadd = 4 - iadd; pchar = const_cast(img_.GetPixelsRW()); - for(int y = 0; y < ih; y++) + for (int y = 0; y < ih; y++) { - ph = &ppic8[y*(iw * 3 + iadd)]; - for(int x = 0; x < iw; x++) + ph = &ppic8[y * (iw * 3 + iadd)]; + for (int x = 0; x < iw; x++) { - *pchar++ = (unsigned char) *ph++; - *pchar++ = (unsigned char) *ph++; - *pchar++ = (unsigned char) *ph++; + *pchar++ = (unsigned char)*ph++; + *pchar++ = (unsigned char)*ph++; + *pchar++ = (unsigned char)*ph++; *pchar++ = 0; } } } + else if (img_.Depth() == 6) + { + if (m_bDoAutoBalance) + { + m_pCamera->SetLutMinMax(TRUE, TRUE); + m_pCamera->AutoBalance(0, 0, 0, 0, 0); + m_bDoAutoBalance = FALSE; + } + m_pCamera->Convert(ibufnum); + iw = img_.Width(); + ih = img_.Height(); + unsigned short* pchar; + unsigned char* ppic8, * ph; + int iadd; + + ppic8 = m_pCamera->GetPic8c(); + + iadd = (iw * 3) % 4; + if (iadd != 0) + iadd = 4 - iadd; + pchar = (unsigned short*)(img_.GetPixelsRW()); + for (int y = 0; y < ih; y++) + { + ph = &ppic8[y * (iw * 3 + iadd)]; + for (int x = 0; x < iw; x++) + { + *pchar++ = (unsigned char)*ph++; + *pchar++ = (unsigned char)*ph++; + *pchar++ = (unsigned char)*ph++; + } + } + } if(nErr != 0) return 0; @@ -2165,7 +2210,7 @@ int CPCOCam::ResizeImageBuffer() m_iHeight = nHeight; } - if(!(pixelDepth_ == 1 || pixelDepth_ == 2 || pixelDepth_ == 4)) + if(!(pixelDepth_ == 1 || pixelDepth_ == 2 || pixelDepth_ == 4 || pixelDepth_ == 6)) return -1; img_.Resize(nWidth, nHeight, pixelDepth_); SetSizes(nWidth, nHeight, pixelDepth_); From 3c97e21eaef2452d4b0826793dc067037ce7b257 Mon Sep 17 00:00:00 2001 From: bls337 Date: Wed, 26 Jun 2024 14:23:51 -0700 Subject: [PATCH 3/3] ASIStage: fix bug in CRISP Objective NA, can be > 1 now --- DeviceAdapters/ASIStage/ASICRISP.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DeviceAdapters/ASIStage/ASICRISP.cpp b/DeviceAdapters/ASIStage/ASICRISP.cpp index 8b2333ab8..4e2e0eb0b 100644 --- a/DeviceAdapters/ASIStage/ASICRISP.cpp +++ b/DeviceAdapters/ASIStage/ASICRISP.cpp @@ -651,7 +651,7 @@ int CRISP::OnNA(MM::PropertyBase* pProp, MM::ActionType eAct) } else if (eAct == MM::AfterSet) { - long na; + double na; pProp->Get(na); std::ostringstream command; command << std::fixed << "LR Y=" << na;