38498c63d96f9b97bd7b17c66efc22b8c4e72b3f
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 <winsock2.h>
BlinkenMovie.c              11) #include <windows.h>
BlinkenMovie.c              12) #else
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

BlinkenMovie.c              13) #include <unistd.h>
BlinkenMovie.c              14) #include <sys/time.h>
BlinkenMovie.c              15) #include <sys/types.h>
BlinkenMovie.c              16) #include <sys/socket.h>
BlinkenMovie.c              17) #include <sys/select.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/BlinkenConstants.h>
BlinkenLib/BlinkenMovie.c   21) #include <BlinkenLib/BlinkenFrame.h>
BlinkenLib/BlinkenMovie.c   22) #include <BlinkenLib/BlinkenMovie.h>
BlinkenLib/BlinkenMovie.c   23) #include <BlinkenLib/Tools.h>
Christian Heimke BlinkenLib v.0.6.0 (2008-05...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c   24) #ifdef BLINKENLIB_CFG_MNG
BlinkenLib/BlinkenMovie.c   25) #include <BlinkenLib/BlinkenMng.h>
BlinkenLib/BlinkenMovie.c   26) #endif // #ifdef BLINKENLIB_CFG_MNG
Stefan Schuermans implement reading GIFs

Stefan Schuermans authored 7 years ago

BlinkenLib/BlinkenMovie.c   27) #ifdef BLINKENLIB_CFG_GIF
BlinkenLib/BlinkenMovie.c   28) #include <BlinkenLib/BlinkenGif.h>
BlinkenLib/BlinkenMovie.c   29) #endif // #ifdef BLINKENLIB_CFG_GIF
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c              42) #ifdef WIN32
BlinkenMovie.c              43) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c   44) static void msleep(unsigned int ms)
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c   46)   Sleep(ms);
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c   51)   return GetTickCount();
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenMovie.c              52) }
BlinkenMovie.c              53) 
BlinkenMovie.c              54) #else
BlinkenMovie.c              55) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c   56) static void msleep(unsigned int ms)
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c   58)   usleep(ms * 1000);
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c              62) {
BlinkenMovie.c              63)   struct timeval tv;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c              65)   return (unsigned int)(tv.tv_usec / 1000 + tv.tv_sec * 1000);
BlinkenMovie.c              66) }
BlinkenMovie.c              67) 
BlinkenMovie.c              68) #endif
BlinkenMovie.c              69) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c   70) stBlinkenMovie *BlinkenMovieNew(int height, int width, int channels,
BlinkenLib/BlinkenMovie.c   71)                                 int maxval)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c   73)   stBlinkenMovie *pMovie;
BlinkenLib/BlinkenMovie.c   74) 
BlinkenLib/BlinkenMovie.c   75)   if (height < BlinkenHeightMin)
BlinkenLib/BlinkenMovie.c   76)     height = BlinkenHeightMin;
BlinkenLib/BlinkenMovie.c   77)   if (height > BlinkenHeightMax)
BlinkenLib/BlinkenMovie.c   78)     height = BlinkenHeightMax;
BlinkenLib/BlinkenMovie.c   79)   if (width < BlinkenWidthMin)
BlinkenLib/BlinkenMovie.c   80)     width = BlinkenWidthMin;
BlinkenLib/BlinkenMovie.c   81)   if (width > BlinkenWidthMax)
BlinkenLib/BlinkenMovie.c   82)     width = BlinkenWidthMax;
BlinkenLib/BlinkenMovie.c   83)   if (channels < BlinkenChannelsMin)
BlinkenLib/BlinkenMovie.c   84)     channels = BlinkenChannelsMin;
BlinkenLib/BlinkenMovie.c   85)   if (channels > BlinkenChannelsMax)
BlinkenLib/BlinkenMovie.c   86)     channels = BlinkenMaxvalMax;
BlinkenLib/BlinkenMovie.c   87)   if (maxval < BlinkenMaxvalMin)
BlinkenLib/BlinkenMovie.c   88)     maxval = BlinkenMaxvalMin;
BlinkenLib/BlinkenMovie.c   89)   if (maxval > BlinkenMaxvalMax)
BlinkenLib/BlinkenMovie.c   90)     maxval = BlinkenMaxvalMax;
BlinkenLib/BlinkenMovie.c   91) 
BlinkenLib/BlinkenMovie.c   92)   pMovie = (stBlinkenMovie *) malloc(sizeof(stBlinkenMovie));
BlinkenLib/BlinkenMovie.c   93)   if (pMovie == NULL)
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->height = height;
BlinkenMovie.c              97)   pMovie->width = width;
BlinkenMovie.c              98)   pMovie->channels = channels;
BlinkenMovie.c              99)   pMovie->maxval = maxval;
BlinkenMovie.c             100)   pMovie->infoCnt = 0;
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             104)     return NULL;
BlinkenMovie.c             105)   }
BlinkenMovie.c             106)   pMovie->frameCnt = 0;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  107)   pMovie->ppFrames =
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             112)     return NULL;
BlinkenMovie.c             113)   }
BlinkenMovie.c             114) 
BlinkenMovie.c             115)   return pMovie;
BlinkenMovie.c             116) }
BlinkenMovie.c             117) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  118) stBlinkenMovie *BlinkenMovieClone(stBlinkenMovie *pSrcMovie)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             122)   int i;
BlinkenMovie.c             123) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  124)   pMovie =
BlinkenLib/BlinkenMovie.c  125)       BlinkenMovieNew(pSrcMovie->height, pSrcMovie->width,
BlinkenLib/BlinkenMovie.c  126)                       pSrcMovie->channels, pSrcMovie->maxval);
BlinkenLib/BlinkenMovie.c  127)   if (pMovie == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             128)     return NULL;
BlinkenMovie.c             129) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             139) 
BlinkenMovie.c             140)   return pMovie;
BlinkenMovie.c             141) }
BlinkenMovie.c             142) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             144) {
BlinkenMovie.c             145)   int i;
BlinkenMovie.c             146) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  163) int BlinkenMovieGetHeight(stBlinkenMovie *pMovie)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             164) {
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->height;
BlinkenMovie.c             169) }
BlinkenMovie.c             170) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  171) int BlinkenMovieGetWidth(stBlinkenMovie *pMovie)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             174)     return 0;
BlinkenMovie.c             175) 
BlinkenMovie.c             176)   return pMovie->width;
BlinkenMovie.c             177) }
BlinkenMovie.c             178) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  179) int BlinkenMovieGetChannels(stBlinkenMovie *pMovie)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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)   return pMovie->channels;
BlinkenMovie.c             185) }
BlinkenMovie.c             186) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  187) int BlinkenMovieGetMaxval(stBlinkenMovie *pMovie)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             190)     return 0;
BlinkenMovie.c             191) 
BlinkenMovie.c             192)   return pMovie->maxval;
BlinkenMovie.c             193) }
BlinkenMovie.c             194) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             196) {
BlinkenMovie.c             197)   int i, duration;
BlinkenMovie.c             198) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             200)     return 0;
BlinkenMovie.c             201) 
BlinkenMovie.c             202)   duration = 0;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             205)   return duration;
BlinkenMovie.c             206) }
BlinkenMovie.c             207) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  208) int BlinkenMovieGetInfoCnt(stBlinkenMovie *pMovie)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             211)     return 0;
BlinkenMovie.c             212) 
BlinkenMovie.c             213)   return pMovie->infoCnt;
BlinkenMovie.c             214) }
BlinkenMovie.c             215) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  216) char *BlinkenMovieGetInfoType(stBlinkenMovie *pMovie, int infoNo)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             219)     return "";
BlinkenMovie.c             220) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  221)   if (infoNo < 0)
BlinkenLib/BlinkenMovie.c  222)     infoNo = 0;
BlinkenLib/BlinkenMovie.c  223)   if (infoNo >= pMovie->infoCnt)
BlinkenLib/BlinkenMovie.c  224)     infoNo = pMovie->infoCnt - 1;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             225)   return pMovie->pppInfos[infoNo][0];
BlinkenMovie.c             226) }
BlinkenMovie.c             227) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  228) char *BlinkenMovieGetInfoData(stBlinkenMovie *pMovie, int infoNo)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             231)     return "";
BlinkenMovie.c             232) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  233)   if (infoNo < 0)
BlinkenLib/BlinkenMovie.c  234)     infoNo = 0;
BlinkenLib/BlinkenMovie.c  235)   if (infoNo >= pMovie->infoCnt)
BlinkenLib/BlinkenMovie.c  236)     infoNo = pMovie->infoCnt - 1;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             237)   return pMovie->pppInfos[infoNo][1];
BlinkenMovie.c             238) }
BlinkenMovie.c             239) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  240) void BlinkenMovieSetInfo(stBlinkenMovie *pMovie, int infoNo,
BlinkenLib/BlinkenMovie.c  241)                          const char *pInfoType, const char *pInfoData)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  245)   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             246)     return;
BlinkenMovie.c             247) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             254)     return;
BlinkenMovie.c             255)   }
BlinkenMovie.c             256) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             260)   pMovie->pppInfos[infoNo][1] = pData;
BlinkenMovie.c             261) }
BlinkenMovie.c             262) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  263) void BlinkenMovieInsertInfo(stBlinkenMovie *pMovie, int infoNo,
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  264)                             const char *pInfoType, const char *pInfoData)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             267)   int i;
BlinkenMovie.c             268) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  269)   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             270)     return;
BlinkenMovie.c             271) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             280)     return;
BlinkenMovie.c             281)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  282)   pData = strdup(pInfoData);
BlinkenLib/BlinkenMovie.c  283)   if (pData == NULL) {
BlinkenLib/BlinkenMovie.c  284)     free(pppNewInfos);
BlinkenLib/BlinkenMovie.c  285)     free(pType);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             290)     pppNewInfos[i][0] = pMovie->pppInfos[i][0];
BlinkenMovie.c             291)     pppNewInfos[i][1] = pMovie->pppInfos[i][1];
BlinkenMovie.c             292)   }
BlinkenMovie.c             293) 
BlinkenMovie.c             294)   pppNewInfos[infoNo][0] = pType;
BlinkenMovie.c             295)   pppNewInfos[infoNo][1] = pData;
BlinkenMovie.c             296) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  297)   for (i = infoNo; i < pMovie->infoCnt; i++) {
BlinkenLib/BlinkenMovie.c  298)     pppNewInfos[i + 1][0] = pMovie->pppInfos[i][0];
BlinkenLib/BlinkenMovie.c  299)     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             300)   }
BlinkenMovie.c             301) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             303)   pMovie->pppInfos = pppNewInfos;
BlinkenMovie.c             304)   pMovie->infoCnt++;
BlinkenMovie.c             305) }
BlinkenMovie.c             306) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  307) void BlinkenMovieAppendInfo(stBlinkenMovie *pMovie, const char *pInfoType,
BlinkenLib/BlinkenMovie.c  308)                             const char *pInfoData)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  316) void BlinkenMovieDeleteInfo(stBlinkenMovie *pMovie, int infoNo)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             319)   int i;
BlinkenMovie.c             320) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  321)   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             322)     return;
BlinkenMovie.c             323) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  326)   if (pppNewInfos == 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 changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             330)     pppNewInfos[i][0] = pMovie->pppInfos[i][0];
BlinkenMovie.c             331)     pppNewInfos[i][1] = pMovie->pppInfos[i][1];
BlinkenMovie.c             332)   }
BlinkenMovie.c             333) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  337)   for (i = infoNo; i < pMovie->infoCnt - 1; i++) {
BlinkenLib/BlinkenMovie.c  338)     pppNewInfos[i][0] = pMovie->pppInfos[i + 1][0];
BlinkenLib/BlinkenMovie.c  339)     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             340)   }
BlinkenMovie.c             341) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             343)   pMovie->pppInfos = pppNewInfos;
BlinkenMovie.c             344)   pMovie->infoCnt--;
BlinkenMovie.c             345) }
BlinkenMovie.c             346) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  347) void BlinkenMovieDeleteInfos(stBlinkenMovie *pMovie)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             350)   int i;
BlinkenMovie.c             351) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             353)     return;
BlinkenMovie.c             354) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             365)   pMovie->pppInfos = pppNewInfos;
BlinkenMovie.c             366)   pMovie->infoCnt = 0;
BlinkenMovie.c             367) }
BlinkenMovie.c             368) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  369) int BlinkenMovieGetFrameCnt(stBlinkenMovie *pMovie)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             372)     return 0;
BlinkenMovie.c             373) 
BlinkenMovie.c             374)   return pMovie->frameCnt;
BlinkenMovie.c             375) }
BlinkenMovie.c             376) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  377) stBlinkenFrame *BlinkenMovieGetFrame(stBlinkenMovie *pMovie, int frameNo)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             380)     return NULL;
BlinkenMovie.c             381) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  382)   if (frameNo < 0)
BlinkenLib/BlinkenMovie.c  383)     frameNo = 0;
BlinkenLib/BlinkenMovie.c  384)   if (frameNo >= pMovie->frameCnt)
BlinkenLib/BlinkenMovie.c  385)     frameNo = pMovie->frameCnt - 1;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             386)   return pMovie->ppFrames[frameNo];
BlinkenMovie.c             387) }
BlinkenMovie.c             388) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  389) void BlinkenMovieSetFrame(stBlinkenMovie *pMovie, int frameNo,
BlinkenLib/BlinkenMovie.c  390)                           stBlinkenFrame *pFrame)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  392)   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             393)     return;
BlinkenMovie.c             394) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             397)   pMovie->ppFrames[frameNo] = pFrame;
BlinkenMovie.c             398) }
BlinkenMovie.c             399) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  400) int BlinkenMovieInsertFrame(stBlinkenMovie *pMovie, int frameNo,
BlinkenLib/BlinkenMovie.c  401)                             stBlinkenFrame *pFrame)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             404)   int i;
BlinkenMovie.c             405) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  406)   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             407)     return -1;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  409)   ppNewFrames =
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  410)       (stBlinkenFrame **) BlinkenMalloc1D(pMovie->frameCnt + 1,
BlinkenLib/BlinkenMovie.c  411)                                           sizeof(stBlinkenFrame *));
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  431) int BlinkenMovieAppendFrame(stBlinkenMovie *pMovie, stBlinkenFrame *pFrame)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  439) void BlinkenMovieDeleteFrame(stBlinkenMovie *pMovie, int frameNo)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             442)   int i;
BlinkenMovie.c             443) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  444)   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             445)     return;
BlinkenMovie.c             446) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             461)   pMovie->ppFrames = ppNewFrames;
BlinkenMovie.c             462)   pMovie->frameCnt--;
BlinkenMovie.c             463) }
BlinkenMovie.c             464) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  465) void BlinkenMovieDeleteFrames(stBlinkenMovie *pMovie)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             468)   int i;
BlinkenMovie.c             469) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             471)     return;
BlinkenMovie.c             472) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             482)   pMovie->ppFrames = ppNewFrames;
BlinkenMovie.c             483)   pMovie->frameCnt = 0;
BlinkenMovie.c             484) }
BlinkenMovie.c             485) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  486) int BlinkenMovieConcat(stBlinkenMovie *pMovie,
BlinkenLib/BlinkenMovie.c  487)                        stBlinkenMovie *pMovie2 /* appended and freed */)
Christian Heimke BlinkenLib v.0.6.4 (2010-12...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  498)   ppNewFrames =
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  499)       (stBlinkenFrame **)BlinkenMalloc1D(pMovie->frameCnt + pMovie2->frameCnt,
BlinkenLib/BlinkenMovie.c  500)                                          sizeof(stBlinkenFrame *));
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c  502)     return -1;
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c  506)     return -1;
BlinkenLib/BlinkenMovie.c  507)   }
BlinkenLib/BlinkenMovie.c  508) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  509)   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  510)     ppNewFrames[i] = pMovie->ppFrames[i];
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  511)   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  512)     ppNewFrames[pMovie->frameCnt + i] = pMovie2->ppFrames[i];
BlinkenLib/BlinkenMovie.c  513) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c  515)   pMovie->ppFrames = ppNewFrames;
BlinkenLib/BlinkenMovie.c  516)   pMovie->frameCnt += pMovie2->frameCnt;
BlinkenLib/BlinkenMovie.c  517) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c  519)   pMovie2->ppFrames = ppNewFrames2;
BlinkenLib/BlinkenMovie.c  520)   pMovie2->frameCnt = 0;
BlinkenLib/BlinkenMovie.c  521) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c  523) 
BlinkenLib/BlinkenMovie.c  524)   return 0;
BlinkenLib/BlinkenMovie.c  525) }
BlinkenLib/BlinkenMovie.c  526) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  532)   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  533)     pFrame = pMovie->ppFrames[i];
BlinkenLib/BlinkenMovie.c  534)     pMovie->ppFrames[i] = pMovie->ppFrames[j];
BlinkenLib/BlinkenMovie.c  535)     pMovie->ppFrames[j] = pFrame;
BlinkenLib/BlinkenMovie.c  536)   }
BlinkenLib/BlinkenMovie.c  537) }
BlinkenLib/BlinkenMovie.c  538) 
Stefan Schuermans implement cutting movie in...

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenMovie.c  539) void BlinkenMovieCutTime(stBlinkenMovie *pMovie,
BlinkenLib/BlinkenMovie.c  540)                          int begin /* in ms */, int end /* in ms */)
BlinkenLib/BlinkenMovie.c  541) {
BlinkenLib/BlinkenMovie.c  542)   int i, duration, curtime, idx_begin, idx_end, duration_begin, duration_end;
BlinkenLib/BlinkenMovie.c  543)   int frameCnt;
BlinkenLib/BlinkenMovie.c  544)   stBlinkenFrame **ppNewFrames;
BlinkenLib/BlinkenMovie.c  545) 
Stefan Schuermans implement changing duration...

