6 #ifndef INCLUDED_IMF_PARTHELPER_H
7 #define INCLUDED_IMF_PARTHELPER_H
59 std::size_t
q =
name.rfind (
'.');
60 if (q ==
name.npos) {
return ""; }
61 return name.substr (0, q);
66 std::size_t
q =
name.rfind (
'.');
68 return name.substr (q + 1);
90 bool multipart =
true,
95 for (
T i = begin; i !=
end; i++)
100 if (i->view ==
"") { i->internal_name = i->name; }
110 if (i->view == heroView) { i->internal_name = i->name; }
113 i->internal_name = i->view +
"." + i->name;
119 lname +
"." + i->view +
"." + i->getSuffix ();
131 std::map<std::string, std::set<std::string>> viewsInLayers;
132 for (
T i = begin; i !=
end; i++)
134 viewsInLayers[i->getLayer ()].insert (i->view);
139 std::map<std::pair<std::string, std::string>,
int> layerToPart;
143 for (std::map<
std::string, std::set<std::string>>::const_iterator
144 layer = viewsInLayers.begin ();
145 layer != viewsInLayers.end ();
149 bool layer_has_hero =
150 layer->second.find (heroView) !=
layer->second.end ();
153 layerToPart[std::make_pair (
layer->first, heroView)] =
158 for (std::set<std::string>::const_iterator
view =
159 layer->second.begin ();
163 if (*
view != heroView)
165 layerToPart[std::make_pair (
layer->first, *
view)] =
173 for (
T i = begin; i !=
end; i++)
175 i->internal_name = i->name;
177 layerToPart[std::make_pair (i->getLayer (), i->view)];
193 bool has_multiview =
false;
195 if (file.
parts () == 1)
197 if (hasMultiView (file.
header (0)))
199 mview = multiView (file.
header (0));
200 has_multiview =
true;
204 for (
int p = 0; p < file.
parts (); p++)
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
GLsizei const GLchar *const * string
IMF_EXPORT Iterator begin()
IMF_EXPORT std::string removeViewName(const std::string &channel, const std::string &view)
GLdouble GLdouble GLdouble q
IMF_EXPORT Iterator end()
GLenum GLuint GLint GLint layer
IMF_EXPORT std::string viewFromChannelName(const std::string &channel, const StringVector &multiView)
std::string name
name of channel
std::string getSuffix() const
IMF_EXPORT ConstIterator()
int SplitChannels(const T &begin, const T &end, bool multipart=true, const std::string &heroView=std::string())
assigns individual channels to different parts based on their layer and view name input is an array...
GLuint const GLchar * name
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
PcpNodeRef_ChildrenIterator begin(const PcpNodeRef::child_const_range &r)
Support for range-based for loops for PcpNodeRef children ranges.