nv2_label_server.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  nv2_image_patch_result { NV2_IMAGE_PATCH_VALID = 10001, NV2_IMAGE_PATCH_NONE, NV2_IMAGE_PATCH_END }
 

Result type of nv2_label_server_get_current_patch().

More...
enum  nv2_label_send_result { NV2_LABEL_SEND_OK = 12345, NV2_LABEL_SEND_FAIL }
 

Result type of nv2_label_server_send_label().

More...

Functions

NV2_EXTERN_C struct
nv2_label_server
nv2_label_server_create (const int patch_reader_port, const char *remote_label_reader_addr, const int remote_label_reader_port)
 Create a label server (which will also be a patch reader).
NV2_EXTERN_C void nv2_label_server_destroy (struct nv2_label_server *p)
 Destroy a label server and release all resources associated with it.
NV2_EXTERN_C enum
nv2_image_patch_result 
nv2_label_server_get_current_patch (struct nv2_label_server *p, struct nv2_image_patch *ret)
 Get the most recently received patch.
NV2_EXTERN_C enum
nv2_label_send_result 
nv2_label_server_send_label (struct nv2_label_server *p, const struct nv2_patch_label *l)
 Send a patch label.
NV2_EXTERN_C void nv2_label_server_set_verbosity (struct nv2_label_server *p, const int verbosity)
 Set the verbosity level for the label server.

Detailed Description

Definition in file nv2_label_server.h.


Enumeration Type Documentation

Result type of nv2_label_server_get_current_patch().

Enumerator:
NV2_IMAGE_PATCH_VALID 

patch is a normal, valid patch

NV2_IMAGE_PATCH_NONE 

patch is empty, should be ignored

NV2_IMAGE_PATCH_END 

patch stream has ended, program should quit

Definition at line 73 of file nv2_label_server.h.

Result type of nv2_label_server_send_label().

Enumerator:
NV2_LABEL_SEND_OK 

label was sent succesfully

NV2_LABEL_SEND_FAIL 

label was not sent (maybe server is down?)

Definition at line 95 of file nv2_label_server.h.


Function Documentation

NV2_EXTERN_C struct nv2_label_server* nv2_label_server_create ( const int  patch_reader_port,
const char *  remote_label_reader_addr,
const int  remote_label_reader_port 
) [read]

Create a label server (which will also be a patch reader).

Parameters:
patch_reader_port tcp port on which the patch reader should run on this host machine (by default you should use NV2_PATCH_READER_PORT)
remote_label_reader_addr ip address to which we should connect to find the label reader
remote_label_reader_port tcp port on which the label reader is running on remote_label_reader_addr

Definition at line 252 of file nv2_label_server.c.

References nv2_fatal, and nv2_image_patch_init_empty().

NV2_EXTERN_C void nv2_label_server_destroy ( struct nv2_label_server p  ) 

Destroy a label server and release all resources associated with it.

Definition at line 289 of file nv2_label_server.c.

References nv2_fatal, and nv2_image_patch_destroy().

NV2_EXTERN_C enum nv2_image_patch_result nv2_label_server_get_current_patch ( struct nv2_label_server p,
struct nv2_image_patch ret 
)

Get the most recently received patch.

Parameters:
p handle to the label server from which to retrieve the patch
ret the returned image patch; NOTE that ownership of the nv2_image_patch object is transferred to the caller here, so that the caller is responsible for freeing resources associated with this image patch by calling nv2_image_patch_destroy() after use

Definition at line 305 of file nv2_label_server.c.

References NV2_IMAGE_PATCH_END, nv2_image_patch_init_empty(), NV2_IMAGE_PATCH_NONE, and NV2_IMAGE_PATCH_VALID.

NV2_EXTERN_C enum nv2_label_send_result nv2_label_server_send_label ( struct nv2_label_server p,
const struct nv2_patch_label l 
)

Send a patch label.

Parameters:
p handle to the label server from which to send the patch label
l patch label to be sent
Returns:
non-zero if the label was sent succesfully, or zero if there was an error

Definition at line 320 of file nv2_label_server.c.

References nv2_patch_label::confidence, nv2_fatal, NV2_LABEL_SEND_FAIL, NV2_LABEL_SEND_OK, nv2_robust_write(), and nv2_warn.

NV2_EXTERN_C void nv2_label_server_set_verbosity ( struct nv2_label_server p,
const int  verbosity 
)

Set the verbosity level for the label server.

Parameters:
verbosity if 0, then don't print anything except fatal error messages; if 1, then also print warnings (but not informational messages)

Definition at line 362 of file nv2_label_server.c.

Generated on Sun May 8 08:42:45 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3