Stefan Schuermans authored 10 years ago

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

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenMovie.c  548)     return;
BlinkenLib/BlinkenMovie.c  549) 
BlinkenLib/BlinkenMovie.c  550)   // get movie duration
BlinkenLib/BlinkenMovie.c  551)   duration = 0;
BlinkenLib/BlinkenMovie.c  552)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  553)     duration += BlinkenFrameGetDuration(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  554) 
BlinkenLib/BlinkenMovie.c  555)   // sanitize inputs
BlinkenLib/BlinkenMovie.c  556)   if (begin < 0)
BlinkenLib/BlinkenMovie.c  557)     begin = 0;
BlinkenLib/BlinkenMovie.c  558)   if (begin > duration)
BlinkenLib/BlinkenMovie.c  559)     begin = duration;
BlinkenLib/BlinkenMovie.c  560)   if (end < begin)
BlinkenLib/BlinkenMovie.c  561)     end = begin;
BlinkenLib/BlinkenMovie.c  562)   if (end > duration)
BlinkenLib/BlinkenMovie.c  563)     end = duration;
BlinkenLib/BlinkenMovie.c  564) 
BlinkenLib/BlinkenMovie.c  565)   // get begin and end indices, also get duration of begin and end frames
BlinkenLib/BlinkenMovie.c  566)   if (begin >= end) {
BlinkenLib/BlinkenMovie.c  567)     // empty result movie
BlinkenLib/BlinkenMovie.c  568)     idx_begin = 1;
BlinkenLib/BlinkenMovie.c  569)     idx_end = 0;
BlinkenLib/BlinkenMovie.c  570)     duration_begin = 0;
BlinkenLib/BlinkenMovie.c  571)     duration_end = 0;
BlinkenLib/BlinkenMovie.c  572)   } else {
BlinkenLib/BlinkenMovie.c  573)     // at least one frame in result movie
BlinkenLib/BlinkenMovie.c  574)     curtime = 0;
BlinkenLib/BlinkenMovie.c  575)     idx_begin = 0;
BlinkenLib/BlinkenMovie.c  576)     duration_begin = BlinkenFrameGetDuration(pMovie->ppFrames[idx_begin]);
BlinkenLib/BlinkenMovie.c  577)     idx_end = pMovie->frameCnt - 1;
BlinkenLib/BlinkenMovie.c  578)     duration_end = BlinkenFrameGetDuration(pMovie->ppFrames[idx_end]);
BlinkenLib/BlinkenMovie.c  579)     for (i = 0; i < pMovie->frameCnt; i++) {
BlinkenLib/BlinkenMovie.c  580)       duration = BlinkenFrameGetDuration(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  581)       // begin and end in current frame
BlinkenLib/BlinkenMovie.c  582)       if (curtime <= begin && curtime + duration >= end) {
BlinkenLib/BlinkenMovie.c  583)         idx_begin = i;
BlinkenLib/BlinkenMovie.c  584)         idx_end = i;
BlinkenLib/BlinkenMovie.c  585)         duration_begin = end - begin;
BlinkenLib/BlinkenMovie.c  586)         duration_end = end - begin;
BlinkenLib/BlinkenMovie.c  587)         break;
BlinkenLib/BlinkenMovie.c  588)       }
BlinkenLib/BlinkenMovie.c  589)       // begin in current frame
BlinkenLib/BlinkenMovie.c  590)       if (curtime <= begin && curtime + duration > begin) {
BlinkenLib/BlinkenMovie.c  591)         idx_begin = i;
BlinkenLib/BlinkenMovie.c  592)         duration_begin = curtime + duration - begin;
BlinkenLib/BlinkenMovie.c  593)       }
BlinkenLib/BlinkenMovie.c  594)       // end in current frame
BlinkenLib/BlinkenMovie.c  595)       if (curtime < end && curtime + duration >= end) {
BlinkenLib/BlinkenMovie.c  596)         idx_end = i;
BlinkenLib/BlinkenMovie.c  597)         duration_end = end - curtime;
BlinkenLib/BlinkenMovie.c  598)         break;
BlinkenLib/BlinkenMovie.c  599)       }
BlinkenLib/BlinkenMovie.c  600)       curtime += duration;
BlinkenLib/BlinkenMovie.c  601)     }
BlinkenLib/BlinkenMovie.c  602)   }
BlinkenLib/BlinkenMovie.c  603) 
BlinkenLib/BlinkenMovie.c  604)   // remove/free unneeded frames
BlinkenLib/BlinkenMovie.c  605) 
BlinkenLib/BlinkenMovie.c  606)   frameCnt = idx_end - idx_begin + 1;
BlinkenLib/BlinkenMovie.c  607)   ppNewFrames = (stBlinkenFrame **)BlinkenMalloc1D(frameCnt,
BlinkenLib/BlinkenMovie.c  608)                                                    sizeof(stBlinkenFrame *));
BlinkenLib/BlinkenMovie.c  609)   if (ppNewFrames == NULL)
BlinkenLib/BlinkenMovie.c  610)     return;
BlinkenLib/BlinkenMovie.c  611) 
BlinkenLib/BlinkenMovie.c  612)   for (i = 0; i < idx_begin; i++)
BlinkenLib/BlinkenMovie.c  613)     BlinkenFrameFree(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  614)   for (; i <= idx_end; i++)
BlinkenLib/BlinkenMovie.c  615)     ppNewFrames[i - idx_begin] = pMovie->ppFrames[i];
BlinkenLib/BlinkenMovie.c  616)   for (; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  617)     BlinkenFrameFree(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  618) 
BlinkenLib/BlinkenMovie.c  619)   free(pMovie->ppFrames);
BlinkenLib/BlinkenMovie.c  620)   pMovie->ppFrames = ppNewFrames;
BlinkenLib/BlinkenMovie.c  621)   pMovie->frameCnt = frameCnt;
BlinkenLib/BlinkenMovie.c  622) 
BlinkenLib/BlinkenMovie.c  623)   // change duration of begin and end frame
BlinkenLib/BlinkenMovie.c  624)   if (frameCnt > 0) {
BlinkenLib/BlinkenMovie.c  625)     BlinkenFrameSetDuration(pMovie->ppFrames[0], duration_begin);
BlinkenLib/BlinkenMovie.c  626)     BlinkenFrameSetDuration(pMovie->ppFrames[frameCnt - 1], duration_end);
BlinkenLib/BlinkenMovie.c  627)   }
BlinkenLib/BlinkenMovie.c  628) }
BlinkenLib/BlinkenMovie.c  629) 
Stefan Schuermans implement changing duration...

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenMovie.c  630) void BlinkenMovieAdaptDuration(stBlinkenMovie *pMovie,
BlinkenLib/BlinkenMovie.c  631)                                int duration /* in ms */)
BlinkenLib/BlinkenMovie.c  632) {
BlinkenLib/BlinkenMovie.c  633)   int old_duration, old_curtime, curtime;
BlinkenLib/BlinkenMovie.c  634)   int i, old_dur, dur, old_end, end;
BlinkenLib/BlinkenMovie.c  635) 
BlinkenLib/BlinkenMovie.c  636)   // do nothing if no movie, empty movie or invalid duration
BlinkenLib/BlinkenMovie.c  637)   if (pMovie == NULL || pMovie->frameCnt < 1 || duration <= 0)
BlinkenLib/BlinkenMovie.c  638)     return;
BlinkenLib/BlinkenMovie.c  639) 
BlinkenLib/BlinkenMovie.c  640)   // get movie duration
BlinkenLib/BlinkenMovie.c  641)   old_duration = 0;
BlinkenLib/BlinkenMovie.c  642)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  643)     old_duration += BlinkenFrameGetDuration(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  644) 
BlinkenLib/BlinkenMovie.c  645)   // adapt duration of frames
BlinkenLib/BlinkenMovie.c  646)   old_curtime = 0;
BlinkenLib/BlinkenMovie.c  647)   curtime = 0;
BlinkenLib/BlinkenMovie.c  648)   for (i = 0; i < pMovie->frameCnt; i++) {
BlinkenLib/BlinkenMovie.c  649)     // get old end time of current frame
BlinkenLib/BlinkenMovie.c  650)     old_dur = BlinkenFrameGetDuration(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  651)     old_end = old_curtime + old_dur;
BlinkenLib/BlinkenMovie.c  652)     // compute new end time and new duration
BlinkenLib/BlinkenMovie.c  653)     end = (int)((double)old_end / (double)old_duration * (double)duration
BlinkenLib/BlinkenMovie.c  654)                 + 0.5);
BlinkenLib/BlinkenMovie.c  655)     dur = end - curtime;
BlinkenLib/BlinkenMovie.c  656)     if (dur < BlinkenDurationMin)
BlinkenLib/BlinkenMovie.c  657)       dur = BlinkenDurationMin;
BlinkenLib/BlinkenMovie.c  658)     if (dur > BlinkenDurationMax)
BlinkenLib/BlinkenMovie.c  659)       dur = BlinkenDurationMax;
BlinkenLib/BlinkenMovie.c  660)     // update frame duration
BlinkenLib/BlinkenMovie.c  661)     BlinkenFrameSetDuration(pMovie->ppFrames[i], dur);
BlinkenLib/BlinkenMovie.c  662)     // advance time
BlinkenLib/BlinkenMovie.c  663)     old_curtime += old_dur;
BlinkenLib/BlinkenMovie.c  664)     curtime += dur;
BlinkenLib/BlinkenMovie.c  665)   }
BlinkenLib/BlinkenMovie.c  666) }
BlinkenLib/BlinkenMovie.c  667) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  668) void BlinkenMovieResize(stBlinkenMovie *pMovie, int height, int width,
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             670) {
BlinkenMovie.c             671)   int i;
BlinkenMovie.c             672) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  676)   if (height < BlinkenHeightMin)
BlinkenLib/BlinkenMovie.c  677)     height = BlinkenHeightMin;
BlinkenLib/BlinkenMovie.c  678)   if (height > BlinkenHeightMax)
BlinkenLib/BlinkenMovie.c  679)     height = BlinkenHeightMax;
BlinkenLib/BlinkenMovie.c  680)   if (width < BlinkenWidthMin)
BlinkenLib/BlinkenMovie.c  681)     width = BlinkenWidthMin;
BlinkenLib/BlinkenMovie.c  682)   if (width > BlinkenWidthMax)
BlinkenLib/BlinkenMovie.c  683)     width = BlinkenWidthMax;
BlinkenLib/BlinkenMovie.c  684)   if (channels < BlinkenChannelsMin)
BlinkenLib/BlinkenMovie.c  685)     channels = BlinkenChannelsMin;
BlinkenLib/BlinkenMovie.c  686)   if (channels > BlinkenChannelsMax)
BlinkenLib/BlinkenMovie.c  687)     channels = BlinkenMaxvalMax;
BlinkenLib/BlinkenMovie.c  688)   if (maxval < BlinkenMaxvalMin)
BlinkenLib/BlinkenMovie.c  689)     maxval = BlinkenMaxvalMin;
BlinkenLib/BlinkenMovie.c  690)   if (maxval > BlinkenMaxvalMax)
BlinkenLib/BlinkenMovie.c  691)     maxval = BlinkenMaxvalMax;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             692) 
BlinkenMovie.c             693)   pMovie->height = height;
BlinkenMovie.c             694)   pMovie->width = width;
BlinkenMovie.c             695)   pMovie->channels = channels;
BlinkenMovie.c             696)   pMovie->maxval = maxval;
BlinkenMovie.c             697) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  698)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  699)     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             700) }
BlinkenMovie.c             701) 
Stefan Schuermans implement cropping movies

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenMovie.c  702) void BlinkenMovieCrop(stBlinkenMovie *pMovie, int top, int left,
BlinkenLib/BlinkenMovie.c  703)                       int height, int width)
BlinkenLib/BlinkenMovie.c  704) {
BlinkenLib/BlinkenMovie.c  705)   int i;
BlinkenLib/BlinkenMovie.c  706) 
BlinkenLib/BlinkenMovie.c  707)   if (pMovie == NULL)
BlinkenLib/BlinkenMovie.c  708)     return;
BlinkenLib/BlinkenMovie.c  709) 
BlinkenLib/BlinkenMovie.c  710)   if (top < 0)
BlinkenLib/BlinkenMovie.c  711)     top = 0;
BlinkenLib/BlinkenMovie.c  712)   if (top > pMovie->height - BlinkenHeightMin)
BlinkenLib/BlinkenMovie.c  713)     top = pMovie->height - BlinkenHeightMin;
BlinkenLib/BlinkenMovie.c  714)   if (height < BlinkenHeightMin)
BlinkenLib/BlinkenMovie.c  715)     height = BlinkenHeightMin;
BlinkenLib/BlinkenMovie.c  716)   if (height > pMovie->height - top)
BlinkenLib/BlinkenMovie.c  717)     height = pMovie->height - top;
BlinkenLib/BlinkenMovie.c  718)   if (left < 0)
BlinkenLib/BlinkenMovie.c  719)     left = 0;
BlinkenLib/BlinkenMovie.c  720)   if (left > pMovie->width - BlinkenWidthMin)
BlinkenLib/BlinkenMovie.c  721)     left = pMovie->width - BlinkenWidthMin;
BlinkenLib/BlinkenMovie.c  722)   if (width < BlinkenWidthMin)
BlinkenLib/BlinkenMovie.c  723)     width = BlinkenWidthMin;
BlinkenLib/BlinkenMovie.c  724)   if (width > pMovie->width - left)
BlinkenLib/BlinkenMovie.c  725)     width = pMovie->width - left;
BlinkenLib/BlinkenMovie.c  726) 
BlinkenLib/BlinkenMovie.c  727)   if (top == 0 && left == 0 &&
BlinkenLib/BlinkenMovie.c  728)       height == pMovie->height && width == pMovie->width)
BlinkenLib/BlinkenMovie.c  729)     return;
BlinkenLib/BlinkenMovie.c  730) 
BlinkenLib/BlinkenMovie.c  731)   pMovie->height = height;
BlinkenLib/BlinkenMovie.c  732)   pMovie->width = width;
BlinkenLib/BlinkenMovie.c  733) 
BlinkenLib/BlinkenMovie.c  734)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  735)     BlinkenFrameCrop(pMovie->ppFrames[i], top, left, height, width);
BlinkenLib/BlinkenMovie.c  736) }
BlinkenLib/BlinkenMovie.c  737) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  738) 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             739) {
BlinkenMovie.c             740)   int i;
BlinkenMovie.c             741) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  745)   if (height < BlinkenHeightMin)
BlinkenLib/BlinkenMovie.c  746)     height = BlinkenHeightMin;
BlinkenLib/BlinkenMovie.c  747)   if (height > BlinkenHeightMax)
BlinkenLib/BlinkenMovie.c  748)     height = BlinkenHeightMax;
BlinkenLib/BlinkenMovie.c  749)   if (width < BlinkenWidthMin)
BlinkenLib/BlinkenMovie.c  750)     width = BlinkenWidthMin;
BlinkenLib/BlinkenMovie.c  751)   if (width > BlinkenWidthMax)
BlinkenLib/BlinkenMovie.c  752)     width = BlinkenWidthMax;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             753) 
BlinkenMovie.c             754)   pMovie->height = height;
BlinkenMovie.c             755)   pMovie->width = width;
BlinkenMovie.c             756) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  761) 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             762) {
BlinkenMovie.c             763)   int i, step;
BlinkenMovie.c             764) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  768)   if (channels < BlinkenChannelsMin)
BlinkenLib/BlinkenMovie.c  769)     channels = BlinkenChannelsMin;
BlinkenLib/BlinkenMovie.c  770)   if (channels > BlinkenChannelsMax)
BlinkenLib/BlinkenMovie.c  771)     channels = BlinkenMaxvalMax;
Christian Heimke BlinkenLib v.0.5.3 (2007-12...

Christian Heimke authored 13 years ago

BlinkenMovie.c             772) 
BlinkenMovie.c             773)   pMovie->channels = channels;
BlinkenMovie.c             774)   pMovie->maxval = BlinkenMaxvalMax;
BlinkenMovie.c             775) 
BlinkenMovie.c             776)   step = 0;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             780)   }
BlinkenMovie.c             781) }
BlinkenMovie.c             782) 
Stefan Schuermans implemented copying rectang...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  783) void BlinkenMovieCopyRect(stBlinkenMovie *pDest, int destY, int destX,
BlinkenLib/BlinkenMovie.c  784)                           stBlinkenMovie *pSrc, int srcY, int srcX,
BlinkenLib/BlinkenMovie.c  785)                           int height, int width)
BlinkenLib/BlinkenMovie.c  786) {
BlinkenLib/BlinkenMovie.c  787)   int dcnt, scnt, di, si, dest_dur, src_dur, src_time_ofs;
BlinkenLib/BlinkenMovie.c  788)   stBlinkenFrame *pFrame;
BlinkenLib/BlinkenMovie.c  789) 
BlinkenLib/BlinkenMovie.c  790)   if (pDest == NULL || pSrc == NULL)
BlinkenLib/BlinkenMovie.c  791)     return;
BlinkenLib/BlinkenMovie.c  792) 
BlinkenLib/BlinkenMovie.c  793)   // exit if both movies empty
BlinkenLib/BlinkenMovie.c  794)   dcnt = pDest->frameCnt;
BlinkenLib/BlinkenMovie.c  795)   scnt = pSrc->frameCnt;
BlinkenLib/BlinkenMovie.c  796)   if (dcnt == 0 || scnt == 0)
BlinkenLib/BlinkenMovie.c  797)     return;
BlinkenLib/BlinkenMovie.c  798) 
BlinkenLib/BlinkenMovie.c  799)   // go throuh all source frames
BlinkenLib/BlinkenMovie.c  800)   di = 0;
BlinkenLib/BlinkenMovie.c  801)   si = 0;
BlinkenLib/BlinkenMovie.c  802)   dest_dur = dcnt > 0 ? BlinkenFrameGetDuration(pDest->ppFrames[0]) : 0;
BlinkenLib/BlinkenMovie.c  803)   src_dur = scnt > 0 ? BlinkenFrameGetDuration(pSrc->ppFrames[0]) : 0;
BlinkenLib/BlinkenMovie.c  804)   src_time_ofs = 0;
BlinkenLib/BlinkenMovie.c  805)   while (si < scnt) {
BlinkenLib/BlinkenMovie.c  806) 
BlinkenLib/BlinkenMovie.c  807)     // make sure there is a frame in destination movie
BlinkenLib/BlinkenMovie.c  808)     if (di >= dcnt) {
BlinkenLib/BlinkenMovie.c  809)       // append new empty frame that last until end of source frame
BlinkenLib/BlinkenMovie.c  810)       pFrame = BlinkenFrameNew(pDest->height, pDest->width,
BlinkenLib/BlinkenMovie.c  811)                                pDest->channels, pDest->maxval,
BlinkenLib/BlinkenMovie.c  812)                                src_dur - src_time_ofs);
BlinkenLib/BlinkenMovie.c  813)       if (pFrame == NULL)
BlinkenLib/BlinkenMovie.c  814)         return;
BlinkenLib/BlinkenMovie.c  815)       BlinkenFrameClear(pFrame);
BlinkenLib/BlinkenMovie.c  816)       if (BlinkenMovieAppendFrame(pDest, pFrame) != 0)
BlinkenLib/BlinkenMovie.c  817)         return;
BlinkenLib/BlinkenMovie.c  818)       dcnt++;
BlinkenLib/BlinkenMovie.c  819)       dest_dur = src_dur - src_time_ofs;
BlinkenLib/BlinkenMovie.c  820)     }
BlinkenLib/BlinkenMovie.c  821) 
BlinkenLib/BlinkenMovie.c  822)     // make sure destination frame does not last longer than source frame
BlinkenLib/BlinkenMovie.c  823)     if (dest_dur > src_dur - src_time_ofs) {
BlinkenLib/BlinkenMovie.c  824)       // split destination frame into two
BlinkenLib/BlinkenMovie.c  825)       pFrame = BlinkenFrameClone(pDest->ppFrames[di]);
BlinkenLib/BlinkenMovie.c  826)       if (pFrame == NULL)
BlinkenLib/BlinkenMovie.c  827)         return;
BlinkenLib/BlinkenMovie.c  828)       if (BlinkenMovieInsertFrame(pDest, di+1, pFrame) != 0)
BlinkenLib/BlinkenMovie.c  829)         return;
BlinkenLib/BlinkenMovie.c  830)       dcnt++;
BlinkenLib/BlinkenMovie.c  831)       BlinkenFrameSetDuration(pDest->ppFrames[di],
BlinkenLib/BlinkenMovie.c  832)                               src_dur - src_time_ofs);
BlinkenLib/BlinkenMovie.c  833)       BlinkenFrameSetDuration(pDest->ppFrames[di+1],
BlinkenLib/BlinkenMovie.c  834)                               dest_dur - (src_dur - src_time_ofs));
BlinkenLib/BlinkenMovie.c  835)       dest_dur = src_dur - src_time_ofs;
BlinkenLib/BlinkenMovie.c  836)     }
BlinkenLib/BlinkenMovie.c  837) 
BlinkenLib/BlinkenMovie.c  838)     // copy from source frame to destination frame
BlinkenLib/BlinkenMovie.c  839)     BlinkenFrameCopyRect(pDest->ppFrames[di], destY, destX,
BlinkenLib/BlinkenMovie.c  840)                          pSrc->ppFrames[si], srcY, srcX, height, width);
BlinkenLib/BlinkenMovie.c  841)     src_time_ofs += dest_dur;
BlinkenLib/BlinkenMovie.c  842)     di++;
BlinkenLib/BlinkenMovie.c  843)     dest_dur = di < dcnt ? BlinkenFrameGetDuration(pDest->ppFrames[di]) : 0;
BlinkenLib/BlinkenMovie.c  844) 
BlinkenLib/BlinkenMovie.c  845)     // go to next source frame
BlinkenLib/BlinkenMovie.c  846)     if (src_time_ofs >= src_dur) {
BlinkenLib/BlinkenMovie.c  847)       si++;
BlinkenLib/BlinkenMovie.c  848)       src_dur = si < scnt ? BlinkenFrameGetDuration(pSrc->ppFrames[si]) : 0;
BlinkenLib/BlinkenMovie.c  849)       src_time_ofs = 0;
BlinkenLib/BlinkenMovie.c  850)     }
BlinkenLib/BlinkenMovie.c  851) 
BlinkenLib/BlinkenMovie.c  852)   } // while (si < scnt)
BlinkenLib/BlinkenMovie.c  853) }
BlinkenLib/BlinkenMovie.c  854) 
Stefan Schuermans implemented rotationg and m...

Stefan Schuermans authored 11 years ago

BlinkenLib/BlinkenMovie.c  855) void BlinkenMovieRotateCw(stBlinkenMovie *pMovie)
BlinkenLib/BlinkenMovie.c  856) {
BlinkenLib/BlinkenMovie.c  857)   int tmp, i;
BlinkenLib/BlinkenMovie.c  858) 
BlinkenLib/BlinkenMovie.c  859)   if (pMovie == NULL)
BlinkenLib/BlinkenMovie.c  860)     return;
BlinkenLib/BlinkenMovie.c  861) 
BlinkenLib/BlinkenMovie.c  862)   tmp = pMovie->height;
BlinkenLib/BlinkenMovie.c  863)   pMovie->height = pMovie->width;
BlinkenLib/BlinkenMovie.c  864)   pMovie->width = tmp;
BlinkenLib/BlinkenMovie.c  865) 
BlinkenLib/BlinkenMovie.c  866)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  867)     BlinkenFrameRotateCw(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  868) }
BlinkenLib/BlinkenMovie.c  869) 
BlinkenLib/BlinkenMovie.c  870) void BlinkenMovieRotateCcw(stBlinkenMovie *pMovie)
BlinkenLib/BlinkenMovie.c  871) {
BlinkenLib/BlinkenMovie.c  872)   int tmp, i;
BlinkenLib/BlinkenMovie.c  873) 
BlinkenLib/BlinkenMovie.c  874)   if (pMovie == NULL)
BlinkenLib/BlinkenMovie.c  875)     return;
BlinkenLib/BlinkenMovie.c  876) 
BlinkenLib/BlinkenMovie.c  877)   tmp = pMovie->height;
BlinkenLib/BlinkenMovie.c  878)   pMovie->height = pMovie->width;
BlinkenLib/BlinkenMovie.c  879)   pMovie->width = tmp;
BlinkenLib/BlinkenMovie.c  880) 
BlinkenLib/BlinkenMovie.c  881)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  882)     BlinkenFrameRotateCcw(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  883) }
BlinkenLib/BlinkenMovie.c  884) 
BlinkenLib/BlinkenMovie.c  885) void BlinkenMovieRotateHalf(stBlinkenMovie *pMovie)
BlinkenLib/BlinkenMovie.c  886) {
BlinkenLib/BlinkenMovie.c  887)   int i;
BlinkenLib/BlinkenMovie.c  888) 
BlinkenLib/BlinkenMovie.c  889)   if (pMovie == NULL)
BlinkenLib/BlinkenMovie.c  890)     return;
BlinkenLib/BlinkenMovie.c  891) 
BlinkenLib/BlinkenMovie.c  892)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  893)     BlinkenFrameRotateHalf(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  894) }
BlinkenLib/BlinkenMovie.c  895) 
BlinkenLib/BlinkenMovie.c  896) void BlinkenMovieMirrorHor(stBlinkenMovie *pMovie)
BlinkenLib/BlinkenMovie.c  897) {
BlinkenLib/BlinkenMovie.c  898)   int i;
BlinkenLib/BlinkenMovie.c  899) 
BlinkenLib/BlinkenMovie.c  900)   if (pMovie == NULL)
BlinkenLib/BlinkenMovie.c  901)     return;
BlinkenLib/BlinkenMovie.c  902) 
BlinkenLib/BlinkenMovie.c  903)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  904)     BlinkenFrameMirrorHor(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  905) }
BlinkenLib/BlinkenMovie.c  906) 
BlinkenLib/BlinkenMovie.c  907) void BlinkenMovieMirrorVer(stBlinkenMovie *pMovie)
BlinkenLib/BlinkenMovie.c  908) {
BlinkenLib/BlinkenMovie.c  909)   int i;
BlinkenLib/BlinkenMovie.c  910) 
BlinkenLib/BlinkenMovie.c  911)   if (pMovie == NULL)
BlinkenLib/BlinkenMovie.c  912)     return;
BlinkenLib/BlinkenMovie.c  913) 
BlinkenLib/BlinkenMovie.c  914)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  915)     BlinkenFrameMirrorVer(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  916) }
BlinkenLib/BlinkenMovie.c  917) 
BlinkenLib/BlinkenMovie.c  918) void BlinkenMovieMirrorDiag(stBlinkenMovie *pMovie)
BlinkenLib/BlinkenMovie.c  919) {
BlinkenLib/BlinkenMovie.c  920)   int tmp, i;
BlinkenLib/BlinkenMovie.c  921) 
BlinkenLib/BlinkenMovie.c  922)   if (pMovie == NULL)
BlinkenLib/BlinkenMovie.c  923)     return;
BlinkenLib/BlinkenMovie.c  924) 
BlinkenLib/BlinkenMovie.c  925)   tmp = pMovie->height;
BlinkenLib/BlinkenMovie.c  926)   pMovie->height = pMovie->width;
BlinkenLib/BlinkenMovie.c  927)   pMovie->width = tmp;
BlinkenLib/BlinkenMovie.c  928) 
BlinkenLib/BlinkenMovie.c  929)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  930)     BlinkenFrameMirrorDiag(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  931) }
BlinkenLib/BlinkenMovie.c  932) 
BlinkenLib/BlinkenMovie.c  933) void BlinkenMovieMirrorDiag2(stBlinkenMovie *pMovie)
BlinkenLib/BlinkenMovie.c  934) {
BlinkenLib/BlinkenMovie.c  935)   int tmp, i;
BlinkenLib/BlinkenMovie.c  936) 
BlinkenLib/BlinkenMovie.c  937)   if (pMovie == NULL)
BlinkenLib/BlinkenMovie.c  938)     return;
BlinkenLib/BlinkenMovie.c  939) 
BlinkenLib/BlinkenMovie.c  940)   tmp = pMovie->height;
BlinkenLib/BlinkenMovie.c  941)   pMovie->height = pMovie->width;
BlinkenLib/BlinkenMovie.c  942)   pMovie->width = tmp;
BlinkenLib/BlinkenMovie.c  943) 
BlinkenLib/BlinkenMovie.c  944)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  945)     BlinkenFrameMirrorDiag2(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  946) }
BlinkenLib/BlinkenMovie.c  947) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  948) char *BlinkenMovieToString(stBlinkenMovie *pMovie)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             954)     return NULL;
BlinkenMovie.c             955) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             958)     return NULL;
BlinkenMovie.c             959) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  960)   for (i = 0; i < pMovie->frameCnt; i++) {
BlinkenLib/BlinkenMovie.c  961)     strs[i] = BlinkenFrameToString(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  962)     if (strs[i] == NULL) {
BlinkenLib/BlinkenMovie.c  963)       for (i--; i >= 0; i--)
BlinkenLib/BlinkenMovie.c  964)         free(strs[i]);
BlinkenLib/BlinkenMovie.c  965)       free(strs);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             966)       return NULL;
BlinkenMovie.c             967)     }
BlinkenMovie.c             968)   }
BlinkenMovie.c             969) 
BlinkenMovie.c             970)   size = 128;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  971)   for (i = 0; i < pMovie->infoCnt; i++)
BlinkenLib/BlinkenMovie.c  972)     size +=
BlinkenLib/BlinkenMovie.c  973)         strlen(pMovie->pppInfos[i][0]) + strlen(pMovie->pppInfos[i][1]) + 8;
BlinkenLib/BlinkenMovie.c  974)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  975)     size += strlen(strs[i]) + 32;
BlinkenLib/BlinkenMovie.c  976) 
BlinkenLib/BlinkenMovie.c  977)   str = (char *)malloc(size);
BlinkenLib/BlinkenMovie.c  978)   if (str == NULL) {
BlinkenLib/BlinkenMovie.c  979)     for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  980)       free(strs[i]);
BlinkenLib/BlinkenMovie.c  981)     free(strs);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             982)     return NULL;
BlinkenMovie.c             983)   }
BlinkenMovie.c             984) 
BlinkenMovie.c             985)   ptr = str;
BlinkenMovie.c             986) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1004) }
BlinkenMovie.c            1005) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1006) stBlinkenMovie *BlinkenMovieLoadBlm(const char *pFilename)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1008)   FILE *pFile;
BlinkenLib/BlinkenMovie.c 1009)   stBlinkenMovie *pMovie;
BlinkenLib/BlinkenMovie.c 1010)   stBlinkenFrame *pFrame;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1015)     return NULL;
BlinkenMovie.c            1016) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1025)     return NULL;
BlinkenMovie.c            1026)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1027)   // allocate a new movie
BlinkenLib/BlinkenMovie.c 1028)   pMovie = BlinkenMovieNew(height, width, 1, 1);
BlinkenLib/BlinkenMovie.c 1029)   if (pMovie == NULL) {
BlinkenLib/BlinkenMovie.c 1030)     fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1031)     return NULL;
BlinkenMovie.c            1032)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1034)   pFrame = NULL;
BlinkenMovie.c            1035)   y = 0;
BlinkenMovie.c            1036) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1037)   // read frames
BlinkenLib/BlinkenMovie.c 1038)   while (!feof(pFile)) {
BlinkenLib/BlinkenMovie.c 1039)     // skip rest of previous line (including newline)
BlinkenLib/BlinkenMovie.c 1040)     while ((chr = fgetc(pFile)) != '\n' && chr != EOF) ;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1042)     // info line
BlinkenLib/BlinkenMovie.c 1043)     if (fscanf
BlinkenLib/BlinkenMovie.c 1044)         (pFile, " # %255[A-Za-z0-9] %*[=:] %1023[^\n]", infoType,
BlinkenLib/BlinkenMovie.c 1045)          infoData) == 2) {
BlinkenLib/BlinkenMovie.c 1046)       BlinkenMovieAppendInfo(pMovie, infoType, infoData);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1048)     // start of frame
BlinkenLib/BlinkenMovie.c 1049)     else if (fscanf(pFile, " @ %u", &duration) == 1) {
BlinkenLib/BlinkenMovie.c 1050)       // create new frame and append it to movie
BlinkenLib/BlinkenMovie.c 1051)       pFrame = BlinkenFrameNew(height, width, 1, 1, duration);
BlinkenLib/BlinkenMovie.c 1052)       if (pFrame != NULL) {
BlinkenLib/BlinkenMovie.c 1053)         BlinkenFrameClear(pFrame);
BlinkenLib/BlinkenMovie.c 1054)         if (BlinkenMovieAppendFrame(pMovie, pFrame) != 0) {
BlinkenLib/BlinkenMovie.c 1055)           BlinkenFrameFree(pFrame);
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1058)         y = 0;
BlinkenMovie.c            1059)       }
BlinkenMovie.c            1060)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1061)     // data line
BlinkenLib/BlinkenMovie.c 1062)     else if (fscanf(pFile, "%1[01]", pixel) == 1) {
BlinkenLib/BlinkenMovie.c 1063)       if (pFrame != NULL) {
BlinkenLib/BlinkenMovie.c 1064)         for (x = 0;; x++) {
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1065)           BlinkenFrameSetPixel(pFrame, y, x, 0, // set pixel
BlinkenLib/BlinkenMovie.c 1066)                                (unsigned char)(pixel[0] == '1' ? 1 : 0));
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1067)           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            1068)             break;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1069)         }
BlinkenLib/BlinkenMovie.c 1070)         y++;    // next row
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1078) 
BlinkenMovie.c            1079)   return pMovie;
BlinkenMovie.c            1080) }
BlinkenMovie.c            1081) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1082) stBlinkenMovie *BlinkenMovieLoadBmm(const char *pFilename)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1084)   FILE *pFile;
BlinkenLib/BlinkenMovie.c 1085)   stBlinkenMovie *pMovie;
BlinkenLib/BlinkenMovie.c 1086)   stBlinkenFrame *pFrame;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1091)     return NULL;
BlinkenMovie.c            1092) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1101)     return NULL;
BlinkenMovie.c            1102)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1107)     return NULL;
BlinkenMovie.c            1108)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1110)   pFrame = NULL;
BlinkenMovie.c            1111)   y = 0;
BlinkenMovie.c            1112) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1113)   // read frames
BlinkenLib/BlinkenMovie.c 1114)   while (!feof(pFile)) {
BlinkenLib/BlinkenMovie.c 1115)     // skip rest of previous line (including newline)
BlinkenLib/BlinkenMovie.c 1116)     while ((chr = fgetc(pFile)) != '\n' && chr != EOF) ;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1118)     // info line
BlinkenLib/BlinkenMovie.c 1119)     if (fscanf
BlinkenLib/BlinkenMovie.c 1120)         (pFile, " # %255[A-Za-z0-9] %*[=:] %1023[^\n]", infoType,
BlinkenLib/BlinkenMovie.c 1121)          infoData) == 2) {
BlinkenLib/BlinkenMovie.c 1122)       BlinkenMovieAppendInfo(pMovie, infoType, infoData);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1124)     // start of frame
BlinkenLib/BlinkenMovie.c 1125)     else if (fscanf(pFile, " @ %u", &duration) == 1) {
BlinkenLib/BlinkenMovie.c 1126)       // create new frame and append it to movie
BlinkenLib/BlinkenMovie.c 1127)       pFrame = BlinkenFrameNew(height, width, 1, 255, duration);
BlinkenLib/BlinkenMovie.c 1128)       if (pFrame != NULL) {
BlinkenLib/BlinkenMovie.c 1129)         BlinkenFrameClear(pFrame);
BlinkenLib/BlinkenMovie.c 1130)         if (BlinkenMovieAppendFrame(pMovie, pFrame) != 0) {
BlinkenLib/BlinkenMovie.c 1131)           BlinkenFrameFree(pFrame);
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1137)     // data line
BlinkenLib/BlinkenMovie.c 1138)     else if (fscanf(pFile, "%7[0-9A-FXa-fx]", pixel) == 1) {
BlinkenLib/BlinkenMovie.c 1139)       if (pFrame != NULL) {
BlinkenLib/BlinkenMovie.c 1140)         for (x = 0;; x++) {
BlinkenLib/BlinkenMovie.c 1141)           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            1142)             break;
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1143)           BlinkenFrameSetPixel(pFrame, y, x, 0, // set pixel
BlinkenLib/BlinkenMovie.c 1144)                                (unsigned char)val);
Stefan Schuermans fixes for gcc 5.4

