860e91ba85e0070b3deb854f8a8e9952bceca480
Stefan Schuermans cleanup file headers after...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c    1) /* BlinkenLib
Stefan Schuermans update email address of author

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenMovie.c    2)    Copyright 2004-2014 Stefan Schuermans <stefan@schuermans.info>
Stefan Schuermans cleanup file headers after...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c    3)    Copyleft GNU public license - http://www.gnu.org/copyleft/gpl.html
BlinkenLib/BlinkenMovie.c    4)    a blinkenarea.org project */
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c               5) 
BlinkenMovie.c               6) #include <stdio.h>
BlinkenMovie.c               7) #include <stdlib.h>
BlinkenMovie.c               8) #include <string.h>
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenMovie.c               9) #ifdef WIN32
BlinkenMovie.c              10) #include <windows.h>
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c          11) #include <winsock2.h>
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenMovie.c              12) #else
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c          13) #include <sys/select.h>
src/BlinkenMovie.c          14) #include <sys/socket.h>
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

BlinkenMovie.c              15) #include <sys/time.h>
BlinkenMovie.c              16) #include <sys/types.h>
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c          17) #include <unistd.h>
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenMovie.c              18) #endif
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c              19) 
Christian Heimke BlinkenLib v.0.5.5 (2008-03...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c   20) #include <BlinkenLib/BlinkenFrame.h>
BlinkenLib/BlinkenMovie.c   21) #include <BlinkenLib/BlinkenMovie.h>
Stefan Schuermans restructure directories

Stefan Schuermans authored 5 years ago

src/BlinkenMovie.c          22) 
src/BlinkenMovie.c          23) #include "BlinkenConstants.h"
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c          24) #include "Tools.h"
Christian Heimke BlinkenLib v.0.6.0 (2008-05...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c   25) #ifdef BLINKENLIB_CFG_MNG
Stefan Schuermans restructure directories

Stefan Schuermans authored 5 years ago

src/BlinkenMovie.c          26) #include "BlinkenMng.h"
Christian Heimke BlinkenLib v.0.6.0 (2008-05...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c   27) #endif // #ifdef BLINKENLIB_CFG_MNG
Stefan Schuermans implement reading GIFs

Stefan Schuermans authored 7 years ago

BlinkenLib/BlinkenMovie.c   28) #ifdef BLINKENLIB_CFG_GIF
Stefan Schuermans restructure directories

Stefan Schuermans authored 5 years ago

src/BlinkenMovie.c          29) #include "BlinkenGif.h"
Stefan Schuermans implement reading GIFs

Stefan Schuermans authored 7 years ago

BlinkenLib/BlinkenMovie.c   30) #endif // #ifdef BLINKENLIB_CFG_GIF
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c              31) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c   32) struct sBlinkenMovie {
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c              33)   int height;
BlinkenMovie.c              34)   int width;
BlinkenMovie.c              35)   int channels;
BlinkenMovie.c              36)   int maxval;
BlinkenMovie.c              37)   int infoCnt;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c   38)   char ***pppInfos;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c              39)   int frameCnt;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c   40)   stBlinkenFrame **ppFrames;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c              41) };
BlinkenMovie.c              42) 
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenMovie.c              43) #ifdef WIN32
BlinkenMovie.c              44) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c          45) static void msleep(unsigned int ms) { Sleep(ms); }
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenMovie.c              46) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c          47) static unsigned int get_ms() { return GetTickCount(); }
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenMovie.c              48) 
BlinkenMovie.c              49) #else
BlinkenMovie.c              50) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c          51) static void msleep(unsigned int ms) { usleep(ms * 1000); }
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenMovie.c              52) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c          53) static unsigned int get_ms() {
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenMovie.c              54)   struct timeval tv;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c   55)   gettimeofday(&tv, NULL);
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenMovie.c              56)   return (unsigned int)(tv.tv_usec / 1000 + tv.tv_sec * 1000);
BlinkenMovie.c              57) }
BlinkenMovie.c              58) 
BlinkenMovie.c              59) #endif
BlinkenMovie.c              60) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c   61) stBlinkenMovie *BlinkenMovieNew(int height, int width, int channels,
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c          62)                                 int maxval) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c   63)   stBlinkenMovie *pMovie;
BlinkenLib/BlinkenMovie.c   64) 
BlinkenLib/BlinkenMovie.c   65)   if (height < BlinkenHeightMin)
BlinkenLib/BlinkenMovie.c   66)     height = BlinkenHeightMin;
BlinkenLib/BlinkenMovie.c   67)   if (height > BlinkenHeightMax)
BlinkenLib/BlinkenMovie.c   68)     height = BlinkenHeightMax;
BlinkenLib/BlinkenMovie.c   69)   if (width < BlinkenWidthMin)
BlinkenLib/BlinkenMovie.c   70)     width = BlinkenWidthMin;
BlinkenLib/BlinkenMovie.c   71)   if (width > BlinkenWidthMax)
BlinkenLib/BlinkenMovie.c   72)     width = BlinkenWidthMax;
BlinkenLib/BlinkenMovie.c   73)   if (channels < BlinkenChannelsMin)
BlinkenLib/BlinkenMovie.c   74)     channels = BlinkenChannelsMin;
BlinkenLib/BlinkenMovie.c   75)   if (channels > BlinkenChannelsMax)
BlinkenLib/BlinkenMovie.c   76)     channels = BlinkenMaxvalMax;
BlinkenLib/BlinkenMovie.c   77)   if (maxval < BlinkenMaxvalMin)
BlinkenLib/BlinkenMovie.c   78)     maxval = BlinkenMaxvalMin;
BlinkenLib/BlinkenMovie.c   79)   if (maxval > BlinkenMaxvalMax)
BlinkenLib/BlinkenMovie.c   80)     maxval = BlinkenMaxvalMax;
BlinkenLib/BlinkenMovie.c   81) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c          82)   pMovie = (stBlinkenMovie *)malloc(sizeof(stBlinkenMovie));
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c   83)   if (pMovie == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c              84)     return NULL;
BlinkenMovie.c              85) 
BlinkenMovie.c              86)   pMovie->height = height;
BlinkenMovie.c              87)   pMovie->width = width;
BlinkenMovie.c              88)   pMovie->channels = channels;
BlinkenMovie.c              89)   pMovie->maxval = maxval;
BlinkenMovie.c              90)   pMovie->infoCnt = 0;
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c   91)   pMovie->pppInfos = (char ***)BlinkenMalloc2D(0, 2, sizeof(char *));
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c   92)   if (pMovie->pppInfos == NULL) {
BlinkenLib/BlinkenMovie.c   93)     free(pMovie);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c              94)     return NULL;
BlinkenMovie.c              95)   }
BlinkenMovie.c              96)   pMovie->frameCnt = 0;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c   97)   pMovie->ppFrames =
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c          98)       (stBlinkenFrame **)BlinkenMalloc1D(0, sizeof(stBlinkenFrame *));
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c   99)   if (pMovie->ppFrames == NULL) {
BlinkenLib/BlinkenMovie.c  100)     free(pMovie->pppInfos);
BlinkenLib/BlinkenMovie.c  101)     free(pMovie);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             102)     return NULL;
BlinkenMovie.c             103)   }
BlinkenMovie.c             104) 
BlinkenMovie.c             105)   return pMovie;
BlinkenMovie.c             106) }
BlinkenMovie.c             107) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         108) stBlinkenMovie *BlinkenMovieClone(stBlinkenMovie *pSrcMovie) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  109)   stBlinkenMovie *pMovie;
BlinkenLib/BlinkenMovie.c  110)   stBlinkenFrame *pFrame;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             111)   int i;
BlinkenMovie.c             112) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         113)   pMovie = BlinkenMovieNew(pSrcMovie->height, pSrcMovie->width,
src/BlinkenMovie.c         114)                            pSrcMovie->channels, pSrcMovie->maxval);
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  115)   if (pMovie == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             116)     return NULL;
BlinkenMovie.c             117) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  118)   for (i = 0; i < pSrcMovie->infoCnt; i++)
BlinkenLib/BlinkenMovie.c  119)     BlinkenMovieAppendInfo(pMovie, pSrcMovie->pppInfos[i][0],
BlinkenLib/BlinkenMovie.c  120)                            pSrcMovie->pppInfos[i][1]);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             121) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  122)   for (i = 0; i < pSrcMovie->frameCnt; i++) {
BlinkenLib/BlinkenMovie.c  123)     pFrame = BlinkenFrameClone(pSrcMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  124)     if (BlinkenMovieAppendFrame(pMovie, pFrame) != 0)
BlinkenLib/BlinkenMovie.c  125)       BlinkenFrameFree(pFrame);
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

BlinkenMovie.c             126)   }
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             127) 
BlinkenMovie.c             128)   return pMovie;
BlinkenMovie.c             129) }
BlinkenMovie.c             130) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         131) void BlinkenMovieFree(stBlinkenMovie *pMovie) {
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             132)   int i;
BlinkenMovie.c             133) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  134)   if (pMovie == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             135)     return;
BlinkenMovie.c             136) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  137)   for (i = 0; i < pMovie->infoCnt; i++) {
BlinkenLib/BlinkenMovie.c  138)     free(pMovie->pppInfos[i][0]);
BlinkenLib/BlinkenMovie.c  139)     free(pMovie->pppInfos[i][1]);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             140)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  141)   free(pMovie->pppInfos);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             142) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  143)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  144)     BlinkenFrameFree(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  145)   free(pMovie->ppFrames);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             146) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  147)   free(pMovie);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             148) }
BlinkenMovie.c             149) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         150) int BlinkenMovieGetHeight(stBlinkenMovie *pMovie) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  151)   if (pMovie == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             152)     return 0;
BlinkenMovie.c             153) 
BlinkenMovie.c             154)   return pMovie->height;
BlinkenMovie.c             155) }
BlinkenMovie.c             156) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         157) int BlinkenMovieGetWidth(stBlinkenMovie *pMovie) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  158)   if (pMovie == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             159)     return 0;
BlinkenMovie.c             160) 
BlinkenMovie.c             161)   return pMovie->width;
BlinkenMovie.c             162) }
BlinkenMovie.c             163) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         164) int BlinkenMovieGetChannels(stBlinkenMovie *pMovie) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  165)   if (pMovie == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             166)     return 0;
BlinkenMovie.c             167) 
BlinkenMovie.c             168)   return pMovie->channels;
BlinkenMovie.c             169) }
BlinkenMovie.c             170) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         171) int BlinkenMovieGetMaxval(stBlinkenMovie *pMovie) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  172)   if (pMovie == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             173)     return 0;
BlinkenMovie.c             174) 
BlinkenMovie.c             175)   return pMovie->maxval;
BlinkenMovie.c             176) }
BlinkenMovie.c             177) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         178) int BlinkenMovieGetDuration(stBlinkenMovie *pMovie) {
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             179)   int i, duration;
BlinkenMovie.c             180) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  181)   if (pMovie == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             182)     return 0;
BlinkenMovie.c             183) 
BlinkenMovie.c             184)   duration = 0;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  185)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  186)     duration += BlinkenFrameGetDuration(pMovie->ppFrames[i]);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             187)   return duration;
BlinkenMovie.c             188) }
BlinkenMovie.c             189) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         190) int BlinkenMovieGetInfoCnt(stBlinkenMovie *pMovie) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  191)   if (pMovie == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             192)     return 0;
BlinkenMovie.c             193) 
BlinkenMovie.c             194)   return pMovie->infoCnt;
BlinkenMovie.c             195) }
BlinkenMovie.c             196) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         197) char *BlinkenMovieGetInfoType(stBlinkenMovie *pMovie, int infoNo) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  198)   if (pMovie == NULL || pMovie->infoCnt < 1)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             199)     return "";
BlinkenMovie.c             200) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  201)   if (infoNo < 0)
BlinkenLib/BlinkenMovie.c  202)     infoNo = 0;
BlinkenLib/BlinkenMovie.c  203)   if (infoNo >= pMovie->infoCnt)
BlinkenLib/BlinkenMovie.c  204)     infoNo = pMovie->infoCnt - 1;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             205)   return pMovie->pppInfos[infoNo][0];
BlinkenMovie.c             206) }
BlinkenMovie.c             207) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         208) char *BlinkenMovieGetInfoData(stBlinkenMovie *pMovie, int infoNo) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  209)   if (pMovie == NULL || pMovie->infoCnt < 1)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             210)     return "";
BlinkenMovie.c             211) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  212)   if (infoNo < 0)
BlinkenLib/BlinkenMovie.c  213)     infoNo = 0;
BlinkenLib/BlinkenMovie.c  214)   if (infoNo >= pMovie->infoCnt)
BlinkenLib/BlinkenMovie.c  215)     infoNo = pMovie->infoCnt - 1;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             216)   return pMovie->pppInfos[infoNo][1];
BlinkenMovie.c             217) }
BlinkenMovie.c             218) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  219) void BlinkenMovieSetInfo(stBlinkenMovie *pMovie, int infoNo,
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         220)                          const char *pInfoType, const char *pInfoData) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  221)   char *pType, *pData;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             222) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  223)   if (pMovie == NULL || infoNo < 0 || infoNo >= pMovie->infoCnt)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             224)     return;
BlinkenMovie.c             225) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  226)   pType = strdup(pInfoType);
BlinkenLib/BlinkenMovie.c  227)   if (pType == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             228)     return;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  229)   pData = strdup(pInfoData);
BlinkenLib/BlinkenMovie.c  230)   if (pData == NULL) {
BlinkenLib/BlinkenMovie.c  231)     free(pType);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             232)     return;
BlinkenMovie.c             233)   }
BlinkenMovie.c             234) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  235)   free(pMovie->pppInfos[infoNo][0]);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             236)   pMovie->pppInfos[infoNo][0] = pType;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  237)   free(pMovie->pppInfos[infoNo][1]);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             238)   pMovie->pppInfos[infoNo][1] = pData;
BlinkenMovie.c             239) }
BlinkenMovie.c             240) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  241) void BlinkenMovieInsertInfo(stBlinkenMovie *pMovie, int infoNo,
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         242)                             const char *pInfoType, const char *pInfoData) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  243)   char ***pppNewInfos, *pType, *pData;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             244)   int i;
BlinkenMovie.c             245) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  246)   if (pMovie == NULL || infoNo < 0 || infoNo > pMovie->infoCnt)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             247)     return;
BlinkenMovie.c             248) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         249)   pppNewInfos =
src/BlinkenMovie.c         250)       (char ***)BlinkenMalloc2D(pMovie->infoCnt + 1, 2, sizeof(char *));
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  251)   if (pppNewInfos == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             252)     return;
BlinkenMovie.c             253) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  254)   pType = strdup(pInfoType);
BlinkenLib/BlinkenMovie.c  255)   if (pType == NULL) {
BlinkenLib/BlinkenMovie.c  256)     free(pppNewInfos);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             257)     return;
BlinkenMovie.c             258)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  259)   pData = strdup(pInfoData);
BlinkenLib/BlinkenMovie.c  260)   if (pData == NULL) {
BlinkenLib/BlinkenMovie.c  261)     free(pppNewInfos);
BlinkenLib/BlinkenMovie.c  262)     free(pType);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             263)     return;
BlinkenMovie.c             264)   }
BlinkenMovie.c             265) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  266)   for (i = 0; i < infoNo; i++) {
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             267)     pppNewInfos[i][0] = pMovie->pppInfos[i][0];
BlinkenMovie.c             268)     pppNewInfos[i][1] = pMovie->pppInfos[i][1];
BlinkenMovie.c             269)   }
BlinkenMovie.c             270) 
BlinkenMovie.c             271)   pppNewInfos[infoNo][0] = pType;
BlinkenMovie.c             272)   pppNewInfos[infoNo][1] = pData;
BlinkenMovie.c             273) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  274)   for (i = infoNo; i < pMovie->infoCnt; i++) {
BlinkenLib/BlinkenMovie.c  275)     pppNewInfos[i + 1][0] = pMovie->pppInfos[i][0];
BlinkenLib/BlinkenMovie.c  276)     pppNewInfos[i + 1][1] = pMovie->pppInfos[i][1];
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             277)   }
BlinkenMovie.c             278) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  279)   free(pMovie->pppInfos);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             280)   pMovie->pppInfos = pppNewInfos;
BlinkenMovie.c             281)   pMovie->infoCnt++;
BlinkenMovie.c             282) }
BlinkenMovie.c             283) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  284) void BlinkenMovieAppendInfo(stBlinkenMovie *pMovie, const char *pInfoType,
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         285)                             const char *pInfoData) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  286)   if (pMovie == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             287)     return;
BlinkenMovie.c             288) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  289)   BlinkenMovieInsertInfo(pMovie, pMovie->infoCnt, pInfoType, pInfoData);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             290) }
BlinkenMovie.c             291) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         292) void BlinkenMovieDeleteInfo(stBlinkenMovie *pMovie, int infoNo) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  293)   char ***pppNewInfos;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             294)   int i;
BlinkenMovie.c             295) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  296)   if (pMovie == NULL || infoNo < 0 || infoNo >= pMovie->infoCnt)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             297)     return;
BlinkenMovie.c             298) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         299)   pppNewInfos =
src/BlinkenMovie.c         300)       (char ***)BlinkenMalloc2D(pMovie->infoCnt - 1, 2, sizeof(char *));
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  301)   if (pppNewInfos == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             302)     return;
BlinkenMovie.c             303) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  304)   for (i = 0; i < infoNo; i++) {
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             305)     pppNewInfos[i][0] = pMovie->pppInfos[i][0];
BlinkenMovie.c             306)     pppNewInfos[i][1] = pMovie->pppInfos[i][1];
BlinkenMovie.c             307)   }
BlinkenMovie.c             308) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  309)   free(pMovie->pppInfos[infoNo][0]);
BlinkenLib/BlinkenMovie.c  310)   free(pMovie->pppInfos[infoNo][1]);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             311) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  312)   for (i = infoNo; i < pMovie->infoCnt - 1; i++) {
BlinkenLib/BlinkenMovie.c  313)     pppNewInfos[i][0] = pMovie->pppInfos[i + 1][0];
BlinkenLib/BlinkenMovie.c  314)     pppNewInfos[i][1] = pMovie->pppInfos[i + 1][1];
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             315)   }
BlinkenMovie.c             316) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  317)   free(pMovie->pppInfos);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             318)   pMovie->pppInfos = pppNewInfos;
BlinkenMovie.c             319)   pMovie->infoCnt--;
BlinkenMovie.c             320) }
BlinkenMovie.c             321) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         322) void BlinkenMovieDeleteInfos(stBlinkenMovie *pMovie) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  323)   char ***pppNewInfos;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             324)   int i;
BlinkenMovie.c             325) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  326)   if (pMovie == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             327)     return;
BlinkenMovie.c             328) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  329)   pppNewInfos = (char ***)BlinkenMalloc2D(0, 2, sizeof(char *));
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  330)   if (pppNewInfos == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             331)     return;
BlinkenMovie.c             332) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  333)   for (i = 0; i < pMovie->infoCnt; i++) {
BlinkenLib/BlinkenMovie.c  334)     free(pMovie->pppInfos[i][0]);
BlinkenLib/BlinkenMovie.c  335)     free(pMovie->pppInfos[i][1]);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             336)   }
BlinkenMovie.c             337) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  338)   free(pMovie->pppInfos);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             339)   pMovie->pppInfos = pppNewInfos;
BlinkenMovie.c             340)   pMovie->infoCnt = 0;
BlinkenMovie.c             341) }
BlinkenMovie.c             342) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         343) int BlinkenMovieGetFrameCnt(stBlinkenMovie *pMovie) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  344)   if (pMovie == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             345)     return 0;
BlinkenMovie.c             346) 
BlinkenMovie.c             347)   return pMovie->frameCnt;
BlinkenMovie.c             348) }
BlinkenMovie.c             349) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         350) stBlinkenFrame *BlinkenMovieGetFrame(stBlinkenMovie *pMovie, int frameNo) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  351)   if (pMovie == NULL || pMovie->frameCnt < 1)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             352)     return NULL;
BlinkenMovie.c             353) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  354)   if (frameNo < 0)
BlinkenLib/BlinkenMovie.c  355)     frameNo = 0;
BlinkenLib/BlinkenMovie.c  356)   if (frameNo >= pMovie->frameCnt)
BlinkenLib/BlinkenMovie.c  357)     frameNo = pMovie->frameCnt - 1;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             358)   return pMovie->ppFrames[frameNo];
BlinkenMovie.c             359) }
BlinkenMovie.c             360) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  361) void BlinkenMovieSetFrame(stBlinkenMovie *pMovie, int frameNo,
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         362)                           stBlinkenFrame *pFrame) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  363)   if (pMovie == NULL || frameNo < 0 || frameNo >= pMovie->frameCnt)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             364)     return;
BlinkenMovie.c             365) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  366)   BlinkenFrameResize(pFrame, pMovie->height, pMovie->width, pMovie->channels,
BlinkenLib/BlinkenMovie.c  367)                      pMovie->maxval);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             368)   pMovie->ppFrames[frameNo] = pFrame;
BlinkenMovie.c             369) }
BlinkenMovie.c             370) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  371) int BlinkenMovieInsertFrame(stBlinkenMovie *pMovie, int frameNo,
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         372)                             stBlinkenFrame *pFrame) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  373)   stBlinkenFrame **ppNewFrames;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             374)   int i;
BlinkenMovie.c             375) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  376)   if (pMovie == NULL || frameNo < 0 || frameNo > pMovie->frameCnt)
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

