Advertisement
snicker02

updated dc_carpet variation

Feb 19th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.86 KB | None | 0 0
  1. FLAME FILE:
  2.  
  3. <flame name="updated dc_carpet BS" smooth_gradient="0" version="JWildfire V3.30 (21.12.2017)" size="1080 1080" center="-0.4619622801440984 0.44712862894681094" scale="526.66380000576" rotate="35.770290315744866" filter="0.75" filter_type="ADAPTIVE" filter_kernel="MITCHELL_SINEPOW" filter_indicator="0" filter_sharpness="4.0" filter_low_density="0.025" oversample="2" post_noise_filter="0" post_noise_filter_threshold="0.35" quality="100.0" background_type="GRADIENT_2X2_C" background_ul="0.0 0.0 0.0" background_ur="0.0 0.0 0.0" background_ll="0.0 0.0 0.0" background_lr="0.0 0.0 0.0" background_cc="0.0 0.0 0.0" bg_transparency="0" brightness="4.0" saturation="1.0" gamma="4.0" gamma_threshold="0.01" vibrancy="1.0" contrast="1.0" white_level="220.0" temporal_samples="1.0" cam_zoom="1.0" cam_pitch="-2.5691246589356527" cam_yaw="0.06283185307179587" cam_persp="0.0" cam_xfocus="0.0" cam_yfocus="0.0" cam_zfocus="0.0" cam_pos_x="0.0" cam_pos_y="0.0" cam_pos_z="0.0" cam_zpos="0.0" cam_dof="0.0" cam_dof_area="0.5" cam_dof_exponent="2.0" low_density_brightness="0.24" balancing_red="1.0" balancing_green="1.0" balancing_blue="1.0" cam_dof_shape="BUBBLE" cam_dof_scale="1.0" cam_dof_rotate="0.0" cam_dof_fade="1.0" preserve_z="1" antialias_amount="0.0" antialias_radius="0.0" post_symmetry_type="NONE" post_symmetry_order="3" post_symmetry_centre_x="0.0" post_symmetry_centre_y="0.0" post_symmetry_distance="1.25" post_symmetry_rotation="6.0" frame="1" frame_count="300" fps="30" post_blur_radius="0" post_blur_fade="0.95" post_blur_falloff="2.0" zbuffer_scale="1.0" sld_render_enabled="1" sld_render_ao_enabled="1" sld_render_ao_intensity="0.6" sld_render_ao_search_radius="4.0" sld_render_ao_blur_radius="1.5" sld_render_ao_radius_samples="6" sld_render_ao_azimuth_samples="7" sld_render_ao_falloff="0.5" sld_render_ao_affect_diffuse="0.1" sld_render_shadow_type="FAST" sld_render_shadow_smooth_radius="1.0" sld_render_shadowmap_size="2048" sld_render_shadowmap_bias="0.01" post_bokeh_filter_kernel="SINEPOW15" post_bokeh_intensity="0.005" post_bokeh_brightness="1.0" post_bokeh_size="2.0" post_bokeh_activation="0.2" sld_render_material_count="2" sld_render_material_diffuse0="0.14" sld_render_material_ambient0="1.52" sld_render_material_phong0="0.0634" sld_render_material_phong_size0="12.0" sld_render_material_phong_red0="1.0" sld_render_material_phong_green0="1.0" sld_render_material_phong_blue0="1.0" sld_render_material_refl_map_intensity0="0.5" sld_render_material_refl_map_filename0="" sld_render_material_refl_mappping0="BLINN_NEWELL" sld_render_material_light_diif_func0="COSA_SQUARE" sld_render_material_diffuse1="0.1" sld_render_material_ambient1="1.0" sld_render_material_phong1="0.6" sld_render_material_phong_size1="15.0" sld_render_material_phong_red1="1.0" sld_render_material_phong_green1="1.0" sld_render_material_phong_blue1="1.0" sld_render_material_refl_map_intensity1="0.5" sld_render_material_refl_map_filename1="" sld_render_material_refl_mappping1="BLINN_NEWELL" sld_render_material_light_diif_func1="COSA" sld_render_ligtht_count="2" sld_render_light_altitude0="-55.238" sld_render_light_azimuth0="264.762" sld_render_light_intensity0="1.0" sld_render_light_red0="1.0" sld_render_light_green0="1.0" sld_render_light_blue0="1.0" sld_render_light_shadows0="1" sld_render_light_shadow_intensity0="1.0" sld_render_light_altitude1="55.0" sld_render_light_azimuth1="-15.0" sld_render_light_intensity1="0.5" sld_render_light_red1="1.0" sld_render_light_green1="1.0" sld_render_light_blue1="1.0" sld_render_light_shadows1="0" sld_render_light_shadow_intensity1="0.7" mixer_mode="OFF">
  4. <xform weight="0.5" color="0.0" symmetry="0.0" mirror_pre_post_translations="0" material="0.0" material_speed="0.0" mod_gamma="0.0" mod_gamma_speed="0.0" mod_contrast="0.0" mod_contrast_speed="0.0" mod_saturation="0.0" mod_saturation_speed="0.0" mod_hue="0.0" mod_hue_speed="0.0" custom_wf_full="0.5" custom_wf_full_fx_priority="0" custom_wf_full_origin="2.0" custom_wf_full_color_a="-0.7036000000000002" custom_wf_full_color_b="2.46" custom_wf_full_color_c="1.0" custom_wf_full_color_d="1.0" custom_wf_full_color_e="2.528" custom_wf_full_color_f="1.0" custom_wf_full_stretch_x="1.0" custom_wf_full_stretch_y="1.0" custom_wf_full_scale_x="1.0" custom_wf_full_scale_y="1.0" custom_wf_full_scale_z="1.584" custom_wf_full_offset_z="0.0" custom_wf_full_reset_z="0.0" custom_wf_full_code_full_variation="2F2A0A20204A57696C6466697265202D20616E20696D61676520616E6420616E696D6174696F6E2070726F636573736F72207772697474656E20696E204A617661200A2020436F707972696768742028432920313939352D3230313120416E6472656173204D617363686B650A0A202054686973206973206672656520736F6674776172653B20796F752063616E2072656469737472696275746520697420616E642F6F72206D6F6469667920697420756E64657220746865207465726D73206F662074686520474E55204C6573736572200A202047656E6572616C205075626C6963204C6963656E7365206173207075626C697368656420627920746865204672656520536F66747761726520466F756E646174696F6E3B206569746865722076657273696F6E20322E31206F6620746865200A20204C6963656E73652C206F722028617420796F7572206F7074696F6E2920616E79206C617465722076657273696F6E2E0A200A20205468697320736F66747761726520697320646973747269627574656420696E2074686520686F706520746861742069742077696C6C2062652075736566756C2C2062757420574954484F555420414E592057415252414E54593B20776974686F7574200A20206576656E2074686520696D706C6965642077617272616E7479206F66204D45524348414E544142494C495459206F72204649544E45535320464F52204120504152544943554C415220505552504F53452E205365652074686520474E55200A20204C65737365722047656E6572616C205075626C6963204C6963656E736520666F72206D6F72652064657461696C732E0A0A2020596F752073686F756C642068617665207265636569766564206120636F7079206F662074686520474E55204C65737365722047656E6572616C205075626C6963204C6963656E736520616C6F6E672077697468207468697320736F6674776172653B200A20206966206E6F742C20777269746520746F20746865204672656520536F66747761726520466F756E646174696F6E2C20496E632E2C203531204672616E6B6C696E2053742C20466966746820466C6F6F722C20426F73746F6E2C204D410A202030323131302D31333031205553412C206F7220736565207468652046534620736974653A20687474703A2F2F7777772E6673662E6F72672E0A2A2F0A7061636B616765206F72672E6A77696C64666972652E6372656174652E74696E612E766172696174696F6E3B0A0A696D706F727420737461746963206F72672E6A77696C64666972652E626173652E6D6174686C69622E4D6174684C69622E666162733B0A696D706F727420737461746963206F72672E6A77696C64666972652E626173652E6D6174686C69622E4D6174684C69622E666D6F643B0A0A696D706F7274206F72672E6A77696C64666972652E6372656174652E74696E612E626173652E4C617965723B0A696D706F7274206F72672E6A77696C64666972652E6372656174652E74696E612E626173652E58466F726D3B0A696D706F7274206F72672E6A77696C64666972652E6372656174652E74696E612E626173652E58595A506F696E743B0A0A7075626C696320636C61737320444343617270657446756E6320657874656E647320566172696174696F6E46756E63207B0A0970726976617465207374617469632066696E616C206C6F6E672073657269616C56657273696F6E554944203D20314C3B0A0A0970726976617465207374617469632066696E616C20537472696E6720504152414D5F4F524947494E203D20226F726967696E223B0A0970726976617465207374617469632066696E616C20537472696E6720504152414D5F434F4C4F525F41203D2022636F6C6F725F61223B0A0970726976617465207374617469632066696E616C20537472696E6720504152414D5F434F4C4F525F42203D2022636F6C6F725F62223B0A0970726976617465207374617469632066696E616C20537472696E6720504152414D5F434F4C4F525F43203D2022636F6C6F725F63223B0A0970726976617465207374617469632066696E616C20537472696E6720504152414D5F434F4C4F525F44203D2022636F6C6F725F64223B0A0970726976617465207374617469632066696E616C20537472696E6720504152414D5F434F4C4F525F45203D2022636F6C6F725F65223B0A0970726976617465207374617469632066696E616C20537472696E6720504152414D5F434F4C4F525F46203D2022636F6C6F725F66223B0A0970726976617465207374617469632066696E616C20537472696E6720504152414D5F535452455443485F58203D2022737472657463685F78223B0A0970726976617465207374617469632066696E616C20537472696E6720504152414D5F535452455443485F59203D2022737472657463685F79223B0A0970726976617465207374617469632066696E616C20537472696E6720504152414D5F5343414C455F58203D20227363616C655F78223B0A0970726976617465207374617469632066696E616C20537472696E6720504152414D5F5343414C455F59203D20227363616C655F79223B0A0970726976617465207374617469632066696E616C20537472696E6720504152414D5F5343414C455A203D20227363616C655F7A223B0A0970726976617465207374617469632066696E616C20537472696E6720504152414D5F4F46465345545A203D20226F66667365745F7A223B0A0970726976617465207374617469632066696E616C20537472696E6720504152414D5F52455345545A203D202272657365745F7A223B0A0A0970726976617465207374617469632066696E616C20537472696E675B5D20706172616D4E616D6573203D207B20504152414D5F4F524947494E2C20504152414D5F434F4C4F525F412C20504152414D5F434F4C4F525F422C20504152414D5F434F4C4F525F432C0A090909504152414D5F434F4C4F525F442C20504152414D5F434F4C4F525F452C20504152414D5F434F4C4F525F462C20504152414D5F535452455443485F582C20504152414D5F535452455443485F592C20504152414D5F5343414C455F582C20504152414D5F5343414C455F592C0A090909504152414D5F5343414C455A2C20504152414D5F4F46465345545A2C20504152414D5F52455345545A207D3B0A097072697661746520646F75626C65206F726967696E203D20302E353B0A097072697661746520646F75626C6520636F6C6F725F61203D20302E353B0A097072697661746520646F75626C6520636F6C6F725F62203D20312E303B0A097072697661746520646F75626C6520636F6C6F725F63203D20312E303B0A097072697661746520646F75626C6520636F6C6F725F64203D20312E303B0A097072697661746520646F75626C6520636F6C6F725F65203D20302E353B0A097072697661746520646F75626C6520636F6C6F725F66203D20312E303B0A097072697661746520646F75626C6520737472657463685F78203D20312E303B0A097072697661746520646F75626C6520737472657463685F79203D20312E303B0A097072697661746520646F75626C65207363616C655F78203D20312E303B0A097072697661746520646F75626C65207363616C655F79203D20312E303B0A097072697661746520646F75626C65207363616C655F7A203D20302E303B0A097072697661746520646F75626C65206F66667365745F7A203D20302E303B0A097072697661746520646F75626C652072657365745F7A203D20302E303B0A0A09404F766572726964650A097075626C696320766F6964207472616E73666F726D28466C616D655472616E73666F726D6174696F6E436F6E746578742070436F6E746578742C2058466F726D207058466F726D2C2058595A506F696E742070416666696E6554502C2058595A506F696E74207056617254502C0A090909646F75626C652070416D6F756E7429207B0A09092F2A0A0909202A2064635F63617270657420627920587972757330322C20687474703A2F2F61706F7068797369732D37782E6F72672F657874656E73696F6E73206164646564207661726961626C65732062790A0909202A20427261642053746566616E6F760A0909202A2F0A0909696E74207830203D202870436F6E746578742E72616E646F6D2829203C20302E3529203F202D31203A20313B0A0909696E74207930203D202870436F6E746578742E72616E646F6D2829203E20302E3529203F202D31203A20313B0A0A0909646F75626C652078203D2070416666696E6554502E78202B207830202A20737472657463685F782C2079203D2070416666696E6554502E79202B207930202A20737472657463685F793B0A0909646F75626C652078305F786F725F7930203D2028646F75626C652920287830205E207930293B0A0909646F75626C65206868203D202D48202B2028636F6C6F725F62202D2078305F786F725F793029202A20483B0A0A09097056617254502E78202B3D2070416D6F756E74202A20287058466F726D2E6765745859436F65666630302829202A2078202B207058466F726D2E6765745859436F65666631302829202A2079202B207058466F726D2E6765745859436F6566663230282929202A207363616C655F783B0A09097056617254502E79202B3D2070416D6F756E74202A20287058466F726D2E6765745859436F65666630312829202A2078202B207058466F726D2E6765745859436F65666631312829202A2079202B207058466F726D2E6765745859436F6566663231282929202A207363616C655F793B0A09097056617254502E636F6C6F72203D20666D6F642866616273287056617254502E636F6C6F72202A20636F6C6F725F61202A2028636F6C6F725F63202B20686829202B2078305F786F725F7930202A2028636F6C6F725F64202D20686829202A20636F6C6F725F65292C0A09090909636F6C6F725F66293B0A0A09096966202870436F6E746578742E697350726573657276655A436F6F7264696E617465282929207B0A0909097056617254502E7A202B3D2070416D6F756E74202A2070416666696E6554502E7A3B0A09097D0A0909646F75626C6520647A203D207056617254502E636F6C6F72202A207363616C655F7A202B206F66667365745F7A3B0A09096966202872657365745F7A203E203029207B0A0909097056617254502E7A203D20647A3B0A09097D20656C7365207B0A0909097056617254502E7A202B3D20647A3B0A09097D0A097D0A0A09404F766572726964650A097075626C696320537472696E675B5D20676574506172616D657465724E616D65732829207B0A090972657475726E20706172616D4E616D65733B0A097D0A0A09404F766572726964650A097075626C6963204F626A6563745B5D20676574506172616D6574657256616C7565732829207B0A090972657475726E206E6577204F626A6563745B5D207B206F726967696E2C20636F6C6F725F612C20636F6C6F725F622C20636F6C6F725F632C20636F6C6F725F642C20636F6C6F725F652C20636F6C6F725F662C20737472657463685F782C20737472657463685F792C0A090909097363616C655F782C207363616C655F792C207363616C655F7A2C206F66667365745F7A2C2072657365745F7A207D3B0A097D0A0A09404F766572726964650A097075626C696320766F696420736574506172616D6574657228537472696E6720704E616D652C20646F75626C65207056616C756529207B0A090969662028504152414D5F4F524947494E2E657175616C7349676E6F72654361736528704E616D652929207B0A0909096F726967696E203D207056616C75653B0A09097D20656C73652069662028504152414D5F434F4C4F525F412E657175616C7349676E6F72654361736528704E616D652929207B0A090909636F6C6F725F61203D207056616C75653B0A09097D20656C73652069662028504152414D5F434F4C4F525F422E657175616C7349676E6F72654361736528704E616D652929207B0A090909636F6C6F725F62203D207056616C75653B0A09097D20656C73652069662028504152414D5F434F4C4F525F432E657175616C7349676E6F72654361736528704E616D652929207B0A090909636F6C6F725F63203D207056616C75653B0A09097D20656C73652069662028504152414D5F434F4C4F525F442E657175616C7349676E6F72654361736528704E616D652929207B0A090909636F6C6F725F64203D207056616C75653B0A09097D20656C73652069662028504152414D5F434F4C4F525F452E657175616C7349676E6F72654361736528704E616D652929207B0A090909636F6C6F725F65203D207056616C75653B0A09097D20656C73652069662028504152414D5F434F4C4F525F462E657175616C7349676E6F72654361736528704E616D652929207B0A090909636F6C6F725F66203D207056616C75653B0A09097D20656C73652069662028504152414D5F535452455443485F582E657175616C7349676E6F72654361736528704E616D652929207B0A090909737472657463685F78203D207056616C75653B0A09097D20656C73652069662028504152414D5F535452455443485F592E657175616C7349676E6F72654361736528704E616D652929207B0A090909737472657463685F79203D207056616C75653B0A09097D20656C73652069662028504152414D5F5343414C455F582E657175616C7349676E6F72654361736528704E616D652929207B0A0909097363616C655F78203D207056616C75653B0A09097D20656C73652069662028504152414D5F5343414C455F592E657175616C7349676E6F72654361736528704E616D652929207B0A0909097363616C655F79203D207056616C75653B0A09097D20656C73652069662028504152414D5F5343414C455A2E657175616C7349676E6F72654361736528704E616D6529290A0909097363616C655F7A203D207056616C75653B0A0909656C73652069662028504152414D5F4F46465345545A2E657175616C7349676E6F72654361736528704E616D6529290A0909096F66667365745F7A203D207056616C75653B0A0909656C73652069662028504152414D5F52455345545A2E657175616C7349676E6F72654361736528704E616D6529290A09090972657365745F7A203D207056616C75653B0A0909656C7365207B0A09090953797374656D2E6F75742E7072696E746C6E2822704E616D65206E6F74207265636F676E697A65643A2022202B20704E616D65293B0A0909097468726F77206E657720496C6C6567616C417267756D656E74457863657074696F6E28704E616D65293B0A09097D0A097D0A0A09404F766572726964650A097075626C696320537472696E67206765744E616D652829207B0A090972657475726E202264635F636172706574223B0A097D0A0A097072697661746520646F75626C6520483B0A0A09404F766572726964650A097075626C696320766F696420696E697428466C616D655472616E73666F726D6174696F6E436F6E746578742070436F6E746578742C204C6179657220704C617965722C2058466F726D207058466F726D2C20646F75626C652070416D6F756E7429207B0A090948203D20302E31202A206F726967696E3B0A0A097D0A0A7D" coefs="1.0 0.0 0.0 1.0 0.0 0.0" chaos="1.0"/>
  5. <finalxform weight="0.0" color="0.0" symmetry="0.0" mirror_pre_post_translations="0" material="0.0" material_speed="0.0" mod_gamma="-1.0" mod_gamma_speed="-1.0" mod_contrast="1.0" mod_contrast_speed="0.0" mod_saturation="0.0" mod_saturation_speed="0.0" mod_hue="0.0" mod_hue_speed="0.0" linear3D="1.0" linear3D_fx_priority="0" coefs="1.0 0.0 0.0 1.0 0.0 0.0" chaos="1.0"/>
  6. <palette count="256" format="RGB">
  7. F9B9FDE5A7FCD196FCBD84FBA873FAB27DDFC692BBDBA697EFBB72E2B155AF853F7B5929
  8. 482C132209012F0A023D0A024B0B03580B035F26396542736B5FAD717BE7888CEEA997DC
  9. C9A2C9E9ADB7FCABA1FB9486FA7C6BFA6550F9553BFA7253FB906BFBAE83FCCB9BFCD1A0
  10. FCD3A3FCD5A6FCD7A9FCC99DFBB187FA9971F9B9FDE5A7FCD196FCBD84FBA873FAB27DDF
  11. C692BBDBA697EFBB72E2B155AF853F7B5929482C132209012F0A023D0A024B0B03580B03
  12. 5F26396542736B5FAD717BE7888CEEA997DCC9A2C9E9ADB7FCABA1FB9486FA7C6BFA6550
  13. F9553BFA7253FB906BFBAE83FCCB9BFCD1A0FCD3A3FCD5A6FCD7A9FCC99DFBB187FA9971
  14. F9B9FDE5A7FCD196FCBD84FBA873FAB27DDFC692BBDBA697EFBB72E2B155AF853F7B5929
  15. 482C132209012F0A023D0A024B0B03580B035F26396542736B5FAD717BE7888CEEA997DC
  16. C9A2C9E9ADB7FCABA1FB9486FA7C6BFA6550F9553BFA7253FB906BFBAE83FCCB9BFCD1A0
  17. FCD3A3FCD5A6FCD7A9FCC99DFBB187FA9971F9B9FDE5A7FCD196FCBD84FBA873FAB27DDF
  18. C692BBDBA697EFBB72E2B155AF853F7B5929482C132209012F0A023D0A024B0B03580B03
  19. 5F26396542736B5FAD717BE7888CEEA997DCC9A2C9E9ADB7FCABA1FB9486FA7C6BFA6550
  20. F9553BFA7253FB906BFBAE83FCCB9BFCD1A0FCD3A3FCD5A6FCD7A9FCC99DFBB187FA9971
  21. F9B9FDE5A7FCD196FCBD84FBA873FAB27DDFC692BBDBA697EFBB72E2B155AF853F7B5929
  22. 482C132209012F0A023D0A024B0B03580B035F26396542736B5FAD717BE7888CEEA997DC
  23. C9A2C9E9ADB7FCABA1FB9486FA7C6BFA6550F9553BFA7253FB906BFBAE83FCCB9BFCD1A0
  24. FCD3A3FCD5A6FCD7A9FCC99DFBB187FA9971F9B9FDE5A7FCD196FCBD84FBA873FAB27DDF
  25. C692BBDBA697EFBB72E2B155AF853F7B5929482C132209012F0A023D0A024B0B03580B03
  26. 5F26396542736B5FAD717BE7888CEEA997DCC9A2C9E9ADB7FCABA1FB9486FA7C6BFA6550
  27. F9553BFA7253FB906BFBAE83FCCB9BFCD1A0FCD3A3FCD5A6FCD7A9FCC99DFBB187FA9971
  28. F9805CF97C58F97854F97451 </palette>
  29. </flame>
  30.  
  31. JAVA CUSTOM code:
  32.  
  33. /*
  34. JWildfire - an image and animation processor written in Java
  35. Copyright (C) 1995-2011 Andreas Maschke
  36.  
  37. This is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser
  38. General Public License as published by the Free Software Foundation; either version 2.1 of the
  39. License, or (at your option) any later version.
  40.  
  41. This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
  42. even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  43. Lesser General Public License for more details.
  44.  
  45. You should have received a copy of the GNU Lesser General Public License along with this software;
  46. if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  47. 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  48. */
  49. package org.jwildfire.create.tina.variation;
  50.  
  51. import static org.jwildfire.base.mathlib.MathLib.fabs;
  52. import static org.jwildfire.base.mathlib.MathLib.fmod;
  53.  
  54. import org.jwildfire.create.tina.base.Layer;
  55. import org.jwildfire.create.tina.base.XForm;
  56. import org.jwildfire.create.tina.base.XYZPoint;
  57.  
  58. public class DCCarpetFunc extends VariationFunc {
  59. private static final long serialVersionUID = 1L;
  60.  
  61. private static final String PARAM_ORIGIN = "origin";
  62. private static final String PARAM_COLOR_A = "color_a";
  63. private static final String PARAM_COLOR_B = "color_b";
  64. private static final String PARAM_COLOR_C = "color_c";
  65. private static final String PARAM_COLOR_D = "color_d";
  66. private static final String PARAM_COLOR_E = "color_e";
  67. private static final String PARAM_COLOR_F = "color_f";
  68. private static final String PARAM_STRETCH_X = "stretch_x";
  69. private static final String PARAM_STRETCH_Y = "stretch_y";
  70. private static final String PARAM_SCALE_X = "scale_x";
  71. private static final String PARAM_SCALE_Y = "scale_y";
  72. private static final String PARAM_SCALEZ = "scale_z";
  73. private static final String PARAM_OFFSETZ = "offset_z";
  74. private static final String PARAM_RESETZ = "reset_z";
  75.  
  76. private static final String[] paramNames = { PARAM_ORIGIN, PARAM_COLOR_A, PARAM_COLOR_B, PARAM_COLOR_C,
  77. PARAM_COLOR_D, PARAM_COLOR_E, PARAM_COLOR_F, PARAM_STRETCH_X, PARAM_STRETCH_Y, PARAM_SCALE_X, PARAM_SCALE_Y,
  78. PARAM_SCALEZ, PARAM_OFFSETZ, PARAM_RESETZ };
  79. private double origin = 0.5;
  80. private double color_a = 0.5;
  81. private double color_b = 1.0;
  82. private double color_c = 1.0;
  83. private double color_d = 1.0;
  84. private double color_e = 0.5;
  85. private double color_f = 1.0;
  86. private double stretch_x = 1.0;
  87. private double stretch_y = 1.0;
  88. private double scale_x = 1.0;
  89. private double scale_y = 1.0;
  90. private double scale_z = 0.0;
  91. private double offset_z = 0.0;
  92. private double reset_z = 0.0;
  93.  
  94. @Override
  95. public void transform(FlameTransformationContext pContext, XForm pXForm, XYZPoint pAffineTP, XYZPoint pVarTP,
  96. double pAmount) {
  97. /*
  98. * dc_carpet by Xyrus02, http://apophysis-7x.org/extensions added variables by
  99. * Brad Stefanov
  100. */
  101. int x0 = (pContext.random() < 0.5) ? -1 : 1;
  102. int y0 = (pContext.random() > 0.5) ? -1 : 1;
  103.  
  104. double x = pAffineTP.x + x0 * stretch_x, y = pAffineTP.y + y0 * stretch_y;
  105. double x0_xor_y0 = (double) (x0 ^ y0);
  106. double hh = -H + (color_b - x0_xor_y0) * H;
  107.  
  108. pVarTP.x += pAmount * (pXForm.getXYCoeff00() * x + pXForm.getXYCoeff10() * y + pXForm.getXYCoeff20()) * scale_x;
  109. pVarTP.y += pAmount * (pXForm.getXYCoeff01() * x + pXForm.getXYCoeff11() * y + pXForm.getXYCoeff21()) * scale_y;
  110. pVarTP.color = fmod(fabs(pVarTP.color * color_a * (color_c + hh) + x0_xor_y0 * (color_d - hh) * color_e),
  111. color_f);
  112.  
  113. if (pContext.isPreserveZCoordinate()) {
  114. pVarTP.z += pAmount * pAffineTP.z;
  115. }
  116. double dz = pVarTP.color * scale_z + offset_z;
  117. if (reset_z > 0) {
  118. pVarTP.z = dz;
  119. } else {
  120. pVarTP.z += dz;
  121. }
  122. }
  123.  
  124. @Override
  125. public String[] getParameterNames() {
  126. return paramNames;
  127. }
  128.  
  129. @Override
  130. public Object[] getParameterValues() {
  131. return new Object[] { origin, color_a, color_b, color_c, color_d, color_e, color_f, stretch_x, stretch_y,
  132. scale_x, scale_y, scale_z, offset_z, reset_z };
  133. }
  134.  
  135. @Override
  136. public void setParameter(String pName, double pValue) {
  137. if (PARAM_ORIGIN.equalsIgnoreCase(pName)) {
  138. origin = pValue;
  139. } else if (PARAM_COLOR_A.equalsIgnoreCase(pName)) {
  140. color_a = pValue;
  141. } else if (PARAM_COLOR_B.equalsIgnoreCase(pName)) {
  142. color_b = pValue;
  143. } else if (PARAM_COLOR_C.equalsIgnoreCase(pName)) {
  144. color_c = pValue;
  145. } else if (PARAM_COLOR_D.equalsIgnoreCase(pName)) {
  146. color_d = pValue;
  147. } else if (PARAM_COLOR_E.equalsIgnoreCase(pName)) {
  148. color_e = pValue;
  149. } else if (PARAM_COLOR_F.equalsIgnoreCase(pName)) {
  150. color_f = pValue;
  151. } else if (PARAM_STRETCH_X.equalsIgnoreCase(pName)) {
  152. stretch_x = pValue;
  153. } else if (PARAM_STRETCH_Y.equalsIgnoreCase(pName)) {
  154. stretch_y = pValue;
  155. } else if (PARAM_SCALE_X.equalsIgnoreCase(pName)) {
  156. scale_x = pValue;
  157. } else if (PARAM_SCALE_Y.equalsIgnoreCase(pName)) {
  158. scale_y = pValue;
  159. } else if (PARAM_SCALEZ.equalsIgnoreCase(pName))
  160. scale_z = pValue;
  161. else if (PARAM_OFFSETZ.equalsIgnoreCase(pName))
  162. offset_z = pValue;
  163. else if (PARAM_RESETZ.equalsIgnoreCase(pName))
  164. reset_z = pValue;
  165. else {
  166. System.out.println("pName not recognized: " + pName);
  167. throw new IllegalArgumentException(pName);
  168. }
  169. }
  170.  
  171. @Override
  172. public String getName() {
  173. return "dc_carpet";
  174. }
  175.  
  176. private double H;
  177.  
  178. @Override
  179. public void init(FlameTransformationContext pContext, Layer pLayer, XForm pXForm, double pAmount) {
  180. H = 0.1 * origin;
  181.  
  182. }
  183.  
  184. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement