Code Search for Developers
 
 
  

inc_pprocess.inc.html from PovClipse at Krugle


Show inc_pprocess.inc.html syntax highlighted

<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>3.5. The 'pprocess.inc' include file</title><link rel="stylesheet" href="megapov.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="MegaPOV Documentation"><link rel="up" href="include.html" title="Chapter 3. MegaPOV Include files"><link rel="previous" href="mechsim.inc.html" title="3.4. The 'mechsim.inc' include file"><link rel="next" href="tone_mapping.inc.html" title="3.6. The 'tone_mapping.inc' include file"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">3.5. The 'pprocess.inc' include file</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="mechsim.inc.html">Prev</a> </td><th width="60%" align="center">Chapter 3. MegaPOV Include files</th><td width="20%" align="right"> <a accesskey="n" href="tone_mapping.inc.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="inc_pprocess.inc"></a>3.5. The '<tt class="filename">pprocess.inc</tt>' include file</h2></div><div><div class="author"><h3 class="author"><span class="firstname">W&#322;odzimierz</span> <span class="othername">ABX</span> <span class="surname">Skiba</span></h3></div></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="post_proc_macros"></a>3.5.1. Macros with effects</h3></div></div><div></div></div><p>
      Because using functions is not equally easy to every user, some predefined post processing
      effects can be used in the form of macros with user-friendly syntax (like every other
      functionality of the <span class="trademark">POV-Ray</span>&#8482;).
    </p><p>
      To use these macros with post process effects, the include file <tt class="filename">pprocess.inc</tt>
      must be included. Several of these macros have a syntax similar to the old MegaPOV post process, so
      they may be familiar to you.
    </p><p>
      Following macros are available to the user:
    </p><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="post_proc_clipping"></a>3.5.1.1. Clipping colors</h4></div></div><div></div></div><p>
        </p><pre class="synopsis"><tt class="function">post_process</tt> { PP_Clip_Colors(color_min,color_max) }</pre><p>
        Clips all colors in the image to the range color_min and color_max
      </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="pp_color_matrix"></a>3.5.1.2. Color matrix</h4></div></div><div></div></div><p>
        </p><pre class="synopsis"><tt class="function">post_process</tt> { PP_Color_Matrix(Array) }
      
// Runs the color through a 3*3 matrix expressed in Array.
// The equation is:
// R = r*AA + g*AB + b*AC
// G = r*BA + g*BB + b*BC
// B = r*CA + g*CB + b*CC
// and Array means
// array[9]{AA, AB, AC, BA, BB, BC, CA, CB, CC}</pre><p>
        Combination of colors.
      </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="pp_convolution_matrix"></a>3.5.1.3. Convolution matrix</h4></div></div><div></div></div><p>
        </p><pre class="synopsis"><tt class="function">post_process</tt> { PP_Convolution_Matrix(XDim,YDim,Divisor,Leveling,Matrix) }</pre><p>
        Multiplies the pixel and the adjacent pixels (in the area defined by the matrix size)
        by the respective values in the matrix, adds the results together and divides by Divisor to 
        get an average color. A leveling value can be added in before the final division.
      </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="pp_depth"></a>3.5.1.4. Depth</h4></div></div><div></div></div><p>
        </p><pre class="synopsis"><tt class="function">post_process</tt> { PP_Depth(Field_Start,Field_Depth) }</pre><p>
        The image is converted to a gray-scale image with the gray-value of the pixel depending
        of the depth location in the scene.
      </p><p>
        Field_Start specifies the beginning of the focal range in units from the camera.
      </p><p>
        Field_Depth specifies the length of the focal range.
      </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="pp_find_edges"></a>3.5.1.5. Finding edges</h4></div></div><div></div></div><p>
        </p><pre class="synopsis"><tt class="function">post_process</tt> {
  PP_Find_Edges(Depth_Thresh,Normal_Thresh,Color_Thresh,Line_Radius,Sharpness,Pigment)
}</pre><p>
        This post process effect finds the edges in an image using depth, normal, and color information.
        Separate thresholds are specified for each of the three methods of edge detection.
        </p><div class="itemizedlist"><ul type="disc" compact><li>Depth_Thresh: range: 0 to infinity. An edge is detected if the difference of
          depth (of the first intersection) in two consecutive pixels exceeds this value.</li><li>Normal_Thresh: range: 0 to 1. Zero represents normal vectors pointing in
          the same direction, 0.5 means a 90 degree difference, and 1.0 means the normal vectors point
          in opposite directions.</li><li>Color_Thresh: range: 0 to 1. Zero means no color difference, 1 means the
          opposite color. The color channels (red, green, and blue) are differenced separately and
          the results are averaged to produce the final difference.</li></ul></div><p>
      </p><p>
        The width of the lines is controlled by the "Line_Radius" parameter.
      </p><p>
         The sharpness of the lines is controlled by the "Sharpness" parameter. A
         sharpness of 1.0 yields nicely anti-aliased lines. A sharpness value of 0.0 leads to blurry
         lines when larger radii are used, and a sharpness value of greater than 1.0 begins to remove
         anti-aliasing from the lines.
      </p><p>
         The color of the line is controlled by the pigment specified. This pigment is evaluated over
         the range of &lt;x,y&gt; = &lt;0,0&gt; ... &lt;1,1&gt; (with z=0) over the full size of the image.
         Using solid  colors is usually a good idea, unless special effects are desired.
      </p><div class="example"><a name="id2581130"></a><p class="title"><b>Example 3.17. Find edge macro</b></p><pre class="programlisting">PP_Find_Edges( 1.0, 0.3, 0.15, 2, 1.0, rgb 0 )</pre></div><p>
         Finds edges wherever there is a depth difference greater than 1.0, a normal difference greater
         than  0.3 (about 60 degrees), or a color difference of 0.15. It uses a line radius of 2.0, with
         black (rgb 0) antialiased (sharpness 1.0) lines.
      </p><p>
        The PP_Find_Edges macro is a straight implementation of the functionality of the effect available
        in previous versions of MegaPOV. In fact this macro is a wrapper to the more functional
        macro PP_Find_Edges_Back():
        </p><pre class="synopsis"><tt class="function">post_process</tt> {
  PP_Find_Edges_Back(
    Depth_Thresh,Normal_Thresh,Color_Thresh,Line_Radius,Sharpness,Pigment,
    Background,Background_Filter,Width,Height
  )
}</pre><p>
        This macro adds four more parameters:
      </p><p>
        Background: a pigment as replacement to be placed between edges instead of the original rendering.
      </p><p>
        Background_Filter: pigment with a filter value for weighting between the "Background"
        parameter and the "Pigment" parameter.
      </p><p>
        Width,Height: the image sizes to make the parameter "Line_Radius" relative to the image area.
        It is usually <tt class="function">image_width</tt> and <tt class="function">image_height</tt> but can be something different in case
        somebody wants a special effect like larger rectangles instead of lines.
      </p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="shared_effects"></a>3.5.2. Shared predefined effects</h3></div></div><div></div></div><p>
      Macros mentioned in earlier sections are prefixed with 'PP_' on purpose.
      Include file <tt class="filename">pprocess.inc</tt> for those macros with respective equivalents
      for camera_view and referenced post processing. For example:
      </p><pre class="programlisting">// create clipping effect of the rendering output
<tt class="function">post_process</tt> { PP_Clip_Colors(COLOR_MIN,COLOR_MAX) }

// create clipping effect of another post processing stage
<tt class="function">post_process</tt> { PP_Clip_Colors_Ref(Nth,COLOR_MIN,COLOR_MAX) }

// create clipping effect of another camera output
<tt class="function">post_process</tt> { PP_Clip_Colors_Cam(CAMERA,COLOR_MIN,COLOR_MAX) }

// create a pigment with clipping of the other camera output
<tt class="function">#declare</tt> Pigment = Pig_Clip_Colors_Cam(CAMERA,COLOR_MIN,COLOR_MAX) }</pre><p>
    </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="mechsim.inc.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="include.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="tone_mapping.inc.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">3.4. The 'mechsim.inc' include file </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 3.6. The 'tone_mapping.inc' include file</td></tr></table></div></body></html>




See more files for this project here

PovClipse

PovClipse is an eclipse editor plugin for Povray (Persistence of Vision Raytracer) sceene- and include files.\r\nIt features syntax highlighting, code folding, code assist, outline view as well as running Povray using render configurations.

Project homepage: http://sourceforge.net/projects/povclipse
Programming language(s): Java
License: other

  icons/
    blank.png
    caution.gif
    caution.png
    caution.tif
    draft.png
    home.gif
    home.png
    important.gif
    important.png
    important.tif
    next.gif
    next.png
    note.gif
    note.png
    note.tif
    prev.gif
    prev.png
    tip.gif
    tip.png
    tip.tif
    toc-blank.png
    toc-minus.png
    toc-plus.png
    up.gif
    up.png
    warning.gif
    warning.png
    warning.tif
  img/
    coll_con.png
    coll_face.png
    coll_mass.png
    con_visc.png
    con_vk.png
    connections1.png
    env_force.png
    env_impact.png
    expo1.png
    expo2.png
    faces1.png
    formula001.png
    formula001_print.png
    formula002.png
    formula002_print.png
    formula003.png
    formula003_print.png
    formula004.png
    formula004_print.png
    formula005.png
    formula005_print.png
    formula006.png
    formula006_print.png
    hdr1.png
    hdr2.png
    hdr3.png
    macro01.png
    macro02.png
    macro03a.png
    macro03b.png
    macro03c.png
    macro03d.png
    macro03e.png
    macro03f.png
    macro04.png
    macro05a.png
    macro05b.png
    macro05c.png
    macro05d.png
    macro05e.png
    macro06.png
    macro07.png
    macro09.png
    macro10a.png
    macro10b.png
    macro10c.png
    macro10d.png
    macro10e.png
    macro11.png
    macro12.png
    masses1.png
    patch01.png
    rad_halton_1600a.png
    rad_halton_1600b.png
    rad_halton_300a.png
    rad_halton_300b.png
    rad_halton_50a.png
    rad_halton_50b.png
    rad_internal_1600a.png
    rad_internal_1600b.png
    rad_internal_300a.png
    rad_internal_300b.png
    rad_internal_50a.png
    rad_internal_50b.png
    rad_sampling.png
    rad_viz_low_count.png
    rad_viz_sampling.png
    titlepage.png
    tut_drape01.jpg
    tut_drape02.jpg
    tut_drape03.jpg
    tut_drape04.jpg
    tut_drape05.jpg
    tut_hdr_1.png
    tut_hdr_2.png
    tut_hdr_3.png
    tut_hdr_env1.png
    tut_hdr_env2.png
    tut_hdr_res1.png
    tut_hdr_res2.png
    tut_hdr_view.hdr
    tut_hdr_view1.png
    tut_hdr_view2.png
    tut_nappe01.jpg
    tut_nappe02.jpg
    tut_nappe03.jpg
    tut_nappe04.jpg
    tutorial01.png
    tutorial02.png
    tutorial03.png
    tutorial04.png
    tutorial05.png
    tutorial06.png
    tutorial07.png
    tutorial08.png
    tutorial09.png
  msim_tut/
    tutorial01.pov
    tutorial02.mpg
    tutorial02.pov
    tutorial03.mpg
    tutorial03.pov
    tutorial04.mpg
    tutorial04.pov
    tutorial05.mpg
    tutorial05.pov
    tutorial06.mpg
    tutorial06.pov
    tutorial07.mpg
    tutorial07.pov
    tutorial08.mpg
    tutorial08.pov
    tutorial09.mpg
    tutorial09.pov
  appendices.html
  binaries.html
  camera.html
  contribution.html
  effects.html
  enable.html
  expressions.html
  global_settings.html
  inc_pprocess.inc.html
  include.html
  index.html
  internals.html
  internals_expressions.html
  internals_patterns.html
  introduction.html
  mechsim.inc.html
  megapov.css
  megapov0121.html
  megapov_index.html
  mp_consts.inc.html
  mp_types.inc.html
  multiformat_documentation.html
  nappe.pov
  news.html
  objects.html
  old_megapov.html
  parser.html
  patterns.html
  references.html
  tone_mapping.inc.html
  tutorials.html
  tutorials_hdri.html
  tutorials_simulation.html
  where.html
  why.html