BlinkenMovie.c             377)     return -1;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             378) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         379)   ppNewFrames = (stBlinkenFrame **)BlinkenMalloc1D(pMovie->frameCnt + 1,
src/BlinkenMovie.c         380)                                                    sizeof(stBlinkenFrame *));
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  381)   if (ppNewFrames == NULL)
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

BlinkenMovie.c             382)     return -1;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             383) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  384)   for (i = 0; i < frameNo; i++)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             385)     ppNewFrames[i] = pMovie->ppFrames[i];
BlinkenMovie.c             386) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  387)   BlinkenFrameResize(pFrame, pMovie->height, pMovie->width, pMovie->channels,
BlinkenLib/BlinkenMovie.c  388)                      pMovie->maxval);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             389)   ppNewFrames[frameNo] = pFrame;
BlinkenMovie.c             390) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  391)   for (i = frameNo; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  392)     ppNewFrames[i + 1] = pMovie->ppFrames[i];
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             393) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  394)   free(pMovie->ppFrames);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             395)   pMovie->ppFrames = ppNewFrames;
BlinkenMovie.c             396)   pMovie->frameCnt++;
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

BlinkenMovie.c             397)   return 0;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             398) }
BlinkenMovie.c             399) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         400) int BlinkenMovieAppendFrame(stBlinkenMovie *pMovie, stBlinkenFrame *pFrame) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  401)   if (pMovie == NULL)
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

BlinkenMovie.c             402)     return -1;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             403) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  404)   return BlinkenMovieInsertFrame(pMovie, pMovie->frameCnt, pFrame);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             405) }
BlinkenMovie.c             406) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         407) void BlinkenMovieDeleteFrame(stBlinkenMovie *pMovie, int frameNo) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  408)   stBlinkenFrame **ppNewFrames;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             409)   int i;
BlinkenMovie.c             410) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  411)   if (pMovie == NULL || frameNo < 0 || frameNo >= pMovie->frameCnt)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             412)     return;
BlinkenMovie.c             413) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  414)   ppNewFrames = (stBlinkenFrame **)BlinkenMalloc1D(pMovie->frameCnt - 1,
BlinkenLib/BlinkenMovie.c  415)                                                    sizeof(stBlinkenFrame *));
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  416)   if (ppNewFrames == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             417)     return;
BlinkenMovie.c             418) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  419)   for (i = 0; i < frameNo; i++)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             420)     ppNewFrames[i] = pMovie->ppFrames[i];
BlinkenMovie.c             421) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  422)   BlinkenFrameFree(pMovie->ppFrames[frameNo]);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             423) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  424)   for (i = frameNo; i < pMovie->frameCnt - 1; i++)
BlinkenLib/BlinkenMovie.c  425)     ppNewFrames[i] = pMovie->ppFrames[i + 1];
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             426) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  427)   free(pMovie->ppFrames);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             428)   pMovie->ppFrames = ppNewFrames;
BlinkenMovie.c             429)   pMovie->frameCnt--;
BlinkenMovie.c             430) }
BlinkenMovie.c             431) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         432) void BlinkenMovieDeleteFrames(stBlinkenMovie *pMovie) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  433)   stBlinkenFrame **ppNewFrames;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             434)   int i;
BlinkenMovie.c             435) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  436)   if (pMovie == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             437)     return;
BlinkenMovie.c             438) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         439)   ppNewFrames = (stBlinkenFrame **)BlinkenMalloc1D(0, sizeof(stBlinkenFrame *));
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  440)   if (ppNewFrames == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             441)     return;
BlinkenMovie.c             442) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  443)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  444)     BlinkenFrameFree(pMovie->ppFrames[i]);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             445) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  446)   free(pMovie->ppFrames);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             447)   pMovie->ppFrames = ppNewFrames;
BlinkenMovie.c             448)   pMovie->frameCnt = 0;
BlinkenMovie.c             449) }
BlinkenMovie.c             450) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  451) int BlinkenMovieConcat(stBlinkenMovie *pMovie,
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         452)                        stBlinkenMovie *pMovie2 /* appended and freed */) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  453)   stBlinkenFrame **ppNewFrames, **ppNewFrames2;
Christian Heimke BlinkenLib v.0.6.4 (2010-12...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c  454)   int i;
BlinkenLib/BlinkenMovie.c  455) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  456)   if (pMovie == NULL || pMovie2 == NULL)
Christian Heimke BlinkenLib v.0.6.4 (2010-12...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c  457)     return -1;
BlinkenLib/BlinkenMovie.c  458) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  459)   BlinkenMovieResize(pMovie2, pMovie->height, pMovie->width, pMovie->channels,
BlinkenLib/BlinkenMovie.c  460)                      pMovie->maxval);
Christian Heimke BlinkenLib v.0.6.4 (2010-12...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c  461) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         462)   ppNewFrames = (stBlinkenFrame **)BlinkenMalloc1D(
src/BlinkenMovie.c         463)       pMovie->frameCnt + pMovie2->frameCnt, sizeof(stBlinkenFrame *));
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  464)   if (ppNewFrames == NULL)
Christian Heimke BlinkenLib v.0.6.4 (2010-12...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c  465)     return -1;
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         466)   ppNewFrames2 =
src/BlinkenMovie.c         467)       (stBlinkenFrame **)BlinkenMalloc1D(0, sizeof(stBlinkenFrame *));
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  468)   if (ppNewFrames2 == NULL) {
BlinkenLib/BlinkenMovie.c  469)     free(ppNewFrames);
Christian Heimke BlinkenLib v.0.6.4 (2010-12...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c  470)     return -1;
BlinkenLib/BlinkenMovie.c  471)   }
BlinkenLib/BlinkenMovie.c  472) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  473)   for (i = 0; i < pMovie->frameCnt; i++)
Christian Heimke BlinkenLib v.0.6.4 (2010-12...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c  474)     ppNewFrames[i] = pMovie->ppFrames[i];
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  475)   for (i = 0; i < pMovie2->frameCnt; i++)
Christian Heimke BlinkenLib v.0.6.4 (2010-12...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c  476)     ppNewFrames[pMovie->frameCnt + i] = pMovie2->ppFrames[i];
BlinkenLib/BlinkenMovie.c  477) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  478)   free(pMovie->ppFrames);
Christian Heimke BlinkenLib v.0.6.4 (2010-12...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c  479)   pMovie->ppFrames = ppNewFrames;
BlinkenLib/BlinkenMovie.c  480)   pMovie->frameCnt += pMovie2->frameCnt;
BlinkenLib/BlinkenMovie.c  481) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  482)   free(pMovie2->ppFrames);
Christian Heimke BlinkenLib v.0.6.4 (2010-12...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c  483)   pMovie2->ppFrames = ppNewFrames2;
BlinkenLib/BlinkenMovie.c  484)   pMovie2->frameCnt = 0;
BlinkenLib/BlinkenMovie.c  485) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  486)   BlinkenMovieFree(pMovie2);
Christian Heimke BlinkenLib v.0.6.4 (2010-12...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c  487) 
BlinkenLib/BlinkenMovie.c  488)   return 0;
BlinkenLib/BlinkenMovie.c  489) }
BlinkenLib/BlinkenMovie.c  490) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         491) void BlinkenMovieReverse(stBlinkenMovie *pMovie) {
Christian Heimke BlinkenLib v.0.6.4 (2010-12...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c  492)   int i, j;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  493)   stBlinkenFrame *pFrame;
Christian Heimke BlinkenLib v.0.6.4 (2010-12...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c  494) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  495)   for (i = 0, j = pMovie->frameCnt - 1; i < pMovie->frameCnt / 2; i++, j--) {
Christian Heimke BlinkenLib v.0.6.4 (2010-12...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c  496)     pFrame = pMovie->ppFrames[i];
BlinkenLib/BlinkenMovie.c  497)     pMovie->ppFrames[i] = pMovie->ppFrames[j];
BlinkenLib/BlinkenMovie.c  498)     pMovie->ppFrames[j] = pFrame;
BlinkenLib/BlinkenMovie.c  499)   }
BlinkenLib/BlinkenMovie.c  500) }
BlinkenLib/BlinkenMovie.c  501) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         502) void BlinkenMovieCutTime(stBlinkenMovie *pMovie, int begin /* in ms */,
src/BlinkenMovie.c         503)                          int end /* in ms */) {
Stefan Schuermans implement cutting movie in...

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenMovie.c  504)   int i, duration, curtime, idx_begin, idx_end, duration_begin, duration_end;
BlinkenLib/BlinkenMovie.c  505)   int frameCnt;
BlinkenLib/BlinkenMovie.c  506)   stBlinkenFrame **ppNewFrames;
BlinkenLib/BlinkenMovie.c  507) 
Stefan Schuermans implement changing duration...

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenMovie.c  508)   // do nothing if no movie or empty movie
BlinkenLib/BlinkenMovie.c  509)   if (pMovie == NULL || pMovie->frameCnt < 1)
Stefan Schuermans implement cutting movie in...

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenMovie.c  510)     return;
BlinkenLib/BlinkenMovie.c  511) 
BlinkenLib/BlinkenMovie.c  512)   // get movie duration
BlinkenLib/BlinkenMovie.c  513)   duration = 0;
BlinkenLib/BlinkenMovie.c  514)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  515)     duration += BlinkenFrameGetDuration(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  516) 
BlinkenLib/BlinkenMovie.c  517)   // sanitize inputs
BlinkenLib/BlinkenMovie.c  518)   if (begin < 0)
BlinkenLib/BlinkenMovie.c  519)     begin = 0;
BlinkenLib/BlinkenMovie.c  520)   if (begin > duration)
BlinkenLib/BlinkenMovie.c  521)     begin = duration;
BlinkenLib/BlinkenMovie.c  522)   if (end < begin)
BlinkenLib/BlinkenMovie.c  523)     end = begin;
BlinkenLib/BlinkenMovie.c  524)   if (end > duration)
BlinkenLib/BlinkenMovie.c  525)     end = duration;
BlinkenLib/BlinkenMovie.c  526) 
BlinkenLib/BlinkenMovie.c  527)   // get begin and end indices, also get duration of begin and end frames
BlinkenLib/BlinkenMovie.c  528)   if (begin >= end) {
BlinkenLib/BlinkenMovie.c  529)     // empty result movie
BlinkenLib/BlinkenMovie.c  530)     idx_begin = 1;
BlinkenLib/BlinkenMovie.c  531)     idx_end = 0;
BlinkenLib/BlinkenMovie.c  532)     duration_begin = 0;
BlinkenLib/BlinkenMovie.c  533)     duration_end = 0;
BlinkenLib/BlinkenMovie.c  534)   } else {
BlinkenLib/BlinkenMovie.c  535)     // at least one frame in result movie
BlinkenLib/BlinkenMovie.c  536)     curtime = 0;
BlinkenLib/BlinkenMovie.c  537)     idx_begin = 0;
BlinkenLib/BlinkenMovie.c  538)     duration_begin = BlinkenFrameGetDuration(pMovie->ppFrames[idx_begin]);
BlinkenLib/BlinkenMovie.c  539)     idx_end = pMovie->frameCnt - 1;
BlinkenLib/BlinkenMovie.c  540)     duration_end = BlinkenFrameGetDuration(pMovie->ppFrames[idx_end]);
BlinkenLib/BlinkenMovie.c  541)     for (i = 0; i < pMovie->frameCnt; i++) {
BlinkenLib/BlinkenMovie.c  542)       duration = BlinkenFrameGetDuration(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  543)       // begin and end in current frame
BlinkenLib/BlinkenMovie.c  544)       if (curtime <= begin && curtime + duration >= end) {
BlinkenLib/BlinkenMovie.c  545)         idx_begin = i;
BlinkenLib/BlinkenMovie.c  546)         idx_end = i;
BlinkenLib/BlinkenMovie.c  547)         duration_begin = end - begin;
BlinkenLib/BlinkenMovie.c  548)         duration_end = end - begin;
BlinkenLib/BlinkenMovie.c  549)         break;
BlinkenLib/BlinkenMovie.c  550)       }
BlinkenLib/BlinkenMovie.c  551)       // begin in current frame
BlinkenLib/BlinkenMovie.c  552)       if (curtime <= begin && curtime + duration > begin) {
BlinkenLib/BlinkenMovie.c  553)         idx_begin = i;
BlinkenLib/BlinkenMovie.c  554)         duration_begin = curtime + duration - begin;
BlinkenLib/BlinkenMovie.c  555)       }
BlinkenLib/BlinkenMovie.c  556)       // end in current frame
BlinkenLib/BlinkenMovie.c  557)       if (curtime < end && curtime + duration >= end) {
BlinkenLib/BlinkenMovie.c  558)         idx_end = i;
BlinkenLib/BlinkenMovie.c  559)         duration_end = end - curtime;
BlinkenLib/BlinkenMovie.c  560)         break;
BlinkenLib/BlinkenMovie.c  561)       }
BlinkenLib/BlinkenMovie.c  562)       curtime += duration;
BlinkenLib/BlinkenMovie.c  563)     }
BlinkenLib/BlinkenMovie.c  564)   }
BlinkenLib/BlinkenMovie.c  565) 
BlinkenLib/BlinkenMovie.c  566)   // remove/free unneeded frames
BlinkenLib/BlinkenMovie.c  567) 
BlinkenLib/BlinkenMovie.c  568)   frameCnt = idx_end - idx_begin + 1;
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         569)   ppNewFrames =
src/BlinkenMovie.c         570)       (stBlinkenFrame **)BlinkenMalloc1D(frameCnt, sizeof(stBlinkenFrame *));
Stefan Schuermans implement cutting movie in...

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenMovie.c  571)   if (ppNewFrames == NULL)
BlinkenLib/BlinkenMovie.c  572)     return;
BlinkenLib/BlinkenMovie.c  573) 
BlinkenLib/BlinkenMovie.c  574)   for (i = 0; i < idx_begin; i++)
BlinkenLib/BlinkenMovie.c  575)     BlinkenFrameFree(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  576)   for (; i <= idx_end; i++)
BlinkenLib/BlinkenMovie.c  577)     ppNewFrames[i - idx_begin] = pMovie->ppFrames[i];
BlinkenLib/BlinkenMovie.c  578)   for (; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  579)     BlinkenFrameFree(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  580) 
BlinkenLib/BlinkenMovie.c  581)   free(pMovie->ppFrames);
BlinkenLib/BlinkenMovie.c  582)   pMovie->ppFrames = ppNewFrames;
BlinkenLib/BlinkenMovie.c  583)   pMovie->frameCnt = frameCnt;
BlinkenLib/BlinkenMovie.c  584) 
BlinkenLib/BlinkenMovie.c  585)   // change duration of begin and end frame
BlinkenLib/BlinkenMovie.c  586)   if (frameCnt > 0) {
BlinkenLib/BlinkenMovie.c  587)     BlinkenFrameSetDuration(pMovie->ppFrames[0], duration_begin);
BlinkenLib/BlinkenMovie.c  588)     BlinkenFrameSetDuration(pMovie->ppFrames[frameCnt - 1], duration_end);
BlinkenLib/BlinkenMovie.c  589)   }
BlinkenLib/BlinkenMovie.c  590) }
BlinkenLib/BlinkenMovie.c  591) 
Stefan Schuermans implement changing duration...

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenMovie.c  592) void BlinkenMovieAdaptDuration(stBlinkenMovie *pMovie,
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         593)                                int duration /* in ms */) {
Stefan Schuermans implement changing duration...

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenMovie.c  594)   int old_duration, old_curtime, curtime;
BlinkenLib/BlinkenMovie.c  595)   int i, old_dur, dur, old_end, end;
BlinkenLib/BlinkenMovie.c  596) 
BlinkenLib/BlinkenMovie.c  597)   // do nothing if no movie, empty movie or invalid duration
BlinkenLib/BlinkenMovie.c  598)   if (pMovie == NULL || pMovie->frameCnt < 1 || duration <= 0)
BlinkenLib/BlinkenMovie.c  599)     return;
BlinkenLib/BlinkenMovie.c  600) 
BlinkenLib/BlinkenMovie.c  601)   // get movie duration
BlinkenLib/BlinkenMovie.c  602)   old_duration = 0;
BlinkenLib/BlinkenMovie.c  603)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  604)     old_duration += BlinkenFrameGetDuration(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  605) 
BlinkenLib/BlinkenMovie.c  606)   // adapt duration of frames
BlinkenLib/BlinkenMovie.c  607)   old_curtime = 0;
BlinkenLib/BlinkenMovie.c  608)   curtime = 0;
BlinkenLib/BlinkenMovie.c  609)   for (i = 0; i < pMovie->frameCnt; i++) {
BlinkenLib/BlinkenMovie.c  610)     // get old end time of current frame
BlinkenLib/BlinkenMovie.c  611)     old_dur = BlinkenFrameGetDuration(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  612)     old_end = old_curtime + old_dur;
BlinkenLib/BlinkenMovie.c  613)     // compute new end time and new duration
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         614)     end =
src/BlinkenMovie.c         615)         (int)((double)old_end / (double)old_duration * (double)duration + 0.5);
Stefan Schuermans implement changing duration...

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenMovie.c  616)     dur = end - curtime;
BlinkenLib/BlinkenMovie.c  617)     if (dur < BlinkenDurationMin)
BlinkenLib/BlinkenMovie.c  618)       dur = BlinkenDurationMin;
BlinkenLib/BlinkenMovie.c  619)     if (dur > BlinkenDurationMax)
BlinkenLib/BlinkenMovie.c  620)       dur = BlinkenDurationMax;
BlinkenLib/BlinkenMovie.c  621)     // update frame duration
BlinkenLib/BlinkenMovie.c  622)     BlinkenFrameSetDuration(pMovie->ppFrames[i], dur);
BlinkenLib/BlinkenMovie.c  623)     // advance time
BlinkenLib/BlinkenMovie.c  624)     old_curtime += old_dur;
BlinkenLib/BlinkenMovie.c  625)     curtime += dur;
BlinkenLib/BlinkenMovie.c  626)   }
BlinkenLib/BlinkenMovie.c  627) }
BlinkenLib/BlinkenMovie.c  628) 
Stefan Schuermans implement adapting maximum...

