<?xml version="1.0" encoding="UTF-8"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://camitk.imag.fr/vrColormap"
            xmlns="http://camitk.imag.fr/vrColormap"
            elementFormDefault="qualified">
    
    <xsd:element name="vrColorMap" type="VrColorMap"/>
    
    <xsd:complexType name="VrColorMap">
        <xsd:sequence>
            <xsd:element name="transparencies" type="Transparencies"/>
            <xsd:element name="colors" type="Colors"/>
            <xsd:element name="gradientOpacities" type="GradientOpacities"/>
            <xsd:element name="shading" type="Shading"/>
        </xsd:sequence>
    </xsd:complexType>
    
    <xsd:complexType name="Transparencies">
        <xsd:sequence>
            <xsd:element name="transparency" type="Transparency" minOccurs="2" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>
    
    <xsd:complexType name="GradientOpacities">
        <xsd:sequence>
            <xsd:element name="gradientOpacity" type="Transparency" minOccurs="2" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>
    
    <xsd:complexType name="Transparency">
        <xsd:attribute name="gray"  type="UnsignedChar"/>
        <xsd:attribute name="value" type="Real"/>
    </xsd:complexType>
    
    <xsd:complexType name="Colors">
        <xsd:sequence>
            <xsd:element name="color" type="Color" minOccurs="2" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="Color">
        <xsd:attribute name="gray"  type="UnsignedChar"/>
        <xsd:attribute name="red"   type="UnsignedChar"/>
        <xsd:attribute name="green" type="UnsignedChar"/>
        <xsd:attribute name="blue"  type="UnsignedChar"/>
        <xsd:attribute name="alpha" type="UnsignedChar"/>
    </xsd:complexType>
    
    <xsd:complexType name="Shading">
        <xsd:sequence>
            <xsd:element name="ambiant" type="Shade"/>
            <xsd:element name="diffuse" type="Shade"/>
            <xsd:element name="specular" type="Shade"/>
        </xsd:sequence>
    </xsd:complexType>
    
    <xsd:complexType name="Shade">
        <xsd:attribute name="value" type="Real"/>
    </xsd:complexType>

    <xsd:simpleType name="UnsignedChar">
        <xsd:restriction base="xsd:int">
            <xsd:minInclusive value="0"/>
            <xsd:maxInclusive value="255"/>
        </xsd:restriction>
    </xsd:simpleType>
    
    <xsd:simpleType name="Real">
        <xsd:restriction base="xsd:double">
            <xsd:minInclusive value="0.0"/>
            <xsd:maxInclusive value="1.0"/>
        </xsd:restriction>
    </xsd:simpleType>
    
</xsd:schema>

