Skip to content

Commit 294df24

Browse files
author
romainbehar
committed
NEW: copy from the SVN repository
0 parents  commit 294df24

File tree

518 files changed

+59162
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

518 files changed

+59162
-0
lines changed

.hgignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.*\.o$
2+
.*\.a$
3+
.sconf_temp
4+
.sconsign.dblite
5+
config.log
6+
doc/.*\.xml
7+
shrimp

AUTHORS.txt

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
Andy Gill: wrote the first Shrimp version
3+
4+
Luis Barrancos (aka rconstruct): RenderMan Shader Language guru, rewrote and greatly enhanced all the blocks
5+
6+
Romain Behar: rewrote Shrimp entirely using FLTK 2 and OpenGL
7+
8+
Freddy Chaleur (aka fredfewo): added box selection, copy paste and delete of blocks and groups, improved mouse control, wrote spline arrows to connect block
9+
10+
Matthew Lawrence: OpenGL code cleanup, replaced round corners with vertex arrays and GL_POLYGON_STRIP and improved performances dramatically; made it MESA stack compatible
11+

COPYING.txt

+674
Large diffs are not rendered by default.

SConstruct

+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# scons configuration file
2+
3+
import os, platform
4+
5+
6+
# Optional FLTK 2 paths
7+
vars = Variables('custom.py')
8+
vars.Add(PathVariable('fltk_include_path', 'Point to the fltk header files', '', PathVariable.PathAccept))
9+
vars.Add(PathVariable('fltk_lib_path', 'Point to the fltk library files', '', PathVariable.PathAccept))
10+
11+
12+
# Path setup
13+
env = Environment(variables = vars)
14+
15+
env.ParseConfig("fltk2-config --cxxflags --ldflags")
16+
env.ParseConfig( 'pkg-config --cflags --libs sigc++-2.0' )
17+
18+
# Linked libraries
19+
env.Append(LIBS = ['tinyxml', 'GL', 'GLU', 'fltk2_gl', 'fltk2_images', 'jpeg', 'png','tiff'])
20+
21+
22+
if platform.system() == 'Linux':
23+
env.Append(CPPPATH = ['/usr/include/', '/usr/include/GL', '$fltk_include_path', '/usr/local/include/fltk/compat/'])
24+
env.Append(LIBPATH = ['.', '/usr/lib/', '/usr/local/lib', '/usr/X11R6/lib', '$fltk_lib_path'])
25+
26+
elif platform.system() == 'Darwin':
27+
# OS X
28+
env.Append(CPPPATH = ['/System/Library/Frameworks/OpenGL.framework/Headers', '$fltk_include_path', '/usr/local/include/fltk/compat'])
29+
env.Append(LIBPATH = ['.', '/usr/local/lib', '/usr/X11R6/lib', '/opt/local/lib', '$fltk_lib_path'])
30+
env.Append(LINKFLAGS = ['-framework', 'Cocoa', '-framework', 'AGL', '-framework', 'OpenGL', '-framework', 'Carbon'])
31+
32+
else:
33+
print "Unknown platform: " + platform.system()
34+
Exit(1)
35+
36+
37+
# Check GL headers
38+
conf = Configure(env)
39+
if not conf.CheckCHeader('gl.h') or not conf.CheckCHeader('glu.h'):
40+
print 'Shrimp requires OpenGL and GLU'
41+
Exit(1)
42+
43+
# Check FLTK 2 headers
44+
if not conf.CheckCXXHeader('fltk/run.h'):
45+
print 'Shrimp requires FLTK 2'
46+
Exit(1)
47+
48+
# Check for libsigc++
49+
if not conf.TryAction('pkg-config --exists sigc++-2.0')[0]:
50+
print 'Shrimp requires libsigc++ 2.x'
51+
Exit(1)
52+
53+
# Check for libtiff
54+
#TODO
55+
56+
env = conf.Finish()
57+
58+
59+
# Debug
60+
#env.Append(CXXFLAGS = '-O2')
61+
env.Append(CXXFLAGS = '-g -Wall')
62+
#env.Append(LINKFLAGS = '-static-libgcc')
63+
64+
65+
# TinyXML
66+
StaticLibrary('tinyxml', Split("""
67+
src/miscellaneous/tinyxml/tinystr.cpp
68+
src/miscellaneous/tinyxml/tinyxml.cpp
69+
src/miscellaneous/tinyxml/tinyxmlerror.cpp
70+
src/miscellaneous/tinyxml/tinyxmlparser.cpp
71+
"""))
72+
73+
74+
# Shrimp
75+
env.Append(CPPPATH = ['src/application', 'src/miscellaneous', 'src/shading'])
76+
77+
shrimp_files = Split("""
78+
src/miscellaneous/misc_system_functions.cpp
79+
src/miscellaneous/misc_xml.cpp
80+
src/miscellaneous/logging.cpp
81+
82+
src/shading/preferences.cpp
83+
src/shading/shader_block.cpp
84+
src/shading/scene.cpp
85+
src/shading/scene_blocks.cpp
86+
src/shading/scene_grouping.cpp
87+
src/shading/scene_serialization.cpp
88+
src/shading/rib_root_block.cpp
89+
src/shading/rib_root_block_parsing.cpp
90+
91+
src/services.cpp
92+
src/opengl_view.cpp
93+
94+
src/application/shrimp.cpp
95+
src/application/ui_about.cpp
96+
src/application/ui_application_window.cpp
97+
src/application/ui_scene_view.cpp
98+
src/application/ui_splash.cpp
99+
src/application/tiffImage.cxx
100+
""")
101+
102+
103+
env.Program(target = 'shrimp', source = shrimp_files)
104+
105+
106+
# File change test
107+
Decider('timestamp-match')
108+