Stefan Schuermans authored 5 years ago

BlinkenLib/BlinkenMovie.c  629) void BlinkenMovieAdaptMaxFrameDuration(stBlinkenMovie *pMovie,
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         630)                                        int maxDuration /* in ms */) {
Stefan Schuermans implement adapting maximum...

Stefan Schuermans authored 5 years ago

BlinkenLib/BlinkenMovie.c  631)   int i, j, cmp, dur, lastdur;
BlinkenLib/BlinkenMovie.c  632)   unsigned int extraFrames;
BlinkenLib/BlinkenMovie.c  633)   stBlinkenFrame **ppNewFrames;
BlinkenLib/BlinkenMovie.c  634)   stBlinkenFrame *pNewFrame;
BlinkenLib/BlinkenMovie.c  635) 
BlinkenLib/BlinkenMovie.c  636)   if (pMovie == NULL)
BlinkenLib/BlinkenMovie.c  637)     return;
BlinkenLib/BlinkenMovie.c  638)   if (maxDuration < BlinkenDurationMin) {
BlinkenLib/BlinkenMovie.c  639)     maxDuration = BlinkenDurationMin;
BlinkenLib/BlinkenMovie.c  640)   }
BlinkenLib/BlinkenMovie.c  641)   if (maxDuration > BlinkenDurationMax) {
BlinkenLib/BlinkenMovie.c  642)     maxDuration = BlinkenDurationMax;
BlinkenLib/BlinkenMovie.c  643)   }
BlinkenLib/BlinkenMovie.c  644) 
BlinkenLib/BlinkenMovie.c  645)   // compute how many extra frames are needed
BlinkenLib/BlinkenMovie.c  646)   extraFrames = 0;
BlinkenLib/BlinkenMovie.c  647)   for (i = 0; i < pMovie->frameCnt; i++) {
BlinkenLib/BlinkenMovie.c  648)     dur = BlinkenFrameGetDuration(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  649)     extraFrames += (dur + maxDuration - 1) / maxDuration - 1;
BlinkenLib/BlinkenMovie.c  650)   }
BlinkenLib/BlinkenMovie.c  651) 
BlinkenLib/BlinkenMovie.c  652)   // allocate new frame array
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         653)   ppNewFrames = (stBlinkenFrame **)BlinkenMalloc1D(
src/BlinkenMovie.c         654)       pMovie->frameCnt + extraFrames, sizeof(stBlinkenFrame *));
src/BlinkenMovie.c         655)   if (!ppNewFrames) {
Stefan Schuermans implement adapting maximum...

Stefan Schuermans authored 5 years ago

BlinkenLib/BlinkenMovie.c  656)     return;
BlinkenLib/BlinkenMovie.c  657)   }
BlinkenLib/BlinkenMovie.c  658) 
BlinkenLib/BlinkenMovie.c  659)   // merge/split frames in time
BlinkenLib/BlinkenMovie.c  660)   j = 0;
BlinkenLib/BlinkenMovie.c  661)   for (i = 0; i < pMovie->frameCnt; i++) {
BlinkenLib/BlinkenMovie.c  662)     // join frame with last one if equal
BlinkenLib/BlinkenMovie.c  663)     if (j > 0) {
BlinkenLib/BlinkenMovie.c  664)       cmp = BlinkenFrameCompare(pMovie->ppFrames[i], ppNewFrames[j - 1]);
BlinkenLib/BlinkenMovie.c  665)       if (cmp == 0) {
BlinkenLib/BlinkenMovie.c  666)         // frame equal to last one
BlinkenLib/BlinkenMovie.c  667)         dur = BlinkenFrameGetDuration(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  668)         lastdur = BlinkenFrameGetDuration(ppNewFrames[j - 1]);
BlinkenLib/BlinkenMovie.c  669)         if (lastdur + dur <= maxDuration) {
BlinkenLib/BlinkenMovie.c  670)           // merge frame completely
BlinkenLib/BlinkenMovie.c  671)           BlinkenFrameSetDuration(ppNewFrames[j - 1], lastdur + dur);
BlinkenLib/BlinkenMovie.c  672)           BlinkenFrameFree(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  673)           pMovie->ppFrames[i] = NULL;
BlinkenLib/BlinkenMovie.c  674)           continue; // frame completely merged
BlinkenLib/BlinkenMovie.c  675)         } else {
BlinkenLib/BlinkenMovie.c  676)           // move as much duration to previous frame
BlinkenLib/BlinkenMovie.c  677)           BlinkenFrameSetDuration(ppNewFrames[j - 1], maxDuration);
BlinkenLib/BlinkenMovie.c  678)           BlinkenFrameSetDuration(pMovie->ppFrames[i],
BlinkenLib/BlinkenMovie.c  679)                                   lastdur + dur - maxDuration);
BlinkenLib/BlinkenMovie.c  680)         }
BlinkenLib/BlinkenMovie.c  681)       }
BlinkenLib/BlinkenMovie.c  682)     }
BlinkenLib/BlinkenMovie.c  683)     // split frames longer than maxDuration
BlinkenLib/BlinkenMovie.c  684)     while (1) {
BlinkenLib/BlinkenMovie.c  685)       dur = BlinkenFrameGetDuration(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  686)       if (dur <= maxDuration) {
BlinkenLib/BlinkenMovie.c  687)         break;
BlinkenLib/BlinkenMovie.c  688)       }
BlinkenLib/BlinkenMovie.c  689)       pNewFrame = BlinkenFrameClone(pMovie->ppFrames[i]);
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         690)       if (!pNewFrame) {
Stefan Schuermans implement adapting maximum...

Stefan Schuermans authored 5 years ago

BlinkenLib/BlinkenMovie.c  691)         break;
BlinkenLib/BlinkenMovie.c  692)       }
BlinkenLib/BlinkenMovie.c  693)       // add new frame with max duration
BlinkenLib/BlinkenMovie.c  694)       BlinkenFrameSetDuration(pNewFrame, maxDuration);
BlinkenLib/BlinkenMovie.c  695)       ppNewFrames[j++] = pNewFrame;
BlinkenLib/BlinkenMovie.c  696)       // reduce duration of current frame
BlinkenLib/BlinkenMovie.c  697)       BlinkenFrameSetDuration(pMovie->ppFrames[i], dur - maxDuration);
BlinkenLib/BlinkenMovie.c  698)     } // while (1)
BlinkenLib/BlinkenMovie.c  699)     // overtake current frame
BlinkenLib/BlinkenMovie.c  700)     ppNewFrames[j++] = pMovie->ppFrames[i];
BlinkenLib/BlinkenMovie.c  701)     pMovie->ppFrames[i] = NULL;
BlinkenLib/BlinkenMovie.c  702)   } // for (i ...
BlinkenLib/BlinkenMovie.c  703) 
BlinkenLib/BlinkenMovie.c  704)   // use new frames array in movie
BlinkenLib/BlinkenMovie.c  705)   free(pMovie->ppFrames);
BlinkenLib/BlinkenMovie.c  706)   pMovie->ppFrames = ppNewFrames;
BlinkenLib/BlinkenMovie.c  707)   pMovie->frameCnt = j;
BlinkenLib/BlinkenMovie.c  708) }
BlinkenLib/BlinkenMovie.c  709) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  710) void BlinkenMovieResize(stBlinkenMovie *pMovie, int height, int width,
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         711)                         int channels, int maxval) {
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             712)   int i;
BlinkenMovie.c             713) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  714)   if (pMovie == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             715)     return;
BlinkenMovie.c             716) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  717)   if (height < BlinkenHeightMin)
BlinkenLib/BlinkenMovie.c  718)     height = BlinkenHeightMin;
BlinkenLib/BlinkenMovie.c  719)   if (height > BlinkenHeightMax)
BlinkenLib/BlinkenMovie.c  720)     height = BlinkenHeightMax;
BlinkenLib/BlinkenMovie.c  721)   if (width < BlinkenWidthMin)
BlinkenLib/BlinkenMovie.c  722)     width = BlinkenWidthMin;
BlinkenLib/BlinkenMovie.c  723)   if (width > BlinkenWidthMax)
BlinkenLib/BlinkenMovie.c  724)     width = BlinkenWidthMax;
BlinkenLib/BlinkenMovie.c  725)   if (channels < BlinkenChannelsMin)
BlinkenLib/BlinkenMovie.c  726)     channels = BlinkenChannelsMin;
BlinkenLib/BlinkenMovie.c  727)   if (channels > BlinkenChannelsMax)
BlinkenLib/BlinkenMovie.c  728)     channels = BlinkenMaxvalMax;
BlinkenLib/BlinkenMovie.c  729)   if (maxval < BlinkenMaxvalMin)
BlinkenLib/BlinkenMovie.c  730)     maxval = BlinkenMaxvalMin;
BlinkenLib/BlinkenMovie.c  731)   if (maxval > BlinkenMaxvalMax)
BlinkenLib/BlinkenMovie.c  732)     maxval = BlinkenMaxvalMax;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             733) 
BlinkenMovie.c             734)   pMovie->height = height;
BlinkenMovie.c             735)   pMovie->width = width;
BlinkenMovie.c             736)   pMovie->channels = channels;
BlinkenMovie.c             737)   pMovie->maxval = maxval;
BlinkenMovie.c             738) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  739)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  740)     BlinkenFrameResize(pMovie->ppFrames[i], height, width, channels, maxval);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             741) }
BlinkenMovie.c             742) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         743) void BlinkenMovieCrop(stBlinkenMovie *pMovie, int top, int left, int height,
src/BlinkenMovie.c         744)                       int width) {
Stefan Schuermans implement cropping movies

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenMovie.c  745)   int i;
BlinkenLib/BlinkenMovie.c  746) 
BlinkenLib/BlinkenMovie.c  747)   if (pMovie == NULL)
BlinkenLib/BlinkenMovie.c  748)     return;
BlinkenLib/BlinkenMovie.c  749) 
BlinkenLib/BlinkenMovie.c  750)   if (top < 0)
BlinkenLib/BlinkenMovie.c  751)     top = 0;
BlinkenLib/BlinkenMovie.c  752)   if (top > pMovie->height - BlinkenHeightMin)
BlinkenLib/BlinkenMovie.c  753)     top = pMovie->height - BlinkenHeightMin;
BlinkenLib/BlinkenMovie.c  754)   if (height < BlinkenHeightMin)
BlinkenLib/BlinkenMovie.c  755)     height = BlinkenHeightMin;
BlinkenLib/BlinkenMovie.c  756)   if (height > pMovie->height - top)
BlinkenLib/BlinkenMovie.c  757)     height = pMovie->height - top;
BlinkenLib/BlinkenMovie.c  758)   if (left < 0)
BlinkenLib/BlinkenMovie.c  759)     left = 0;
BlinkenLib/BlinkenMovie.c  760)   if (left > pMovie->width - BlinkenWidthMin)
BlinkenLib/BlinkenMovie.c  761)     left = pMovie->width - BlinkenWidthMin;
BlinkenLib/BlinkenMovie.c  762)   if (width < BlinkenWidthMin)
BlinkenLib/BlinkenMovie.c  763)     width = BlinkenWidthMin;
BlinkenLib/BlinkenMovie.c  764)   if (width > pMovie->width - left)
BlinkenLib/BlinkenMovie.c  765)     width = pMovie->width - left;
BlinkenLib/BlinkenMovie.c  766) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         767)   if (top == 0 && left == 0 && height == pMovie->height &&
src/BlinkenMovie.c         768)       width == pMovie->width)
Stefan Schuermans implement cropping movies

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenMovie.c  769)     return;
BlinkenLib/BlinkenMovie.c  770) 
BlinkenLib/BlinkenMovie.c  771)   pMovie->height = height;
BlinkenLib/BlinkenMovie.c  772)   pMovie->width = width;
BlinkenLib/BlinkenMovie.c  773) 
BlinkenLib/BlinkenMovie.c  774)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  775)     BlinkenFrameCrop(pMovie->ppFrames[i], top, left, height, width);
BlinkenLib/BlinkenMovie.c  776) }
BlinkenLib/BlinkenMovie.c  777) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         778) void BlinkenMovieScale(stBlinkenMovie *pMovie, int height, int width) {
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             779)   int i;
BlinkenMovie.c             780) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  781)   if (pMovie == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             782)     return;
BlinkenMovie.c             783) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  784)   if (height < BlinkenHeightMin)
BlinkenLib/BlinkenMovie.c  785)     height = BlinkenHeightMin;
BlinkenLib/BlinkenMovie.c  786)   if (height > BlinkenHeightMax)
BlinkenLib/BlinkenMovie.c  787)     height = BlinkenHeightMax;
BlinkenLib/BlinkenMovie.c  788)   if (width < BlinkenWidthMin)
BlinkenLib/BlinkenMovie.c  789)     width = BlinkenWidthMin;
BlinkenLib/BlinkenMovie.c  790)   if (width > BlinkenWidthMax)
BlinkenLib/BlinkenMovie.c  791)     width = BlinkenWidthMax;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             792) 
BlinkenMovie.c             793)   pMovie->height = height;
BlinkenMovie.c             794)   pMovie->width = width;
BlinkenMovie.c             795) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  796)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  797)     BlinkenFrameScale(pMovie->ppFrames[i], height, width);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             798) }
BlinkenMovie.c             799) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         800) void BlinkenMovieColorize(stBlinkenMovie *pMovie, int channels, int mode) {
Christian Heimke BlinkenLib v.0.5.3 (2007-12...

Christian Heimke authored 13 years ago

BlinkenMovie.c             801)   int i, step;
BlinkenMovie.c             802) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  803)   if (pMovie == NULL)
Christian Heimke BlinkenLib v.0.5.3 (2007-12...

Christian Heimke authored 13 years ago

BlinkenMovie.c             804)     return;
BlinkenMovie.c             805) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  806)   if (channels < BlinkenChannelsMin)
BlinkenLib/BlinkenMovie.c  807)     channels = BlinkenChannelsMin;
BlinkenLib/BlinkenMovie.c  808)   if (channels > BlinkenChannelsMax)
BlinkenLib/BlinkenMovie.c  809)     channels = BlinkenMaxvalMax;
Christian Heimke BlinkenLib v.0.5.3 (2007-12...

Christian Heimke authored 13 years ago

BlinkenMovie.c             810) 
BlinkenMovie.c             811)   pMovie->channels = channels;
BlinkenMovie.c             812)   pMovie->maxval = BlinkenMaxvalMax;
BlinkenMovie.c             813) 
BlinkenMovie.c             814)   step = 0;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  815)   for (i = 0; i < pMovie->frameCnt; i++) {
BlinkenLib/BlinkenMovie.c  816)     BlinkenFrameColorize(pMovie->ppFrames[i], channels, mode, step);
BlinkenLib/BlinkenMovie.c  817)     step += BlinkenFrameGetDuration(pMovie->ppFrames[i]);
Christian Heimke BlinkenLib v.0.5.3 (2007-12...

Christian Heimke authored 13 years ago

BlinkenMovie.c             818)   }
BlinkenMovie.c             819) }
BlinkenMovie.c             820) 
Stefan Schuermans implemented copying rectang...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  821) void BlinkenMovieCopyRect(stBlinkenMovie *pDest, int destY, int destX,
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         822)                           stBlinkenMovie *pSrc, int srcY, int srcX, int height,
src/BlinkenMovie.c         823)                           int width) {
Stefan Schuermans implemented copying rectang...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  824)   int dcnt, scnt, di, si, dest_dur, src_dur, src_time_ofs;
BlinkenLib/BlinkenMovie.c  825)   stBlinkenFrame *pFrame;
BlinkenLib/BlinkenMovie.c  826) 
BlinkenLib/BlinkenMovie.c  827)   if (pDest == NULL || pSrc == NULL)
BlinkenLib/BlinkenMovie.c  828)     return;
BlinkenLib/BlinkenMovie.c  829) 
BlinkenLib/BlinkenMovie.c  830)   // exit if both movies empty
BlinkenLib/BlinkenMovie.c  831)   dcnt = pDest->frameCnt;
BlinkenLib/BlinkenMovie.c  832)   scnt = pSrc->frameCnt;
BlinkenLib/BlinkenMovie.c  833)   if (dcnt == 0 || scnt == 0)
BlinkenLib/BlinkenMovie.c  834)     return;
BlinkenLib/BlinkenMovie.c  835) 
BlinkenLib/BlinkenMovie.c  836)   // go throuh all source frames
BlinkenLib/BlinkenMovie.c  837)   di = 0;
BlinkenLib/BlinkenMovie.c  838)   si = 0;
BlinkenLib/BlinkenMovie.c  839)   dest_dur = dcnt > 0 ? BlinkenFrameGetDuration(pDest->ppFrames[0]) : 0;
BlinkenLib/BlinkenMovie.c  840)   src_dur = scnt > 0 ? BlinkenFrameGetDuration(pSrc->ppFrames[0]) : 0;
BlinkenLib/BlinkenMovie.c  841)   src_time_ofs = 0;
BlinkenLib/BlinkenMovie.c  842)   while (si < scnt) {
BlinkenLib/BlinkenMovie.c  843) 
BlinkenLib/BlinkenMovie.c  844)     // make sure there is a frame in destination movie
BlinkenLib/BlinkenMovie.c  845)     if (di >= dcnt) {
BlinkenLib/BlinkenMovie.c  846)       // append new empty frame that last until end of source frame
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         847)       pFrame = BlinkenFrameNew(pDest->height, pDest->width, pDest->channels,
src/BlinkenMovie.c         848)                                pDest->maxval, src_dur - src_time_ofs);
Stefan Schuermans implemented copying rectang...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  849)       if (pFrame == NULL)
BlinkenLib/BlinkenMovie.c  850)         return;
BlinkenLib/BlinkenMovie.c  851)       BlinkenFrameClear(pFrame);
BlinkenLib/BlinkenMovie.c  852)       if (BlinkenMovieAppendFrame(pDest, pFrame) != 0)
BlinkenLib/BlinkenMovie.c  853)         return;
BlinkenLib/BlinkenMovie.c  854)       dcnt++;
BlinkenLib/BlinkenMovie.c  855)       dest_dur = src_dur - src_time_ofs;
BlinkenLib/BlinkenMovie.c  856)     }
BlinkenLib/BlinkenMovie.c  857) 
BlinkenLib/BlinkenMovie.c  858)     // make sure destination frame does not last longer than source frame
BlinkenLib/BlinkenMovie.c  859)     if (dest_dur > src_dur - src_time_ofs) {
BlinkenLib/BlinkenMovie.c  860)       // split destination frame into two
BlinkenLib/BlinkenMovie.c  861)       pFrame = BlinkenFrameClone(pDest->ppFrames[di]);
BlinkenLib/BlinkenMovie.c  862)       if (pFrame == NULL)
BlinkenLib/BlinkenMovie.c  863)         return;
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         864)       if (BlinkenMovieInsertFrame(pDest, di + 1, pFrame) != 0)
Stefan Schuermans implemented copying rectang...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  865)         return;
BlinkenLib/BlinkenMovie.c  866)       dcnt++;
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         867)       BlinkenFrameSetDuration(pDest->ppFrames[di], src_dur - src_time_ofs);
src/BlinkenMovie.c         868)       BlinkenFrameSetDuration(pDest->ppFrames[di + 1],
Stefan Schuermans implemented copying rectang...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  869)                               dest_dur - (src_dur - src_time_ofs));
BlinkenLib/BlinkenMovie.c  870)       dest_dur = src_dur - src_time_ofs;
BlinkenLib/BlinkenMovie.c  871)     }
BlinkenLib/BlinkenMovie.c  872) 
BlinkenLib/BlinkenMovie.c  873)     // copy from source frame to destination frame
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         874)     BlinkenFrameCopyRect(pDest->ppFrames[di], destY, destX, pSrc->ppFrames[si],
src/BlinkenMovie.c         875)                          srcY, srcX, height, width);
Stefan Schuermans implemented copying rectang...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  876)     src_time_ofs += dest_dur;
BlinkenLib/BlinkenMovie.c  877)     di++;
BlinkenLib/BlinkenMovie.c  878)     dest_dur = di < dcnt ? BlinkenFrameGetDuration(pDest->ppFrames[di]) : 0;
BlinkenLib/BlinkenMovie.c  879) 
BlinkenLib/BlinkenMovie.c  880)     // go to next source frame
BlinkenLib/BlinkenMovie.c  881)     if (src_time_ofs >= src_dur) {
BlinkenLib/BlinkenMovie.c  882)       si++;
BlinkenLib/BlinkenMovie.c  883)       src_dur = si < scnt ? BlinkenFrameGetDuration(pSrc->ppFrames[si]) : 0;
BlinkenLib/BlinkenMovie.c  884)       src_time_ofs = 0;
BlinkenLib/BlinkenMovie.c  885)     }
BlinkenLib/BlinkenMovie.c  886) 
BlinkenLib/BlinkenMovie.c  887)   } // while (si < scnt)
BlinkenLib/BlinkenMovie.c  888) }
BlinkenLib/BlinkenMovie.c  889) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         890) void BlinkenMovieRotateCw(stBlinkenMovie *pMovie) {
Stefan Schuermans implemented rotationg and m...

Stefan Schuermans authored 11 years ago

BlinkenLib/BlinkenMovie.c  891)   int tmp, i;
BlinkenLib/BlinkenMovie.c  892) 
BlinkenLib/BlinkenMovie.c  893)   if (pMovie == NULL)
BlinkenLib/BlinkenMovie.c  894)     return;
BlinkenLib/BlinkenMovie.c  895) 
BlinkenLib/BlinkenMovie.c  896)   tmp = pMovie->height;
BlinkenLib/BlinkenMovie.c  897)   pMovie->height = pMovie->width;
BlinkenLib/BlinkenMovie.c  898)   pMovie->width = tmp;
BlinkenLib/BlinkenMovie.c  899) 
BlinkenLib/BlinkenMovie.c  900)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  901)     BlinkenFrameRotateCw(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  902) }
BlinkenLib/BlinkenMovie.c  903) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         904) void BlinkenMovieRotateCcw(stBlinkenMovie *pMovie) {
Stefan Schuermans implemented rotationg and m...

Stefan Schuermans authored 11 years ago

BlinkenLib/BlinkenMovie.c  905)   int tmp, i;
BlinkenLib/BlinkenMovie.c  906) 
BlinkenLib/BlinkenMovie.c  907)   if (pMovie == NULL)
BlinkenLib/BlinkenMovie.c  908)     return;
BlinkenLib/BlinkenMovie.c  909) 
BlinkenLib/BlinkenMovie.c  910)   tmp = pMovie->height;
BlinkenLib/BlinkenMovie.c  911)   pMovie->height = pMovie->width;
BlinkenLib/BlinkenMovie.c  912)   pMovie->width = tmp;
BlinkenLib/BlinkenMovie.c  913) 
BlinkenLib/BlinkenMovie.c  914)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  915)     BlinkenFrameRotateCcw(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  916) }
BlinkenLib/BlinkenMovie.c  917) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         918) void BlinkenMovieRotateHalf(stBlinkenMovie *pMovie) {
Stefan Schuermans implemented rotationg and m...

Stefan Schuermans authored 11 years ago

BlinkenLib/BlinkenMovie.c  919)   int i;
BlinkenLib/BlinkenMovie.c  920) 
BlinkenLib/BlinkenMovie.c  921)   if (pMovie == NULL)
BlinkenLib/BlinkenMovie.c  922)     return;
BlinkenLib/BlinkenMovie.c  923) 
BlinkenLib/BlinkenMovie.c  924)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  925)     BlinkenFrameRotateHalf(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  926) }
BlinkenLib/BlinkenMovie.c  927) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         928) void BlinkenMovieMirrorHor(stBlinkenMovie *pMovie) {
Stefan Schuermans implemented rotationg and m...

Stefan Schuermans authored 11 years ago

BlinkenLib/BlinkenMovie.c  929)   int i;
BlinkenLib/BlinkenMovie.c  930) 
BlinkenLib/BlinkenMovie.c  931)   if (pMovie == NULL)
BlinkenLib/BlinkenMovie.c  932)     return;
BlinkenLib/BlinkenMovie.c  933) 
BlinkenLib/BlinkenMovie.c  934)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  935)     BlinkenFrameMirrorHor(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  936) }
BlinkenLib/BlinkenMovie.c  937) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         938) void BlinkenMovieMirrorVer(stBlinkenMovie *pMovie) {
Stefan Schuermans implemented rotationg and m...

Stefan Schuermans authored 11 years ago

BlinkenLib/BlinkenMovie.c  939)   int i;
BlinkenLib/BlinkenMovie.c  940) 
BlinkenLib/BlinkenMovie.c  941)   if (pMovie == NULL)
BlinkenLib/BlinkenMovie.c  942)     return;
BlinkenLib/BlinkenMovie.c  943) 
BlinkenLib/BlinkenMovie.c  944)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  945)     BlinkenFrameMirrorVer(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  946) }
BlinkenLib/BlinkenMovie.c  947) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         948) void BlinkenMovieMirrorDiag(stBlinkenMovie *pMovie) {
Stefan Schuermans implemented rotationg and m...

Stefan Schuermans authored 11 years ago

BlinkenLib/BlinkenMovie.c  949)   int tmp, i;
BlinkenLib/BlinkenMovie.c  950) 
BlinkenLib/BlinkenMovie.c  951)   if (pMovie == NULL)
BlinkenLib/BlinkenMovie.c  952)     return;
BlinkenLib/BlinkenMovie.c  953) 
BlinkenLib/BlinkenMovie.c  954)   tmp = pMovie->height;
BlinkenLib/BlinkenMovie.c  955)   pMovie->height = pMovie->width;
BlinkenLib/BlinkenMovie.c  956)   pMovie->width = tmp;
BlinkenLib/BlinkenMovie.c  957) 
BlinkenLib/BlinkenMovie.c  958)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  959)     BlinkenFrameMirrorDiag(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  960) }
BlinkenLib/BlinkenMovie.c  961) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         962) void BlinkenMovieMirrorDiag2(stBlinkenMovie *pMovie) {
Stefan Schuermans implemented rotationg and m...

Stefan Schuermans authored 11 years ago

BlinkenLib/BlinkenMovie.c  963)   int tmp, i;
BlinkenLib/BlinkenMovie.c  964) 
BlinkenLib/BlinkenMovie.c  965)   if (pMovie == NULL)
BlinkenLib/BlinkenMovie.c  966)     return;
BlinkenLib/BlinkenMovie.c  967) 
BlinkenLib/BlinkenMovie.c  968)   tmp = pMovie->height;
BlinkenLib/BlinkenMovie.c  969)   pMovie->height = pMovie->width;
BlinkenLib/BlinkenMovie.c  970)   pMovie->width = tmp;
BlinkenLib/BlinkenMovie.c  971) 
BlinkenLib/BlinkenMovie.c  972)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  973)     BlinkenFrameMirrorDiag2(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  974) }
BlinkenLib/BlinkenMovie.c  975) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         976) char *BlinkenMovieToString(stBlinkenMovie *pMovie) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  977)   char **strs, *str, *ptr;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             978)   int i, size;
BlinkenMovie.c             979) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  980)   if (pMovie == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             981)     return NULL;
BlinkenMovie.c             982) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  983)   strs = (char **)BlinkenMalloc1D(pMovie->frameCnt, sizeof(char *));
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  984)   if (strs == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             985)     return NULL;
BlinkenMovie.c             986) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  987)   for (i = 0; i < pMovie->frameCnt; i++) {
BlinkenLib/BlinkenMovie.c  988)     strs[i] = BlinkenFrameToString(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  989)     if (strs[i] == NULL) {
BlinkenLib/BlinkenMovie.c  990)       for (i--; i >= 0; i--)
BlinkenLib/BlinkenMovie.c  991)         free(strs[i]);
BlinkenLib/BlinkenMovie.c  992)       free(strs);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             993)       return NULL;
BlinkenMovie.c             994)     }
BlinkenMovie.c             995)   }
BlinkenMovie.c             996) 
BlinkenMovie.c             997)   size = 128;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  998)   for (i = 0; i < pMovie->infoCnt; i++)
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c         999)     size += strlen(pMovie->pppInfos[i][0]) + strlen(pMovie->pppInfos[i][1]) + 8;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1000)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c 1001)     size += strlen(strs[i]) + 32;
BlinkenLib/BlinkenMovie.c 1002) 
BlinkenLib/BlinkenMovie.c 1003)   str = (char *)malloc(size);
BlinkenLib/BlinkenMovie.c 1004)   if (str == NULL) {
BlinkenLib/BlinkenMovie.c 1005)     for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c 1006)       free(strs[i]);
BlinkenLib/BlinkenMovie.c 1007)     free(strs);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1008)     return NULL;
BlinkenMovie.c            1009)   }
BlinkenMovie.c            1010) 
BlinkenMovie.c            1011)   ptr = str;
BlinkenMovie.c            1012) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1013)   sprintf(ptr, "BlinkenMovie %ux%u-%u/%u\n", pMovie->width, pMovie->height,
BlinkenLib/BlinkenMovie.c 1014)           pMovie->channels, pMovie->maxval + 1);
BlinkenLib/BlinkenMovie.c 1015)   ptr += strlen(ptr);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1016) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1017)   for (i = 0; i < pMovie->infoCnt; i++) {
BlinkenLib/BlinkenMovie.c 1018)     sprintf(ptr, "%s = %s\n", pMovie->pppInfos[i][0], pMovie->pppInfos[i][1]);
BlinkenLib/BlinkenMovie.c 1019)     ptr += strlen(ptr);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1020)   }
BlinkenMovie.c            1021) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1022)   for (i = 0; i < pMovie->frameCnt; i++) {
BlinkenLib/BlinkenMovie.c 1023)     sprintf(ptr, "frame %u\n%s", i, strs[i]);
BlinkenLib/BlinkenMovie.c 1024)     ptr += strlen(ptr);
BlinkenLib/BlinkenMovie.c 1025)     free(strs[i]);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1026)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1027)   free(strs);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1028) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1029)   return str;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1030) }
BlinkenMovie.c            1031) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1032) stBlinkenMovie *BlinkenMovieLoadBlm(const char *pFilename) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1033)   FILE *pFile;
BlinkenLib/BlinkenMovie.c 1034)   stBlinkenMovie *pMovie;
BlinkenLib/BlinkenMovie.c 1035)   stBlinkenFrame *pFrame;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1036)   int width, height, y, x, chr, duration;
BlinkenMovie.c            1037)   char infoType[256], infoData[1024], pixel[2];
BlinkenMovie.c            1038) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1039)   if (pFilename == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1040)     return NULL;
BlinkenMovie.c            1041) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1042)   // open file
BlinkenLib/BlinkenMovie.c 1043)   pFile = fopen(pFilename, "rt");
BlinkenLib/BlinkenMovie.c 1044)   if (pFile == NULL)
Christian Heimke BlinkenLib v.0.2 (2005-01-27)

