Re: Change Channel names

Peter Hillman <[email protected]> Mon, 14 Dec 2015 14:15:46 +1300
Newsgroups gmane.comp.video.openexr.user
Message-ID <[email protected]>
--===============0350146273898944344==
Content-Type: multipart/alternative;
	boundary="------------080605010308060400010404"

--------------080605010308060400010404
Content-Type: text/plain; charset="windows-1252"; format=flowed
Content-Transfer-Encoding: 7bit

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


--------------080605010308060400010404
Content-Type: text/html; charset="windows-1252"
Content-Transfer-Encoding: 7bit

<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    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">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <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>
  </body>
</html>

--------------080605010308060400010404--


--===============0350146273898944344==
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

--===============0350146273898944344==--