int CoreCallback::InsertImage(const MM::Device* caller, const ImgBuffer & imgBuf) { Metadata md = imgBuf.GetMetadata(); unsigned char* p = const_cast<unsigned char*>(imgBuf.GetPixels()); MM::ImageProcessor* ip = GetImageProcessor(caller); if( NULL != ip) { ip->Process(p, imgBuf.Width(), imgBuf.Height(), imgBuf.Depth()); } return InsertImage(caller, imgBuf.GetPixels(), imgBuf.Width(), imgBuf.Height(), imgBuf.Depth(), &md); }
void ImgBuffer::Copy(const ImgBuffer& right) { if (!Compatible(right)) Resize(right.width_, right.height_, right.pixDepth_); SetPixels((void*)right.GetPixels()); }
const unsigned char* FrameBuffer::GetPixels(unsigned channel, unsigned slice) const { ImgBuffer* img = FindImage(channel, slice); if (img) return img->GetPixels(); else return 0; }
void COpenCVgrabber::GenerateEmptyImage(ImgBuffer& img) { MMThreadGuard g(imgPixelsLock_); if (img.Height() == 0 || img.Width() == 0 || img.Depth() == 0) return; unsigned char* pBuf = const_cast<unsigned char*>(img.GetPixels()); memset(pBuf, 0, img.Height()*img.Width()*img.Depth()); }
void CIDS_uEye::ClearImageBuffer(ImgBuffer& img) { MMThreadGuard g(imgPixelsLock_); if (img.Height() == 0 || img.Width() == 0 || img.Depth() == 0) return; unsigned char* pBuf = const_cast<unsigned char*>(img.GetPixels()); memset(pBuf, 0, img.Height()*img.Width()*img.Depth()); }