Christian Heimke authored 13 years ago

BlinkenMovie.c            1045)     return NULL;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1046) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1047)   // read magic and size
BlinkenLib/BlinkenMovie.c 1048)   if (fscanf(pFile, " # BlinkenLights Movie %ux%u", &width, &height) != 2) {
BlinkenLib/BlinkenMovie.c 1049)     fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1050)     return NULL;
BlinkenMovie.c            1051)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1052)   // allocate a new movie
BlinkenLib/BlinkenMovie.c 1053)   pMovie = BlinkenMovieNew(height, width, 1, 1);
BlinkenLib/BlinkenMovie.c 1054)   if (pMovie == NULL) {
BlinkenLib/BlinkenMovie.c 1055)     fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1056)     return NULL;
BlinkenMovie.c            1057)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1058)   // no frame yet
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1059)   pFrame = NULL;
BlinkenMovie.c            1060)   y = 0;
BlinkenMovie.c            1061) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1062)   // read frames
BlinkenLib/BlinkenMovie.c 1063)   while (!feof(pFile)) {
BlinkenLib/BlinkenMovie.c 1064)     // skip rest of previous line (including newline)
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1065)     while ((chr = fgetc(pFile)) != '\n' && chr != EOF)
src/BlinkenMovie.c        1066)       ;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1067) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1068)     // info line
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1069)     if (fscanf(pFile, " # %255[A-Za-z0-9] %*[=:] %1023[^\n]", infoType,
src/BlinkenMovie.c        1070)                infoData) == 2) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1071)       BlinkenMovieAppendInfo(pMovie, infoType, infoData);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1072)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1073)     // start of frame
BlinkenLib/BlinkenMovie.c 1074)     else if (fscanf(pFile, " @ %u", &duration) == 1) {
BlinkenLib/BlinkenMovie.c 1075)       // create new frame and append it to movie
BlinkenLib/BlinkenMovie.c 1076)       pFrame = BlinkenFrameNew(height, width, 1, 1, duration);
BlinkenLib/BlinkenMovie.c 1077)       if (pFrame != NULL) {
BlinkenLib/BlinkenMovie.c 1078)         BlinkenFrameClear(pFrame);
BlinkenLib/BlinkenMovie.c 1079)         if (BlinkenMovieAppendFrame(pMovie, pFrame) != 0) {
BlinkenLib/BlinkenMovie.c 1080)           BlinkenFrameFree(pFrame);
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