Stefan Schuermans authored 8 years ago

BlinkenLib/BlinkenMovie.c 1145)           if (fscanf(pFile, "%*[ \t]") != 0)     // kill space
BlinkenLib/BlinkenMovie.c 1146)             break;
BlinkenLib/BlinkenMovie.c 1147)           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            1148)             break;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1149)         }
BlinkenLib/BlinkenMovie.c 1150)         y++;    // next row
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1151)       }
BlinkenMovie.c            1152)     }
BlinkenMovie.c            1153) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1158) 
BlinkenMovie.c            1159)   return pMovie;
BlinkenMovie.c            1160) }
BlinkenMovie.c            1161) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1162) stBlinkenMovie *BlinkenMovieLoadBml(const char *pFilename)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1164)   FILE *pFile;
BlinkenLib/BlinkenMovie.c 1165)   stBlinkenMovie *pMovie;
BlinkenLib/BlinkenMovie.c 1166)   stBlinkenFrame *pFrame;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1167)   int width, height, channels, bits, maxval, chrs, y, x, c, duration, val;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1168)   char buffer[2048], infoType[256], infoData[1024], pixelFormat[16], pixel[8],
BlinkenLib/BlinkenMovie.c 1169)       *ptr, chr;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1172)     return NULL;
BlinkenMovie.c            1173) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1179)   // 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            1180)   pMovie = NULL;
BlinkenMovie.c            1181) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1183)   pFrame = NULL;
BlinkenMovie.c            1184)   y = 0;
BlinkenMovie.c            1185) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 8 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1199)     // no blm tag yet
BlinkenLib/BlinkenMovie.c 1200)     if (pMovie == 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)       // blm tag
BlinkenLib/BlinkenMovie.c 1203)       if (fscanf(pFile, "blm%2047[^>]", buffer) == 1) {
BlinkenLib/BlinkenMovie.c 1204)         // get attributes
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1207)         channels = 1;
BlinkenMovie.c            1208)         bits = 4;
BlinkenMovie.c            1209)         maxval = 15;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1210)         if ((ptr = strstr(buffer, "height=\"")) != NULL)        // height
BlinkenLib/BlinkenMovie.c 1211)           sscanf(ptr + 8, "%u", &height);
BlinkenLib/BlinkenMovie.c 1212)         if ((ptr = strstr(buffer, "width=\"")) != NULL) // width
BlinkenLib/BlinkenMovie.c 1213)           sscanf(ptr + 7, "%u", &width);
BlinkenLib/BlinkenMovie.c 1214)         if ((ptr = strstr(buffer, "channels=\"")) != NULL)      // channels
BlinkenLib/BlinkenMovie.c 1215)           sscanf(ptr + 10, "%u", &channels);
BlinkenLib/BlinkenMovie.c 1216)         if ((ptr = strstr(buffer, "bits=\"")) != NULL)  // bits
BlinkenLib/BlinkenMovie.c 1217)           sscanf(ptr + 6, "%u", &bits);
BlinkenLib/BlinkenMovie.c 1218)         maxval = (1 << bits) - 1;       // maxval
BlinkenLib/BlinkenMovie.c 1219) 
BlinkenLib/BlinkenMovie.c 1220)         // allocate a new movie
BlinkenLib/BlinkenMovie.c 1221)         pMovie = BlinkenMovieNew(height, width, channels, maxval);
BlinkenLib/BlinkenMovie.c 1222)         if (pMovie == NULL) {
BlinkenLib/BlinkenMovie.c 1223)           fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1224)           return NULL;
BlinkenMovie.c            1225)         }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1229)         //   read max 5 chars (2 already in use by prefix)
BlinkenLib/BlinkenMovie.c 1230)         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 1231)         // initialize pixel buffer with hex prefix
BlinkenLib/BlinkenMovie.c 1232)         strcpy(pixel, "0x");
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1237)     // blm tag was already found
BlinkenLib/BlinkenMovie.c 1238)     else        // if( pMovie == NULL )
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1246)       // description tag
BlinkenLib/BlinkenMovie.c 1247)       else if (fscanf(pFile, "description>%2047[^<]", buffer) == 1) {
BlinkenLib/BlinkenMovie.c 1248)         // check if generic info
BlinkenLib/BlinkenMovie.c 1249)         if (sscanf
BlinkenLib/BlinkenMovie.c 1250)             (buffer, "%255[A-Za-z0-9] %*[=:] %1023[^\n]", infoType,
BlinkenLib/BlinkenMovie.c 1251)              infoData) == 2)
BlinkenLib/BlinkenMovie.c 1252)           // add info to movie
BlinkenLib/BlinkenMovie.c 1253)           BlinkenMovieAppendInfo(pMovie, infoType, infoData);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1281)         duration = 0;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1282)         if ((ptr = strstr(buffer, "duration=\"")) != NULL)      // duration
BlinkenLib/BlinkenMovie.c 1283)           sscanf(ptr + 10, "%u", &duration);
BlinkenLib/BlinkenMovie.c 1284)         // create new frame and append it to movie
BlinkenLib/BlinkenMovie.c 1285)         pFrame = BlinkenFrameNew(height, width, channels, maxval, duration);
BlinkenLib/BlinkenMovie.c 1286)         if (pFrame != NULL) {
BlinkenLib/BlinkenMovie.c 1287)           BlinkenFrameClear(pFrame);
BlinkenLib/BlinkenMovie.c 1288)           if (BlinkenMovieAppendFrame(pMovie, pFrame) != 0) {
BlinkenLib/BlinkenMovie.c 1289)             BlinkenFrameFree(pFrame);
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1292)           y = 0;
BlinkenMovie.c            1293)         }
BlinkenMovie.c            1294)       }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1295)       // row tag
BlinkenLib/BlinkenMovie.c 1296)       else if (fscanf(pFile, "row%c", &chr) == 1 && chr == '>') {
BlinkenLib/BlinkenMovie.c 1297)         if (pFrame != NULL) {
BlinkenLib/BlinkenMovie.c 1298)           // parse row
BlinkenLib/BlinkenMovie.c 1299)           for (x = 0; x < width; x++) {
BlinkenLib/BlinkenMovie.c 1300)             for (c = 0; c < channels; c++) {
BlinkenLib/BlinkenMovie.c 1301)               // read next pixel (one channel of pixel)
BlinkenLib/BlinkenMovie.c 1302)               if (fscanf(pFile, pixelFormat, pixel + 2) != 1) {
BlinkenLib/BlinkenMovie.c 1303)                 x = width;      // also terminate x loop
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1304)                 break;
BlinkenMovie.c            1305)               }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1306)               // convert pixel (one channel of pixel) to number
BlinkenLib/BlinkenMovie.c 1307)               if (sscanf(pixel, "%i", &val) != 1) {
BlinkenLib/BlinkenMovie.c 1308)                 x = width;      // also terminate x loop
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1309)                 break;
BlinkenMovie.c            1310)               }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1311)               // set pixel (one channel of pixel)
BlinkenLib/BlinkenMovie.c 1312)               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            1313)             }
BlinkenMovie.c            1314)           }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1316)         }
BlinkenMovie.c            1317)       }
BlinkenMovie.c            1318) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1325) 
BlinkenMovie.c            1326)   return pMovie;
BlinkenMovie.c            1327) }
BlinkenMovie.c            1328) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1329) stBlinkenMovie *BlinkenMovieLoadBbm(const char *pFilename)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1331)   FILE *pFile;
BlinkenLib/BlinkenMovie.c 1332)   stBlinkenMovie *pMovie;
BlinkenLib/BlinkenMovie.c 1333)   stBlinkenFrame *pFrame;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 11 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1336)   unsigned short headerHeight, headerWidth, headerChannels, headerMaxval;
BlinkenMovie.c            1337)   unsigned long subHeaderMagic, frameStartMarkerMagic;
BlinkenMovie.c            1338)   unsigned short subHeaderSize;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1344)     return NULL;
BlinkenMovie.c            1345) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1354)     return NULL;
BlinkenMovie.c            1355)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1359)   headerHeight = (unsigned short)header[4] << 8 | (unsigned short)header[5];
BlinkenMovie.c            1360)   headerWidth = (unsigned short)header[6] << 8 | (unsigned short)header[7];
BlinkenMovie.c            1361)   headerChannels = (unsigned short)header[8] << 8 | (unsigned short)header[9];
BlinkenMovie.c            1362)   headerMaxval = (unsigned short)header[10] << 8 | (unsigned short)header[11];
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1363)   headerFramePtr =
BlinkenLib/BlinkenMovie.c 1364)       (unsigned long)header[20] << 24 | (unsigned long)header[21] << 16 |
BlinkenLib/BlinkenMovie.c 1365)       (unsigned long)header[22] << 8 | (unsigned long)header[23];
BlinkenLib/BlinkenMovie.c 1366)   // check magic
BlinkenLib/BlinkenMovie.c 1367)   if (headerMagic != 0x23542666) {
BlinkenLib/BlinkenMovie.c 1368)     fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1369)     return NULL;
BlinkenMovie.c            1370)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1371)   // allocate a new movie
BlinkenLib/BlinkenMovie.c 1372)   pMovie =
BlinkenLib/BlinkenMovie.c 1373)       BlinkenMovieNew(headerHeight, headerWidth, headerChannels,
BlinkenLib/BlinkenMovie.c 1374)                       headerMaxval);
BlinkenLib/BlinkenMovie.c 1375)   if (pMovie == NULL) {
BlinkenLib/BlinkenMovie.c 1376)     fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1377)     return NULL;
BlinkenMovie.c            1378)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1379)   // read subheaders
BlinkenLib/BlinkenMovie.c 1380)   while (ftell(pFile) + 6 <= (long)headerFramePtr) {
BlinkenLib/BlinkenMovie.c 1381)     if (fread(subHeader, 1, 6, pFile) != 6) {
BlinkenLib/BlinkenMovie.c 1382)       BlinkenMovieFree(pMovie);
BlinkenLib/BlinkenMovie.c 1383)       fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1384)       return NULL;
BlinkenMovie.c            1385)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1386)     subHeaderMagic =
BlinkenLib/BlinkenMovie.c 1387)         (unsigned long)subHeader[0] << 24 | (unsigned long)subHeader[1] << 16
BlinkenLib/BlinkenMovie.c 1388)         | (unsigned long)subHeader[2] << 8 | (unsigned long)subHeader[3];
BlinkenLib/BlinkenMovie.c 1389)     subHeaderSize =
BlinkenLib/BlinkenMovie.c 1390)         (unsigned short)subHeader[4] << 8 | (unsigned short)subHeader[5];
BlinkenLib/BlinkenMovie.c 1391) 
BlinkenLib/BlinkenMovie.c 1392)     // header fits into gap to frame start
BlinkenLib/BlinkenMovie.c 1393)     if (subHeaderSize >= 6
BlinkenLib/BlinkenMovie.c 1394)         && ftell(pFile) + subHeaderSize - 6 <= (long)headerFramePtr) {
BlinkenLib/BlinkenMovie.c 1395)       // info header
BlinkenLib/BlinkenMovie.c 1396)       if (subHeaderMagic == 0x696E666F) // 'i' 'n' 'f' 'o'
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1398)         // read rest of info header
BlinkenLib/BlinkenMovie.c 1399)         pInfoHeader = (char *)malloc(subHeaderSize - 6);
BlinkenLib/BlinkenMovie.c 1400)         if (pInfoHeader == NULL) {
BlinkenLib/BlinkenMovie.c 1401)           BlinkenMovieFree(pMovie);
BlinkenLib/BlinkenMovie.c 1402)           fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1405)         if (fread(pInfoHeader, 1, subHeaderSize - 6, pFile) !=
BlinkenLib/BlinkenMovie.c 1406)             (unsigned short)(subHeaderSize - 6)) {
BlinkenLib/BlinkenMovie.c 1407)           free(pInfoHeader);
BlinkenLib/BlinkenMovie.c 1408)           BlinkenMovieFree(pMovie);
BlinkenLib/BlinkenMovie.c 1409)           fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1410)           return NULL;
BlinkenMovie.c            1411)         }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1412)         // parse information
BlinkenLib/BlinkenMovie.c 1413)         if ((pInfoHeaderX =
BlinkenLib/BlinkenMovie.c 1414)              memchr(pInfoHeader, 0, subHeaderSize - 6)) != NULL) {
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1427)     }   // if( ftell( pFile ) ...
BlinkenLib/BlinkenMovie.c 1428)   }     // while( ftell( pFile ) ...
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1437)     return NULL;
BlinkenMovie.c            1438)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1439)   frameStartMarkerMagic =
BlinkenLib/BlinkenMovie.c 1440)       (unsigned long)frameStartMarker[0] << 24 | (unsigned long)
BlinkenLib/BlinkenMovie.c 1441)       frameStartMarker[1] << 16 | (unsigned long)frameStartMarker[2] << 8 |
BlinkenLib/BlinkenMovie.c 1442)       (unsigned long)frameStartMarker[3];
BlinkenLib/BlinkenMovie.c 1443)   if (frameStartMarkerMagic != 0x66726D73)      // 'f' 'r' 'm' 's'
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1447)     return NULL;
BlinkenMovie.c            1448)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1451)   pFrameData = (unsigned char *)malloc(len);
BlinkenLib/BlinkenMovie.c 1452)   if (pFrameData == NULL) {
BlinkenLib/BlinkenMovie.c 1453)     BlinkenMovieFree(pMovie);
BlinkenLib/BlinkenMovie.c 1454)     fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1455)     return NULL;
BlinkenMovie.c            1456)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1457)   // read frames
BlinkenLib/BlinkenMovie.c 1458)   for (;;) {
BlinkenLib/BlinkenMovie.c 1459)     // read frame
BlinkenLib/BlinkenMovie.c 1460)     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            1461)       break;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1462)     duration =
BlinkenLib/BlinkenMovie.c 1463)         (unsigned short)pFrameData[0] << 8 | (unsigned short)pFrameData[1];
BlinkenLib/BlinkenMovie.c 1464)     // build frame and append it to movie
BlinkenLib/BlinkenMovie.c 1465)     pFrame =
BlinkenLib/BlinkenMovie.c 1466)         BlinkenFrameNew(headerHeight, headerWidth, headerChannels,
BlinkenLib/BlinkenMovie.c 1467)                         headerMaxval, duration);
BlinkenLib/BlinkenMovie.c 1468)     if (pFrame == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1471)     for (y = 0; y < headerHeight; y++)
BlinkenLib/BlinkenMovie.c 1472)       for (x = 0; x < headerWidth; x++)
BlinkenLib/BlinkenMovie.c 1473)         for (c = 0; c < headerChannels; c++, i++)
BlinkenLib/BlinkenMovie.c 1474)           BlinkenFrameSetPixel(pFrame, y, x, c, pFrameData[i]);
BlinkenLib/BlinkenMovie.c 1475)     if (BlinkenMovieAppendFrame(pMovie, pFrame) != 0) {
BlinkenLib/BlinkenMovie.c 1476)       BlinkenFrameFree(pFrame);
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1487) 
BlinkenMovie.c            1488)   return pMovie;
BlinkenMovie.c            1489) }
BlinkenMovie.c            1490) 
Christian Heimke BlinkenLib v.0.6.0 (2008-05...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c 1491) #ifdef BLINKENLIB_CFG_MNG
BlinkenLib/BlinkenMovie.c 1492) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1493) stBlinkenMovie *BlinkenMovieLoadMng(const char *pFilename)
Christian Heimke BlinkenLib v.0.6.0 (2008-05...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c 1496) }
BlinkenLib/BlinkenMovie.c 1497) 
BlinkenLib/BlinkenMovie.c 1498) #endif // #ifdef BLINKENLIB_CFG_MNG
BlinkenLib/BlinkenMovie.c 1499) 
Stefan Schuermans implement reading GIFs