blocks/AOVs/aov_ambient.xml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<shrimp type="function" name="AOV_Ambient" description="Ambient AOV" author="rconstruct">
2+
<input name="in" description="Value for AOV" storage="varying" type="color" multi="+" default="color(0)"/>
3+
<output name="val" description="Value passed for AOV" storage="varying" type="color"/>
4+
<rsl_code>
5+
aov_ambient += $(in);
6+
$(val) = $(in);
7+
</rsl_code>
8+
<usage>Passes the values connected to the input, to the ambient AOV. The preset AOVs are aov_surfacecolor, aov_ambient, aov_diffuse, aov_indirectdiffuse, aov_specular, aov_specularcolor, aov_reflection, aov_refraction, aov_rimlighting, aov_scattering, aov_translucence, aov_shadows, aov_occlusion, aov_caustics. Note that all shading models blocks already have assigned AOVs to their respective components, as well as some other blocks, see the blocks information for details.</usage>
9+
</shrimp>

blocks/AOVs/aov_caustics.xml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<shrimp type="function" name="AOV_Caustics" description="Caustics AOV" author="rconstruct">
2+
<input name="in" description="Value for AOV" storage="varying" type="color" multi="+" default="color(0)"/>
3+
<output name="val" description="Value passed for AOV" storage="varying" type="color"/>
4+
<rsl_code>
5+
aov_caustics += $(in);
6+
$(val) = $(in);
7+
</rsl_code>
8+
<usage>Passes the values connected to the input, to the caustics AOV. The preset AOVs are aov_surfacecolor, aov_ambient, aov_diffuse, aov_indirectdiffuse, aov_specular, aov_specularcolor, aov_reflection, aov_refraction, aov_rimlighting, aov_scattering, aov_translucence, aov_shadows, aov_occlusion, aov_caustics. Note that all shading models blocks already have assigned AOVs to their respective components, as well as some other blocks, see the blocks information for details.</usage>
9+
</shrimp>