BlinkenMovie.c            1081)           pFrame = NULL;
BlinkenMovie.c            1082)         }
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1083)         y = 0;
BlinkenMovie.c            1084)       }
BlinkenMovie.c            1085)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1086)     // data line
BlinkenLib/BlinkenMovie.c 1087)     else if (fscanf(pFile, "%1[01]", pixel) == 1) {
BlinkenLib/BlinkenMovie.c 1088)       if (pFrame != NULL) {
BlinkenLib/BlinkenMovie.c 1089)         for (x = 0;; x++) {
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1090)           BlinkenFrameSetPixel(pFrame, y, x, 0,    // set pixel
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1091)                                (unsigned char)(pixel[0] == '1' ? 1 : 0));
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1092)           if (fscanf(pFile, "%1[01]", pixel) != 1) // read next pixel
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1093)             break;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1094)         }
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1095)         y++; // next row
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1096)       }
BlinkenMovie.c            1097)     }
BlinkenMovie.c            1098) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1099)   } // while( ! feof( pFile ) )
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1100) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1101)   // close file
BlinkenLib/BlinkenMovie.c 1102)   fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1103) 
BlinkenMovie.c            1104)   return pMovie;
BlinkenMovie.c            1105) }
BlinkenMovie.c            1106) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1107) stBlinkenMovie *BlinkenMovieLoadBmm(const char *pFilename) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1108)   FILE *pFile;
BlinkenLib/BlinkenMovie.c 1109)   stBlinkenMovie *pMovie;
BlinkenLib/BlinkenMovie.c 1110)   stBlinkenFrame *pFrame;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1111)   int width, height, y, x, chr, duration, val;
BlinkenMovie.c            1112)   char infoType[256], infoData[1024], pixel[8];
BlinkenMovie.c            1113) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1114)   if (pFilename == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1115)     return NULL;
BlinkenMovie.c            1116) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1117)   // open file
BlinkenLib/BlinkenMovie.c 1118)   pFile = fopen(pFilename, "rt");
BlinkenLib/BlinkenMovie.c 1119)   if (pFile == NULL)
Christian Heimke BlinkenLib v.0.2 (2005-01-27)

Christian Heimke authored 13 years ago

BlinkenMovie.c            1120)     return NULL;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1121) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1122)   // read magic and size
BlinkenLib/BlinkenMovie.c 1123)   if (fscanf(pFile, " # BlinkenMini Movie %ux%u", &width, &height) != 2) {
BlinkenLib/BlinkenMovie.c 1124)     fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1125)     return NULL;
BlinkenMovie.c            1126)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1127)   // allocate a new movie
BlinkenLib/BlinkenMovie.c 1128)   pMovie = BlinkenMovieNew(height, width, 1, 255);
BlinkenLib/BlinkenMovie.c 1129)   if (pMovie == NULL) {
BlinkenLib/BlinkenMovie.c 1130)     fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1131)     return NULL;
BlinkenMovie.c            1132)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1133)   // no frame yet
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1134)   pFrame = NULL;
BlinkenMovie.c            1135)   y = 0;
BlinkenMovie.c            1136) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1137)   // read frames
BlinkenLib/BlinkenMovie.c 1138)   while (!feof(pFile)) {
BlinkenLib/BlinkenMovie.c 1139)     // skip rest of previous line (including newline)
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1140)     while ((chr = fgetc(pFile)) != '\n' && chr != EOF)
src/BlinkenMovie.c        1141)       ;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1142) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1143)     // info line
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1144)     if (fscanf(pFile, " # %255[A-Za-z0-9] %*[=:] %1023[^\n]", infoType,
src/BlinkenMovie.c        1145)                infoData) == 2) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1146)       BlinkenMovieAppendInfo(pMovie, infoType, infoData);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1147)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1148)     // start of frame
BlinkenLib/BlinkenMovie.c 1149)     else if (fscanf(pFile, " @ %u", &duration) == 1) {
BlinkenLib/BlinkenMovie.c 1150)       // create new frame and append it to movie
BlinkenLib/BlinkenMovie.c 1151)       pFrame = BlinkenFrameNew(height, width, 1, 255, duration);
BlinkenLib/BlinkenMovie.c 1152)       if (pFrame != NULL) {
BlinkenLib/BlinkenMovie.c 1153)         BlinkenFrameClear(pFrame);
BlinkenLib/BlinkenMovie.c 1154)         if (BlinkenMovieAppendFrame(pMovie, pFrame) != 0) {
BlinkenLib/BlinkenMovie.c 1155)           BlinkenFrameFree(pFrame);
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

BlinkenMovie.c            1156)           pFrame = NULL;
BlinkenMovie.c            1157)         }
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1158)         y = 0;
BlinkenMovie.c            1159)       }
BlinkenMovie.c            1160)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1161)     // data line
BlinkenLib/BlinkenMovie.c 1162)     else if (fscanf(pFile, "%7[0-9A-FXa-fx]", pixel) == 1) {
BlinkenLib/BlinkenMovie.c 1163)       if (pFrame != NULL) {
BlinkenLib/BlinkenMovie.c 1164)         for (x = 0;; x++) {
BlinkenLib/BlinkenMovie.c 1165)           if (sscanf(pixel, "%i", &val) != 1)   // convert pixel to number
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1166)             break;
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1167)           BlinkenFrameSetPixel(pFrame, y, x, 0, // set pixel
BlinkenLib/BlinkenMovie.c 1168)                                (unsigned char)val);
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1169)           if (fscanf(pFile, "%*[ \t]") != 0)    // kill space
Stefan Schuermans fixes for gcc 5.4

Stefan Schuermans authored 8 years ago

BlinkenLib/BlinkenMovie.c 1170)             break;
BlinkenLib/BlinkenMovie.c 1171)           if (fscanf(pFile, "%7[0-9A-FXa-fx]", pixel) != 1) // read next pixel
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1172)             break;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1173)         }
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1174)         y++; // next row
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1175)       }
BlinkenMovie.c            1176)     }
BlinkenMovie.c            1177) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1178)   } // while( ! feof( pFile ) )
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1179) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1180)   // close file
BlinkenLib/BlinkenMovie.c 1181)   fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1182) 
BlinkenMovie.c            1183)   return pMovie;
BlinkenMovie.c            1184) }
BlinkenMovie.c            1185) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1186) stBlinkenMovie *BlinkenMovieLoadBml(const char *pFilename) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1187)   FILE *pFile;
BlinkenLib/BlinkenMovie.c 1188)   stBlinkenMovie *pMovie;
BlinkenLib/BlinkenMovie.c 1189)   stBlinkenFrame *pFrame;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1190)   int width, height, channels, bits, maxval, chrs, y, x, c, duration, val;
Stefan Schuermans adapt to newer compiler wit...

Stefan Schuermans authored 5 years ago

src/BlinkenMovie.c        1191)   char buffer[2048], infoType[256], infoData[1024], pixelFormat[24], pixel[8],
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1192)       *ptr, chr;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1193) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1194)   if (pFilename == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1195)     return NULL;
BlinkenMovie.c            1196) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1197)   // open file
BlinkenLib/BlinkenMovie.c 1198)   pFile = fopen(pFilename, "rt");
BlinkenLib/BlinkenMovie.c 1199)   if (pFile == NULL)
Christian Heimke BlinkenLib v.0.2 (2005-01-27)

Christian Heimke authored 13 years ago

BlinkenMovie.c            1200)     return NULL;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1201) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1202)   // no movie yet - blm tag not yet found
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1203)   pMovie = NULL;
BlinkenMovie.c            1204) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1205)   // no frame yet
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1206)   pFrame = NULL;
BlinkenMovie.c            1207)   y = 0;
BlinkenMovie.c            1208) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1209)   // read tags
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1210)   maxval = 0;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1211)   while (!feof(pFile)) {
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1212) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1213)     // skip to just before beginning of next tag
Stefan Schuermans fixes for gcc 5.4

Stefan Schuermans authored 8 years ago

BlinkenLib/BlinkenMovie.c 1214)     if (fscanf(pFile, "%*[^<]") != 0)
BlinkenLib/BlinkenMovie.c 1215)       // end loop (error)
BlinkenLib/BlinkenMovie.c 1216)       break;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1217)     // skip beginning character of next tag
BlinkenLib/BlinkenMovie.c 1218)     if (fgetc(pFile) != '<')
BlinkenLib/BlinkenMovie.c 1219)       // end loop (no more tags)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1220)       break;
BlinkenMovie.c            1221) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1222)     // no blm tag yet
BlinkenLib/BlinkenMovie.c 1223)     if (pMovie == NULL) {
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1224) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1225)       // blm tag
BlinkenLib/BlinkenMovie.c 1226)       if (fscanf(pFile, "blm%2047[^>]", buffer) == 1) {
BlinkenLib/BlinkenMovie.c 1227)         // get attributes
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1228)         width = 0;
BlinkenMovie.c            1229)         height = 0;
Christian Heimke BlinkenLib v.0.3.1 (2005-03...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1230)         channels = 1;
BlinkenMovie.c            1231)         bits = 4;
BlinkenMovie.c            1232)         maxval = 15;
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1233)         if ((ptr = strstr(buffer, "height=\"")) != NULL)   // height
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1234)           sscanf(ptr + 8, "%u", &height);
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1235)         if ((ptr = strstr(buffer, "width=\"")) != NULL)    // width
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1236)           sscanf(ptr + 7, "%u", &width);
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1237)         if ((ptr = strstr(buffer, "channels=\"")) != NULL) // channels
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1238)           sscanf(ptr + 10, "%u", &channels);
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1239)         if ((ptr = strstr(buffer, "bits=\"")) != NULL)     // bits
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1240)           sscanf(ptr + 6, "%u", &bits);
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1241)         maxval = (1 << bits) - 1;                          // maxval
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1242) 
BlinkenLib/BlinkenMovie.c 1243)         // allocate a new movie
BlinkenLib/BlinkenMovie.c 1244)         pMovie = BlinkenMovieNew(height, width, channels, maxval);
BlinkenLib/BlinkenMovie.c 1245)         if (pMovie == NULL) {
BlinkenLib/BlinkenMovie.c 1246)           fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1247)           return NULL;
BlinkenMovie.c            1248)         }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1249)         // get number of characters per channel
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1250)         chrs = (bits + 3) >> 2;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1251)         // get fscanf formart string for reading a pixel
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1252)         //   read max 5 chars (2 already in use by prefix)
BlinkenLib/BlinkenMovie.c 1253)         sprintf(pixelFormat, "%%%d[0-9A-Fa-f]", chrs > 4 ? 5 : chrs);
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1254)         // initialize pixel buffer with hex prefix
BlinkenLib/BlinkenMovie.c 1255)         strcpy(pixel, "0x");
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1256)       }
BlinkenMovie.c            1257) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1258)     } // if( pMovie == NULL )
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1259) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1260)     // blm tag was already found
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1261)     else // if( pMovie == NULL )
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1262)     {
BlinkenMovie.c            1263) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1264)       // title tag
BlinkenLib/BlinkenMovie.c 1265)       if (fscanf(pFile, "title>%2047[^<]", buffer) == 1) {
BlinkenLib/BlinkenMovie.c 1266)         // add info to movie
BlinkenLib/BlinkenMovie.c 1267)         BlinkenMovieAppendInfo(pMovie, "title", buffer);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1268)       }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1269)       // description tag
BlinkenLib/BlinkenMovie.c 1270)       else if (fscanf(pFile, "description>%2047[^<]", buffer) == 1) {
BlinkenLib/BlinkenMovie.c 1271)         // check if generic info
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1272)         if (sscanf(buffer, "%255[A-Za-z0-9] %*[=:] %1023[^\n]", infoType,
src/BlinkenMovie.c        1273)                    infoData) == 2)
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1274)           // add info to movie
BlinkenLib/BlinkenMovie.c 1275)           BlinkenMovieAppendInfo(pMovie, infoType, infoData);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1276)         else
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1277)           // add info to movie
BlinkenLib/BlinkenMovie.c 1278)           BlinkenMovieAppendInfo(pMovie, "description", buffer);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1279)       }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1280)       // creator tag
BlinkenLib/BlinkenMovie.c 1281)       else if (fscanf(pFile, "creator>%2047[^<]", buffer) == 1) {
BlinkenLib/BlinkenMovie.c 1282)         // add info to movie
BlinkenLib/BlinkenMovie.c 1283)         BlinkenMovieAppendInfo(pMovie, "creator", buffer);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1284)       }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1285)       // author tag
BlinkenLib/BlinkenMovie.c 1286)       else if (fscanf(pFile, "author>%2047[^<]", buffer) == 1) {
BlinkenLib/BlinkenMovie.c 1287)         // add info to movie
BlinkenLib/BlinkenMovie.c 1288)         BlinkenMovieAppendInfo(pMovie, "author", buffer);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1289)       }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1290)       // email tag
BlinkenLib/BlinkenMovie.c 1291)       else if (fscanf(pFile, "email>%2047[^<]", buffer) == 1) {
BlinkenLib/BlinkenMovie.c 1292)         // add info to movie
BlinkenLib/BlinkenMovie.c 1293)         BlinkenMovieAppendInfo(pMovie, "email", buffer);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1294)       }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1295)       // url tag
BlinkenLib/BlinkenMovie.c 1296)       else if (fscanf(pFile, "url>%2047[^<]", buffer) == 1) {
BlinkenLib/BlinkenMovie.c 1297)         // add info to movie
BlinkenLib/BlinkenMovie.c 1298)         BlinkenMovieAppendInfo(pMovie, "url", buffer);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1299)       }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1300)       // frame tag
BlinkenLib/BlinkenMovie.c 1301)       else if (fscanf(pFile, "frame%2047[^>]", buffer) == 1) {
BlinkenLib/BlinkenMovie.c 1302)         // get attributes
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1303)         duration = 0;
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1304)         if ((ptr = strstr(buffer, "duration=\"")) != NULL) // duration
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1305)           sscanf(ptr + 10, "%u", &duration);
BlinkenLib/BlinkenMovie.c 1306)         // create new frame and append it to movie
BlinkenLib/BlinkenMovie.c 1307)         pFrame = BlinkenFrameNew(height, width, channels, maxval, duration);
BlinkenLib/BlinkenMovie.c 1308)         if (pFrame != NULL) {
BlinkenLib/BlinkenMovie.c 1309)           BlinkenFrameClear(pFrame);
BlinkenLib/BlinkenMovie.c 1310)           if (BlinkenMovieAppendFrame(pMovie, pFrame) != 0) {
BlinkenLib/BlinkenMovie.c 1311)             BlinkenFrameFree(pFrame);
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