Stefan Schuermans authored 7 years ago

BlinkenLib/BlinkenMovie.c 1500) #ifdef BLINKENLIB_CFG_GIF
BlinkenLib/BlinkenMovie.c 1501) 
BlinkenLib/BlinkenMovie.c 1502) stBlinkenMovie *BlinkenMovieLoadGif(const char *pFilename)
BlinkenLib/BlinkenMovie.c 1503) {
BlinkenLib/BlinkenMovie.c 1504)   return BlinkenGifLoad(pFilename);
BlinkenLib/BlinkenMovie.c 1505) }
BlinkenLib/BlinkenMovie.c 1506) 
BlinkenLib/BlinkenMovie.c 1507) #endif // #ifdef BLINKENLIB_CFG_GIF
BlinkenLib/BlinkenMovie.c 1508) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1510) {
BlinkenMovie.c            1511)   int len;
BlinkenMovie.c            1512) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1514)     return NULL;
BlinkenMovie.c            1515) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1516)   len = strlen(pFilename);
BlinkenLib/BlinkenMovie.c 1517)   if (len > 4 && strcmp(pFilename + len - 4, ".blm") == 0)
BlinkenLib/BlinkenMovie.c 1518)     return BlinkenMovieLoadBlm(pFilename);
BlinkenLib/BlinkenMovie.c 1519)   if (len > 4 && strcmp(pFilename + len - 4, ".bmm") == 0)
BlinkenLib/BlinkenMovie.c 1520)     return BlinkenMovieLoadBmm(pFilename);
BlinkenLib/BlinkenMovie.c 1521)   if (len > 4 && strcmp(pFilename + len - 4, ".bml") == 0)
BlinkenLib/BlinkenMovie.c 1522)     return BlinkenMovieLoadBml(pFilename);
BlinkenLib/BlinkenMovie.c 1523)   if (len > 4 && strcmp(pFilename + len - 4, ".bbm") == 0)
BlinkenLib/BlinkenMovie.c 1524)     return BlinkenMovieLoadBbm(pFilename);
Christian Heimke BlinkenLib v.0.6.0 (2008-05...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 7 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1533)   return NULL;
BlinkenMovie.c            1534) }
BlinkenMovie.c            1535) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1536) int BlinkenMovieSaveBlm(stBlinkenMovie *pMovie, const char *pFilename)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1549)   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            1550) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1551)   // open file
BlinkenLib/BlinkenMovie.c 1552)   pFile = fopen(pFilename, "wt");
BlinkenLib/BlinkenMovie.c 1553)   if (pFile == NULL) {
BlinkenLib/BlinkenMovie.c 1554)     BlinkenMovieFree(pOutMovie);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1557)   // write header line
BlinkenLib/BlinkenMovie.c 1558)   fprintf(pFile, "# BlinkenLights Movie %ux%u\n", pOutMovie->width,
BlinkenLib/BlinkenMovie.c 1559)           pOutMovie->height);
BlinkenLib/BlinkenMovie.c 1560) 
BlinkenLib/BlinkenMovie.c 1561)   // write information lines
BlinkenLib/BlinkenMovie.c 1562)   for (i = 0; i < pOutMovie->infoCnt; i++)
BlinkenLib/BlinkenMovie.c 1563)     fprintf(pFile, "# %s = %s\n", pOutMovie->pppInfos[i][0],
BlinkenLib/BlinkenMovie.c 1564)             pOutMovie->pppInfos[i][1]);
BlinkenLib/BlinkenMovie.c 1565) 
BlinkenLib/BlinkenMovie.c 1566)   // write frames
BlinkenLib/BlinkenMovie.c 1567)   for (i = 0; i < pOutMovie->frameCnt; i++) {
BlinkenLib/BlinkenMovie.c 1568)     fprintf(pFile, "\n@%u\n",
BlinkenLib/BlinkenMovie.c 1569)             BlinkenFrameGetDuration(pOutMovie->ppFrames[i]));
BlinkenLib/BlinkenMovie.c 1570)     for (y = 0; y < pOutMovie->height; y++) {
BlinkenLib/BlinkenMovie.c 1571)       for (x = 0; x < pOutMovie->width; x++) {
BlinkenLib/BlinkenMovie.c 1572)         if (BlinkenFrameGetPixel(pOutMovie->ppFrames[i], y, x, 0) != 0)
BlinkenLib/BlinkenMovie.c 1573)           fprintf(pFile, "1");
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1578)     }
BlinkenMovie.c            1579)   }
BlinkenMovie.c            1580) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1588)   return 0;
BlinkenMovie.c            1589) }
BlinkenMovie.c            1590) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1591) int BlinkenMovieSaveBmm(stBlinkenMovie *pMovie, const char *pFilename)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1604)   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            1605) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1606)   // open file
BlinkenLib/BlinkenMovie.c 1607)   pFile = fopen(pFilename, "wt");
BlinkenLib/BlinkenMovie.c 1608)   if (pFile == NULL) {
BlinkenLib/BlinkenMovie.c 1609)     BlinkenMovieFree(pOutMovie);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1612)   // write header line
BlinkenLib/BlinkenMovie.c 1613)   fprintf(pFile, "# BlinkenMini Movie %ux%u\n", pOutMovie->width,
BlinkenLib/BlinkenMovie.c 1614)           pOutMovie->height);
BlinkenLib/BlinkenMovie.c 1615) 
BlinkenLib/BlinkenMovie.c 1616)   // write information lines
BlinkenLib/BlinkenMovie.c 1617)   for (i = 0; i < pOutMovie->infoCnt; i++)
BlinkenLib/BlinkenMovie.c 1618)     fprintf(pFile, "# %s = %s\n", pOutMovie->pppInfos[i][0],
BlinkenLib/BlinkenMovie.c 1619)             pOutMovie->pppInfos[i][1]);
BlinkenLib/BlinkenMovie.c 1620) 
BlinkenLib/BlinkenMovie.c 1621)   // write frames
BlinkenLib/BlinkenMovie.c 1622)   for (i = 0; i < pOutMovie->frameCnt; i++) {
BlinkenLib/BlinkenMovie.c 1623)     fprintf(pFile, "\n@%u\n",
BlinkenLib/BlinkenMovie.c 1624)             BlinkenFrameGetDuration(pOutMovie->ppFrames[i]));
BlinkenLib/BlinkenMovie.c 1625)     for (y = 0; y < pOutMovie->height; y++) {
BlinkenLib/BlinkenMovie.c 1626)       fprintf(pFile, "0x%02X",
BlinkenLib/BlinkenMovie.c 1627)               BlinkenFrameGetPixel(pOutMovie->ppFrames[i], y, 0, 0));
BlinkenLib/BlinkenMovie.c 1628)       for (x = 1; x < pOutMovie->width; x++)
BlinkenLib/BlinkenMovie.c 1629)         fprintf(pFile, " 0x%02X",
BlinkenLib/BlinkenMovie.c 1630)                 BlinkenFrameGetPixel(pOutMovie->ppFrames[i], y, x, 0));
BlinkenLib/BlinkenMovie.c 1631)       fprintf(pFile, "\n");
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1632)     }
BlinkenMovie.c            1633)   }
BlinkenMovie.c            1634) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1642)   return 0;
BlinkenMovie.c            1643) }
BlinkenMovie.c            1644) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1645) int BlinkenMovieSaveBml(stBlinkenMovie *pMovie, const char *pFilename)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1658)   val = pOutMovie->maxval;      // get number of bits
BlinkenLib/BlinkenMovie.c 1659)   for (bits = 0; val != 0; val >>= 1, bits++) ;
BlinkenLib/BlinkenMovie.c 1660)   BlinkenMovieResize(pOutMovie, pOutMovie->height, pOutMovie->width,
BlinkenLib/BlinkenMovie.c 1661)                      pOutMovie->channels, (1 << bits) - 1);
BlinkenLib/BlinkenMovie.c 1662) 
BlinkenLib/BlinkenMovie.c 1663)   // open file
BlinkenLib/BlinkenMovie.c 1664)   pFile = fopen(pFilename, "wt");
BlinkenLib/BlinkenMovie.c 1665)   if (pFile == NULL) {
BlinkenLib/BlinkenMovie.c 1666)     BlinkenMovieFree(pOutMovie);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1669)   // write header line
BlinkenLib/BlinkenMovie.c 1670)   fprintf(pFile, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
BlinkenLib/BlinkenMovie.c 1671) 
BlinkenLib/BlinkenMovie.c 1672)   // write blm start tag
BlinkenLib/BlinkenMovie.c 1673)   fprintf(pFile,
BlinkenLib/BlinkenMovie.c 1674)           "<blm width=\"%u\" height=\"%u\" bits=\"%u\" channels=\"%u\">\n",
BlinkenLib/BlinkenMovie.c 1675)           pOutMovie->width, pOutMovie->height, bits, pOutMovie->channels);
BlinkenLib/BlinkenMovie.c 1676) 
BlinkenLib/BlinkenMovie.c 1677)   // write information lines
BlinkenLib/BlinkenMovie.c 1678)   fprintf(pFile, "\t<header>\n");
BlinkenLib/BlinkenMovie.c 1679)   for (i = 0; i < pOutMovie->infoCnt; i++) {
BlinkenLib/BlinkenMovie.c 1680)     if (strcmp(pOutMovie->pppInfos[i][0], "title") == 0)
BlinkenLib/BlinkenMovie.c 1681)       fprintf(pFile, "\t\t<title>%s</title>\n", pOutMovie->pppInfos[i][1]);
BlinkenLib/BlinkenMovie.c 1682)     else if (strcmp(pOutMovie->pppInfos[i][0], "description") == 0)
BlinkenLib/BlinkenMovie.c 1683)       fprintf(pFile, "\t\t<description>%s</description>\n",
BlinkenLib/BlinkenMovie.c 1684)               pOutMovie->pppInfos[i][1]);
BlinkenLib/BlinkenMovie.c 1685)     else if (strcmp(pOutMovie->pppInfos[i][0], "creator") == 0)
BlinkenLib/BlinkenMovie.c 1686)       fprintf(pFile, "\t\t<creator>%s</creator>\n",
BlinkenLib/BlinkenMovie.c 1687)               pOutMovie->pppInfos[i][1]);
BlinkenLib/BlinkenMovie.c 1688)     else if (strcmp(pOutMovie->pppInfos[i][0], "author") == 0)
BlinkenLib/BlinkenMovie.c 1689)       fprintf(pFile, "\t\t<author>%s</author>\n", pOutMovie->pppInfos[i][1]);
BlinkenLib/BlinkenMovie.c 1690)     else if (strcmp(pOutMovie->pppInfos[i][0], "email") == 0)
BlinkenLib/BlinkenMovie.c 1691)       fprintf(pFile, "\t\t<email>%s</email>\n", pOutMovie->pppInfos[i][1]);
BlinkenLib/BlinkenMovie.c 1692)     else if (strcmp(pOutMovie->pppInfos[i][0], "url") == 0)
BlinkenLib/BlinkenMovie.c 1693)       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            1694)     else
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1695)       fprintf(pFile, "\t\t<description>%s: %s</description>\n",
BlinkenLib/BlinkenMovie.c 1696)               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            1697)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1698)   fprintf(pFile, "\t</header>\n");
BlinkenLib/BlinkenMovie.c 1699) 
BlinkenLib/BlinkenMovie.c 1700)   // write frames
BlinkenLib/BlinkenMovie.c 1701)   for (i = 0; i < pOutMovie->frameCnt; i++) {
BlinkenLib/BlinkenMovie.c 1702)     fprintf(pFile, "\n\t<frame duration=\"%u\">\n",
BlinkenLib/BlinkenMovie.c 1703)             BlinkenFrameGetDuration(pOutMovie->ppFrames[i]));
BlinkenLib/BlinkenMovie.c 1704)     for (y = 0; y < pOutMovie->height; y++) {
BlinkenLib/BlinkenMovie.c 1705)       fprintf(pFile, "\t\t<row>");
BlinkenLib/BlinkenMovie.c 1706)       for (x = 0; x < pOutMovie->width; x++)
BlinkenLib/BlinkenMovie.c 1707)         for (c = 0; c < pOutMovie->channels; c++)
BlinkenLib/BlinkenMovie.c 1708)           fprintf(pFile, bits > 4 ? "%02X" : "%01X",
BlinkenLib/BlinkenMovie.c 1709)                   BlinkenFrameGetPixel(pOutMovie->ppFrames[i], y, x, c));
BlinkenLib/BlinkenMovie.c 1710)       fprintf(pFile, "</row>\n");
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1725)   return 0;
BlinkenMovie.c            1726) }
BlinkenMovie.c            1727) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1728) int BlinkenMovieSaveBbm(stBlinkenMovie *pMovie, const char *pFilename)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1730)   unsigned char *pFrameData;
BlinkenLib/BlinkenMovie.c 1731)   FILE *pFile;
BlinkenLib/BlinkenMovie.c 1732)   unsigned char header[24], infoHeader[6], framePointer[4],
BlinkenLib/BlinkenMovie.c 1733)       frameStartMarker[4];
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1740)   // allocate frame data buffer
BlinkenLib/BlinkenMovie.c 1741)   pFrameData =
BlinkenLib/BlinkenMovie.c 1742)       (unsigned char *)malloc(2 +
BlinkenLib/BlinkenMovie.c 1743)                               pMovie->height * pMovie->width *
BlinkenLib/BlinkenMovie.c 1744)                               pMovie->channels);
BlinkenLib/BlinkenMovie.c 1745)   if (pFrameData == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1748)   // open file
BlinkenLib/BlinkenMovie.c 1749)   pFile = fopen(pFilename, "wb");
BlinkenLib/BlinkenMovie.c 1750)   if (pFile == NULL) {
BlinkenLib/BlinkenMovie.c 1751)     free(pFrameData);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1774)   header[16] = (unsigned char)(duration >> 24);
BlinkenMovie.c            1775)   header[17] = (unsigned char)(duration >> 16);
BlinkenMovie.c            1776)   header[18] = (unsigned char)(duration >> 8);
BlinkenMovie.c            1777)   header[19] = (unsigned char)duration;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1778)   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            1779)   header[21] = 0;
BlinkenMovie.c            1780)   header[22] = 0;
BlinkenMovie.c            1781)   header[23] = 0;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1791)       len1 = 32760;
BlinkenMovie.c            1792)     len = 8 + len0 + len1;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1793)     infoHeader[0] = 0x69;       // 'i'
BlinkenLib/BlinkenMovie.c 1794)     infoHeader[1] = 0x6E;       // 'n'
BlinkenLib/BlinkenMovie.c 1795)     infoHeader[2] = 0x66;       // 'f'
BlinkenLib/BlinkenMovie.c 1796)     infoHeader[3] = 0x6F;       // 'o'
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1799)     fwrite(infoHeader, 1, 6, pFile);
BlinkenLib/BlinkenMovie.c 1800)     fwrite(pMovie->pppInfos[i][0], 1, len0, pFile);
BlinkenLib/BlinkenMovie.c 1801)     fwrite("\0", 1, 1, pFile);
BlinkenLib/BlinkenMovie.c 1802)     fwrite(pMovie->pppInfos[i][1], 1, len1, pFile);
BlinkenLib/BlinkenMovie.c 1803)     fwrite("\0", 1, 1, pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1808)   framePointer[0] = (unsigned char)(pos >> 24);
BlinkenMovie.c            1809)   framePointer[1] = (unsigned char)(pos >> 16);
BlinkenMovie.c            1810)   framePointer[2] = (unsigned char)(pos >> 8);
BlinkenMovie.c            1811)   framePointer[3] = (unsigned char)pos;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1812)   fseek(pFile, 20, SEEK_SET);
BlinkenLib/BlinkenMovie.c 1813)   fwrite(framePointer, 1, 4, pFile);
BlinkenLib/BlinkenMovie.c 1814)   fseek(pFile, pos, SEEK_SET);
BlinkenLib/BlinkenMovie.c 1815) 
BlinkenLib/BlinkenMovie.c 1816)   // write frame start marker
BlinkenLib/BlinkenMovie.c 1817)   frameStartMarker[0] = 0x66;   // 'f'
BlinkenLib/BlinkenMovie.c 1818)   frameStartMarker[1] = 0x72;   // 'r'
BlinkenLib/BlinkenMovie.c 1819)   frameStartMarker[2] = 0x6D;   // 'm'
BlinkenLib/BlinkenMovie.c 1820)   frameStartMarker[3] = 0x73;   // 's'
BlinkenLib/BlinkenMovie.c 1821)   fwrite(frameStartMarker, 1, 4, pFile);
BlinkenLib/BlinkenMovie.c 1822) 
BlinkenLib/BlinkenMovie.c 1823)   // write frames
BlinkenLib/BlinkenMovie.c 1824)   for (i = 0; i < pMovie->frameCnt; i++) {
BlinkenLib/BlinkenMovie.c 1825)     val = BlinkenFrameGetDuration(pMovie->ppFrames[i]);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1828)     for (j = 2, y = 0; y < pMovie->height; y++)
BlinkenLib/BlinkenMovie.c 1829)       for (x = 0; x < pMovie->width; x++)
BlinkenLib/BlinkenMovie.c 1830)         for (c = 0; c < pMovie->channels; c++, j++)
BlinkenLib/BlinkenMovie.c 1831)           pFrameData[j] = BlinkenFrameGetPixel(pMovie->ppFrames[i], y, x, c);
BlinkenLib/BlinkenMovie.c 1832)     fwrite(pFrameData, 1, j, pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1842)   return 0;
BlinkenMovie.c            1843) }
BlinkenMovie.c            1844) 
Christian Heimke BlinkenLib v.0.6.0 (2008-05...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c 1845) #ifdef BLINKENLIB_CFG_MNG
BlinkenLib/BlinkenMovie.c 1846) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1847) int BlinkenMovieSaveMng(stBlinkenMovie *pMovie, const char *pFilename)
Christian Heimke BlinkenLib v.0.6.0 (2008-05...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c 1850) }
BlinkenLib/BlinkenMovie.c 1851) 
BlinkenLib/BlinkenMovie.c 1852) #endif // #ifdef BLINKENLIB_CFG_MNG
BlinkenLib/BlinkenMovie.c 1853) 
Stefan Schuermans implement writing GIFs