blocks/AOVs/aov_diffuse.xml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<shrimp type="function" name="AOV_Diffuse" description="Diffuse AOV" author="rconstruct">
2+
<input name="in" description="Value for AOV" storage="varying" type="color" multi="+" default="color(0)"/>
3+
<output name="val" description="Value passed for AOV" storage="varying" type="color"/>
4+
<rsl_code>
5+
aov_diffuse += $(in);
6+
$(val) = $(in);
7+
</rsl_code>
8+
<usage>Passes the values connected to the input, to the diffuse AOV. The preset AOVs are aov_surfacecolor, aov_ambient, aov_diffuse, aov_indirectdiffuse, aov_specular, aov_specularcolor, aov_reflection, aov_refraction, aov_rimlighting, aov_scattering, aov_translucence, aov_shadows, aov_occlusion, aov_caustics. Note that all shading models blocks already have assigned AOVs to their respective components, as well as some other blocks, see the blocks information for details.</usage>
9+
</shrimp>

blocks/AOVs/aov_indirectdiffuse.xml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<shrimp type="function" name="AOV_IndDiffuse" description="Indirect Diffuse AOV" author="rconstruct">
2+
<input name="in" description="Value for AOV" storage="varying" type="color" multi="+" default="color(0)"/>
3+
<output name="val" description="Value passed for AOV" storage="varying" type="color"/>
4+
<rsl_code>
5+
aov_indirectdiffuse += $(in);
6+
$(val) = $(in);
7+
</rsl_code>
8+
<usage>Passes the values connected to the input, to the indirect diffuse AOV. The preset AOVs are aov_surfacecolor, aov_ambient, aov_diffuse, aov_indirectdiffuse, aov_specular, aov_specularcolor, aov_reflection, aov_refraction, aov_rimlighting, aov_scattering, aov_translucence, aov_shadows, aov_occlusion, aov_caustics. Note that all shading models blocks already have assigned AOVs to their respective components, as well as some other blocks, see the blocks information for details.</usage>
9+
</shrimp>

blocks/AOVs/aov_occlusion.xml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<shrimp type="function" name="AOV_Occlusion" description="Occlusion AOV" author="rconstruct">
2+
<input name="in" description="Value for AOV" storage="varying" type="float" multi="+" default="0"/>
3+
<output name="val" description="Value passed for AOV" storage="varying" type="float"/>
4+
<rsl_code>
5+
aov_occlusion += $(in);
6+
$(val) = $(in);
7+
</rsl_code>
8+
<usage>Passes the values connected to the input, to the occlusion AOV. The preset AOVs are aov_surfacecolor, aov_ambient, aov_diffuse, aov_indirectdiffuse, aov_specular, aov_specularcolor, aov_reflection, aov_refraction, aov_rimlighting, aov_scattering, aov_translucence, aov_shadows, aov_occlusion, aov_caustics. Note that all shading models blocks already have assigned AOVs to their respective components, as well as some other blocks, see the blocks information for details.</usage>
9+
</shrimp>

blocks/AOVs/aov_reflection.xml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<shrimp type="function" name="AOV_Reflection" description="Reflection AOV" author="rconstruct">
2+
<input name="in" description="Value for AOV" storage="varying" type="color" multi="+" default="color(0)"/>
3+
<output name="val" description="Value passed for AOV" storage="varying" type="color"/>
4+
<rsl_code>
5+
aov_reflection += $(in);
6+
$(val) = $(in);
7+
</rsl_code>
8+
<usage>Passes the values connected to the input, to the reflection AOV. The preset AOVs are aov_surfacecolor, aov_ambient, aov_diffuse, aov_indirectdiffuse, aov_specular, aov_specularcolor, aov_reflection, aov_refraction, aov_rimlighting, aov_scattering, aov_translucence, aov_shadows, aov_occlusion, aov_caustics. Note that all shading models blocks already have assigned AOVs to their respective components, as well as some other blocks, see the blocks information for details.</usage>
9+
</shrimp>