BlinkenMovie.c            1312)             pFrame = NULL;
BlinkenMovie.c            1313)           }
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1314)           y = 0;
BlinkenMovie.c            1315)         }
BlinkenMovie.c            1316)       }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1317)       // row tag
BlinkenLib/BlinkenMovie.c 1318)       else if (fscanf(pFile, "row%c", &chr) == 1 && chr == '>') {
BlinkenLib/BlinkenMovie.c 1319)         if (pFrame != NULL) {
BlinkenLib/BlinkenMovie.c 1320)           // parse row
BlinkenLib/BlinkenMovie.c 1321)           for (x = 0; x < width; x++) {
BlinkenLib/BlinkenMovie.c 1322)             for (c = 0; c < channels; c++) {
BlinkenLib/BlinkenMovie.c 1323)               // read next pixel (one channel of pixel)
BlinkenLib/BlinkenMovie.c 1324)               if (fscanf(pFile, pixelFormat, pixel + 2) != 1) {
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1325)                 x = width; // also terminate x loop
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1326)                 break;
BlinkenMovie.c            1327)               }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1328)               // convert pixel (one channel of pixel) to number
BlinkenLib/BlinkenMovie.c 1329)               if (sscanf(pixel, "%i", &val) != 1) {
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1330)                 x = width; // also terminate x loop
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1331)                 break;
BlinkenMovie.c            1332)               }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1333)               // set pixel (one channel of pixel)
BlinkenLib/BlinkenMovie.c 1334)               BlinkenFrameSetPixel(pFrame, y, x, c, (unsigned char)val);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1335)             }
BlinkenMovie.c            1336)           }
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1337)           y++; // next row
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1338)         }
BlinkenMovie.c            1339)       }
BlinkenMovie.c            1340) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1341)     } // if( pMovie == NULL ) ... else
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1342) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1343)   }   // while( ! feof( pFile ) )
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1344) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1345)   // close file
BlinkenLib/BlinkenMovie.c 1346)   fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1347) 
BlinkenMovie.c            1348)   return pMovie;
BlinkenMovie.c            1349) }
BlinkenMovie.c            1350) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1351) stBlinkenMovie *BlinkenMovieLoadBbm(const char *pFilename) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1352)   FILE *pFile;
BlinkenLib/BlinkenMovie.c 1353)   stBlinkenMovie *pMovie;
BlinkenLib/BlinkenMovie.c 1354)   stBlinkenFrame *pFrame;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1355)   unsigned char header[24], subHeader[6], frameStartMarker[4];
Stefan Schuermans implemented rotationg and m...

Stefan Schuermans authored 11 years ago

BlinkenLib/BlinkenMovie.c 1356)   unsigned long headerMagic, headerFramePtr;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1357)   unsigned short headerHeight, headerWidth, headerChannels, headerMaxval;
BlinkenMovie.c            1358)   unsigned long subHeaderMagic, frameStartMarkerMagic;
BlinkenMovie.c            1359)   unsigned short subHeaderSize;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1360)   char *pInfoHeader, *pInfoHeaderX;
BlinkenLib/BlinkenMovie.c 1361)   unsigned char *pFrameData;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1362)   int len, duration, y, x, c, i;
BlinkenMovie.c            1363) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1364)   if (pFilename == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1365)     return NULL;
BlinkenMovie.c            1366) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1367)   // open file
BlinkenLib/BlinkenMovie.c 1368)   pFile = fopen(pFilename, "rb");
BlinkenLib/BlinkenMovie.c 1369)   if (pFile == NULL)
Christian Heimke BlinkenLib v.0.2 (2005-01-27)

Christian Heimke authored 13 years ago

BlinkenMovie.c            1370)     return NULL;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1371) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1372)   // read header
BlinkenLib/BlinkenMovie.c 1373)   if (fread(header, 1, 24, pFile) != 24) {
BlinkenLib/BlinkenMovie.c 1374)     fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1375)     return NULL;
BlinkenMovie.c            1376)   }
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1377)   headerMagic = (unsigned long)header[0] << 24 |
src/BlinkenMovie.c        1378)                 (unsigned long)header[1] << 16 | (unsigned long)header[2] << 8 |
src/BlinkenMovie.c        1379)                 (unsigned long)header[3];
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1380)   headerHeight = (unsigned short)header[4] << 8 | (unsigned short)header[5];
BlinkenMovie.c            1381)   headerWidth = (unsigned short)header[6] << 8 | (unsigned short)header[7];
BlinkenMovie.c            1382)   headerChannels = (unsigned short)header[8] << 8 | (unsigned short)header[9];
BlinkenMovie.c            1383)   headerMaxval = (unsigned short)header[10] << 8 | (unsigned short)header[11];
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1384)   headerFramePtr = (unsigned long)header[20] << 24 |
src/BlinkenMovie.c        1385)                    (unsigned long)header[21] << 16 |
src/BlinkenMovie.c        1386)                    (unsigned long)header[22] << 8 | (unsigned long)header[23];
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1387)   // check magic
BlinkenLib/BlinkenMovie.c 1388)   if (headerMagic != 0x23542666) {
BlinkenLib/BlinkenMovie.c 1389)     fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1390)     return NULL;
BlinkenMovie.c            1391)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1392)   // allocate a new movie
BlinkenLib/BlinkenMovie.c 1393)   pMovie =
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1394)       BlinkenMovieNew(headerHeight, headerWidth, headerChannels, headerMaxval);
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1395)   if (pMovie == NULL) {
BlinkenLib/BlinkenMovie.c 1396)     fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1397)     return NULL;
BlinkenMovie.c            1398)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1399)   // read subheaders
BlinkenLib/BlinkenMovie.c 1400)   while (ftell(pFile) + 6 <= (long)headerFramePtr) {
BlinkenLib/BlinkenMovie.c 1401)     if (fread(subHeader, 1, 6, pFile) != 6) {
BlinkenLib/BlinkenMovie.c 1402)       BlinkenMovieFree(pMovie);
BlinkenLib/BlinkenMovie.c 1403)       fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1404)       return NULL;
BlinkenMovie.c            1405)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1406)     subHeaderMagic =
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1407)         (unsigned long)subHeader[0] << 24 | (unsigned long)subHeader[1] << 16 |
src/BlinkenMovie.c        1408)         (unsigned long)subHeader[2] << 8 | (unsigned long)subHeader[3];
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1409)     subHeaderSize =
BlinkenLib/BlinkenMovie.c 1410)         (unsigned short)subHeader[4] << 8 | (unsigned short)subHeader[5];
BlinkenLib/BlinkenMovie.c 1411) 
BlinkenLib/BlinkenMovie.c 1412)     // header fits into gap to frame start
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1413)     if (subHeaderSize >= 6 &&
src/BlinkenMovie.c        1414)         ftell(pFile) + subHeaderSize - 6 <= (long)headerFramePtr) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1415)       // info header
BlinkenLib/BlinkenMovie.c 1416)       if (subHeaderMagic == 0x696E666F) // 'i' 'n' 'f' 'o'
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1417)       {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1418)         // read rest of info header
BlinkenLib/BlinkenMovie.c 1419)         pInfoHeader = (char *)malloc(subHeaderSize - 6);
BlinkenLib/BlinkenMovie.c 1420)         if (pInfoHeader == NULL) {
BlinkenLib/BlinkenMovie.c 1421)           BlinkenMovieFree(pMovie);
BlinkenLib/BlinkenMovie.c 1422)           fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1423)           return NULL;
BlinkenMovie.c            1424)         }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1425)         if (fread(pInfoHeader, 1, subHeaderSize - 6, pFile) !=
BlinkenLib/BlinkenMovie.c 1426)             (unsigned short)(subHeaderSize - 6)) {
BlinkenLib/BlinkenMovie.c 1427)           free(pInfoHeader);
BlinkenLib/BlinkenMovie.c 1428)           BlinkenMovieFree(pMovie);
BlinkenLib/BlinkenMovie.c 1429)           fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1430)           return NULL;
BlinkenMovie.c            1431)         }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1432)         // parse information
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1433)         if ((pInfoHeaderX = memchr(pInfoHeader, 0, subHeaderSize - 6)) !=
src/BlinkenMovie.c        1434)             NULL) {
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1435)           pInfoHeaderX++;
BlinkenMovie.c            1436)           len = pInfoHeaderX - pInfoHeader;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1437)           if (memchr(pInfoHeaderX, 0, subHeaderSize - 6 - len) != NULL)
BlinkenLib/BlinkenMovie.c 1438)             BlinkenMovieAppendInfo(pMovie, pInfoHeader, pInfoHeaderX);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1439)         }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1440)         free(pInfoHeader);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1441)       }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1442)       // unknown subHeader
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1443)       else
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1444)         // skip
BlinkenLib/BlinkenMovie.c 1445)         fseek(pFile, subHeaderSize - 6, SEEK_CUR);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1446) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1447)     } // if( ftell( pFile ) ...
src/BlinkenMovie.c        1448)   }   // while( ftell( pFile ) ...
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1449) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1450)   // seek to start of frames
BlinkenLib/BlinkenMovie.c 1451)   fseek(pFile, headerFramePtr, SEEK_SET);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1452) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1453)   // read frame start marker
BlinkenLib/BlinkenMovie.c 1454)   if (fread(frameStartMarker, 1, 4, pFile) != 4) {
BlinkenLib/BlinkenMovie.c 1455)     BlinkenMovieFree(pMovie);
BlinkenLib/BlinkenMovie.c 1456)     fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1457)     return NULL;
BlinkenMovie.c            1458)   }
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1459)   frameStartMarkerMagic = (unsigned long)frameStartMarker[0] << 24 |
src/BlinkenMovie.c        1460)                           (unsigned long)frameStartMarker[1] << 16 |
src/BlinkenMovie.c        1461)                           (unsigned long)frameStartMarker[2] << 8 |
src/BlinkenMovie.c        1462)                           (unsigned long)frameStartMarker[3];
src/BlinkenMovie.c        1463)   if (frameStartMarkerMagic != 0x66726D73) // 'f' 'r' 'm' 's'
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1464)   {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1465)     BlinkenMovieFree(pMovie);
BlinkenLib/BlinkenMovie.c 1466)     fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1467)     return NULL;
BlinkenMovie.c            1468)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1469)   // allocate buffer for frame data
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1470)   len = 2 + headerHeight * headerWidth * headerChannels;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1471)   pFrameData = (unsigned char *)malloc(len);
BlinkenLib/BlinkenMovie.c 1472)   if (pFrameData == NULL) {
BlinkenLib/BlinkenMovie.c 1473)     BlinkenMovieFree(pMovie);
BlinkenLib/BlinkenMovie.c 1474)     fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1475)     return NULL;
BlinkenMovie.c            1476)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1477)   // read frames
BlinkenLib/BlinkenMovie.c 1478)   for (;;) {
BlinkenLib/BlinkenMovie.c 1479)     // read frame
BlinkenLib/BlinkenMovie.c 1480)     if (fread(pFrameData, 1, len, pFile) != (unsigned int)len)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1481)       break;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1482)     duration =
BlinkenLib/BlinkenMovie.c 1483)         (unsigned short)pFrameData[0] << 8 | (unsigned short)pFrameData[1];
BlinkenLib/BlinkenMovie.c 1484)     // build frame and append it to movie
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1485)     pFrame = BlinkenFrameNew(headerHeight, headerWidth, headerChannels,
src/BlinkenMovie.c        1486)                              headerMaxval, duration);
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1487)     if (pFrame == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1488)       break;
BlinkenMovie.c            1489)     i = 2;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1490)     for (y = 0; y < headerHeight; y++)
BlinkenLib/BlinkenMovie.c 1491)       for (x = 0; x < headerWidth; x++)
BlinkenLib/BlinkenMovie.c 1492)         for (c = 0; c < headerChannels; c++, i++)
BlinkenLib/BlinkenMovie.c 1493)           BlinkenFrameSetPixel(pFrame, y, x, c, pFrameData[i]);
BlinkenLib/BlinkenMovie.c 1494)     if (BlinkenMovieAppendFrame(pMovie, pFrame) != 0) {
BlinkenLib/BlinkenMovie.c 1495)       BlinkenFrameFree(pFrame);
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

BlinkenMovie.c            1496)       pFrame = NULL;
BlinkenMovie.c            1497)     }
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1498) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1499)   } // for( ; ; )
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1500) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1501)   // free buffer for frame data
BlinkenLib/BlinkenMovie.c 1502)   free(pFrameData);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1503) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1504)   // close file
BlinkenLib/BlinkenMovie.c 1505)   fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1506) 
BlinkenMovie.c            1507)   return pMovie;
BlinkenMovie.c            1508) }
BlinkenMovie.c            1509) 
Christian Heimke BlinkenLib v.0.6.0 (2008-05...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c 1510) #ifdef BLINKENLIB_CFG_MNG
BlinkenLib/BlinkenMovie.c 1511) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1512) stBlinkenMovie *BlinkenMovieLoadMng(const char *pFilename) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1513)   return BlinkenMngLoad(pFilename);
Christian Heimke BlinkenLib v.0.6.0 (2008-05...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c 1514) }
BlinkenLib/BlinkenMovie.c 1515) 
BlinkenLib/BlinkenMovie.c 1516) #endif // #ifdef BLINKENLIB_CFG_MNG
BlinkenLib/BlinkenMovie.c 1517) 
Stefan Schuermans implement reading GIFs

Stefan Schuermans authored 7 years ago

BlinkenLib/BlinkenMovie.c 1518) #ifdef BLINKENLIB_CFG_GIF
BlinkenLib/BlinkenMovie.c 1519) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1520) stBlinkenMovie *BlinkenMovieLoadGif(const char *pFilename) {
Stefan Schuermans implement reading GIFs

Stefan Schuermans authored 7 years ago

BlinkenLib/BlinkenMovie.c 1521)   return BlinkenGifLoad(pFilename);
BlinkenLib/BlinkenMovie.c 1522) }
BlinkenLib/BlinkenMovie.c 1523) 
BlinkenLib/BlinkenMovie.c 1524) #endif // #ifdef BLINKENLIB_CFG_GIF
BlinkenLib/BlinkenMovie.c 1525) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1526) stBlinkenMovie *BlinkenMovieLoad(const char *pFilename) {
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1527)   int len;
BlinkenMovie.c            1528) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1529)   if (pFilename == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1530)     return NULL;
BlinkenMovie.c            1531) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1532)   len = strlen(pFilename);
BlinkenLib/BlinkenMovie.c 1533)   if (len > 4 && strcmp(pFilename + len - 4, ".blm") == 0)
BlinkenLib/BlinkenMovie.c 1534)     return BlinkenMovieLoadBlm(pFilename);
BlinkenLib/BlinkenMovie.c 1535)   if (len > 4 && strcmp(pFilename + len - 4, ".bmm") == 0)
BlinkenLib/BlinkenMovie.c 1536)     return BlinkenMovieLoadBmm(pFilename);
BlinkenLib/BlinkenMovie.c 1537)   if (len > 4 && strcmp(pFilename + len - 4, ".bml") == 0)
BlinkenLib/BlinkenMovie.c 1538)     return BlinkenMovieLoadBml(pFilename);
BlinkenLib/BlinkenMovie.c 1539)   if (len > 4 && strcmp(pFilename + len - 4, ".bbm") == 0)
BlinkenLib/BlinkenMovie.c 1540)     return BlinkenMovieLoadBbm(pFilename);
Christian Heimke BlinkenLib v.0.6.0 (2008-05...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c 1541) #ifdef BLINKENLIB_CFG_MNG
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1542)   if (len > 4 && strcmp(pFilename + len - 4, ".mng") == 0)
BlinkenLib/BlinkenMovie.c 1543)     return BlinkenMovieLoadMng(pFilename);
Christian Heimke BlinkenLib v.0.6.0 (2008-05...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c 1544) #endif // #ifdef BLINKENLIB_CFG_MNG
Stefan Schuermans implement reading GIFs

Stefan Schuermans authored 7 years ago

