See the source code examples for documentation.