| 156 | } |
| 157 | |
| 158 | void 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 | |
| 180 | void setImageSpecFormatOptions( const CompoundObject *operands, ImageSpec *spec, const std::string &fileFormatName ) |
| 181 | { |