Re: Change Channel names
Aaron Carlisle <[email protected]> Mon, 14 Dec 2015 05:47:45 -0500
| Newsgroups | gmane.comp.video.openexr.user |
|---|---|
| Message-ID | <[email protected]> |
--===============3952975864096373708== Content-Type: multipart/alternative; boundary="----XT961SP2O1R6KN6G0QQNQZ2ZO0WB2U" Content-Transfer-Encoding: 8bit ------XT961SP2O1R6KN6G0QQNQZ2ZO0WB2U Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 You're awesome! Ill work with this today, and see where I get. In addition to changing the channel names I also wanted to be able to combine the channel data from the rgb channels from each layer into one. In python I just created a dictionary, grouped the rgb channels and used array to convert them. So (customlayer.red, customlayer.blue, customlayer.green) became (newlayername.customchannelname(combined pixel data from red, green, blue)). In C++ it doesn't seem seem as simple. Do you have any suggestions for doing the same in C++? Thanks again!! On Dec 13, 2015, 8:48 PM, at 8:48 PM, Peter Hillman <[email protected]> wrote: >You cannot modify a channel name because the ChannelList object keeps >them sorted. If you wish to rename a channel within a list, you must >delete it and reinsert it with the new name, or else assemble a >completely new ChannelList containing the channels the way you want. > >You may find the source of the multiview utility instructive: >https://github.com/openexr/openexr/blob/master/OpenEXR/exrmultiview/makeMultiView.cpp >That reads in channels from the input(s) and writes them out with >different names. >You could drop a channel from the output file by making these two lines > >conditional: >header.channels().insert(outChanName, inChannel); >and >outFb.insert(outChanName,image.channel(outChanName).slice()); > > > >On 12/12/15 08:02, Aaron Carlisle wrote: >> In the ChannelList::Iterator and ChannelList::ConsIterator name() is >> being defined as a const char * name () const, which means I can't >> change the name. Is there anyway around this? I just want to be able >> to change the channel name. I tried converting name into a string >then >> back into a const char * which works, but I have significant data >loss >> and the pixels no longer show up in the image. >> >> >> _______________________________________________ >> Openexr-user mailing list >> [email protected] >> https://lists.nongnu.org/mailman/listinfo/openexr-user > > > >------------------------------------------------------------------------ > >_______________________________________________ >Openexr-user mailing list >[email protected] >https://lists.nongnu.org/mailman/listinfo/openexr-user ------XT961SP2O1R6KN6G0QQNQZ2ZO0WB2U Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit <html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"></head><body><p dir="ltr">You're awesome! Ill work with this today, and see where I get. </p> <p dir="ltr">In addition to changing the channel names I also wanted to be able to combine the channel data from the rgb channels from each layer into one. In python I just created a dictionary, grouped the rgb channels and used array to convert them. So (<a href="http://customlayer.red">customlayer.red</a>, <a href="http://customlayer.blue">customlayer.blue</a>, <a href="http://customlayer.green">customlayer.green</a>) became (newlayername.customchannelname(combined pixel data from red, green, blue)). In C++ it doesn't seem seem as simple. Do you have any suggestions for doing the same in C++?</p> <p dir="ltr">Thanks again!!<br><br></p> <div class="gmail_quote" >On Dec 13, 2015, at 8:48 PM, Peter Hillman <<a href="mailto:[email protected]" target="_blank">[email protected]</a>> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> You cannot modify a channel name because the ChannelList object keeps them sorted. If you wish to rename a channel within a list, you must delete it and reinsert it with the new name, or else assemble a completely new ChannelList containing the channels the way you want. <br> <br> You may find the source of the multiview utility instructive: <br> <tt><a class="moz-txt-link-freetext" href="https://github.com/openexr/openexr/blob/master/OpenEXR/exrmultiview/makeMultiView.cpp">https://github.com/openexr/openexr/blob/master/OpenEXR/exrmultiview/makeMultiView.cpp</a></tt> <br> That reads in channels from the input(s) and writes them out with different names. <br> You could drop a channel from the output file by making these two lines conditional: <br> <tt>header.</tt> <tt><span class="pl-c1">channels</span></tt> <tt>().</tt> <tt><span class="pl-c1">insert</span></tt> <tt> (outChanName, inChannel); </tt> <br> and <br> <tt>outFb.</tt> <tt><span class="pl-c1">insert</span></tt> <tt> (outChanName,image.</tt> <tt><span class="pl-c1">channel</span></tt> <tt>(outChanName).</tt> <tt><span class="pl-c1">slice</span></tt> <tt>());</tt> <br> <br> <br> <br> <div class="moz-cite-prefix"> On 12/12/15 08:02, Aaron Carlisle wrote: <br> </div> <blockquote cite="mid:CADwEHsO24VMfQcUausakqRtO7uQPm-kshDDoFjLe+hwaxXu0xg@mail.gmail.com" type="cite"> <div dir="ltr"> In the ChannelList::Iterator and ChannelList::ConsIterator name() is being defined as a const char * name () const, which means I can't change the name. Is there anyway around this? I just want to be able to change the channel name. I tried converting name into a string then back into a const char * which works, but I have significant data loss and the pixels no longer show up in the image. </div> <br> <fieldset class="mimeAttachmentHeader"></fieldset> <br> <pre wrap="">_______________________________________________ Openexr-user mailing list <a class="moz-txt-link-abbreviated" href="mailto:[email protected]">[email protected]</a> <a class="moz-txt-link-freetext" href="https://lists.nongnu.org/mailman/listinfo/openexr-user">https://lists.nongnu.org/mailman/listinfo/openexr-user</a> </pre> </blockquote> <br> <pre class="blue"> <hr><br>Openexr-user mailing list<br>[email protected]<br><a href="https://lists.nongnu.org/mailman/listinfo/openexr-user">https://lists.nongnu.org/mailman/listinfo/openexr-user</a><br></pre></blockquote></div></body></html> ------XT961SP2O1R6KN6G0QQNQZ2ZO0WB2U-- --===============3952975864096373708== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Openexr-user mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/openexr-user --===============3952975864096373708==--