MCPcopy Create free account
hub / github.com/ImageEngine/cortex / ImageDisplayDriver

Method ImageDisplayDriver

src/IECoreImage/ImageDisplayDriver.cpp:55–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53static std::mutex g_poolMutex;
54
55ImageDisplayDriver::ImageDisplayDriver( const Box2i &displayWindow, const Box2i &dataWindow, const vector<string> &channelNames, ConstCompoundDataPtr parameters ) :
56 DisplayDriver( displayWindow, dataWindow, channelNames, parameters ),
57 m_image( new ImagePrimitive( dataWindow, displayWindow ) )
58{
59 for ( vector<string>::const_iterator it = channelNames.begin(); it != channelNames.end(); it++ )
60 {
61 m_image->createChannel<float>( *it );
62 }
63 if( parameters )
64 {
65 // Add all entries that follow our 'header:' metadata convention to the blindData.
66 // Other entries are omitted.
67 CompoundDataMap &xData = m_image->blindData()->writable();
68 const CompoundDataMap &yData = parameters->readable();
69 CompoundDataMap::const_iterator iterY = yData.begin();
70 for ( ; iterY != yData.end(); iterY++ )
71 {
72 if( starts_with( iterY->first.string(), "header:" ) )
73 {
74 xData[ iterY->first.string().substr( 7 ) ] = iterY->second->copy();
75 }
76 }
77
78 ConstStringDataPtr handle = parameters->member<StringData>( "handle" );
79 if( handle )
80 {
81 std::lock_guard<std::mutex> lock( g_poolMutex );
82 g_pool[handle->readable()] = m_image;
83 }
84 }
85}
86
87ImageDisplayDriver::~ImageDisplayDriver()
88{

Callers 3

testConstructionMethod · 0.80
testCompleteMethod · 0.80

Calls 6

blindDataMethod · 0.80
readableMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
writableMethod · 0.45
copyMethod · 0.45

Tested by 3

testConstructionMethod · 0.64
testCompleteMethod · 0.64