blocks/AOVs/aov_refraction.xml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<shrimp type="function" name="AOV_Refraction" description="Refraction AOV" author="rconstruct">
2+
<input name="in" description="Value for AOV" storage="varying" type="color" multi="+" default="color(0)"/>
3+
<output name="val" description="Value passed for AOV" storage="varying" type="color"/>
4+
<rsl_code>
5+
aov_refraction += $(in);
6+
$(val) = $(in);
7+
</rsl_code>
8+
<usage>Passes the values connected to the input, to the refraction AOV. The preset AOVs are aov_surfacecolor, aov_ambient, aov_diffuse, aov_indirectdiffuse, aov_specular, aov_specularcolor, aov_reflection, aov_refraction, aov_rimlighting, aov_scattering, aov_translucence, aov_shadows, aov_occlusion, aov_caustics. Note that all shading models blocks already have assigned AOVs to their respective components, as well as some other blocks, see the blocks information for details.</usage>
9+
</shrimp>

blocks/AOVs/aov_rimlighting.xml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<shrimp type="function" name="AOV_RimLight" description="Rim Lighting AOV" author="rconstruct">
2+
<input name="in" description="Value for AOV" storage="varying" type="color" multi="+" default="color(0)"/>
3+
<output name="val" description="Value passed for AOV" storage="varying" type="color"/>
4+
<rsl_code>
5+
aov_rimlighting += $(in);
6+
$(val) = $(in);
7+
</rsl_code>
8+
<usage>Passes the values connected to the input, to the rim lighting AOV. The preset AOVs are aov_surfacecolor, aov_ambient, aov_diffuse, aov_indirectdiffuse, aov_specular, aov_specularcolor, aov_reflection, aov_refraction, aov_rimlighting, aov_scattering, aov_translucence, aov_shadows, aov_occlusion, aov_caustics. Note that all shading models blocks already have assigned AOVs to their respective components, as well as some other blocks, see the blocks information for details.</usage>
9+
</shrimp>

blocks/AOVs/aov_scattering.xml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<shrimp type="function" name="AOV_Scatter" description="Scattering AOV" author="rconstruct">
2+
<input name="in" description="Value for AOV" storage="varying" type="color" multi="+" default="color(0)"/>
3+
<output name="val" description="Value passed for AOV" storage="varying" type="color"/>
4+
<rsl_code>
5+
aov_scattering += $(in);
6+
$(val) = $(in);
7+
</rsl_code>
8+
<usage>Passes the values connected to the input, to the scattering AOV. The preset AOVs are aov_surfacecolor, aov_ambient, aov_diffuse, aov_indirectdiffuse, aov_specular, aov_specularcolor, aov_reflection, aov_refraction, aov_rimlighting, aov_scattering, aov_translucence, aov_shadows, aov_occlusion, aov_caustics. Note that all shading models blocks already have assigned AOVs to their respective components, as well as some other blocks, see the blocks information for details.</usage>
9+
</shrimp>

blocks/AOVs/aov_shadows.xml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<shrimp type="function" name="AOV_Shadows" description="Shadows AOV" author="rconstruct">
2+
<input name="in" description="Value for AOV" storage="varying" type="color" multi="+" default="color(0)"/>
3+
<output name="val" description="Value passed for AOV" storage="varying" type="color"/>
4+
<rsl_code>
5+
aov_shadows += $(in);
6+
$(val) = $(in);
7+
</rsl_code>
8+
<usage>Passes the values connected to the input, to the shadows AOV. The preset AOVs are aov_surfacecolor, aov_ambient, aov_diffuse, aov_indirectdiffuse, aov_specular, aov_specularcolor, aov_reflection, aov_refraction, aov_rimlighting, aov_scattering, aov_translucence, aov_shadows, aov_occlusion, aov_caustics. Note that all shading models blocks already have assigned AOVs to their respective components, as well as some other blocks, see the blocks information for details.</usage>
9+
</shrimp>

blocks/AOVs/aov_specular.xml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<shrimp type="function" name="AOV_Specular" description="Specular AOV" author="rconstruct">
2+
<input name="in" description="Value for AOV" storage="varying" type="color" multi="+" default="color(0)"/>
3+
<output name="val" description="Value passed for AOV" storage="varying" type="color"/>
4+
<rsl_code>
5+
aov_specular += $(in);
6+
$(val) = $(in);
7+
</rsl_code>
8+
<usage>Passes the values connected to the input, to the specular AOV. The preset AOVs are aov_surfacecolor, aov_ambient, aov_diffuse, aov_indirectdiffuse, aov_specular, aov_specularcolor, aov_reflection, aov_refraction, aov_rimlighting, aov_scattering, aov_translucence, aov_shadows, aov_occlusion, aov_caustics. Note that all shading models blocks already have assigned AOVs to their respective components, as well as some other blocks, see the blocks information for details.</usage>
9+
</shrimp>

