jwildfire.org

The official JWildfire forum
It is currently Sun Dec 16, 2018 9:52 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 1 post ] 
Author Message
PostPosted: Sat Apr 14, 2018 3:38 pm 
Offline
User avatar

Joined: Sun May 31, 2015 2:39 pm
Posts: 547
A small update to the post_point_symmetry_wf variation that adds colorshift variable. So it makes it possible to have colors on a single variation.
Thanks to Rick Sidwell for your help with this.
Example:
regular post_point_symmetry_wf with linear:
Image

updated post_point_symmetry_wf with linear:

Image

Params:
Code:
<flame smooth_gradient="0" version="JWildfire V3.31 (30.03.2018)" size="1080 1080" center="0.9545610815330371 1.0594191131712325" scale="101.32992" rotate="42.72091544818817" 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="10.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="33.32" saturation="1.0" gamma="4.056" gamma_threshold="0.01" vibrancy="1.0" contrast="1.0" white_level="161.2" temporal_samples="1.0" cam_zoom="1.0" cam_pitch="0.0" cam_yaw="0.0" 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" resolution_profile="1080x1080" antialias_amount="0.25" antialias_radius="0.5" 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" mixer_mode="OFF">
  <xform weight="0.5" color="0.6075282863241238" symmetry="0.5538054749598702" 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" linear="0.7068" linear_fx_priority="0" custom_wf_full="1.0" custom_wf_full_fx_priority="0" custom_wf_full_centre_x="1.0" custom_wf_full_centre_y="1.0" custom_wf_full_order="2" custom_wf_full_colorshift="0.469" custom_wf_full_code_full_variation="2F2A0A20204A57696C6466697265202D20616E20696D61676520616E6420616E696D6174696F6E2070726F636573736F72207772697474656E20696E204A617661200A2020436F707972696768742028432920313939352D3230313520416E6472656173204D617363686B650A0A202054686973206973206672656520736F6674776172653B20796F752063616E2072656469737472696275746520697420616E642F6F72206D6F6469667920697420756E64657220746865207465726D73206F662074686520474E55204C6573736572200A202047656E6572616C205075626C6963204C6963656E7365206173207075626C697368656420627920746865204672656520536F66747761726520466F756E646174696F6E3B206569746865722076657273696F6E20322E31206F6620746865200A20204C6963656E73652C206F722028617420796F7572206F7074696F6E2920616E79206C617465722076657273696F6E2E0A200A20205468697320736F66747761726520697320646973747269627574656420696E2074686520686F706520746861742069742077696C6C2062652075736566756C2C2062757420574954484F555420414E592057415252414E54593B20776974686F7574200A20206576656E2074686520696D706C6965642077617272616E7479206F66204D45524348414E544142494C495459206F72204649544E45535320464F52204120504152544943554C415220505552504F53452E205365652074686520474E55200A20204C65737365722047656E6572616C205075626C6963204C6963656E736520666F72206D6F72652064657461696C732E0A0A2020596F752073686F756C642068617665207265636569766564206120636F7079206F662074686520474E55204C65737365722047656E6572616C205075626C6963204C6963656E736520616C6F6E672077697468207468697320736F6674776172653B200A20206966206E6F742C20777269746520746F20746865204672656520536F66747761726520466F756E646174696F6E2C20496E632E2C203531204672616E6B6C696E2053742C20466966746820466C6F6F722C20426F73746F6E2C204D410A202030323131302D31333031205553412C206F7220736565207468652046534620736974653A20687474703A2F2F7777772E6673662E6F72672E0A2A2F0A7061636B616765206F72672E6A77696C64666972652E6372656174652E74696E612E766172696174696F6E3B0A0A696D706F727420737461746963206F72672E6A77696C64666972652E626173652E6D6174686C69622E4D6174684C69622E4D5F3250493B0A696D706F727420737461746963206F72672E6A77696C64666972652E626173652E6D6174686C69622E4D6174684C69622E636F733B0A696D706F727420737461746963206F72672E6A77696C64666972652E626173652E6D6174686C69622E4D6174684C69622E73696E3B0A696D706F727420737461746963206F72672E6A77696C64666972652E626173652E6D6174686C69622E4D6174684C69622E666D6F643B0A0A696D706F7274206F72672E6A77696C64666972652E626173652E546F6F6C733B0A696D706F7274206F72672E6A77696C64666972652E6372656174652E74696E612E626173652E4C617965723B0A696D706F7274206F72672E6A77696C64666972652E6372656174652E74696E612E626173652E58466F726D3B0A696D706F7274206F72672E6A77696C64666972652E6372656174652E74696E612E626173652E58595A506F696E743B0A0A7075626C696320636C61737320506F7374506F696E7453796D6D65747279574646756E6320657874656E647320566172696174696F6E46756E63207B0A0970726976617465207374617469632066696E616C206C6F6E672073657269616C56657273696F6E554944203D20314C3B0A0A0970726976617465207374617469632066696E616C20537472696E6720504152414D5F43454E5452455F58203D202263656E7472655F78223B0A0970726976617465207374617469632066696E616C20537472696E6720504152414D5F43454E5452455F59203D202263656E7472655F79223B0A0970726976617465207374617469632066696E616C20537472696E6720504152414D5F4F52444552203D20226F72646572223B0A0970726976617465207374617469632066696E616C20537472696E6720504152414D5F434F4C4F525348494654203D2022636F6C6F727368696674223B0A0970726976617465207374617469632066696E616C20537472696E675B5D20706172616D4E616D6573203D207B20504152414D5F43454E5452455F582C20504152414D5F43454E5452455F592C20504152414D5F4F524445522C20504152414D5F434F4C4F525348494654207D3B0A0A097072697661746520646F75626C652063656E7472655F78203D20302E32353B0A097072697661746520646F75626C652063656E7472655F79203D20302E353B0A097072697661746520696E74206F72646572203D20333B0A097072697661746520646F75626C6520636F6C6F727368696674203D20303B0A0A09404F766572726964650A097075626C696320766F6964207472616E73666F726D28466C616D655472616E73666F726D6174696F6E436F6E746578742070436F6E746578742C2058466F726D207058466F726D2C2058595A506F696E742070416666696E6554502C2058595A506F696E74207056617254502C0A090909646F75626C652070416D6F756E7429207B0A0909646F75626C65206478203D20287056617254502E78202D2063656E7472655F7829202A2070416D6F756E743B0A0909646F75626C65206479203D20287056617254502E79202D2063656E7472655F7929202A2070416D6F756E743B0A0909696E7420696478203D2070436F6E746578742E72616E646F6D286F72646572293B0A09097056617254502E78203D2063656E7472655F78202B206478202A205F636F73615B6964785D202B206479202A205F73696E615B6964785D3B0A09097056617254502E79203D2063656E7472655F79202B206479202A205F636F73615B6964785D202D206478202A205F73696E615B6964785D3B0A09097056617254502E636F6C6F72203D20666D6F64287056617254502E636F6C6F72202B20696478202A20636F6C6F7273686966742C20312E30293B0A097D0A0A09404F766572726964650A097075626C696320537472696E675B5D20676574506172616D657465724E616D65732829207B0A090972657475726E20706172616D4E616D65733B0A097D0A0A09404F766572726964650A097075626C6963204F626A6563745B5D20676574506172616D6574657256616C7565732829207B0A090972657475726E206E6577204F626A6563745B5D207B2063656E7472655F782C2063656E7472655F792C206F726465722C20636F6C6F727368696674207D3B0A097D0A0A09404F766572726964650A097075626C696320766F696420736574506172616D6574657228537472696E6720704E616D652C20646F75626C65207056616C756529207B0A090969662028504152414D5F43454E5452455F582E657175616C7349676E6F72654361736528704E616D6529290A09090963656E7472655F78203D207056616C75653B0A0909656C73652069662028504152414D5F43454E5452455F592E657175616C7349676E6F72654361736528704E616D6529290A09090963656E7472655F79203D207056616C75653B0A0909656C73652069662028504152414D5F4F524445522E657175616C7349676E6F72654361736528704E616D6529290A0909096F72646572203D206C696D6974496E7456616C28546F6F6C732E46544F49287056616C7565292C20312C20496E74656765722E4D41585F56414C5545293B0A0909656C73652069662028504152414D5F434F4C4F5253484946542E657175616C7349676E6F72654361736528704E616D6529290A090909636F6C6F727368696674203D207056616C75653B0A0909656C73650A0909097468726F77206E657720496C6C6567616C417267756D656E74457863657074696F6E28704E616D65293B0A097D0A0A09404F766572726964650A097075626C696320537472696E67206765744E616D652829207B0A090972657475726E2022706F73745F706F696E745F73796D6D657472795F7766223B0A097D0A0A09404F766572726964650A097075626C696320696E74206765745072696F726974792829207B0A090972657475726E20313B0A097D0A0A097072697661746520646F75626C65205F73696E615B5D2C205F636F73615B5D3B0A0A09404F766572726964650A097075626C696320766F696420696E697428466C616D655472616E73666F726D6174696F6E436F6E746578742070436F6E746578742C204C6179657220704C617965722C2058466F726D207058466F726D2C20646F75626C652070416D6F756E7429207B0A09095F73696E61203D206E657720646F75626C655B6F726465725D3B0A09095F636F7361203D206E657720646F75626C655B6F726465725D3B0A0909646F75626C65206461203D204D5F325049202F2028646F75626C6529206F726465723B0A0909646F75626C6520616E676C65203D20302E303B0A0909666F722028696E742069203D20303B2069203C206F726465723B20692B2B29207B0A0909095F73696E615B695D203D2073696E28616E676C65293B0A0909095F636F73615B695D203D20636F7328616E676C65293B0A090909616E676C65202B3D2064613B0A09097D0A097D0A0A7D0A" coefs="-0.7071067811865474 0.7071067811865477 -0.7071067811865477 -0.7071067811865474 0.0 0.0" chaos="1.0"/>
  <palette count="256" format="RGB">
