Fib multimedia objects can be directly stored in a readable form in the XML-format (see documentation section XML format).

The following examples should give an idea of ​​the possibilities for reusing objects in Fib. All XML representations can be directly translated into the corresponding shown images by the Fib converter (convertFromFib).

One stick figure

Bild eines Strichmännchens The picture, for the example, is shown on the left. It shows a blue stick figure.

The Fib XML description of the image is given below. For better readability it is presented somewhat excessively.

Storage requirements in various formats:

Explanations for the XML representation

The root element is the environment of the image. It contains two main parts: the specification of the domains (<domains>) and the actual representing Fib object (<main_fib_object>).

The domains indicate the size of the image (<dim count="2"> ... , the image is 255 pixels wide and 511 pixels high), the used properties (<property name="colorRGB">, 24-bit RGB color, 8 bits per channel), the numbers used in the elements (<externObject>) and the used external objects (<externObjectInput identifier="-5000">; external subobject with the identifier -5000 (it comes from the database)).

With the property element <property> the (RGB) color (type="property.colorRGB" ) of the object is set to blue.

The external object element <obj> then calls the external object with the identifier -5000 (identifier="-5000", a stick figure from the Fib database).

The parameters then determine the appearance of the stick figure. When the stick figure for the Fib database was implemented, care was taken to ensure, that the input parameters can be used as intuitively as possible. Thus the starting point of the stick figure is the lower point of the right foot. In this way the stick figure is easy to position relative to the ground. Would the starting point, for example, be in the middle of the body, the position of the legs must always be observed, in order to put the stick figure on the ground.

XML representation of the image

<?xml version="1.0" encoding="UTF-8"?>
<fib_object
         xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://www.biokom.info/"
         xsd:schemaLocation="http://www.biokom.info/fib.xsd">
<root>
   <multimedia_info fib_version="3" db_version="3"/>
   <domains>
      <dim count="2">
         <dimension number="1" direction="horizontal"/>
         <dimension number="2" direction="vertical"/>
         <vector elements="2">
            <naturalNumber max="255" />
            <naturalNumber max="512" />
         </vector>
      </dim>
      <property name="colorRGB" >
         <vector elements="3">
            <naturalNumber max="255" />
            <naturalNumber max="255" />
            <naturalNumber max="255" />
         </vector>
      </property>
      
      <externObject>
         <vector elements="4">
            <integer min="-5000" max="-5000" /><!--Identifier-->
            <integer min="15" max="15" /><!--number input values-->
            <naturalNumber max="0" /><!--number subobjects-->
            <naturalNumber max="0" /><!--number output values-->
         </vector>
      </externObject>
      <!-- subobject for the stickman framework -->
      <externObjectInput identifier="-5000">
         <vector elements="15">
            <naturalNumber max="255" />
            <naturalNumber max="255" />
            <naturalNumber max="255" />
            <naturalNumber scalingfactor="0.00001" max="632000"/>
            <naturalNumber scalingfactor="0.00001" max="632000"/>
            <naturalNumber scalingfactor="0.00001" max="632000"/>
            <naturalNumber scalingfactor="0.00001" max="632000"/>
            <naturalNumber scalingfactor="0.00001" max="632000"/>
            <naturalNumber scalingfactor="0.00001" max="632000"/>
            <naturalNumber scalingfactor="0.00001" max="632000"/>
            <naturalNumber scalingfactor="0.00001" max="632000"/>
            <naturalNumber scalingfactor="0.00001" max="632000"/>
            <naturalNumber scalingfactor="0.00001" max="632000"/>
            <naturalNumber max="255" />
            <naturalNumber max="255" />
         </vector>
      </externObjectInput>
   </domains>
   <main_fib_object>
      <property>
         <vector type="property.colorRGB">
            <value>0</value>
            <value>0</value>
            <value>255</value>
         </vector>
         <obj identifier="-5000">
            <vector type="externObjectInput">
               <value>90</value><!-- stickman start point x -->
               <value>20</value><!-- stickman start point y -->
               <value>480</value><!-- size -->
               <value>0</value><!-- body angle -->
               <value>0.7</value><!-- right upper arm angle -->
               <value>0.5</value><!-- left upper arm angle -->
               <value>0.2</value><!-- right upper leg angle -->
               <value>0.2</value><!-- left upper leg angle -->
               <value>0</value><!-- head angle -->
               <value>0</value><!-- right lower arm angle -->
               <value>0</value><!-- left lower arm angle -->
               <value>0</value><!-- right lower leg angle -->
               <value>0</value><!-- left lower leg angle -->
               <value>0</value><!-- line width -->
               <value>0</value><!-- radius of head -->
            </vector>
         </obj>
      </property>
   </main_fib_object>
</root>
</fib_object>

Two stick figures

Picture of a stick figure

The image for the example is shown above. It shows two stick figures.

Once one has defined an external object, it is also no problem to use it as often as desired.
The object can be customized with its parameters. Using the parameters, the external object can be tailored for its usage. So it is simple, to let the second stick figure run into the picture.

Thanks to the separation of the object and property, the different coloring is easy possible.

The space requirement of the image in Fib increases only slightly by the second stick figure. Whereas in other formats the disk space usage grows rather with the number of points in the image.
Storage requirements in various formats:

External objects can also be other defined objects. In the Fib database there are for example already objects for lines, circles, functions, the coverage of pixels by half-planes or the GNU license.

Everyone can therefore define the objects in Fib, which they need for their application. Objects which do not exist in the Fib database can be easily provided with the Fib multimedia object.
If, for example, a drawing program use stars, they can be implemented once for the application as a separate Fib object. In each drawing, which use the stars, these are simply called as an external object and the star object is included in a sub-root object for the whole multi media object.
Another drawing program which uses Fib, but do not know the star objects, can normally open and edit such multimedia objects like any other Fib objects. It can even change the star parameters, without really knowing the object. Despite such changes, the original drawing program can open the changed multi media object and recognize even his stars as his star objects.
As a result the data exchange between different applications is simplified.

Explanations for the XML representation

The root element is substantially in the same as the first example. The only change is in the domains part for the size of the image (<dim count="2"> ...), the image is now 480 pixels wide 512 pixels high (counting begins at 0, <naturalNumber max="479" /> means natural numbers from 0 to 479, so 480 values​​).

With the list element <list> several sub-objects (the two stick figures) are combined into one object.

With the property elements <property> the (RGB) color of the first object is set to blue and of the second to fuchsia.

The external object elements <obj> then calls the external object with the identifier -5000 (identifier="-5000", a stick figure from the Fib database).

The parameters determine the appearance of the stick figure. They have been adapted for the second stick figure, so that it looks as if it runs into the image.

XML representation of the image

<?xml version="1.0" encoding="UTF-8"?>
<fib_object
         xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://www.biokom.info/"
         xsd:schemaLocation="http://www.biokom.info/fib.xsd">
<root>
   <multimedia_info fib_version="3" db_version="3"/>
   <domains>
      <dim count="2">
         <dimension number="1" direction="horizontal"/>
         <dimension number="2" direction="vertical"/>
         <vector elements="2">
            <naturalNumber max="479" />
            <naturalNumber max="511" />
         </vector>
      </dim>
      <property name="colorRGB" >
         <vector elements="3">
            <naturalNumber max="255" />
            <naturalNumber max="255" />
            <naturalNumber max="255" />
         </vector>
      </property>
      
      <externObject>
         <vector elements="4">
            <integer min="-5000" max="-5000" /><!-- identifier -->
            <integer min="15" max="15" /><!-- number of input values -->
            <naturalNumber max="0" /><!--number of subobjects-->
            <naturalNumber max="0" /><!--number of output values-->
         </vector>
      </externObject>
      <!-- external object for the stick figure -->
      <externObjectInput identifier="-5000">
         <vector elements="15">
            <naturalNumber max="255" />
            <naturalNumber max="255" />
            <naturalNumber max="255" />
            <naturalNumber scalingfactor="0.00001" max="632000"/>
            <naturalNumber scalingfactor="0.00001" max="632000"/>
            <naturalNumber scalingfactor="0.00001" max="632000"/>
            <naturalNumber scalingfactor="0.00001" max="632000"/>
            <naturalNumber scalingfactor="0.00001" max="632000"/>
            <naturalNumber scalingfactor="0.00001" max="632000"/>
            <naturalNumber scalingfactor="0.00001" max="632000"/>
            <naturalNumber scalingfactor="0.00001" max="632000"/>
            <naturalNumber scalingfactor="0.00001" max="632000"/>
            <naturalNumber scalingfactor="0.00001" max="632000"/>
            <naturalNumber max="255" />
            <naturalNumber max="255" />
         </vector>
      </externObjectInput>
   </domains>
   <main_fib_object>
      <list>
         <property>
            <vector type="property.colorRGB">
               <value>0</value> <value>0</value> <value>255</value>
            </vector>
            <obj identifier="-5000">
               <vector type="externObjectInput">
                  <value>90</value>  <value>20</value>  <!-- start point -->
                  <value>480</value> <value>0</value>   <!-- size, angle body -->
                  <value>0.7</value> <value>0.5</value> <!-- angle top arms -->
                  <value>0.2</value> <value>0.2</value> <!-- angle top legs -->
                  <value>0</value>                      <!-- angle head -->
                  <value>0</value> <value>0</value> <!-- angle bottom arms -->
                  <value>0</value> <value>0</value> <!-- angle bottom legs -->
                  <value>0</value> <value>0</value> <!-- line width, radius head -->
               </vector>
            </obj>
         </property>
         <property>
            <vector type="property.colorRGB">
               <value>192</value> <value>0</value> <value>64</value>
            </vector>
            <obj identifier="-5000">
               <vector type="externObjectInput">
                  <value>300</value> <value>20</value>   <!-- start point -->
                  <value>480</value> <value>-0.1</value> <!-- size, angle body -->
                  <value>1.8</value> <value>0.5</value>  <!-- angle top arm  -->
                  <value>0.6</value> <value>0.2</value>  <!-- angle top legs -->
                  <value>0.1</value>                     <!-- angle head -->
                  <value>1</value>   <value>-1.2</value> <!-- angle bottom arms -->
                  <value>0.6</value> <value>-1.0</value> <!-- angle bottom legse -->
                  <value>0</value>   <value>0</value>    <!-- line width, radius head -->
               </vector>
            </obj>
         </property>
      </list>
   </main_fib_object>
</root>
</fib_object>