blocks/AOVs/aov_specularcolor.xml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<shrimp type="function" name="AOV_SpecColor" description="Specular Color AOV" author="rconstruct">
2+
<input name="in" description="Value for AOV" storage="varying" type="color" multi="+" default="color(0)"/>
3+
<output name="val" description="Value passed for AOV" storage="varying" type="color"/>
4+
<rsl_code>
5+
aov_specularcolor += $(in);
6+
$(val) = $(in);
7+
</rsl_code>
8+
<usage>Passes the values connected to the input, to the specular color AOV. The preset AOVs are aov_surfacecolor, aov_ambient, aov_diffuse, aov_indirectdiffuse, aov_specular, aov_specularcolor, aov_reflection, aov_refraction, aov_rimlighting, aov_scattering, aov_translucence, aov_shadows, aov_occlusion, aov_caustics. Note that all shading models blocks already have assigned AOVs to their respective components, as well as some other blocks, see the blocks information for details.</usage>
9+
</shrimp>

blocks/AOVs/aov_surfacecolor.xml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<shrimp type="function" name="AOV_SurfColor" description="Surface Color AOV" author="rconstruct">
2+
<input name="in" description="Value for AOV" storage="varying" type="color" multi="+" default="color(0)"/>
3+
<output name="val" description="Value passed for AOV" storage="varying" type="color"/>
4+
<rsl_code>
5+
aov_surfacecolor += $(in);
6+
$(val) = $(in);
7+
</rsl_code>
8+
<usage>Passes the values connected to the input, to the surface color AOV. The preset AOVs are aov_surfacecolor, aov_ambient, aov_diffuse, aov_indirectdiffuse, aov_specular, aov_specularcolor, aov_reflection, aov_refraction, aov_rimlighting, aov_scattering, aov_translucence, aov_shadows, aov_occlusion, aov_caustics. Note that all shading models blocks already have assigned AOVs to their respective components, as well as some other blocks, see the blocks information for details.</usage>
9+
</shrimp>

blocks/AOVs/aov_translucence.xml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<shrimp type="function" name="AOV_Translucence" description="Translucence AOV" author="rconstruct">
2+
<input name="in" description="Value for AOV" storage="varying" type="color" multi="+" default="color(0)"/>
3+
<output name="val" description="Value passed for AOV" storage="varying" type="color"/>
4+
<rsl_code>
5+
aov_translucence += $(in);
6+
$(val) = $(in);
7+
</rsl_code>
8+
<usage>Passes the values connected to the input, to the translucence AOV. The preset AOVs are aov_surfacecolor, aov_ambient, aov_diffuse, aov_indirectdiffuse, aov_specular, aov_specularcolor, aov_reflection, aov_refraction, aov_rimlighting, aov_scattering, aov_translucence, aov_shadows, aov_occlusion, aov_caustics. Note that all shading models blocks already have assigned AOVs to their respective components, as well as some other blocks, see the blocks information for details.</usage>
9+
</shrimp>

blocks/Color/bias.xml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<shrimp type="function" name="Bias" description="Adjust bias." author="rconstruct">
2+
<input name="input" description="Input to be adjusted" type_parent="value" type="float color" default="color(1)"/>
3+
<input name="bias" description="Bias value" type="float" default="0.5"/>
4+
<output name="value" description="Adjusted value." type="float color"/>
5+
<rsl_include>rsl_shrimp_helpers.h</rsl_include>
6+
<rsl_code>
7+
$(value) = $(value:type) bias( $(input), $(bias) );
8+
</rsl_code>
9+
<usage>Bias function, operates on float or color types, it&apos;s similar to a brighness adjustement.</usage>
10+
</shrimp>

