public CFGrid() { _Colour1 = new Colour(); _Colour2 = new Colour(); _Scale = 1; _Ratio = 0.9f; _IsCheckerboard = true; }
public void Set(Colour colour, double max, IGUIUpdateable guiUpdateTarget) { _GUIUpdateTarget = guiUpdateTarget; _Colour = colour; _Maximum = max; RenderSliders(); UpdateSwatch(); }
public static void ReadColour(XmlReader reader, ref Colour colour) { string attr = reader.GetAttribute("colour"); if (attr != null) { string[] rgb = attr.Split(','); colour._Red = float.Parse(rgb[0]); colour._Green = float.Parse(rgb[1]); colour._Blue = float.Parse(rgb[2]); } }
public Material() { _SpecularPower = 5; _Opacity = 1.0f; _RefractiveIndex = 1.0f; _Density = 1.0f; _TintDensity = 0.1f; _Shininess = 1.0f; _DiffuseColour = new Colour(1.0f, 0.5f, 0.0f); _SpecularColour = new Colour(0.4f, 0.4f, 0.4f); _EmissiveColour = new Colour(0.0f, 0.0f, 0.0f); _Reflectivity = new Colour(0.3f, 0.3f, 0.3f); _AbsorptionColour = new Colour(0.0f, 0.0f, 0.0f); _MaterialFunction = ""; }
public XElement CreateElement(string name, bool preview) { XElement mat; if (preview) { Colour black = new Colour(0, 0, 0); mat = new XElement(name, new XAttribute("specularPower", 10), new XAttribute("opacity", 1), new XAttribute("density", 1), new XAttribute("tintdensity", 0.1), new XAttribute("shininess", 1), new XAttribute("refractiveIndex", 1), _DiffuseColour.CreateElement("DIFFUSECOLOUR"), black.CreateElement("SPECULARCOLOUR"), _EmissiveColour.CreateElement("EMISSIVECOLOUR"), black.CreateElement("REFLECTIVITYCOLOUR"), _AbsorptionColour.CreateElement("ABSORPTIONCOLOUR")); } else { mat = new XElement(name, new XAttribute("specularPower", _SpecularPower), new XAttribute("opacity", _Opacity), new XAttribute("density", _Density), new XAttribute("tintdensity", _TintDensity), new XAttribute("shininess", _Shininess), new XAttribute("refractiveIndex", _RefractiveIndex), _DiffuseColour.CreateElement("DIFFUSECOLOUR"), _SpecularColour.CreateElement("SPECULARCOLOUR"), _EmissiveColour.CreateElement("EMISSIVECOLOUR"), _Reflectivity.CreateElement("REFLECTIVITYCOLOUR"), _AbsorptionColour.CreateElement("ABSORPTIONCOLOUR")); } if (_MaterialFunction.Length > 0) mat.Add(new XAttribute("materialFunction", _MaterialFunction)); return mat; }
public Colour(Colour rhs) { _Red = rhs._Red; _Green = rhs._Green; _Blue = rhs._Blue; }
public WorldLight() { _Colour = new Colour(); _Samples = 1; }
public WorldLight(Colour colour, int samples) { _Colour = colour; _Samples = samples; }
public PointLight(Colour colour, Vector3 position) { _Colour = colour; _Position = position; }
public SphereLight(Colour colour, Vector3 position, float radius, int samples) { _Colour = colour; _Position = position; _Radius = radius; _Samples = samples; }
public DirectionalLight(Colour colour, Vector3 direction, float area, int samples) { _Colour = colour; _Direction = direction; _Area = area; _Samples = samples; }
public AmbientLight(Colour colour) { _Colour = colour; }
public PointLight() { _Colour = new Colour(); _Position = new Vector3(); }
public Colour Clone() { Colour ret = new Colour(_Red, _Green, _Blue); return(ret); }
public static Colour max(Colour col1, Colour col2) { return(new Colour(col1._Red > col2._Red ? col1._Red : col2._Red, col1._Green > col2._Green ? col1._Green : col2._Green, col1._Blue > col2._Blue ? col1._Blue : col2._Blue)); }
public Vector3(Colour rhs) { x = rhs._Red; y = rhs._Green; z = rhs._Blue; }
private void GetMinMax(float[] renderBuffer, int renderWidth, int renderHeight) { _MinColour = new Colour(1000000.0f, 1000000.0f, 1000000.0f); _MaxColour = new Colour(0.0f, 0.0f, 0.0f); for (int y = 0; y < renderHeight; y++) { for (int x = 0; x < renderWidth; x++) { int idx = (x + y * renderWidth) * 3; float red = renderBuffer[idx], green = renderBuffer[idx + 1], blue = renderBuffer[idx + 2]; if (red < _MinColour._Red) _MinColour._Red = red; if (green < _MinColour._Green) _MinColour._Green = green; if (blue < _MinColour._Blue) _MinColour._Blue = blue; if (red > _MaxColour._Red) _MaxColour._Red = red; if (green > _MaxColour._Green) _MaxColour._Green = green; if (blue > _MaxColour._Blue) _MaxColour._Blue = blue; } } _MaxValue = Math.Max(_MaxColour._Red, Math.Max(_MaxColour._Green, _MaxColour._Blue)); }
public Colour Clone() { Colour ret = new Colour(_Red, _Green, _Blue); return ret; }
public AmbientLight() { _Colour = new Colour(); }
public DirectionalLight() { _Colour = new Colour(); _Direction = new Vector3(); _Area = 0.0f; _Samples = 1; }
public void SetColour(Colour colour, bool guiUpdate) { _Colour = colour; _HSLColour = new HSLColour(colour); RenderSwatches(); }
public SphereLight() { _Colour = new Colour(); _Position = new Vector3(); _Radius = 1; _Samples = 1; }
public CFConstant() { _Colour = new Colour(); }
public static Colour max(Colour col1, Colour col2) { return new Colour(col1._Red > col2._Red ? col1._Red : col2._Red, col1._Green > col2._Green ? col1._Green : col2._Green, col1._Blue > col2._Blue ? col1._Blue : col2._Blue); }
public CFConstant(double red, double green, double blue) { _Colour = new Colour(red, green, blue); }
public Background() { _Simple = true; _BackgroundColour = new Colour(0, 0, 0); }