Stefan Schuermans authored 7 years ago

BlinkenLib/BlinkenMovie.c 1854) #ifdef BLINKENLIB_CFG_GIF
BlinkenLib/BlinkenMovie.c 1855) 
BlinkenLib/BlinkenMovie.c 1856) int BlinkenMovieSaveGif(stBlinkenMovie *pMovie, const char *pFilename)
BlinkenLib/BlinkenMovie.c 1857) {
BlinkenLib/BlinkenMovie.c 1858)   return BlinkenGifSave(pMovie, pFilename);
BlinkenLib/BlinkenMovie.c 1859) }
BlinkenLib/BlinkenMovie.c 1860) 
BlinkenLib/BlinkenMovie.c 1861) #endif // #ifdef BLINKENLIB_CFG_GIF
BlinkenLib/BlinkenMovie.c 1862) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1864) {
BlinkenMovie.c            1865)   int len;
BlinkenMovie.c            1866) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 7 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1887)   return -1;
BlinkenMovie.c            1888) }
BlinkenMovie.c            1889) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1891)                       etBlinkenProto proto, int maxidle)
BlinkenLib/BlinkenMovie.c 1892) // udp socket must be "connected"
BlinkenLib/BlinkenMovie.c 1893) // maxidle is the maximum idle time between two frames in ms (last frame is
BlinkenLib/BlinkenMovie.c 1894) // 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            1895) {
Christian Heimke BlinkenLib v.0.5.4 (2008-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1896)   int i, len, duration, dur;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1897)   char buffer[65536];   // 64kB is more than maximum UDP size
BlinkenLib/BlinkenMovie.c 1898) 
BlinkenLib/BlinkenMovie.c 1899)   for (i = 0; i < pMovie->frameCnt; i++) {
BlinkenLib/BlinkenMovie.c 1900)     len =
BlinkenLib/BlinkenMovie.c 1901)         BlinkenFrameToNetwork(pMovie->ppFrames[i], proto, buffer,
BlinkenLib/BlinkenMovie.c 1902)                               sizeof(buffer));
BlinkenLib/BlinkenMovie.c 1903)     duration = BlinkenFrameGetDuration(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c 1904)     if (len > 0) {
BlinkenLib/BlinkenMovie.c 1905)       while (duration > 0) {
BlinkenLib/BlinkenMovie.c 1906)         send(udpSocket, buffer, len, 0);
BlinkenLib/BlinkenMovie.c 1907)         dur = maxidle > 0 ? mini(maxidle, duration) : duration;
BlinkenLib/BlinkenMovie.c 1908)         msleep(dur);
BlinkenLib/BlinkenMovie.c 1909)         duration -= dur;
Christian Heimke BlinkenLib v.0.5.4 (2008-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1910)       }
BlinkenMovie.c            1911)     }
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

