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

Function metadataToImageSpecAttributes

src/IECoreImage/ImageWriter.cpp:158–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156}
157
158void metadataToImageSpecAttributes( const CompoundData *metadata, ImageSpec *spec, const std::string &prefix = "" )
159{
160 const auto &members = metadata->readable();
161 for( const auto &item : members )
162 {
163 std::string thisName = ( (bool)prefix.size() ? prefix + "." : std::string("") ) + item.first.value();
164
165 if( const CompoundData *compound = runTimeCast<const CompoundData>( item.second.get() ) )
166 {
167 metadataToImageSpecAttributes( compound, spec, thisName );
168 }
169 else
170 {
171 const OpenImageIOAlgo::DataView dataView( item.second.get() );
172 if( dataView.data )
173 {
174 spec->attribute( thisName, dataView.type, dataView.data );
175 }
176 }
177 }
178}
179
180void setImageSpecFormatOptions( const CompoundObject *operands, ImageSpec *spec, const std::string &fileFormatName )
181{

Callers 1

doWriteMethod · 0.85

Calls 4

readableMethod · 0.80
sizeMethod · 0.45
valueMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected