Home | History | Annotate | Download | only in blending
      1 package com.jme3.scene.plugins.blender.textures.blending;
      2 
      3 import com.jme3.scene.plugins.blender.BlenderContext;
      4 import com.jme3.texture.Texture;
      5 
      6 /**
      7  * An interface for texture blending classes (the classes that mix the texture
      8  * pixels with the material colors).
      9  *
     10  * @author Marcin Roguski (Kaelthas)
     11  */
     12 public interface TextureBlender {
     13 	// types of blending
     14 	int	MTEX_BLEND			= 0;
     15 	int	MTEX_MUL			= 1;
     16 	int	MTEX_ADD			= 2;
     17 	int	MTEX_SUB			= 3;
     18 	int	MTEX_DIV			= 4;
     19 	int	MTEX_DARK			= 5;
     20 	int	MTEX_DIFF			= 6;
     21 	int	MTEX_LIGHT			= 7;
     22 	int	MTEX_SCREEN			= 8;
     23 	int	MTEX_OVERLAY		= 9;
     24 	int	MTEX_BLEND_HUE		= 10;
     25 	int	MTEX_BLEND_SAT		= 11;
     26 	int	MTEX_BLEND_VAL		= 12;
     27 	int	MTEX_BLEND_COLOR	= 13;
     28 	int	MTEX_NUM_BLENDTYPES	= 14;
     29 
     30 	/**
     31 	 * This method blends the given texture with material color and the defined
     32 	 * color in 'map to' panel. As a result of this method a new texture is
     33 	 * created. The input texture is NOT.
     34 	 *
     35 	 * @param materialColor
     36 	 *            the material diffuse color
     37 	 * @param texture
     38 	 *            the texture we use in blending
     39 	 * @param color
     40 	 *            the color defined for the texture
     41 	 * @param affectFactor
     42 	 *            the factor that the color affects the texture (value form 0.0
     43 	 *            to 1.0)
     44 	 * @param blendType
     45 	 *            the blending type
     46 	 * @param blenderContext
     47 	 *            the blender context
     48 	 * @return new texture that was created after the blending
     49 	 */
     50 	Texture blend(float[] materialColor, Texture texture, float[] color, float affectFactor, int blendType, boolean neg, BlenderContext blenderContext);
     51 }
     52