blocks/Color/ctransform.xml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<shrimp type="function" name="Ctransform" description="Transform to a different color space" author="rconstruct">
2+
<input name="Cin" description="color to transform" type="color" type_parent="value" default="color(0)"/>
3+
<input name="from_space" description="The color space to transform from" storage="uniform" type="string" default="&quot;rgb&quot;"/>
4+
<input name="to_space" description="The color space to transform to" storage="uniform" type="string" default="&quot;hsv&quot;"/>
5+
<output name="Cout" description="The transformed color" type="color"/>
6+
<rsl_code>
7+
$(Cout) = ctransform( $(from_space), $(to_space), $(Cin) );
8+
</rsl_code>
9+
<usage>Transforms the color &quot;Cin&quot; from &quot;fromspace&quot; to &quot;tospace&quot;. If fromspace isn&apos;t passed, it&apos;s assumed to be RGB. Color spaces are &quot;rgb&quot; (red, green, and blue), &quot;hsv&quot; (hue, saturation, value), &quot;hsl&quot; (hue, saturation, lightness), &quot;xyz&quot; or &quot;XYZ&quot; (CIE XYZ coordinates), &quot;xyY&quot; or &quot;xyy&quot; (CIE xy and Y), and &quot;YIQ&quot; or &quot;yiq&quot; (NTSC coordinates).</usage>
10+
</shrimp>

blocks/Color/gain.xml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<shrimp type="function" name="Gain" description="Adjust gain." author="rconstruct">
2+
<input name="input" description="Input to be adjusted" type_parent="value" type="float color" default="color(1)"/>
3+
<input name="gain" description="Gain value" type="float" default="0.5"/>
4+
<output name="value" description="Adjusted value." type="float color"/>
5+
<rsl_include>rsl_shrimp_helpers.h</rsl_include>
6+
<rsl_code>
7+
$(value) = $(value:type) gain( $(input), $(gain) );
8+
</rsl_code>
9+
<usage>The gain function operates on both float and color types, and it&apos;s similar to a contrast adjustment.</usage>
10+
</shrimp>

blocks/Color/gamma.xml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<shrimp type="function" name="Gamma" description="Gamma adjustement function" author="rconstruct">
2+
<input name="input" description="Input to be adjusted" type_parent="value" type="float color" default="color(1)"/>
3+
<input name="gamma" description="Range lower point" type="float" default="1"/>
4+
<output name="value" description="Remapped value." type="float color"/>
5+
<rsl_include>rsl_shrimp_helpers.h</rsl_include>
6+
<rsl_code>
7+
$(value) = $(value:type) gamma( $(input), $(gamma) );
8+
</rsl_code>
9+
<usage>A gamma adjustment function, that operates on float and color types.</usage>
10+
</shrimp>

blocks/Color/getcol.xml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<shrimp type="function" name="GetCol" description="Get the components of a color" author="rconstruct">
2+
<input name="Cin" description="Color to split into components" type="color" default="color(0)"/>
3+
<output name="x" description="1st component" type="float"/>
4+
<output name="y" description="2nd component" type="float"/>
5+
<output name="z" description="3rd component" type="float"/>
6+
<rsl_code>
7+
$(x) = comp( $(Cin), 0 );
8+
$(y) = comp( $(Cin), 1 );
9+
$(z) = comp( $(Cin), 2 );
10+
</rsl_code>
11+
<usage>Gets the components of a color type variable.</usage>
12+
</shrimp>

blocks/Color/luminance.xml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<shrimp type="function" name="Luminance" description="Gets the luminance value of a color" author="rconstruct">
2+
<input name="Cin" description="The input color" type="color" default="color(.6, .2, .1)"/>
3+
<output name="value" description="The luminance value" type="float"/>
4+
<rsl_include>rsl_shrimp_helpers.h</rsl_include>
5+
<rsl_code>
6+
$(value) = luminance( $(Cin) );
7+
</rsl_code>
8+
<usage>This blocks returns the luminance value of a color.</usage>
9+
</shrimp>

0 commit comments

Comments
 (0)