BlinkenMovie.c            1912)   }
BlinkenMovie.c            1913) }
BlinkenMovie.c            1914) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1915) stBlinkenMovie *BlinkenMovieReceive(SOCKET udpSocket, int timeout,
BlinkenLib/BlinkenMovie.c 1916)                                     etBlinkenProto * pProto)
BlinkenLib/BlinkenMovie.c 1917) // udp socket must be "bound" and should be "connected"
BlinkenLib/BlinkenMovie.c 1918) // after timeout ms of no reception, the movie is considered to be complete
BlinkenLib/BlinkenMovie.c 1919) // 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            1920) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1925)   struct timeval timeo;
BlinkenMovie.c            1926)   unsigned int lastTime, curTime;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1927)   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            1928)   int len;
BlinkenMovie.c            1929) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1932)     timeout = 0;
BlinkenMovie.c            1933) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1935)   pMovie = NULL;
BlinkenMovie.c            1936)   proto = BlinkenProtoNone;
BlinkenMovie.c            1937)   pLastFrame = NULL;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1945)     // timeout or error
BlinkenLib/BlinkenMovie.c 1946)     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            1947)       break;
BlinkenMovie.c            1948) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1954)     // get frame from data
BlinkenLib/BlinkenMovie.c 1955)     pFrame = BlinkenFrameFromNetwork(buffer, len, &p);
BlinkenLib/BlinkenMovie.c 1956)     if (pFrame != NULL) {
BlinkenLib/BlinkenMovie.c 1957)       // valid protocol
BlinkenLib/BlinkenMovie.c 1958)       if (p != BlinkenProtoNone) {
BlinkenLib/BlinkenMovie.c 1959)         // first frame
BlinkenLib/BlinkenMovie.c 1960)         if (proto == BlinkenProtoNone)
BlinkenLib/BlinkenMovie.c 1961)           proto = p;    // use this protocol
BlinkenLib/BlinkenMovie.c 1962)         // protocol matches
BlinkenLib/BlinkenMovie.c 1963)         if (p == proto) {
BlinkenLib/BlinkenMovie.c 1964)           // no movie yet
BlinkenLib/BlinkenMovie.c 1965)           if (pMovie == NULL) {
BlinkenLib/BlinkenMovie.c 1966)             // allocate a new movie
BlinkenLib/BlinkenMovie.c 1967)             pMovie = BlinkenMovieNew(BlinkenFrameGetHeight(pFrame),
BlinkenLib/BlinkenMovie.c 1968)                                      BlinkenFrameGetWidth(pFrame),
BlinkenLib/BlinkenMovie.c 1969)                                      BlinkenFrameGetChannels(pFrame),
BlinkenLib/BlinkenMovie.c 1970)                                      BlinkenFrameGetMaxval(pFrame));
BlinkenLib/BlinkenMovie.c 1971)             if (pMovie == NULL) {
BlinkenLib/BlinkenMovie.c 1972)               BlinkenFrameFree(pFrame);
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

