BlinkenArea - GitList
Repositories
Blog
Wiki
BlinkenLib
Code
Commits
Branches
Tags
Search
Tree:
bf06f77
Branches
Tags
master
v0.1
v0.2
v0.3
v0.3.1
v0.4
v0.4.1
v0.5
v0.5.1
v0.5.2
v0.5.3
v0.5.4
v0.5.5
v0.6.0
v0.6.1
v0.6.2
v0.6.3
v0.6.4
v0.6.5
v0.6.6
v0.6.7
v0.6.8
v0.6.9
v0.7.0
v0.7.1
v0.7.10
v0.7.2
v0.7.3
v0.7.4
v0.7.5
v0.7.6
v0.7.7
v0.7.8
v0.7.9
v0.8.0
v0.8.1
BlinkenLib
include
BlinkenLib
BlinkenFrame.h
implement getting/setting pixel data
Stefan Schuermans
commited
bf06f77
at 2019-05-30 18:29:21
BlinkenFrame.h
Blame
History
Raw
/* BlinkenLib Copyright 2004-2014 Stefan Schuermans <stefan@schuermans.info> Copyleft GNU public license - http://www.gnu.org/copyleft/gpl.html a blinkenarea.org project */ #ifndef INC_BlinkenLib_BlinkenFrame #define INC_BlinkenLib_BlinkenFrame #include <BlinkenLib/BlinkenProto.h> #ifdef __cplusplus extern "C" { #endif typedef struct sBlinkenFrame stBlinkenFrame; stBlinkenFrame *BlinkenFrameNew(int height, int width, int channels, int maxval, int duration); stBlinkenFrame *BlinkenFrameClone(stBlinkenFrame *pSrcFrame); void BlinkenFrameFree(stBlinkenFrame *pFrame); void BlinkenFrameClear(stBlinkenFrame *pFrame); int BlinkenFrameGetHeight(stBlinkenFrame *pFrame); int BlinkenFrameGetWidth(stBlinkenFrame *pFrame); int BlinkenFrameGetChannels(stBlinkenFrame *pFrame); int BlinkenFrameGetMaxval(stBlinkenFrame *pFrame); int BlinkenFrameGetDuration(stBlinkenFrame *pFrame); void BlinkenFrameSetDuration(stBlinkenFrame *pFrame, int duration); unsigned char BlinkenFrameGetPixel(stBlinkenFrame *pFrame, int y, int x, int c); void BlinkenFrameSetPixel(stBlinkenFrame *pFrame, int y, int x, int c, unsigned char val); unsigned long BlinkenFrameGetColor(stBlinkenFrame *pFrame, int y, int x); void BlinkenFrameSetColor(stBlinkenFrame *pFrame, int y, int x, unsigned long color); /** * get data of an rectangular area of pixels * \param[in] pFrame BlinkenFrame to read * \param[in] y first y coordinate of area * \param[in] dy size of area in y direction * \param[in] x first x coordinate of area * \param[in] dx size of area in x direction * \param[in] c first channel of area * \param[in] dc number of channels in area * \param[in] pData pointer to buffer for pixel data, size must be dy * dx * dc */ void BlinkenFrameGetPixelData(stBlinkenFrame const *pFrame, int y, int dy, int x, int dx, int c, int dc, unsigned char *pData); /** * set data of an rectangular area of pixels * \param[in] pFrame BlinkenFrame to modify * \param[in] y first y coordinate of area * \param[in] dy size of area in y direction * \param[in] x first x coordinate of area * \param[in] dx size of area in x direction * \param[in] c first channel of area * \param[in] dc number of channels in area * \param[in] pData pointer to new pixel data, size must be dy * dx * dc */ void BlinkenFrameSetPixelData(stBlinkenFrame *pFrame, int y, int dy, int x, int dx, int c, int dc, unsigned char const *pData); int BlinkenFrameIsEmpty(stBlinkenFrame *pFrame); // returns 1 if frame is empty (i.e. black), returns 0 otherwise int BlinkenFrameCompare(stBlinkenFrame *pFrame1, stBlinkenFrame *pFrame2); // returns -1 for frame1 smaller, 0 for equal, 1 for frame2 smaller void BlinkenFrameResize(stBlinkenFrame *pFrame, int height, int width, int channels, int maxval); void BlinkenFrameCrop(stBlinkenFrame *pFrame, int top, int left, int height, int width); void BlinkenFrameScale(stBlinkenFrame *pFrame, int height, int width); void BlinkenFrameColorize(stBlinkenFrame *pFrame, int channels, int mode, int step); void BlinkenFrameCopyRect(stBlinkenFrame *pDest, int destY, int destX, stBlinkenFrame *pSrc, int srcY, int srcX, int height, int width); void BlinkenFrameRotateCw(stBlinkenFrame *pFrame); void BlinkenFrameRotateCcw(stBlinkenFrame *pFrame); void BlinkenFrameRotateHalf(stBlinkenFrame *pFrame); void BlinkenFrameMirrorHor(stBlinkenFrame *pFrame); void BlinkenFrameMirrorVer(stBlinkenFrame *pFrame); void BlinkenFrameMirrorDiag(stBlinkenFrame *pFrame); void BlinkenFrameMirrorDiag2(stBlinkenFrame *pFrame); char *BlinkenFrameToString(stBlinkenFrame *pFrame); int BlinkenFrameToNetwork(stBlinkenFrame *pFrame, etBlinkenProto proto, char *pData, int maxLength); // returns length or -1 on error stBlinkenFrame *BlinkenFrameFromNetwork(const char *pData, int length, etBlinkenProto * pProto); // returns protocol in *pProto if pProto not NULL #ifdef __cplusplus } // extern "C" #endif #endif // #ifndef INC_BlinkenLib_BlinkenFrame