POV-Ray : Newsgroups : povray.advanced-users : rgb vs srgb : Re: rgb vs srgb Server Time
28 Sep 2024 18:59:34 EDT (-0400)
  Re: rgb vs srgb  
From: Zeger Knaepen
Date: 12 Sep 2011 17:47:51
Message: <4e6e7e07$1@news.povray.org>
On 12/09/2011 22:15, Zeger Knaepen wrote:
> [0 red 0]
> [1 red 1]

that should of course be "red 3", and the same for green and blue...

corrected code:

--- START CODE ---
#declare noWrap=function(x) {max(min(x,1),0)}
#macro pigmentDegamma(Pigment,Gamma)
   #local PigmentFunction=function {pigment {Pigment}}
   #local Result=pigment {
     function {noWrap(PigmentFunction(x,y,z).transmit)}
     pigment_map {
       [0
         average
         pigment_map {
           [1 function {noWrap(PigmentFunction(x,y,z).red)}
             color_map {
               [0 red 0]
               [1 red 3]
             }
             poly_wave Gamma
           ]
           [1 function {noWrap(PigmentFunction(x,y,z).green)}
             color_map {
               [0 green 0]
               [1 green 3]
             }
             poly_wave Gamma
           ]
           [1 function {noWrap(PigmentFunction(x,y,z).blue)}
             color_map {
               [0 blue 0]
               [1 blue 3]
             }
             poly_wave Gamma
           ]
         }
       ]
       [1
         average
         pigment_map {
           [1 function {noWrap(PigmentFunction(x,y,z).red)}
             color_map {
               [0 red 0 transmit 1]
               [1 red 3 transmit 1]
             }
             poly_wave Gamma
           ]
           [1 function {noWrap(PigmentFunction(x,y,z).green)}
             color_map {
               [0 green 0 transmit 1]
               [1 green 3 transmit 1]
             }
             poly_wave Gamma
           ]
           [1 function {noWrap(PigmentFunction(x,y,z).blue)}
             color_map {
               [0 blue 0 transmit 1]
               [1 blue 3 transmit 1]
             }
             poly_wave Gamma
           ]
         }
       ]
     }
   }
   Result
#end
--- END CODE ---


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.