1628361B2E39232D371C252F181F2F1D1D2F231F2E2E302436352C52444358574F6C6A5D
6C6F5B75705A716B5F76736C70766C727B6D8489758C867AA4997BAD9E84C4AD8DBBAB92
AEA48987897C7C7C6A636B5C5458593E41502C384D2C364732303B2E303A2C2837282935
1F1B291E151D0D152203092306122318162B121F2F12262F162A35273C3F39494942584E
606D66697775717C76676E68545D583C4B57283F45223845243846303B4F3B43565C575B
726B66958673BFA574DFA777FFA97FD4A878A692719480677367596F594364514573233C
972C3B86312C5F35324F3E2E4C3F2F585A57687061757B6D9B9481B59E93CAB38AC8B18E
BDAC909DAC8D9AAA969B998C92968992898289907A858F76858978848775768173737E6F
757B6F7C877D9C8E83B9A27EDEB78EF5C08CF6B985FF9969D56353CA3E4BC2353CB72F39
835B4589695397726C94776D95806B978365A0906C9C926FA09371C49D72E89A6FFF845E
E56753E75A51FB7B64F6A06FFCB984FDBE88F5D69FF8D7A8FFE4ADFFDCAEF9D8ABF8D3A9
F6D0A4F0C5A3F9BD98FFB38CFFB381FBAC74FDB985FAC092E8CF99E6CE9BEECEA8F0D0A8
F6E0AEFEEBB3FFECB9E8D9B8E5D4ADDAB990D4B695C0B69BBCB28FD6BA92DFBE91E3C399
E4CFB4DFCEAED9CBA6DEC19DCEBB9BBAB7A1B2AEA2A3998FA3928E9F978C96998B909787
939B808D8D719382648E7D628D6B6184705B726B586962515F514451545F444F5B30414B
31404A3949494F5453676D637D7C789D9A8BC6B297D0BCA2D7C3AAD7C6A7D9C2A3CEBA9C
A0A28D898A8581817D65666A53525344374042323A37373740423F404744474D4B4D504A
4547563D494C303B41242C321D1719210706330D0940132A411A2E32352C333434343339
26373E28393F37423C414B3B53645457695A6D7868747F647B7B7377756976726072685E
676657505A59394A4A2E41472E464A354A4C516156556258686B625E6E6F566D73525E60
46565C3B4E523B4B5044534E515245685F42706555716557645C59595B583642402C363B
1D2F3111203306162D112234  </palette>
</flame>
Custom Code:
Code:
/*
  JWildfire - an image and animation processor written in Java 
  Copyright (C) 1995-2015 Andreas Maschke

  This is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 
  General Public License as published by the Free Software Foundation; either version 2.1 of the 
  License, or (at your option) any later version.
 
  This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without 
  even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 
  Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public License along with this software; 
  if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jwildfire.create.tina.variation;

import static org.jwildfire.base.mathlib.MathLib.M_2PI;
import static org.jwildfire.base.mathlib.MathLib.cos;
import static org.jwildfire.base.mathlib.MathLib.sin;
import static org.jwildfire.base.mathlib.MathLib.fmod;

import org.jwildfire.base.Tools;
import org.jwildfire.create.tina.base.Layer;
import org.jwildfire.create.tina.base.XForm;
import org.jwildfire.create.tina.base.XYZPoint;

public class PostPointSymmetryWFFunc extends VariationFunc {
	private static final long serialVersionUID = 1L;

	private static final String PARAM_CENTRE_X = "centre_x";
	private static final String PARAM_CENTRE_Y = "centre_y";
	private static final String PARAM_ORDER = "order";
	private static final String PARAM_COLORSHIFT = "colorshift";
	private static final String[] paramNames = { PARAM_CENTRE_X, PARAM_CENTRE_Y, PARAM_ORDER, PARAM_COLORSHIFT };

	private double centre_x = 0.25;
	private double centre_y = 0.5;
	private int order = 3;
	private double colorshift = 0;

	@Override
	public void transform(FlameTransformationContext pContext, XForm pXForm, XYZPoint pAffineTP, XYZPoint pVarTP,
			double pAmount) {
		double dx = (pVarTP.x - centre_x) * pAmount;
		double dy = (pVarTP.y - centre_y) * pAmount;
		int idx = pContext.random(order);
		pVarTP.x = centre_x + dx * _cosa[idx] + dy * _sina[idx];
		pVarTP.y = centre_y + dy * _cosa[idx] - dx * _sina[idx];
		pVarTP.color = fmod(pVarTP.color + idx * colorshift, 1.0);
	}

	@Override
	public String[] getParameterNames() {
		return paramNames;
	}

	@Override
	public Object[] getParameterValues() {
		return new Object[] { centre_x, centre_y, order, colorshift };
	}

	@Override
	public void setParameter(String pName, double pValue) {
		if (PARAM_CENTRE_X.equalsIgnoreCase(pName))
			centre_x = pValue;
		else if (PARAM_CENTRE_Y.equalsIgnoreCase(pName))
			centre_y = pValue;
		else if (PARAM_ORDER.equalsIgnoreCase(pName))
			order = limitIntVal(Tools.FTOI(pValue), 1, Integer.MAX_VALUE);
		else if (PARAM_COLORSHIFT.equalsIgnoreCase(pName))
			colorshift = pValue;
		else
			throw new IllegalArgumentException(pName);
	}

	@Override
	public String getName() {
		return "post_point_symmetry_wf";
	}

	@Override
	public int getPriority() {
		return 1;
	}

	private double _sina[], _cosa[];

	@Override
	public void init(FlameTransformationContext pContext, Layer pLayer, XForm pXForm, double pAmount) {
		_sina = new double[order];
		_cosa = new double[order];
		double da = M_2PI / (double) order;
		double angle = 0.0;
		for (int i = 0; i < order; i++) {
			_sina[i] = sin(angle);
			_cosa[i] = cos(angle);
			angle += da;
		}
	}

}


You do not have the required permissions to view the files attached to this post.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 1 post ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited
Theme Created by HOLLYSMOKE
Theme updated to phpBB 3.1.6 by KamijouTouma
Theme Version is 3.1.6-ss2