Skip to content

Commit

Permalink
Updating documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
lukacu committed Sep 1, 2016
1 parent cb3b8f4 commit 9b20daa
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
50 changes: 50 additions & 0 deletions docs/documentation_cpp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,56 @@ The wrapper is composed of several classes, mostly following the underlying C fu
Returns a file buffer and its length. This function returns a pointer to the internal data which should not be modified.


.. cpp:class:: Properties

.. cpp:function:: Properties()

Create a property object.

.. cpp:function:: Properties(const Properties& original)

A copy constructor.

.. cpp:function:: ~Properties()

Destroy a properties object and clean up the memory.

.. cpp:function:: void clear()

Clear a properties object.

.. cpp:function:: void set(const std::string key, const std::string value)

Set a string property (the value string is cloned).

.. cpp:function:: void set(const std::string key, int value)

Set an integer property. The value will be encoded as a string.

.. cpp:function:: void set(const std::string key, float value)

Set an floating point value property. The value will be encoded as a string.

.. cpp:function:: std::string get(const std::string key)

Get a string property.

.. cpp:function:: int get(const std::string key, int def)

Get an integer property. A stored string value is converted to an integer. If this is not possible or the property does not exist a given default value is returned.

.. cpp:function:: float get(const std::string key, float def)

Get an floating point value property. A stored string value is converted to an float. If this is not possible or the property does not exist a given default value is returned.

.. cpp:function:: bool get(const std::string key, bool def)

Get an boolean point value property. A stored string value is converted to an integer and checked if it is zero. If this is not possible or the property does not exist a given default value is returned.

.. cpp:function:: void enumerate(Enumerator enumerator, void* object)

Iterate over the property set using a callback function. An optional pointer can be given and is forwarded to the callback.

Integration tutorial
--------------------

Expand Down
2 changes: 2 additions & 0 deletions docs/protocol.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ Protocol messages and states
Below we list the valid messages of the protocol as well as the states of the client and server. Despite the apparent simplicity of the protocol its execution should be strict. An inappropriate or indecipherable message should result in immediate termination of connection in case of both parties.

- ``hello`` (server): The message is sent by the server to introduce itself and list its capabilities. This message specifies no mandatory arguments, however, the server can report the capabilities using the optional named arguments. The official arguments, recognized by the first version of the protocol are:

* ``trax.version`` (integer): Specifies the supported version of the protocol. If not present, version 1 is assumed.
* ``trax.name`` (string): Specifies the name of the tracker. The name can be used by the client to verify that the correct algorithm is executed.
* ``trax.identifier`` (string): Specifies the identifier of the current implementation. The identifier can be used to determine the version of the tracker.
* ``trax.image`` (string): Specifies the supported image format. See Section `Region formats`_ for the list of supported formats. By default it is assumed that the tracker can accept file paths as image source.
* ``trax.region`` (string): Specifies the supported region format. See Section `Image formats`_ for the list of supported formats. By default it is assumed that the tracker can accept rectangles as region specification.

- ``initialize`` (client): This message is sent by the client to initialize the tracker. The message contains the image data and the region of the object. The actual format of the required arguments is determined by the image and region formats specified by the server.
- ``frame`` (client): This message is sent by the client to request processing of a new image. The message contains the image data. The actual format of the required argument is determined by the image format specified by the server.
- ``state`` (server): This message is used by the server to send the new region to the client. The message contains region data in arbitrary supported format (most commonly the same format that the server proposed in the introduction message).
Expand Down

0 comments on commit 9b20daa

Please sign in to comment.