BlinkenMovie.c            1973)               break;
BlinkenMovie.c            1974)             }
BlinkenMovie.c            1975)           }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1976)           // ignore frame if it is equal to last one
BlinkenLib/BlinkenMovie.c 1977)           if (pMovie->frameCnt > 0) {
BlinkenLib/BlinkenMovie.c 1978)             if (BlinkenFrameCompare
BlinkenLib/BlinkenMovie.c 1979)                 (pFrame, pMovie->ppFrames[pMovie->frameCnt - 1]) == 0) {
BlinkenLib/BlinkenMovie.c 1980)               BlinkenFrameFree(pFrame);
Christian Heimke BlinkenLib v.0.5.4 (2008-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1981)               continue;
BlinkenMovie.c            1982)             }
BlinkenMovie.c            1983)           }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1984)           // append frame to movie
BlinkenLib/BlinkenMovie.c 1985)           if (BlinkenMovieAppendFrame(pMovie, pFrame) == 0) {
BlinkenLib/BlinkenMovie.c 1986)             // get current time
BlinkenLib/BlinkenMovie.c 1987)             curTime = get_ms();
BlinkenLib/BlinkenMovie.c 1988)             // set duration of last frame
BlinkenLib/BlinkenMovie.c 1989)             if (pLastFrame != NULL)
BlinkenLib/BlinkenMovie.c 1990)               BlinkenFrameSetDuration(pLastFrame, curTime - lastTime);
BlinkenLib/BlinkenMovie.c 1991)             // 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            1992)             pLastFrame = pFrame;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1996)         }       // if( p == proto )
BlinkenLib/BlinkenMovie.c 1997)       } // if( p != BlinkenProtoNone )
BlinkenLib/BlinkenMovie.c 1998)       // free frame if it was not appended
BlinkenLib/BlinkenMovie.c 1999)       if (pFrame != NULL)
BlinkenLib/BlinkenMovie.c 2000)         BlinkenFrameFree(pFrame);
BlinkenLib/BlinkenMovie.c 2001)     }   // if( pFrame != NULL )
BlinkenLib/BlinkenMovie.c 2002)   }     // for( ; ; )
BlinkenLib/BlinkenMovie.c 2003) 
BlinkenLib/BlinkenMovie.c 2004)   // get current time
BlinkenLib/BlinkenMovie.c 2005)   curTime = get_ms();
BlinkenLib/BlinkenMovie.c 2006)   // set duration of last frame
BlinkenLib/BlinkenMovie.c 2007)   if (pLastFrame != NULL)
BlinkenLib/BlinkenMovie.c 2008)     BlinkenFrameSetDuration(pLastFrame, curTime - lastTime);
BlinkenLib/BlinkenMovie.c 2009) 
BlinkenLib/BlinkenMovie.c 2010)   // return protocol
BlinkenLib/BlinkenMovie.c 2011)   if (pProto != NULL)
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 2013)   // return movie