/* bluebox distributor
 * version 0.3.2 date 2007-07-18
 * Copyright (C) 2006-2007 Stefan Schuermans <stefan@blinkenarea.org>
 * Copyleft: GNU public license V2.0 - http://www.gnu.org/copyleft/gpl.html
 * a BlinkenArea project - http://www.blinkenarea.org/
 */

#ifndef INC_protocols
#define INC_protocols

#include "bd_fmt.h"

//initialize mapping from gayscale values to pwm values
void gray2pwm_init( double base, double spread, double gamma );

//processs a recevied datagram
//p_out_buffers must point to an array of dev_cnt output buffers
//  every output buffer must be at least of size (1 + pix_cnt) * ser_cnt
//  pixels start at offset 1 in output buffers
//  every pixel in output buffer is encoded with 7 bit (i.e. 0..127)
//returns 1 on success, 0 on error
int proto_datagram( unsigned char * p_datagram, unsigned int datagram_len,
                    st_bd_fmt * p_bd_fmt, unsigned char * * p_out_buffers );

#endif //#ifndef INC_protocols