BlinkenLib/BlinkenMovie.c 1545) #ifdef BLINKENLIB_CFG_GIF
BlinkenLib/BlinkenMovie.c 1546)   if (len > 4 && strcmp(pFilename + len - 4, ".gif") == 0)
BlinkenLib/BlinkenMovie.c 1547)     return BlinkenMovieLoadGif(pFilename);
BlinkenLib/BlinkenMovie.c 1548) #endif // #ifdef BLINKENLIB_CFG_GIF
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1549)   return NULL;
BlinkenMovie.c            1550) }
BlinkenMovie.c            1551) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1552) int BlinkenMovieSaveBlm(stBlinkenMovie *pMovie, const char *pFilename) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1553)   stBlinkenMovie *pOutMovie;
BlinkenLib/BlinkenMovie.c 1554)   FILE *pFile;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1555)   int i, y, x;
BlinkenMovie.c            1556) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1557)   if (pMovie == NULL || pFilename == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1558)     return -1;
BlinkenMovie.c            1559) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1560)   // convert movie to suitable format
BlinkenLib/BlinkenMovie.c 1561)   pOutMovie = BlinkenMovieClone(pMovie);
BlinkenLib/BlinkenMovie.c 1562)   if (pOutMovie == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1563)     return -1;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1564)   BlinkenMovieResize(pOutMovie, pOutMovie->height, pOutMovie->width, 1, 1);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1565) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1566)   // open file
BlinkenLib/BlinkenMovie.c 1567)   pFile = fopen(pFilename, "wt");
BlinkenLib/BlinkenMovie.c 1568)   if (pFile == NULL) {
BlinkenLib/BlinkenMovie.c 1569)     BlinkenMovieFree(pOutMovie);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1570)     return -1;
BlinkenMovie.c            1571)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1572)   // write header line
BlinkenLib/BlinkenMovie.c 1573)   fprintf(pFile, "# BlinkenLights Movie %ux%u\n", pOutMovie->width,
BlinkenLib/BlinkenMovie.c 1574)           pOutMovie->height);
BlinkenLib/BlinkenMovie.c 1575) 
BlinkenLib/BlinkenMovie.c 1576)   // write information lines
BlinkenLib/BlinkenMovie.c 1577)   for (i = 0; i < pOutMovie->infoCnt; i++)
BlinkenLib/BlinkenMovie.c 1578)     fprintf(pFile, "# %s = %s\n", pOutMovie->pppInfos[i][0],
BlinkenLib/BlinkenMovie.c 1579)             pOutMovie->pppInfos[i][1]);
BlinkenLib/BlinkenMovie.c 1580) 
BlinkenLib/BlinkenMovie.c 1581)   // write frames
BlinkenLib/BlinkenMovie.c 1582)   for (i = 0; i < pOutMovie->frameCnt; i++) {
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1583)     fprintf(pFile, "\n@%u\n", BlinkenFrameGetDuration(pOutMovie->ppFrames[i]));
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1584)     for (y = 0; y < pOutMovie->height; y++) {
BlinkenLib/BlinkenMovie.c 1585)       for (x = 0; x < pOutMovie->width; x++) {
BlinkenLib/BlinkenMovie.c 1586)         if (BlinkenFrameGetPixel(pOutMovie->ppFrames[i], y, x, 0) != 0)
BlinkenLib/BlinkenMovie.c 1587)           fprintf(pFile, "1");
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1588)         else
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1589)           fprintf(pFile, "0");
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1590)       }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1591)       fprintf(pFile, "\n");
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1592)     }
BlinkenMovie.c            1593)   }
BlinkenMovie.c            1594) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1595)   // close file
BlinkenLib/BlinkenMovie.c 1596)   fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1597) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1598)   // free copied movie
BlinkenLib/BlinkenMovie.c 1599)   BlinkenMovieFree(pOutMovie);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1600) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1601)   // success
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1602)   return 0;
BlinkenMovie.c            1603) }
BlinkenMovie.c            1604) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1605) int BlinkenMovieSaveBmm(stBlinkenMovie *pMovie, const char *pFilename) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1606)   stBlinkenMovie *pOutMovie;
BlinkenLib/BlinkenMovie.c 1607)   FILE *pFile;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1608)   int i, y, x;
BlinkenMovie.c            1609) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1610)   if (pMovie == NULL || pFilename == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1611)     return -1;
BlinkenMovie.c            1612) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1613)   // convert movie to suitable format
BlinkenLib/BlinkenMovie.c 1614)   pOutMovie = BlinkenMovieClone(pMovie);
BlinkenLib/BlinkenMovie.c 1615)   if (pOutMovie == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1616)     return -1;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1617)   BlinkenMovieResize(pOutMovie, pOutMovie->height, pOutMovie->width, 1, 255);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1618) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1619)   // open file
BlinkenLib/BlinkenMovie.c 1620)   pFile = fopen(pFilename, "wt");
BlinkenLib/BlinkenMovie.c 1621)   if (pFile == NULL) {
BlinkenLib/BlinkenMovie.c 1622)     BlinkenMovieFree(pOutMovie);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1623)     return -1;
BlinkenMovie.c            1624)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1625)   // write header line
BlinkenLib/BlinkenMovie.c 1626)   fprintf(pFile, "# BlinkenMini Movie %ux%u\n", pOutMovie->width,
BlinkenLib/BlinkenMovie.c 1627)           pOutMovie->height);
BlinkenLib/BlinkenMovie.c 1628) 
BlinkenLib/BlinkenMovie.c 1629)   // write information lines
BlinkenLib/BlinkenMovie.c 1630)   for (i = 0; i < pOutMovie->infoCnt; i++)
BlinkenLib/BlinkenMovie.c 1631)     fprintf(pFile, "# %s = %s\n", pOutMovie->pppInfos[i][0],
BlinkenLib/BlinkenMovie.c 1632)             pOutMovie->pppInfos[i][1]);
BlinkenLib/BlinkenMovie.c 1633) 
BlinkenLib/BlinkenMovie.c 1634)   // write frames
BlinkenLib/BlinkenMovie.c 1635)   for (i = 0; i < pOutMovie->frameCnt; i++) {
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1636)     fprintf(pFile, "\n@%u\n", BlinkenFrameGetDuration(pOutMovie->ppFrames[i]));
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1637)     for (y = 0; y < pOutMovie->height; y++) {
BlinkenLib/BlinkenMovie.c 1638)       fprintf(pFile, "0x%02X",
BlinkenLib/BlinkenMovie.c 1639)               BlinkenFrameGetPixel(pOutMovie->ppFrames[i], y, 0, 0));
BlinkenLib/BlinkenMovie.c 1640)       for (x = 1; x < pOutMovie->width; x++)
BlinkenLib/BlinkenMovie.c 1641)         fprintf(pFile, " 0x%02X",
BlinkenLib/BlinkenMovie.c 1642)                 BlinkenFrameGetPixel(pOutMovie->ppFrames[i], y, x, 0));
BlinkenLib/BlinkenMovie.c 1643)       fprintf(pFile, "\n");
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1644)     }
BlinkenMovie.c            1645)   }
BlinkenMovie.c            1646) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1647)   // close file
BlinkenLib/BlinkenMovie.c 1648)   fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1649) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1650)   // free copied movie
BlinkenLib/BlinkenMovie.c 1651)   BlinkenMovieFree(pOutMovie);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1652) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1653)   // success
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1654)   return 0;
BlinkenMovie.c            1655) }
BlinkenMovie.c            1656) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1657) int BlinkenMovieSaveBml(stBlinkenMovie *pMovie, const char *pFilename) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1658)   stBlinkenMovie *pOutMovie;
BlinkenLib/BlinkenMovie.c 1659)   FILE *pFile;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1660)   int bits, val, i, y, x, c;
BlinkenMovie.c            1661) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1662)   if (pMovie == NULL || pFilename == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1663)     return -1;
BlinkenMovie.c            1664) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1665)   // convert movie to suitable format
BlinkenLib/BlinkenMovie.c 1666)   pOutMovie = BlinkenMovieClone(pMovie);
BlinkenLib/BlinkenMovie.c 1667)   if (pOutMovie == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1668)     return -1;
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1669)   val = pOutMovie->maxval; // get number of bits
src/BlinkenMovie.c        1670)   for (bits = 0; val != 0; val >>= 1, bits++)
src/BlinkenMovie.c        1671)     ;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1672)   BlinkenMovieResize(pOutMovie, pOutMovie->height, pOutMovie->width,
BlinkenLib/BlinkenMovie.c 1673)                      pOutMovie->channels, (1 << bits) - 1);
BlinkenLib/BlinkenMovie.c 1674) 
BlinkenLib/BlinkenMovie.c 1675)   // open file
BlinkenLib/BlinkenMovie.c 1676)   pFile = fopen(pFilename, "wt");
BlinkenLib/BlinkenMovie.c 1677)   if (pFile == NULL) {
BlinkenLib/BlinkenMovie.c 1678)     BlinkenMovieFree(pOutMovie);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1679)     return -1;
BlinkenMovie.c            1680)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1681)   // write header line
BlinkenLib/BlinkenMovie.c 1682)   fprintf(pFile, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
BlinkenLib/BlinkenMovie.c 1683) 
BlinkenLib/BlinkenMovie.c 1684)   // write blm start tag
BlinkenLib/BlinkenMovie.c 1685)   fprintf(pFile,
BlinkenLib/BlinkenMovie.c 1686)           "<blm width=\"%u\" height=\"%u\" bits=\"%u\" channels=\"%u\">\n",
BlinkenLib/BlinkenMovie.c 1687)           pOutMovie->width, pOutMovie->height, bits, pOutMovie->channels);
BlinkenLib/BlinkenMovie.c 1688) 
BlinkenLib/BlinkenMovie.c 1689)   // write information lines
BlinkenLib/BlinkenMovie.c 1690)   fprintf(pFile, "\t<header>\n");
BlinkenLib/BlinkenMovie.c 1691)   for (i = 0; i < pOutMovie->infoCnt; i++) {
BlinkenLib/BlinkenMovie.c 1692)     if (strcmp(pOutMovie->pppInfos[i][0], "title") == 0)
BlinkenLib/BlinkenMovie.c 1693)       fprintf(pFile, "\t\t<title>%s</title>\n", pOutMovie->pppInfos[i][1]);
BlinkenLib/BlinkenMovie.c 1694)     else if (strcmp(pOutMovie->pppInfos[i][0], "description") == 0)
BlinkenLib/BlinkenMovie.c 1695)       fprintf(pFile, "\t\t<description>%s</description>\n",
BlinkenLib/BlinkenMovie.c 1696)               pOutMovie->pppInfos[i][1]);
BlinkenLib/BlinkenMovie.c 1697)     else if (strcmp(pOutMovie->pppInfos[i][0], "creator") == 0)
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1698)       fprintf(pFile, "\t\t<creator>%s</creator>\n", pOutMovie->pppInfos[i][1]);
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1699)     else if (strcmp(pOutMovie->pppInfos[i][0], "author") == 0)
BlinkenLib/BlinkenMovie.c 1700)       fprintf(pFile, "\t\t<author>%s</author>\n", pOutMovie->pppInfos[i][1]);
BlinkenLib/BlinkenMovie.c 1701)     else if (strcmp(pOutMovie->pppInfos[i][0], "email") == 0)
BlinkenLib/BlinkenMovie.c 1702)       fprintf(pFile, "\t\t<email>%s</email>\n", pOutMovie->pppInfos[i][1]);
BlinkenLib/BlinkenMovie.c 1703)     else if (strcmp(pOutMovie->pppInfos[i][0], "url") == 0)
BlinkenLib/BlinkenMovie.c 1704)       fprintf(pFile, "\t\t<url>%s</url>\n", pOutMovie->pppInfos[i][1]);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1705)     else
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1706)       fprintf(pFile, "\t\t<description>%s: %s</description>\n",
BlinkenLib/BlinkenMovie.c 1707)               pOutMovie->pppInfos[i][0], pOutMovie->pppInfos[i][1]);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1708)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1709)   fprintf(pFile, "\t</header>\n");
BlinkenLib/BlinkenMovie.c 1710) 
BlinkenLib/BlinkenMovie.c 1711)   // write frames
BlinkenLib/BlinkenMovie.c 1712)   for (i = 0; i < pOutMovie->frameCnt; i++) {
BlinkenLib/BlinkenMovie.c 1713)     fprintf(pFile, "\n\t<frame duration=\"%u\">\n",
BlinkenLib/BlinkenMovie.c 1714)             BlinkenFrameGetDuration(pOutMovie->ppFrames[i]));
BlinkenLib/BlinkenMovie.c 1715)     for (y = 0; y < pOutMovie->height; y++) {
BlinkenLib/BlinkenMovie.c 1716)       fprintf(pFile, "\t\t<row>");
BlinkenLib/BlinkenMovie.c 1717)       for (x = 0; x < pOutMovie->width; x++)
BlinkenLib/BlinkenMovie.c 1718)         for (c = 0; c < pOutMovie->channels; c++)
BlinkenLib/BlinkenMovie.c 1719)           fprintf(pFile, bits > 4 ? "%02X" : "%01X",
BlinkenLib/BlinkenMovie.c 1720)                   BlinkenFrameGetPixel(pOutMovie->ppFrames[i], y, x, c));
BlinkenLib/BlinkenMovie.c 1721)       fprintf(pFile, "</row>\n");
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1722)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1723)     fprintf(pFile, "\t</frame>\n");
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1724)   }
BlinkenMovie.c            1725) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1726)   // write blm end tag
BlinkenLib/BlinkenMovie.c 1727)   fprintf(pFile, "</blm>\n");
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1728) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1729)   // close file
BlinkenLib/BlinkenMovie.c 1730)   fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1731) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1732)   // free copied movie
BlinkenLib/BlinkenMovie.c 1733)   BlinkenMovieFree(pOutMovie);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1734) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1735)   // success
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1736)   return 0;
BlinkenMovie.c            1737) }
BlinkenMovie.c            1738) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1739) int BlinkenMovieSaveBbm(stBlinkenMovie *pMovie, const char *pFilename) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1740)   unsigned char *pFrameData;
BlinkenLib/BlinkenMovie.c 1741)   FILE *pFile;
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1742)   unsigned char header[24], infoHeader[6], framePointer[4], frameStartMarker[4];
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1743)   int duration, len, len0, len1, i, j, y, x, c, val;
BlinkenMovie.c            1744)   long pos;
BlinkenMovie.c            1745) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1746)   if (pMovie == NULL || pFilename == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1747)     return -1;
BlinkenMovie.c            1748) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1749)   // allocate frame data buffer
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1750)   pFrameData = (unsigned char *)malloc(2 + pMovie->height * pMovie->width *
src/BlinkenMovie.c        1751)                                                pMovie->channels);
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1752)   if (pFrameData == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1753)     return -1;
BlinkenMovie.c            1754) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1755)   // open file
BlinkenLib/BlinkenMovie.c 1756)   pFile = fopen(pFilename, "wb");
BlinkenLib/BlinkenMovie.c 1757)   if (pFile == NULL) {
BlinkenLib/BlinkenMovie.c 1758)     free(pFrameData);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1759)     return -1;
BlinkenMovie.c            1760)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1761)   // write header
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1762)   header[0] = 0x23; // magic
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1763)   header[1] = 0x54;
BlinkenMovie.c            1764)   header[2] = 0x26;
BlinkenMovie.c            1765)   header[3] = 0x66;
BlinkenMovie.c            1766)   header[4] = (unsigned char)(pMovie->height >> 8);
BlinkenMovie.c            1767)   header[5] = (unsigned char)pMovie->height;
BlinkenMovie.c            1768)   header[6] = (unsigned char)(pMovie->width >> 8);
BlinkenMovie.c            1769)   header[7] = (unsigned char)pMovie->width;
BlinkenMovie.c            1770)   header[8] = (unsigned char)(pMovie->channels >> 8);
BlinkenMovie.c            1771)   header[9] = (unsigned char)pMovie->channels;
BlinkenMovie.c            1772)   header[10] = (unsigned char)(pMovie->maxval >> 8);
BlinkenMovie.c            1773)   header[11] = (unsigned char)pMovie->maxval;
BlinkenMovie.c            1774)   header[12] = (unsigned char)(pMovie->frameCnt >> 24);
BlinkenMovie.c            1775)   header[13] = (unsigned char)(pMovie->frameCnt >> 16);
BlinkenMovie.c            1776)   header[14] = (unsigned char)(pMovie->frameCnt >> 8);
BlinkenMovie.c            1777)   header[15] = (unsigned char)pMovie->frameCnt;
BlinkenMovie.c            1778)   duration = 0;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1779)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c 1780)     duration += BlinkenFrameGetDuration(pMovie->ppFrames[i]);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1781)   header[16] = (unsigned char)(duration >> 24);
BlinkenMovie.c            1782)   header[17] = (unsigned char)(duration >> 16);
BlinkenMovie.c            1783)   header[18] = (unsigned char)(duration >> 8);
BlinkenMovie.c            1784)   header[19] = (unsigned char)duration;
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1785)   header[20] = 0; // frame pointer is written later
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1786)   header[21] = 0;
BlinkenMovie.c            1787)   header[22] = 0;
BlinkenMovie.c            1788)   header[23] = 0;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1789)   fwrite(header, 1, 24, pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1790) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1791)   // write information
BlinkenLib/BlinkenMovie.c 1792)   for (i = 0; i < pMovie->infoCnt; i++) {
BlinkenLib/BlinkenMovie.c 1793)     len0 = strlen(pMovie->pppInfos[i][0]);
BlinkenLib/BlinkenMovie.c 1794)     if (len0 > 32760)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1795)       len0 = 32760;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1796)     len1 = strlen(pMovie->pppInfos[i][1]);
BlinkenLib/BlinkenMovie.c 1797)     if (len1 > 32760)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1798)       len1 = 32760;
BlinkenMovie.c            1799)     len = 8 + len0 + len1;
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1800)     infoHeader[0] = 0x69; // 'i'
src/BlinkenMovie.c        1801)     infoHeader[1] = 0x6E; // 'n'
src/BlinkenMovie.c        1802)     infoHeader[2] = 0x66; // 'f'
src/BlinkenMovie.c        1803)     infoHeader[3] = 0x6F; // 'o'
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1804)     infoHeader[4] = (unsigned char)(len >> 8);
BlinkenMovie.c            1805)     infoHeader[5] = (unsigned char)len;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1806)     fwrite(infoHeader, 1, 6, pFile);
BlinkenLib/BlinkenMovie.c 1807)     fwrite(pMovie->pppInfos[i][0], 1, len0, pFile);
BlinkenLib/BlinkenMovie.c 1808)     fwrite("\0", 1, 1, pFile);
BlinkenLib/BlinkenMovie.c 1809)     fwrite(pMovie->pppInfos[i][1], 1, len1, pFile);
BlinkenLib/BlinkenMovie.c 1810)     fwrite("\0", 1, 1, pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1811)   }
BlinkenMovie.c            1812) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1813)   // write frame pointer
BlinkenLib/BlinkenMovie.c 1814)   pos = ftell(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1815)   framePointer[0] = (unsigned char)(pos >> 24);
BlinkenMovie.c            1816)   framePointer[1] = (unsigned char)(pos >> 16);
BlinkenMovie.c            1817)   framePointer[2] = (unsigned char)(pos >> 8);
BlinkenMovie.c            1818)   framePointer[3] = (unsigned char)pos;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1819)   fseek(pFile, 20, SEEK_SET);
BlinkenLib/BlinkenMovie.c 1820)   fwrite(framePointer, 1, 4, pFile);
BlinkenLib/BlinkenMovie.c 1821)   fseek(pFile, pos, SEEK_SET);
BlinkenLib/BlinkenMovie.c 1822) 
BlinkenLib/BlinkenMovie.c 1823)   // write frame start marker
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1824)   frameStartMarker[0] = 0x66; // 'f'
src/BlinkenMovie.c        1825)   frameStartMarker[1] = 0x72; // 'r'
src/BlinkenMovie.c        1826)   frameStartMarker[2] = 0x6D; // 'm'
src/BlinkenMovie.c        1827)   frameStartMarker[3] = 0x73; // 's'
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1828)   fwrite(frameStartMarker, 1, 4, pFile);
BlinkenLib/BlinkenMovie.c 1829) 
BlinkenLib/BlinkenMovie.c 1830)   // write frames
BlinkenLib/BlinkenMovie.c 1831)   for (i = 0; i < pMovie->frameCnt; i++) {
BlinkenLib/BlinkenMovie.c 1832)     val = BlinkenFrameGetDuration(pMovie->ppFrames[i]);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1833)     pFrameData[0] = (unsigned char)(val >> 8);
BlinkenMovie.c            1834)     pFrameData[1] = (unsigned char)val;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1835)     for (j = 2, y = 0; y < pMovie->height; y++)
BlinkenLib/BlinkenMovie.c 1836)       for (x = 0; x < pMovie->width; x++)
BlinkenLib/BlinkenMovie.c 1837)         for (c = 0; c < pMovie->channels; c++, j++)
BlinkenLib/BlinkenMovie.c 1838)           pFrameData[j] = BlinkenFrameGetPixel(pMovie->ppFrames[i], y, x, c);
BlinkenLib/BlinkenMovie.c 1839)     fwrite(pFrameData, 1, j, pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1840)   }
BlinkenMovie.c            1841) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1842)   // free frame data buffer
BlinkenLib/BlinkenMovie.c 1843)   free(pFrameData);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1844) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1845)   // close file
BlinkenLib/BlinkenMovie.c 1846)   fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1847) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1848)   // success
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1849)   return 0;
BlinkenMovie.c            1850) }
BlinkenMovie.c            1851) 
Christian Heimke BlinkenLib v.0.6.0 (2008-05...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c 1852) #ifdef BLINKENLIB_CFG_MNG
BlinkenLib/BlinkenMovie.c 1853) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1854) int BlinkenMovieSaveMng(stBlinkenMovie *pMovie, const char *pFilename) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1855)   return BlinkenMngSave(pMovie, pFilename);
Christian Heimke BlinkenLib v.0.6.0 (2008-05...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c 1856) }
BlinkenLib/BlinkenMovie.c 1857) 
BlinkenLib/BlinkenMovie.c 1858) #endif // #ifdef BLINKENLIB_CFG_MNG
BlinkenLib/BlinkenMovie.c 1859) 
Stefan Schuermans implement writing GIFs

