zoukankan      html  css  js  c++  java
  • Gamma Correction of OIIO

    apiitem{"oiio:ColorSpace" : string}
      The name of the color space of the color channels. Values incude:
      qkw{Linear}, qkw{sRGB}, qkw{GammaCorrected}, qkw{AdobeRGB},
      qkw{Rec709}, and qkw{KodakLog}.
      apiend
       
      apiitem{"oiio:Gamma" : float}
      If the color space is qkw{GammaCorrected}, this value is the gamma
      exponent.
      apiend
    The {cf ImageSpec::extra_attribs} field may store metadata that reveals
      the color space the image file in the qkw{oiio:ColorSpace}
      attribute, which may take on any of the following values:
       
      egin{description}
      item[halfspc m qkw{Linear}] indicates that the
      color pixel values are known to be linear.
      item[halfspc m qkw{GammaCorrected}] indicates
      that the color pixel values (but not alpha or $z$) have
      already been gamma corrected (raised to the power $1/gamma$), and
      that the gamma exponent may be found in the qkw{oiio:Gamma} metadata.
      item[halfspc m qkw{sRGB}] indicates that the
      color pixel values are in sRGB color space.
      item[halfspc m qkw{AdobeRGB}] indicates that the
      color pixel values are in Adobe RGB color space.
      item[halfspc m qkw{Rec709}] indicates that the
      color pixel values are in Rec709 color space.
      item[halfspc m qkw{KodakLog}] indicates that the
      color pixel values are in Kodak logarithmic color space.
      end{description}
       
      The ImageInput sets the qkw{oiio:ColorSpace} metadata in a
      purely advisory capacity --- the {cf read} will not convert pixel
      values among color spaces. Many image file formats only support
      nonlinear color spaces (for example, JPEG/JFIF dictates use of sRGB).
      So your application should intelligently deal with gamma-corrected and
      sRGB input, at the very least.
       
      The color space hints only describe color channels. You should assume that
      alpha or depth ($z$) channels (designated by the {cf alpha_channel} and
      {cf z_channel} fields, respectively) always represent linear values and
      should never be transformed by your application.

    spec.attribute("oiio::ColorSpace", "Linear");

    spec.attribute("oiio::ColorSpace", "GammaCorrected");
    spec.attribute("oiio::Gamma", (float)gamma);

    spec.attribute("oiio::ColorSpace", "sRGB");
    spec.attribute("oiio::ColorSpace", "Rec709");

    ----------------------------------------------------------------------------------------------------------

    Applies an inverse gamma correction to texture lookups. For example, a value of 2.2 will linearize a texture that comes in with a gamma of 2.2. This is done for 8 and 16 bit images.

    Arnold scans the contents of a texture (it does not rely on the extension) and anything that is not float is considered to have a gamma baked even if the image has a different color space embedded.

    Tx texture format

    You can convert your textures to linear space with the make tx tool. This way you can ensure that all of your textures are linear before rendering. For example:

    maketx --colorconvert sRGB linear C:solidanglemtoadeploy2014inimage.jpg
  • 相关阅读:
    [转]进程与线程及其区别
    [转]工厂模式
    [转]Filter实现处理中文乱码,转义html标签,过滤敏感词
    [转]JAVA设计模式之单例模式
    [转]Servlet 中文乱码问题及解决方案剖析
    Servlet作业2-将表单提交的商品信息输出到页面中
    Servlet作业1-实现注册登录
    [转] ServletContext 与application的异同
    [转]servlet中的service, doGet, doPost方法的区别和联系
    [转]Servlet 3.0 新特性详解
  • 原文地址:https://www.cnblogs.com/len3d/p/4324746.html
Copyright © 2011-2022 走看看