35 #ifndef INCLUDED_IMF_PARTHELPER_H
36 #define INCLUDED_IMF_PARTHELPER_H
88 std::size_t
q=
name.rfind(
'.');
93 return name.substr(0,q);
99 std::size_t
q=
name.rfind(
'.');
104 return name.substr(q+1);
125 template<
typename T>
int
130 for(
T i=begin;i!=
end;i++)
137 i->internal_name=i->name;
147 if(i->view==heroView)
149 i->internal_name = i->name;
151 i->internal_name = i->view+
"."+i->name;
154 i->internal_name = lname+
"."+i->view+
"."+i->getSuffix();
164 std::map< std::string , std::set< std::string > > viewsInLayers;
165 for(
T i=begin;i!=
end;i++)
167 viewsInLayers[i->getLayer()].insert(i->view);
172 std::map< std::pair<std::string,std::string> ,
int > layerToPart;
176 for(std::map<
std::string , std::set< std::string > >::const_iterator
layer=viewsInLayers.begin();
180 bool layer_has_hero =
layer->second.find(heroView)!=
layer->second.end();
183 layerToPart[ std::make_pair(
layer->first,heroView) ] = partCount++;
188 for(std::set< std::string >::const_iterator view=
layer->second.begin();
189 view!=
layer->second.end();view++)
193 layerToPart[ std::make_pair(
layer->first,*view) ] = partCount++;
201 for(
T i=begin;i!=
end;i++)
203 i->internal_name=i->name;
204 i->part_number = layerToPart[ std::make_pair(i->getLayer(),i->view) ];
217 template<
class T>
void
220 bool has_multiview=
false;
224 if(hasMultiView(file.
header(0)))
226 mview=multiView(file.
header(0));
virtual ~MultiViewChannelName()
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
GLenum GLuint GLint GLint layer
IMF_EXPORT Iterator begin()
IMF_EXPORT std::string removeViewName(const std::string &channel, const std::string &view)
GLuint const GLchar * name
IMF_EXPORT Iterator end()
IMF_EXPORT std::string viewFromChannelName(const std::string &channel, const StringVector &multiView)
GLdouble GLdouble GLdouble GLdouble q
std::string name
name of channel
GLsizei const GLchar *const * string
std::string getSuffix() const
int SplitChannels(const T &begin, const T &end, bool multipart=true, const std::string &heroView="")
assigns individual channels to different parts based on their layer and view name input is an array...
int part_number
part number: updated by SplitChannels
std::string getLayer() const
std::string internal_name
name used in headers: in singlepart mode, may contain viewname
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER typedef std::vector< std::string > StringVector
void GetChannelsInMultiPartFile(const MultiPartInputFile &file, T &chans)
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER
std::string view
view for channel