BlinkenArea - GitList
Repositories
Blog
Wiki
libetherpix
Code
Commits
Branches
Tags
Search
Tree:
4ef7955
Branches
Tags
master
libetherpix
include
etherpix
displayer.h
update copyright year
Stefan Schuermans
commited
4ef7955
at 2017-05-20 16:55:59
displayer.h
Blame
History
Raw
/* * EtherPix library * * Copyright 2010-2017 Stefan Schuermans <stefan schuermans info> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 3 of the License. * * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef ETP_INC_DISPLAYER_H #define ETP_INC_DISPLAYER_H #include <etherpix/msg.h> #include <etherpix/types.h> /** * \brief create a new EtherPix displayer * * A displayer manages a display and ensures that a the current * image data is sent often enough to the distributors so * that the pixels do detect a timeout and turn off automatically. * The displayer uses a thread to do this. * Initially, the new displayer is inactive and has to be activated * using etp_displayer_activate(). * * \param[in] sz_config_file name of config file to read * \param[in] p_msg_func message callback function or NULL * \param[in] p_msg_ctx user context for message callback * \return pointer to new EtherPix displayer on success * or NULL on error */ etp_displayer_t *etp_displayer_create(const char *sz_config_file, etp_msg_func_p_t p_msg_func, void *p_msg_ctx); /** * \brief free a EtherPix displayer * * \param[in] p_displayer pointer to EtherPix displayer */ void etp_displayer_free(etp_displayer_t *p_displayer); /** * \brief get size of display managed by displayer * * \param[in] p_displayer pointer to EtherPix displayer * \param[out] p_width width of display * \param[out] p_height height of display */ void etp_displayer_get_size(etp_displayer_t *p_displayer, unsigned int *p_width, unsigned int *p_height); /** * \brief activate the displayer * * set the displayer to active, i.e. make it send image data * to the distributors automatically, * this function might trigger sending of data if the last * sending time was too long ago * * \param[in] p_displayer pointer to EtherPix displayer */ void etp_displayer_activate(etp_displayer_t *p_displayer); /** * \brief deactivate the displayer * * set the displayer to deactive, i.e. prevent it from sening image * data to the distributors automatically, * * \param[in] p_displayer pointer to EtherPix displayer */ void etp_displayer_deactivate(etp_displayer_t *p_displayer); /** * \brief clear image data to output on EtherPix displayer * * clears the stored image data * * \param[in] p_displayer pointer to EtherPix displayer */ void etp_displayer_data_clear(etp_displayer_t *p_displayer); /** * \brief set image data to output on EtherPix display * * updates (part of) the stored image data * * \param[in] p_displayer pointer to EtherPix displayer * \param[in] p_data pointer to rectangular section of image data * \param[in] stride_x stride between two pixels in X direction * \param[in] stride_y stride between two pixels in Y direction * \param[in] x X coordinate of left side of rectangular area * \param[in] y Y coordinate of top side of rectangular area * \param[in] width with of rectangular area * \param[in] height height of rectangular area * \param[in] pixfmt format of pixel data */ void etp_displayer_data_fmt(etp_displayer_t *p_displayer, etp_u8_t *p_data, int stride_x, int stride_y, unsigned int x, unsigned int y, unsigned int width, unsigned int height, etp_pixfmt_t pixfmt); /** * \brief set image data to output on EtherPix display * * see etp_displayer_data_fmt for documentation * pixfmt is fixed to etp_pixfmt_rgb24 */ void etp_displayer_data(etp_displayer_t *p_displayer, etp_u8_t *p_data, int stride_x, int stride_y, unsigned int x, unsigned int y, unsigned int width, unsigned int height); /** * \brief trigger immediate sending of new image data to distributors * * this only works if the displayer is active * * \param[in] p_displayer pointer to EtherPix displayer */ void etp_displayer_send(etp_displayer_t *p_displayer); #endif /* #ifndef ETP_INC_DISPLAYER_H */