Stefan Schuermans authored 7 years ago

BlinkenLib/BlinkenMovie.c 1860) #ifdef BLINKENLIB_CFG_GIF
BlinkenLib/BlinkenMovie.c 1861) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1862) int BlinkenMovieSaveGif(stBlinkenMovie *pMovie, const char *pFilename) {
Stefan Schuermans implement writing GIFs

Stefan Schuermans authored 7 years ago

BlinkenLib/BlinkenMovie.c 1863)   return BlinkenGifSave(pMovie, pFilename);
BlinkenLib/BlinkenMovie.c 1864) }
BlinkenLib/BlinkenMovie.c 1865) 
BlinkenLib/BlinkenMovie.c 1866) #endif // #ifdef BLINKENLIB_CFG_GIF
BlinkenLib/BlinkenMovie.c 1867) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1868) int BlinkenMovieSave(stBlinkenMovie *pMovie, const char *pFilename) {
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1869)   int len;
BlinkenMovie.c            1870) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1871)   if (pMovie == NULL || pFilename == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1872)     return -1;
BlinkenMovie.c            1873) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1874)   len = strlen(pFilename);
BlinkenLib/BlinkenMovie.c 1875)   if (len > 4 && strcmp(pFilename + len - 4, ".blm") == 0)
BlinkenLib/BlinkenMovie.c 1876)     return BlinkenMovieSaveBlm(pMovie, pFilename);
BlinkenLib/BlinkenMovie.c 1877)   if (len > 4 && strcmp(pFilename + len - 4, ".bmm") == 0)
BlinkenLib/BlinkenMovie.c 1878)     return BlinkenMovieSaveBmm(pMovie, pFilename);
BlinkenLib/BlinkenMovie.c 1879)   if (len > 4 && strcmp(pFilename + len - 4, ".bml") == 0)
BlinkenLib/BlinkenMovie.c 1880)     return BlinkenMovieSaveBml(pMovie, pFilename);
BlinkenLib/BlinkenMovie.c 1881)   if (len > 4 && strcmp(pFilename + len - 4, ".bbm") == 0)
BlinkenLib/BlinkenMovie.c 1882)     return BlinkenMovieSaveBbm(pMovie, pFilename);
Christian Heimke BlinkenLib v.0.6.0 (2008-05...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c 1883) #ifdef BLINKENLIB_CFG_MNG
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1884)   if (len > 4 && strcmp(pFilename + len - 4, ".mng") == 0)
BlinkenLib/BlinkenMovie.c 1885)     return BlinkenMovieSaveMng(pMovie, pFilename);
Christian Heimke BlinkenLib v.0.6.0 (2008-05...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c 1886) #endif // #ifdef BLINKENLIB_CFG_MNG
Stefan Schuermans implement writing GIFs

Stefan Schuermans authored 7 years ago

BlinkenLib/BlinkenMovie.c 1887) #ifdef BLINKENLIB_CFG_GIF
BlinkenLib/BlinkenMovie.c 1888)   if (len > 4 && strcmp(pFilename + len - 4, ".gif") == 0)
BlinkenLib/BlinkenMovie.c 1889)     return BlinkenMovieSaveGif(pMovie, pFilename);
BlinkenLib/BlinkenMovie.c 1890) #endif // #ifdef BLINKENLIB_CFG_GIF
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1891)   return -1;
BlinkenMovie.c            1892) }
BlinkenMovie.c            1893) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1894) void BlinkenMovieSend(stBlinkenMovie *pMovie, SOCKET udpSocket,
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1895)                       etBlinkenProto proto, int maxidle)
BlinkenLib/BlinkenMovie.c 1896) // udp socket must be "connected"
BlinkenLib/BlinkenMovie.c 1897) // maxidle is the maximum idle time between two frames in ms (last frame is
BlinkenLib/BlinkenMovie.c 1898) // repeated after this time), use 0 to turn off this feature
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

BlinkenMovie.c            1899) {
Christian Heimke BlinkenLib v.0.5.4 (2008-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1900)   int i, len, duration, dur;
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1901)   char buffer[65536]; // 64kB is more than maximum UDP size
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1902) 
BlinkenLib/BlinkenMovie.c 1903)   for (i = 0; i < pMovie->frameCnt; i++) {
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1904)     len = BlinkenFrameToNetwork(pMovie->ppFrames[i], proto, buffer,
src/BlinkenMovie.c        1905)                                 sizeof(buffer));
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1906)     duration = BlinkenFrameGetDuration(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c 1907)     if (len > 0) {
BlinkenLib/BlinkenMovie.c 1908)       while (duration > 0) {
BlinkenLib/BlinkenMovie.c 1909)         send(udpSocket, buffer, len, 0);
BlinkenLib/BlinkenMovie.c 1910)         dur = maxidle > 0 ? mini(maxidle, duration) : duration;
BlinkenLib/BlinkenMovie.c 1911)         msleep(dur);
BlinkenLib/BlinkenMovie.c 1912)         duration -= dur;
Christian Heimke BlinkenLib v.0.5.4 (2008-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1913)       }
BlinkenMovie.c            1914)     }
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

BlinkenMovie.c            1915)   }
BlinkenMovie.c            1916) }
BlinkenMovie.c            1917) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1918) stBlinkenMovie *BlinkenMovieReceive(SOCKET udpSocket, int timeout,
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1919)                                     etBlinkenProto *pProto)
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1920) // udp socket must be "bound" and should be "connected"
BlinkenLib/BlinkenMovie.c 1921) // after timeout ms of no reception, the movie is considered to be complete
BlinkenLib/BlinkenMovie.c 1922) // returns protocol in *pProto if pProto not NULL
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

BlinkenMovie.c            1923) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1924)   stBlinkenMovie *pMovie;
BlinkenLib/BlinkenMovie.c 1925)   stBlinkenFrame *pLastFrame, *pFrame;
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

BlinkenMovie.c            1926)   etBlinkenProto proto, p;
BlinkenMovie.c            1927)   fd_set readFds;
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1928)   struct timeval timeo;
BlinkenMovie.c            1929)   unsigned int lastTime, curTime;
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1930)   char buffer[65536]; // 64kB is more than maximum UDP size
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

BlinkenMovie.c            1931)   int len;
BlinkenMovie.c            1932) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1933)   // correct timeout
BlinkenLib/BlinkenMovie.c 1934)   if (timeout < 0)
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

BlinkenMovie.c            1935)     timeout = 0;
BlinkenMovie.c            1936) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1937)   // wait for frames
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

BlinkenMovie.c            1938)   pMovie = NULL;
BlinkenMovie.c            1939)   proto = BlinkenProtoNone;
BlinkenMovie.c            1940)   pLastFrame = NULL;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1941)   lastTime = get_ms();
BlinkenLib/BlinkenMovie.c 1942)   for (;;) {
BlinkenLib/BlinkenMovie.c 1943)     // wait for next frame
BlinkenLib/BlinkenMovie.c 1944)     FD_ZERO(&readFds);
BlinkenLib/BlinkenMovie.c 1945)     FD_SET(udpSocket, &readFds);
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

BlinkenMovie.c            1946)     timeo.tv_sec = timeout / 1000;
BlinkenMovie.c            1947)     timeo.tv_usec = (timeout % 1000) * 1000;
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1948)     // timeout or error
BlinkenLib/BlinkenMovie.c 1949)     if (select(udpSocket + 1, &readFds, NULL, NULL, &timeo) <= 0)
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

BlinkenMovie.c            1950)       break;
BlinkenMovie.c            1951) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1952)     // fetch data
BlinkenLib/BlinkenMovie.c 1953)     len = recv(udpSocket, buffer, sizeof(buffer), 0);
BlinkenLib/BlinkenMovie.c 1954)     if (len <= 0)
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

BlinkenMovie.c            1955)       break;
BlinkenMovie.c            1956) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1957)     // get frame from data
BlinkenLib/BlinkenMovie.c 1958)     pFrame = BlinkenFrameFromNetwork(buffer, len, &p);
BlinkenLib/BlinkenMovie.c 1959)     if (pFrame != NULL) {
BlinkenLib/BlinkenMovie.c 1960)       // valid protocol
BlinkenLib/BlinkenMovie.c 1961)       if (p != BlinkenProtoNone) {
BlinkenLib/BlinkenMovie.c 1962)         // first frame
BlinkenLib/BlinkenMovie.c 1963)         if (proto == BlinkenProtoNone)
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1964)           proto = p; // use this protocol
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1965)         // protocol matches
BlinkenLib/BlinkenMovie.c 1966)         if (p == proto) {
BlinkenLib/BlinkenMovie.c 1967)           // no movie yet
BlinkenLib/BlinkenMovie.c 1968)           if (pMovie == NULL) {
BlinkenLib/BlinkenMovie.c 1969)             // allocate a new movie
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1970)             pMovie = BlinkenMovieNew(
src/BlinkenMovie.c        1971)                 BlinkenFrameGetHeight(pFrame), BlinkenFrameGetWidth(pFrame),
src/BlinkenMovie.c        1972)                 BlinkenFrameGetChannels(pFrame), BlinkenFrameGetMaxval(pFrame));
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1973)             if (pMovie == NULL) {
BlinkenLib/BlinkenMovie.c 1974)               BlinkenFrameFree(pFrame);
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

BlinkenMovie.c            1975)               break;
BlinkenMovie.c            1976)             }
BlinkenMovie.c            1977)           }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1978)           // ignore frame if it is equal to last one
BlinkenLib/BlinkenMovie.c 1979)           if (pMovie->frameCnt > 0) {
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1980)             if (BlinkenFrameCompare(
src/BlinkenMovie.c        1981)                     pFrame, pMovie->ppFrames[pMovie->frameCnt - 1]) == 0) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1982)               BlinkenFrameFree(pFrame);
Christian Heimke BlinkenLib v.0.5.4 (2008-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1983)               continue;
BlinkenMovie.c            1984)             }
BlinkenMovie.c            1985)           }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1986)           // append frame to movie
BlinkenLib/BlinkenMovie.c 1987)           if (BlinkenMovieAppendFrame(pMovie, pFrame) == 0) {
BlinkenLib/BlinkenMovie.c 1988)             // get current time
BlinkenLib/BlinkenMovie.c 1989)             curTime = get_ms();
BlinkenLib/BlinkenMovie.c 1990)             // set duration of last frame
BlinkenLib/BlinkenMovie.c 1991)             if (pLastFrame != NULL)
BlinkenLib/BlinkenMovie.c 1992)               BlinkenFrameSetDuration(pLastFrame, curTime - lastTime);
BlinkenLib/BlinkenMovie.c 1993)             // remember this frame as last frame appended to movie
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

BlinkenMovie.c            1994)             pLastFrame = pFrame;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1995)             pFrame = NULL;      // do not free this frame (it was appended)
BlinkenLib/BlinkenMovie.c 1996)             lastTime = curTime; // remember time of this frame
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

BlinkenMovie.c            1997)           }
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        1998)         }                       // if( p == proto )
src/BlinkenMovie.c        1999)       }                         // if( p != BlinkenProtoNone )
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 2000)       // free frame if it was not appended
BlinkenLib/BlinkenMovie.c 2001)       if (pFrame != NULL)
BlinkenLib/BlinkenMovie.c 2002)         BlinkenFrameFree(pFrame);
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

src/BlinkenMovie.c        2003)     } // if( pFrame != NULL )
src/BlinkenMovie.c        2004)   }   // for( ; ; )
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 2005) 
BlinkenLib/BlinkenMovie.c 2006)   // get current time
BlinkenLib/BlinkenMovie.c 2007)   curTime = get_ms();
BlinkenLib/BlinkenMovie.c 2008)   // set duration of last frame
BlinkenLib/BlinkenMovie.c 2009)   if (pLastFrame != NULL)
BlinkenLib/BlinkenMovie.c 2010)     BlinkenFrameSetDuration(pLastFrame, curTime - lastTime);
BlinkenLib/BlinkenMovie.c 2011) 
BlinkenLib/BlinkenMovie.c 2012)   // return protocol
BlinkenLib/BlinkenMovie.c 2013)   if (pProto != NULL)
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

BlinkenMovie.c            2014)     *pProto = proto;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 2015)   // return movie