M
markww
Hi,
This is a continuation of a dead post. I need to make a pixel map where
I can store pixel data for multiple images. Multiple windows in my app
may render the same image, so I want to keep one copy of the pixel data
and that's it (rather than multiple copies). Every image has a unique
StudyID, SeriesID, and then ImageID. So, I created a std::map that
looks like this:
struct ImageSink {
vector<BYTE> vPix;
};
struct SeriesSink {
map<CString, ImageSink> mImages;
};
struct StudySink {
map<CString, SeriesSink> mSeries;
};
class CDatasetPixelMap {
public:
CDatasetPixelMap();
~CDatasetPixelMap();
// This contains all the pixel buffers which can be looked
up.
map<CString, StudySink> m_DatasetPixelMap;
vector<BYTE> *GetPixelPointer(id,id,id);
}
Now I can get a pointer to the pixel data like:
vector<BYTE> *CDatasetPixelMap::GetPixelPointer(id, id, id)
{
return
&m_DatasetPixelMap[strStudyID].mSeries[strSeriesID].mImages[strImgID].vPix;
}
Is that complelety ridiculous? I'm worried about lookup speed (finding
the appropriate pixel buffer in the map with the 3 keys). But that
should be pretty fast right? Any ideas if this would be terribly slow?
Thanks,
Mark
This is a continuation of a dead post. I need to make a pixel map where
I can store pixel data for multiple images. Multiple windows in my app
may render the same image, so I want to keep one copy of the pixel data
and that's it (rather than multiple copies). Every image has a unique
StudyID, SeriesID, and then ImageID. So, I created a std::map that
looks like this:
struct ImageSink {
vector<BYTE> vPix;
};
struct SeriesSink {
map<CString, ImageSink> mImages;
};
struct StudySink {
map<CString, SeriesSink> mSeries;
};
class CDatasetPixelMap {
public:
CDatasetPixelMap();
~CDatasetPixelMap();
// This contains all the pixel buffers which can be looked
up.
map<CString, StudySink> m_DatasetPixelMap;
vector<BYTE> *GetPixelPointer(id,id,id);
}
Now I can get a pointer to the pixel data like:
vector<BYTE> *CDatasetPixelMap::GetPixelPointer(id, id, id)
{
return
&m_DatasetPixelMap[strStudyID].mSeries[strSeriesID].mImages[strImgID].vPix;
}
Is that complelety ridiculous? I'm worried about lookup speed (finding
the appropriate pixel buffer in the map with the 3 keys). But that
should be pretty fast right? Any ideas if this would be terribly slow?
Thanks,
Mark