Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »ahoeben« (15. März 2011, 16:55)
...there is actually some "room" in the 8 bit image to play with the dynamic range.
So, come on and play
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 |
<!--
Just a little plugin that tries to help in setting the values, tweaking
them using sliders, for the plugin "autolevels.swf" from Aldo Hoeben. !!!
Hope it can be useful ;)
This plugin is based on the "slider-blend-cubes" example from Klaus.
-->
<krpano version="1.0.8">
<!-- image -->
<!-- view settings -->
<plugin name="AutoLevels"
url="%SWFPATH%/plugin_autolevels/autolevels.swf"
enabled="true"
effect="0"
adaptation="0"
coloradjust="0"
threshold="0"
attenuation="0"/>
<plugin name="enabled_slider_bg" url="white.jpg" zorder="1" align="bottom" width="200" height="15" x="0" y="200" handcursor="false" alpha="0.5" />
<plugin name="enabled_slider_grip" url="white.jpg" zorder="2" align="lefttop" parent="enabled_slider_bg" width="100" height="15" x="0" y="0" blendmode="add"
ondown="startdragingslider(enabled,get(name),get(parent));set(onover,'');"
onup="stopdragingslider();set(onover,'showtext(enabled,FOVTEXT);');"
onover="showtext(enabled,FOVTEXT);"
effect="glow(0xFFFFFF,0.7,4,2);glow(0x000000,1,4,2);dropshadow(3,45,0x000000,2,0.6);"
/>
<plugin name="effect_slider_bg" url="white.jpg" zorder="1" align="bottom" width="200" height="15" x="0" y="175" handcursor="false" alpha="0.5" />
<plugin name="effect_slider_grip" url="white.jpg" zorder="2" align="lefttop" parent="effect_slider_bg" width="30" height="15" x="0" y="0" blendmode="add"
ondown="startdragingslider(effect,get(name),get(parent));set(onover,'');"
onup="stopdragingslider();set(onover,'showtext(effect,FOVTEXT);');"
onover="showtext(effect,FOVTEXT);"
effect="glow(0xFFFFFF,0.7,4,2);glow(0x000000,1,4,2);dropshadow(3,45,0x000000,2,0.6);"
/>
<plugin name="adaptation_slider_bg" url="white.jpg" zorder="1" align="bottom" width="200" height="15" x="0" y="150" handcursor="false" alpha="0.5" />
<plugin name="adaptation_slider_grip" url="white.jpg" zorder="2" align="lefttop" parent="adaptation_slider_bg" width="30" height="15" x="0" y="0" blendmode="add"
ondown="startdragingslider(adaptation,get(name),get(parent));set(onover,'');"
onup="stopdragingslider();set(onover,'showtext(adaptation,FOVTEXT);');"
onover="showtext(adaptation,FOVTEXT);"
effect="glow(0xFFFFFF,0.7,4,2);glow(0x000000,1,4,2);dropshadow(3,45,0x000000,2,0.6);"
/>
<plugin name="coloradjust_slider_bg" url="white.jpg" zorder="1" align="bottom" width="200" height="15" x="0" y="125" handcursor="false" alpha="0.5" />
<plugin name="coloradjust_slider_grip" url="white.jpg" zorder="2" align="lefttop" parent="coloradjust_slider_bg" width="30" height="15" x="0" y="0" blendmode="add"
ondown="startdragingslider(coloradjust,get(name),get(parent));set(onover,'');"
onup="stopdragingslider();set(onover,'showtext(coloradjust,FOVTEXT);');"
onover="showtext(coloradjust,FOVTEXT);"
effect="glow(0xFFFFFF,0.7,4,2);glow(0x000000,1,4,2);dropshadow(3,45,0x000000,2,0.6);"
/>
<plugin name="threshold_slider_bg" url="white.jpg" zorder="1" align="bottom" width="200" height="15" x="0" y="100" handcursor="false" alpha="0.5" />
<plugin name="threshold_slider_grip" url="white.jpg" zorder="2" align="lefttop" parent="threshold_slider_bg" width="30" height="15" x="0" y="0" blendmode="add"
ondown="startdragingslider(threshold,get(name),get(parent));set(onover,'');"
onup="stopdragingslider();set(onover,'showtext(threshold,FOVTEXT);');"
onover="showtext(threshold,FOVTEXT);"
effect="glow(0xFFFFFF,0.7,4,2);glow(0x000000,1,4,2);dropshadow(3,45,0x000000,2,0.6);"
/>
<plugin name="attenuation_slider_bg" url="white.jpg" zorder="1" align="bottom" width="200" height="15" x="0" y="75" handcursor="false" alpha="0.5" />
<plugin name="attenuation_slider_grip" url="white.jpg" zorder="2" align="lefttop" parent="attenuation_slider_bg" width="30" height="15" x="0" y="0" blendmode="add"
ondown="startdragingslider(attenuation,get(name),get(parent));set(onover,'');"
onup="stopdragingslider();set(onover,'showtext(attenuation,FOVTEXT);');"
onover="showtext(attenuation,FOVTEXT);"
effect="glow(0xFFFFFF,0.7,4,2);glow(0x000000,1,4,2);dropshadow(3,45,0x000000,2,0.6);"
/>
<plugin name="htmltext" url="%SWFPATH%/plugins/textfield.swf"
visible="false"
align="bottom"
width="300" height=""
x="0" y="300"
html="data:code"
borderwidth="10"
bordercolor="0xFFFFFF"
backgroundcolor="0xFFFFFF"
autosize="center"
effect="glow(0xFFFFFF,0.7,4,2);glow(0x000000,1,4,2);dropshadow(3,45,0x000000,2,0.6);"
/>
<data name="code">
</data>
<style name="buttonstyle"
url="%SWFPATH%/plugins/textfield.swf" keep="true" children="false"
css="p{color:#000000; font-family:Arial; font-weight:bold; font-size:14; margin-left:5; margin-right:5; text-align:center; }"
backgroundcolor="0xFFFFFF" roundedge="5" shadow="1" borderwidth="0" glow="4" glowcolor="0xFFFFFF" visible="false"
onover="tween(alpha,0.7,distance(0.3,0.2));"
onout="tween(alpha,1.0,distance(0.3,0.2));"
onloaded="set(alpha,0);set(textblur,15);set(blur,15); set(visible,true); tween(alpha,1,0.3); tween(textblur,0,0.3); tween(blur,0,0.3);"
width="150" height="22"
/>
<plugin name="b1" style="buttonstyle"
html="[p]display the code[/p]"
align="bottom" x="0" y="25"
onclickA="set(plugin[htmltext].visible,true); set(html,[p]hide the code[/p]); set(onclick,onclickB());"
onclickB="set(plugin[htmltext].visible,false); set(html,[p]display the code[/p]); set(onclick,showcode(); onclickA(););"
onclick="showcode(); onclickA();"
/>
<textstyle name="FOVTEXT" origin="bottom" edge="bottom" yoffset="230" textalign="center" background="false" border="false" fontsize="25" textcolor="0xFFFFFF" bold="false" effect="glow(0xFFFFFF,0.7,4,2);glow(0x000000,1,4,2);dropshadow(3,45,0x000000,2,0.6);" showtime="2.0" fadetime="1.0" />
<action name="startdragingslider">
set(plugin[%2].backup_align, get(plugin[%2].align));
set(plugin[%2].backup_edge, get(plugin[%2].edge));
plugin[%2].changeorigin(lefttop,lefttop);
sub(mouse_x_offset, plugin[%2].x, mouse.x);
sub(mouse_y_offset, plugin[%2].y, mouse.y);
set(image_dragging,true);
dragslider(%1,%2,%3);
</action>
<action name="stopdragingslider">
set(image_dragging, false);
</action>
<action name="dragslider">
if(image_dragging,
add(xpos, mouse.x, mouse_x_offset);
sub(xmax, plugin[%3].width, plugin[%2].width);
if(xpos LT 0, set(xpos,0));
if(xpos GT xmax, copy(xpos,xmax));
copy(plugin[%2].x, xpos);
<!-- val = 0.0 ... 1.0 -->
div(val, xpos, xmax);
autolevels_settings(%1);
delayedcall(0.01, dragslider(%1,%2,%3) );
,
plugin[%2].changeorigin(get(plugin[%2].backup_align), get(plugin[%2].backup_edge));
);
</action>
<action name="autolevels_settings">
if( %1 == enabled , if( val LT 0.5 , set(val,true); , set(val,false); ); );
if( %1 == effect , roundval(val,2); );
if( %1 == adaptation , if( val LT 0.01 , set(val,0.01); ); roundval(val,2); );
if( %1 == coloradjust , roundval(val,2); );
if( %1 == threshold , mul(val,255); roundval(val); );
if( %1 == attenuation , roundval(val,2); );
set(plugin[AutoLevels].%1, get(val)); trace(plugin[AutoLevels].%1);
showvaltext(%1);
showcode();
</action>
<action name="showvaltext">
txtadd(msg,%1,' = ',get(val));
showtext(get(msg),FOVTEXT);
</action>
<action name="showcode">
txtadd(msg,'<plugin name="AutoLevels" <br/>',
'url="',get(plugin[AutoLevels].url),'" <br/>',
'enabled="',get(plugin[AutoLevels].enabled),'" <br/>',
'effect="',get(plugin[AutoLevels].effect),'" <br/>',
'adaptation="',get(plugin[AutoLevels].adaptation),'" <br/>',
'coloradjust="',get(plugin[AutoLevels].coloradjust),'" <br/>',
'threshold="',get(plugin[AutoLevels].threshold),'" <br/>',
'attenuation="',get(plugin[AutoLevels].attenuation),'" />',
);
set(data[code].content,get(msg));
set(plugin[htmltext].html,data:code);
</action>
</krpano>
|
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »ahoeben« (26. August 2010, 10:26)
|
|
Quellcode |
1 2 |
this.meterbitmap.draw(this.panosprite,this.scalematrix);
this.meterbitmap.draw(this.krpano.get("hotspot.layer"),this.scalematrix);
|
Yes, that's betterI have shrunk down the ui, added some code so the sliders take their initial values from the xml, and added it to my sample. Thanks!
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 |
<action name="loadslider"> set(temp,plugin[autolevels].%1); if(plugin[autolevels].%1 == '', set(plugin[autolevels].%1,0); ); if(temp == 'plugin[autolevels].%1', set(plugin[autolevels].%1,0); ); set(val, get(plugin[autolevels].%1)); if( %1 == enabled , if( val EQ true , set(val,1); , set(val,0); ); ); if( %1 == threshold , div(val,255) ); sub(xmax, plugin[%3].width, plugin[%2].width); mul(val, xmax); tween(plugin[%2].x, get(val)); </action> |
...
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »michel« (26. August 2010, 21:03)
Benutzerinformationen überspringen
Wohnort: Netherlands
Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer
: https://pame.virtualtuur.comOk, so I have modified the code on the loadslider() action to makes the sliders reflecting the amplification...The reason I put the pow(val,3) in is because even though the range for "adaptation" is from 0 to 1, only small values give interesting results (ie: 0.001 - 0.2). With the amplification in place, it is easier to tune the adaptation to a low value.
|
|
Quellcode |
1 |
if( %1 == adaptation , pow(val,0.33333333333333333333333333333333) ); |
... Unless if the preload is set to true for plugin Autolevels.swf, some times they apply, some no
...
...