| 600 | } |
| 601 | |
| 602 | ObjectPtr ImageReader::doOperation( const CompoundObject *operands ) |
| 603 | { |
| 604 | bool rawChannels = operands->member< BoolData >( "rawChannels" )->readable(); |
| 605 | |
| 606 | ImagePrimitivePtr image = new ImagePrimitive( dataWindow(), displayWindow() ); |
| 607 | |
| 608 | vector<string> channelNames; |
| 609 | channelsToRead( channelNames ); |
| 610 | |
| 611 | for( size_t ci = 0, cend = channelNames.size(); ci != cend; ++ci ) |
| 612 | { |
| 613 | DataPtr d = m_implementation->readChannel( channelNames[ci], rawChannels ); |
| 614 | assert( d ); |
| 615 | assert( rawChannels || d->typeId()==FloatVectorDataTypeId ); |
| 616 | |
| 617 | assert( image->channelValid( d.get() ) ); |
| 618 | |
| 619 | image->channels[ channelNames[ci] ] = d; |
| 620 | } |
| 621 | |
| 622 | if( !rawChannels ) |
| 623 | { |
| 624 | ColorAlgo::transformImage( image.get(), m_implementation->currentColorSpace(), m_implementation->linearColorSpace() ); |
| 625 | } |
| 626 | |
| 627 | m_implementation->updateMetadata( image->blindData() ); |
| 628 | |
| 629 | return image; |
| 630 | } |
| 631 | |
| 632 | DataPtr ImageReader::readChannel( const std::string &name, bool raw ) |
| 633 | { |
nothing calls this directly
no test coverage detected