c9469b64fc3933d0565ffba8a45be8a39df6b927
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/BlinkenFrame.h>
BlinkenLib/BlinkenMovie.c   21) #include <BlinkenLib/BlinkenMovie.h>
Stefan Schuermans restructure directories

Stefan Schuermans authored 5 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 5 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 7 years ago

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

Stefan Schuermans authored 5 years ago

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

Stefan Schuermans authored 7 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c   74)   stBlinkenMovie *pMovie;
BlinkenLib/BlinkenMovie.c   75) 
BlinkenLib/BlinkenMovie.c   76)   if (height < BlinkenHeightMin)
BlinkenLib/BlinkenMovie.c   77)     height = BlinkenHeightMin;
BlinkenLib/BlinkenMovie.c   78)   if (height > BlinkenHeightMax)
BlinkenLib/BlinkenMovie.c   79)     height = BlinkenHeightMax;
BlinkenLib/BlinkenMovie.c   80)   if (width < BlinkenWidthMin)
BlinkenLib/BlinkenMovie.c   81)     width = BlinkenWidthMin;
BlinkenLib/BlinkenMovie.c   82)   if (width > BlinkenWidthMax)
BlinkenLib/BlinkenMovie.c   83)     width = BlinkenWidthMax;
BlinkenLib/BlinkenMovie.c   84)   if (channels < BlinkenChannelsMin)
BlinkenLib/BlinkenMovie.c   85)     channels = BlinkenChannelsMin;
BlinkenLib/BlinkenMovie.c   86)   if (channels > BlinkenChannelsMax)
BlinkenLib/BlinkenMovie.c   87)     channels = BlinkenMaxvalMax;
BlinkenLib/BlinkenMovie.c   88)   if (maxval < BlinkenMaxvalMin)
BlinkenLib/BlinkenMovie.c   89)     maxval = BlinkenMaxvalMin;
BlinkenLib/BlinkenMovie.c   90)   if (maxval > BlinkenMaxvalMax)
BlinkenLib/BlinkenMovie.c   91)     maxval = BlinkenMaxvalMax;
BlinkenLib/BlinkenMovie.c   92) 
BlinkenLib/BlinkenMovie.c   93)   pMovie = (stBlinkenMovie *) malloc(sizeof(stBlinkenMovie));
BlinkenLib/BlinkenMovie.c   94)   if (pMovie == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c              95)     return NULL;
BlinkenMovie.c              96) 
BlinkenMovie.c              97)   pMovie->height = height;
BlinkenMovie.c              98)   pMovie->width = width;
BlinkenMovie.c              99)   pMovie->channels = channels;
BlinkenMovie.c             100)   pMovie->maxval = maxval;
BlinkenMovie.c             101)   pMovie->infoCnt = 0;
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             167)     return 0;
BlinkenMovie.c             168) 
BlinkenMovie.c             169)   return pMovie->height;
BlinkenMovie.c             170) }
BlinkenMovie.c             171) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             183)     return 0;
BlinkenMovie.c             184) 
BlinkenMovie.c             185)   return pMovie->channels;
BlinkenMovie.c             186) }
BlinkenMovie.c             187) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 10 years ago

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

Stefan Schuermans authored 10 years ago

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

Stefan Schuermans authored 10 years ago

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

Stefan Schuermans authored 10 years ago

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

Stefan Schuermans authored 5 years ago

BlinkenLib/BlinkenMovie.c  669) void BlinkenMovieAdaptMaxFrameDuration(stBlinkenMovie *pMovie,
BlinkenLib/BlinkenMovie.c  670)                                        int maxDuration /* in ms */)
BlinkenLib/BlinkenMovie.c  671) {
BlinkenLib/BlinkenMovie.c  672)   int i, j, cmp, dur, lastdur;
BlinkenLib/BlinkenMovie.c  673)   unsigned int extraFrames;
BlinkenLib/BlinkenMovie.c  674)   stBlinkenFrame **ppNewFrames;
BlinkenLib/BlinkenMovie.c  675)   stBlinkenFrame *pNewFrame;
BlinkenLib/BlinkenMovie.c  676) 
BlinkenLib/BlinkenMovie.c  677)   if (pMovie == NULL)
BlinkenLib/BlinkenMovie.c  678)     return;
BlinkenLib/BlinkenMovie.c  679)   if (maxDuration < BlinkenDurationMin) {
BlinkenLib/BlinkenMovie.c  680)     maxDuration = BlinkenDurationMin;
BlinkenLib/BlinkenMovie.c  681)   }
BlinkenLib/BlinkenMovie.c  682)   if (maxDuration > BlinkenDurationMax) {
BlinkenLib/BlinkenMovie.c  683)     maxDuration = BlinkenDurationMax;
BlinkenLib/BlinkenMovie.c  684)   }
BlinkenLib/BlinkenMovie.c  685) 
BlinkenLib/BlinkenMovie.c  686)   // compute how many extra frames are needed
BlinkenLib/BlinkenMovie.c  687)   extraFrames = 0;
BlinkenLib/BlinkenMovie.c  688)   for (i = 0; i < pMovie->frameCnt; i++) {
BlinkenLib/BlinkenMovie.c  689)     dur = BlinkenFrameGetDuration(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  690)     extraFrames += (dur + maxDuration - 1) / maxDuration - 1;
BlinkenLib/BlinkenMovie.c  691)   }
BlinkenLib/BlinkenMovie.c  692) 
BlinkenLib/BlinkenMovie.c  693)   // allocate new frame array
BlinkenLib/BlinkenMovie.c  694)   ppNewFrames = (stBlinkenFrame **)BlinkenMalloc1D(pMovie->frameCnt
BlinkenLib/BlinkenMovie.c  695)                                                    + extraFrames,
BlinkenLib/BlinkenMovie.c  696)                                                    sizeof(stBlinkenFrame *));
BlinkenLib/BlinkenMovie.c  697)   if (! ppNewFrames) {
BlinkenLib/BlinkenMovie.c  698)     return;
BlinkenLib/BlinkenMovie.c  699)   }
BlinkenLib/BlinkenMovie.c  700) 
BlinkenLib/BlinkenMovie.c  701)   // merge/split frames in time
BlinkenLib/BlinkenMovie.c  702)   j = 0;
BlinkenLib/BlinkenMovie.c  703)   for (i = 0; i < pMovie->frameCnt; i++) {
BlinkenLib/BlinkenMovie.c  704)     // join frame with last one if equal
BlinkenLib/BlinkenMovie.c  705)     if (j > 0) {
BlinkenLib/BlinkenMovie.c  706)       cmp = BlinkenFrameCompare(pMovie->ppFrames[i], ppNewFrames[j - 1]);
BlinkenLib/BlinkenMovie.c  707)       if (cmp == 0) {
BlinkenLib/BlinkenMovie.c  708)         // frame equal to last one
BlinkenLib/BlinkenMovie.c  709)         dur = BlinkenFrameGetDuration(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  710)         lastdur = BlinkenFrameGetDuration(ppNewFrames[j - 1]);
BlinkenLib/BlinkenMovie.c  711)         if (lastdur + dur <= maxDuration) {
BlinkenLib/BlinkenMovie.c  712)           // merge frame completely
BlinkenLib/BlinkenMovie.c  713)           BlinkenFrameSetDuration(ppNewFrames[j - 1], lastdur + dur);
BlinkenLib/BlinkenMovie.c  714)           BlinkenFrameFree(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  715)           pMovie->ppFrames[i] = NULL;
BlinkenLib/BlinkenMovie.c  716)           continue; // frame completely merged
BlinkenLib/BlinkenMovie.c  717)         } else {
BlinkenLib/BlinkenMovie.c  718)           // move as much duration to previous frame
BlinkenLib/BlinkenMovie.c  719)           BlinkenFrameSetDuration(ppNewFrames[j - 1], maxDuration);
BlinkenLib/BlinkenMovie.c  720)           BlinkenFrameSetDuration(pMovie->ppFrames[i],
BlinkenLib/BlinkenMovie.c  721)                                   lastdur + dur - maxDuration);
BlinkenLib/BlinkenMovie.c  722)         }
BlinkenLib/BlinkenMovie.c  723)       }
BlinkenLib/BlinkenMovie.c  724)     }
BlinkenLib/BlinkenMovie.c  725)     // split frames longer than maxDuration
BlinkenLib/BlinkenMovie.c  726)     while (1) {
BlinkenLib/BlinkenMovie.c  727)       dur = BlinkenFrameGetDuration(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  728)       if (dur <= maxDuration) {
BlinkenLib/BlinkenMovie.c  729)         break;
BlinkenLib/BlinkenMovie.c  730)       }
BlinkenLib/BlinkenMovie.c  731)       pNewFrame = BlinkenFrameClone(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  732)       if (! pNewFrame) {
BlinkenLib/BlinkenMovie.c  733)         break;
BlinkenLib/BlinkenMovie.c  734)       }
BlinkenLib/BlinkenMovie.c  735)       // add new frame with max duration
BlinkenLib/BlinkenMovie.c  736)       BlinkenFrameSetDuration(pNewFrame, maxDuration);
BlinkenLib/BlinkenMovie.c  737)       ppNewFrames[j++] = pNewFrame;
BlinkenLib/BlinkenMovie.c  738)       // reduce duration of current frame
BlinkenLib/BlinkenMovie.c  739)       BlinkenFrameSetDuration(pMovie->ppFrames[i], dur - maxDuration);
BlinkenLib/BlinkenMovie.c  740)     } // while (1)
BlinkenLib/BlinkenMovie.c  741)     // overtake current frame
BlinkenLib/BlinkenMovie.c  742)     ppNewFrames[j++] = pMovie->ppFrames[i];
BlinkenLib/BlinkenMovie.c  743)     pMovie->ppFrames[i] = NULL;
BlinkenLib/BlinkenMovie.c  744)   } // for (i ...
BlinkenLib/BlinkenMovie.c  745) 
BlinkenLib/BlinkenMovie.c  746)   // use new frames array in movie
BlinkenLib/BlinkenMovie.c  747)   free(pMovie->ppFrames);
BlinkenLib/BlinkenMovie.c  748)   pMovie->ppFrames = ppNewFrames;
BlinkenLib/BlinkenMovie.c  749)   pMovie->frameCnt = j;
BlinkenLib/BlinkenMovie.c  750) }
BlinkenLib/BlinkenMovie.c  751) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             754) {
BlinkenMovie.c             755)   int i;
BlinkenMovie.c             756) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  760)   if (height < BlinkenHeightMin)
BlinkenLib/BlinkenMovie.c  761)     height = BlinkenHeightMin;
BlinkenLib/BlinkenMovie.c  762)   if (height > BlinkenHeightMax)
BlinkenLib/BlinkenMovie.c  763)     height = BlinkenHeightMax;
BlinkenLib/BlinkenMovie.c  764)   if (width < BlinkenWidthMin)
BlinkenLib/BlinkenMovie.c  765)     width = BlinkenWidthMin;
BlinkenLib/BlinkenMovie.c  766)   if (width > BlinkenWidthMax)
BlinkenLib/BlinkenMovie.c  767)     width = BlinkenWidthMax;
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;
BlinkenLib/BlinkenMovie.c  772)   if (maxval < BlinkenMaxvalMin)
BlinkenLib/BlinkenMovie.c  773)     maxval = BlinkenMaxvalMin;
BlinkenLib/BlinkenMovie.c  774)   if (maxval > BlinkenMaxvalMax)
BlinkenLib/BlinkenMovie.c  775)     maxval = BlinkenMaxvalMax;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             776) 
BlinkenMovie.c             777)   pMovie->height = height;
BlinkenMovie.c             778)   pMovie->width = width;
BlinkenMovie.c             779)   pMovie->channels = channels;
BlinkenMovie.c             780)   pMovie->maxval = maxval;
BlinkenMovie.c             781) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  782)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  783)     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             784) }
BlinkenMovie.c             785) 
Stefan Schuermans implement cropping movies

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenMovie.c  786) void BlinkenMovieCrop(stBlinkenMovie *pMovie, int top, int left,
BlinkenLib/BlinkenMovie.c  787)                       int height, int width)
BlinkenLib/BlinkenMovie.c  788) {
BlinkenLib/BlinkenMovie.c  789)   int i;
BlinkenLib/BlinkenMovie.c  790) 
BlinkenLib/BlinkenMovie.c  791)   if (pMovie == NULL)
BlinkenLib/BlinkenMovie.c  792)     return;
BlinkenLib/BlinkenMovie.c  793) 
BlinkenLib/BlinkenMovie.c  794)   if (top < 0)
BlinkenLib/BlinkenMovie.c  795)     top = 0;
BlinkenLib/BlinkenMovie.c  796)   if (top > pMovie->height - BlinkenHeightMin)
BlinkenLib/BlinkenMovie.c  797)     top = pMovie->height - BlinkenHeightMin;
BlinkenLib/BlinkenMovie.c  798)   if (height < BlinkenHeightMin)
BlinkenLib/BlinkenMovie.c  799)     height = BlinkenHeightMin;
BlinkenLib/BlinkenMovie.c  800)   if (height > pMovie->height - top)
BlinkenLib/BlinkenMovie.c  801)     height = pMovie->height - top;
BlinkenLib/BlinkenMovie.c  802)   if (left < 0)
BlinkenLib/BlinkenMovie.c  803)     left = 0;
BlinkenLib/BlinkenMovie.c  804)   if (left > pMovie->width - BlinkenWidthMin)
BlinkenLib/BlinkenMovie.c  805)     left = pMovie->width - BlinkenWidthMin;
BlinkenLib/BlinkenMovie.c  806)   if (width < BlinkenWidthMin)
BlinkenLib/BlinkenMovie.c  807)     width = BlinkenWidthMin;
BlinkenLib/BlinkenMovie.c  808)   if (width > pMovie->width - left)
BlinkenLib/BlinkenMovie.c  809)     width = pMovie->width - left;
BlinkenLib/BlinkenMovie.c  810) 
BlinkenLib/BlinkenMovie.c  811)   if (top == 0 && left == 0 &&
BlinkenLib/BlinkenMovie.c  812)       height == pMovie->height && width == pMovie->width)
BlinkenLib/BlinkenMovie.c  813)     return;
BlinkenLib/BlinkenMovie.c  814) 
BlinkenLib/BlinkenMovie.c  815)   pMovie->height = height;
BlinkenLib/BlinkenMovie.c  816)   pMovie->width = width;
BlinkenLib/BlinkenMovie.c  817) 
BlinkenLib/BlinkenMovie.c  818)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  819)     BlinkenFrameCrop(pMovie->ppFrames[i], top, left, height, width);
BlinkenLib/BlinkenMovie.c  820) }
BlinkenLib/BlinkenMovie.c  821) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  822) 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             823) {
BlinkenMovie.c             824)   int i;
BlinkenMovie.c             825) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  829)   if (height < BlinkenHeightMin)
BlinkenLib/BlinkenMovie.c  830)     height = BlinkenHeightMin;
BlinkenLib/BlinkenMovie.c  831)   if (height > BlinkenHeightMax)
BlinkenLib/BlinkenMovie.c  832)     height = BlinkenHeightMax;
BlinkenLib/BlinkenMovie.c  833)   if (width < BlinkenWidthMin)
BlinkenLib/BlinkenMovie.c  834)     width = BlinkenWidthMin;
BlinkenLib/BlinkenMovie.c  835)   if (width > BlinkenWidthMax)
BlinkenLib/BlinkenMovie.c  836)     width = BlinkenWidthMax;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c             837) 
BlinkenMovie.c             838)   pMovie->height = height;
BlinkenMovie.c             839)   pMovie->width = width;
BlinkenMovie.c             840) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  845) 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             846) {
BlinkenMovie.c             847)   int i, step;
BlinkenMovie.c             848) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  852)   if (channels < BlinkenChannelsMin)
BlinkenLib/BlinkenMovie.c  853)     channels = BlinkenChannelsMin;
BlinkenLib/BlinkenMovie.c  854)   if (channels > BlinkenChannelsMax)
BlinkenLib/BlinkenMovie.c  855)     channels = BlinkenMaxvalMax;
Christian Heimke BlinkenLib v.0.5.3 (2007-12...

Christian Heimke authored 13 years ago

BlinkenMovie.c             856) 
BlinkenMovie.c             857)   pMovie->channels = channels;
BlinkenMovie.c             858)   pMovie->maxval = BlinkenMaxvalMax;
BlinkenMovie.c             859) 
BlinkenMovie.c             860)   step = 0;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c             864)   }
BlinkenMovie.c             865) }
BlinkenMovie.c             866) 
Stefan Schuermans implemented copying rectang...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c  867) void BlinkenMovieCopyRect(stBlinkenMovie *pDest, int destY, int destX,
BlinkenLib/BlinkenMovie.c  868)                           stBlinkenMovie *pSrc, int srcY, int srcX,
BlinkenLib/BlinkenMovie.c  869)                           int height, int width)
BlinkenLib/BlinkenMovie.c  870) {
BlinkenLib/BlinkenMovie.c  871)   int dcnt, scnt, di, si, dest_dur, src_dur, src_time_ofs;
BlinkenLib/BlinkenMovie.c  872)   stBlinkenFrame *pFrame;
BlinkenLib/BlinkenMovie.c  873) 
BlinkenLib/BlinkenMovie.c  874)   if (pDest == NULL || pSrc == NULL)
BlinkenLib/BlinkenMovie.c  875)     return;
BlinkenLib/BlinkenMovie.c  876) 
BlinkenLib/BlinkenMovie.c  877)   // exit if both movies empty
BlinkenLib/BlinkenMovie.c  878)   dcnt = pDest->frameCnt;
BlinkenLib/BlinkenMovie.c  879)   scnt = pSrc->frameCnt;
BlinkenLib/BlinkenMovie.c  880)   if (dcnt == 0 || scnt == 0)
BlinkenLib/BlinkenMovie.c  881)     return;
BlinkenLib/BlinkenMovie.c  882) 
BlinkenLib/BlinkenMovie.c  883)   // go throuh all source frames
BlinkenLib/BlinkenMovie.c  884)   di = 0;
BlinkenLib/BlinkenMovie.c  885)   si = 0;
BlinkenLib/BlinkenMovie.c  886)   dest_dur = dcnt > 0 ? BlinkenFrameGetDuration(pDest->ppFrames[0]) : 0;
BlinkenLib/BlinkenMovie.c  887)   src_dur = scnt > 0 ? BlinkenFrameGetDuration(pSrc->ppFrames[0]) : 0;
BlinkenLib/BlinkenMovie.c  888)   src_time_ofs = 0;
BlinkenLib/BlinkenMovie.c  889)   while (si < scnt) {
BlinkenLib/BlinkenMovie.c  890) 
BlinkenLib/BlinkenMovie.c  891)     // make sure there is a frame in destination movie
BlinkenLib/BlinkenMovie.c  892)     if (di >= dcnt) {
BlinkenLib/BlinkenMovie.c  893)       // append new empty frame that last until end of source frame
BlinkenLib/BlinkenMovie.c  894)       pFrame = BlinkenFrameNew(pDest->height, pDest->width,
BlinkenLib/BlinkenMovie.c  895)                                pDest->channels, pDest->maxval,
BlinkenLib/BlinkenMovie.c  896)                                src_dur - src_time_ofs);
BlinkenLib/BlinkenMovie.c  897)       if (pFrame == NULL)
BlinkenLib/BlinkenMovie.c  898)         return;
BlinkenLib/BlinkenMovie.c  899)       BlinkenFrameClear(pFrame);
BlinkenLib/BlinkenMovie.c  900)       if (BlinkenMovieAppendFrame(pDest, pFrame) != 0)
BlinkenLib/BlinkenMovie.c  901)         return;
BlinkenLib/BlinkenMovie.c  902)       dcnt++;
BlinkenLib/BlinkenMovie.c  903)       dest_dur = src_dur - src_time_ofs;
BlinkenLib/BlinkenMovie.c  904)     }
BlinkenLib/BlinkenMovie.c  905) 
BlinkenLib/BlinkenMovie.c  906)     // make sure destination frame does not last longer than source frame
BlinkenLib/BlinkenMovie.c  907)     if (dest_dur > src_dur - src_time_ofs) {
BlinkenLib/BlinkenMovie.c  908)       // split destination frame into two
BlinkenLib/BlinkenMovie.c  909)       pFrame = BlinkenFrameClone(pDest->ppFrames[di]);
BlinkenLib/BlinkenMovie.c  910)       if (pFrame == NULL)
BlinkenLib/BlinkenMovie.c  911)         return;
BlinkenLib/BlinkenMovie.c  912)       if (BlinkenMovieInsertFrame(pDest, di+1, pFrame) != 0)
BlinkenLib/BlinkenMovie.c  913)         return;
BlinkenLib/BlinkenMovie.c  914)       dcnt++;
BlinkenLib/BlinkenMovie.c  915)       BlinkenFrameSetDuration(pDest->ppFrames[di],
BlinkenLib/BlinkenMovie.c  916)                               src_dur - src_time_ofs);
BlinkenLib/BlinkenMovie.c  917)       BlinkenFrameSetDuration(pDest->ppFrames[di+1],
BlinkenLib/BlinkenMovie.c  918)                               dest_dur - (src_dur - src_time_ofs));
BlinkenLib/BlinkenMovie.c  919)       dest_dur = src_dur - src_time_ofs;
BlinkenLib/BlinkenMovie.c  920)     }
BlinkenLib/BlinkenMovie.c  921) 
BlinkenLib/BlinkenMovie.c  922)     // copy from source frame to destination frame
BlinkenLib/BlinkenMovie.c  923)     BlinkenFrameCopyRect(pDest->ppFrames[di], destY, destX,
BlinkenLib/BlinkenMovie.c  924)                          pSrc->ppFrames[si], srcY, srcX, height, width);
BlinkenLib/BlinkenMovie.c  925)     src_time_ofs += dest_dur;
BlinkenLib/BlinkenMovie.c  926)     di++;
BlinkenLib/BlinkenMovie.c  927)     dest_dur = di < dcnt ? BlinkenFrameGetDuration(pDest->ppFrames[di]) : 0;
BlinkenLib/BlinkenMovie.c  928) 
BlinkenLib/BlinkenMovie.c  929)     // go to next source frame
BlinkenLib/BlinkenMovie.c  930)     if (src_time_ofs >= src_dur) {
BlinkenLib/BlinkenMovie.c  931)       si++;
BlinkenLib/BlinkenMovie.c  932)       src_dur = si < scnt ? BlinkenFrameGetDuration(pSrc->ppFrames[si]) : 0;
BlinkenLib/BlinkenMovie.c  933)       src_time_ofs = 0;
BlinkenLib/BlinkenMovie.c  934)     }
BlinkenLib/BlinkenMovie.c  935) 
BlinkenLib/BlinkenMovie.c  936)   } // while (si < scnt)
BlinkenLib/BlinkenMovie.c  937) }
BlinkenLib/BlinkenMovie.c  938) 
Stefan Schuermans implemented rotationg and m...

Stefan Schuermans authored 11 years ago

BlinkenLib/BlinkenMovie.c  939) void BlinkenMovieRotateCw(stBlinkenMovie *pMovie)
BlinkenLib/BlinkenMovie.c  940) {
BlinkenLib/BlinkenMovie.c  941)   int tmp, i;
BlinkenLib/BlinkenMovie.c  942) 
BlinkenLib/BlinkenMovie.c  943)   if (pMovie == NULL)
BlinkenLib/BlinkenMovie.c  944)     return;
BlinkenLib/BlinkenMovie.c  945) 
BlinkenLib/BlinkenMovie.c  946)   tmp = pMovie->height;
BlinkenLib/BlinkenMovie.c  947)   pMovie->height = pMovie->width;
BlinkenLib/BlinkenMovie.c  948)   pMovie->width = tmp;
BlinkenLib/BlinkenMovie.c  949) 
BlinkenLib/BlinkenMovie.c  950)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  951)     BlinkenFrameRotateCw(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  952) }
BlinkenLib/BlinkenMovie.c  953) 
BlinkenLib/BlinkenMovie.c  954) void BlinkenMovieRotateCcw(stBlinkenMovie *pMovie)
BlinkenLib/BlinkenMovie.c  955) {
BlinkenLib/BlinkenMovie.c  956)   int tmp, i;
BlinkenLib/BlinkenMovie.c  957) 
BlinkenLib/BlinkenMovie.c  958)   if (pMovie == NULL)
BlinkenLib/BlinkenMovie.c  959)     return;
BlinkenLib/BlinkenMovie.c  960) 
BlinkenLib/BlinkenMovie.c  961)   tmp = pMovie->height;
BlinkenLib/BlinkenMovie.c  962)   pMovie->height = pMovie->width;
BlinkenLib/BlinkenMovie.c  963)   pMovie->width = tmp;
BlinkenLib/BlinkenMovie.c  964) 
BlinkenLib/BlinkenMovie.c  965)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  966)     BlinkenFrameRotateCcw(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  967) }
BlinkenLib/BlinkenMovie.c  968) 
BlinkenLib/BlinkenMovie.c  969) void BlinkenMovieRotateHalf(stBlinkenMovie *pMovie)
BlinkenLib/BlinkenMovie.c  970) {
BlinkenLib/BlinkenMovie.c  971)   int i;
BlinkenLib/BlinkenMovie.c  972) 
BlinkenLib/BlinkenMovie.c  973)   if (pMovie == NULL)
BlinkenLib/BlinkenMovie.c  974)     return;
BlinkenLib/BlinkenMovie.c  975) 
BlinkenLib/BlinkenMovie.c  976)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  977)     BlinkenFrameRotateHalf(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  978) }
BlinkenLib/BlinkenMovie.c  979) 
BlinkenLib/BlinkenMovie.c  980) void BlinkenMovieMirrorHor(stBlinkenMovie *pMovie)
BlinkenLib/BlinkenMovie.c  981) {
BlinkenLib/BlinkenMovie.c  982)   int i;
BlinkenLib/BlinkenMovie.c  983) 
BlinkenLib/BlinkenMovie.c  984)   if (pMovie == NULL)
BlinkenLib/BlinkenMovie.c  985)     return;
BlinkenLib/BlinkenMovie.c  986) 
BlinkenLib/BlinkenMovie.c  987)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  988)     BlinkenFrameMirrorHor(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c  989) }
BlinkenLib/BlinkenMovie.c  990) 
BlinkenLib/BlinkenMovie.c  991) void BlinkenMovieMirrorVer(stBlinkenMovie *pMovie)
BlinkenLib/BlinkenMovie.c  992) {
BlinkenLib/BlinkenMovie.c  993)   int i;
BlinkenLib/BlinkenMovie.c  994) 
BlinkenLib/BlinkenMovie.c  995)   if (pMovie == NULL)
BlinkenLib/BlinkenMovie.c  996)     return;
BlinkenLib/BlinkenMovie.c  997) 
BlinkenLib/BlinkenMovie.c  998)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c  999)     BlinkenFrameMirrorVer(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c 1000) }
BlinkenLib/BlinkenMovie.c 1001) 
BlinkenLib/BlinkenMovie.c 1002) void BlinkenMovieMirrorDiag(stBlinkenMovie *pMovie)
BlinkenLib/BlinkenMovie.c 1003) {
BlinkenLib/BlinkenMovie.c 1004)   int tmp, i;
BlinkenLib/BlinkenMovie.c 1005) 
BlinkenLib/BlinkenMovie.c 1006)   if (pMovie == NULL)
BlinkenLib/BlinkenMovie.c 1007)     return;
BlinkenLib/BlinkenMovie.c 1008) 
BlinkenLib/BlinkenMovie.c 1009)   tmp = pMovie->height;
BlinkenLib/BlinkenMovie.c 1010)   pMovie->height = pMovie->width;
BlinkenLib/BlinkenMovie.c 1011)   pMovie->width = tmp;
BlinkenLib/BlinkenMovie.c 1012) 
BlinkenLib/BlinkenMovie.c 1013)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c 1014)     BlinkenFrameMirrorDiag(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c 1015) }
BlinkenLib/BlinkenMovie.c 1016) 
BlinkenLib/BlinkenMovie.c 1017) void BlinkenMovieMirrorDiag2(stBlinkenMovie *pMovie)
BlinkenLib/BlinkenMovie.c 1018) {
BlinkenLib/BlinkenMovie.c 1019)   int tmp, i;
BlinkenLib/BlinkenMovie.c 1020) 
BlinkenLib/BlinkenMovie.c 1021)   if (pMovie == NULL)
BlinkenLib/BlinkenMovie.c 1022)     return;
BlinkenLib/BlinkenMovie.c 1023) 
BlinkenLib/BlinkenMovie.c 1024)   tmp = pMovie->height;
BlinkenLib/BlinkenMovie.c 1025)   pMovie->height = pMovie->width;
BlinkenLib/BlinkenMovie.c 1026)   pMovie->width = tmp;
BlinkenLib/BlinkenMovie.c 1027) 
BlinkenLib/BlinkenMovie.c 1028)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c 1029)     BlinkenFrameMirrorDiag2(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c 1030) }
BlinkenLib/BlinkenMovie.c 1031) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1038)     return NULL;
BlinkenMovie.c            1039) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1042)     return NULL;
BlinkenMovie.c            1043) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1044)   for (i = 0; i < pMovie->frameCnt; i++) {
BlinkenLib/BlinkenMovie.c 1045)     strs[i] = BlinkenFrameToString(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c 1046)     if (strs[i] == NULL) {
BlinkenLib/BlinkenMovie.c 1047)       for (i--; i >= 0; i--)
BlinkenLib/BlinkenMovie.c 1048)         free(strs[i]);
BlinkenLib/BlinkenMovie.c 1049)       free(strs);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1050)       return NULL;
BlinkenMovie.c            1051)     }
BlinkenMovie.c            1052)   }
BlinkenMovie.c            1053) 
BlinkenMovie.c            1054)   size = 128;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1055)   for (i = 0; i < pMovie->infoCnt; i++)
BlinkenLib/BlinkenMovie.c 1056)     size +=
BlinkenLib/BlinkenMovie.c 1057)         strlen(pMovie->pppInfos[i][0]) + strlen(pMovie->pppInfos[i][1]) + 8;
BlinkenLib/BlinkenMovie.c 1058)   for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c 1059)     size += strlen(strs[i]) + 32;
BlinkenLib/BlinkenMovie.c 1060) 
BlinkenLib/BlinkenMovie.c 1061)   str = (char *)malloc(size);
BlinkenLib/BlinkenMovie.c 1062)   if (str == NULL) {
BlinkenLib/BlinkenMovie.c 1063)     for (i = 0; i < pMovie->frameCnt; i++)
BlinkenLib/BlinkenMovie.c 1064)       free(strs[i]);
BlinkenLib/BlinkenMovie.c 1065)     free(strs);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1066)     return NULL;
BlinkenMovie.c            1067)   }
BlinkenMovie.c            1068) 
BlinkenMovie.c            1069)   ptr = str;
BlinkenMovie.c            1070) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1088) }
BlinkenMovie.c            1089) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1092)   FILE *pFile;
BlinkenLib/BlinkenMovie.c 1093)   stBlinkenMovie *pMovie;
BlinkenLib/BlinkenMovie.c 1094)   stBlinkenFrame *pFrame;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1099)     return NULL;
BlinkenMovie.c            1100) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1109)     return NULL;
BlinkenMovie.c            1110)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1111)   // allocate a new movie
BlinkenLib/BlinkenMovie.c 1112)   pMovie = BlinkenMovieNew(height, width, 1, 1);
BlinkenLib/BlinkenMovie.c 1113)   if (pMovie == NULL) {
BlinkenLib/BlinkenMovie.c 1114)     fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1118)   pFrame = NULL;
BlinkenMovie.c            1119)   y = 0;
BlinkenMovie.c            1120) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1132)     // start of frame
BlinkenLib/BlinkenMovie.c 1133)     else if (fscanf(pFile, " @ %u", &duration) == 1) {
BlinkenLib/BlinkenMovie.c 1134)       // create new frame and append it to movie
BlinkenLib/BlinkenMovie.c 1135)       pFrame = BlinkenFrameNew(height, width, 1, 1, duration);
BlinkenLib/BlinkenMovie.c 1136)       if (pFrame != NULL) {
BlinkenLib/BlinkenMovie.c 1137)         BlinkenFrameClear(pFrame);
BlinkenLib/BlinkenMovie.c 1138)         if (BlinkenMovieAppendFrame(pMovie, pFrame) != 0) {
BlinkenLib/BlinkenMovie.c 1139)           BlinkenFrameFree(pFrame);
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1142)         y = 0;
BlinkenMovie.c            1143)       }
BlinkenMovie.c            1144)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1162) 
BlinkenMovie.c            1163)   return pMovie;
BlinkenMovie.c            1164) }
BlinkenMovie.c            1165) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1168)   FILE *pFile;
BlinkenLib/BlinkenMovie.c 1169)   stBlinkenMovie *pMovie;
BlinkenLib/BlinkenMovie.c 1170)   stBlinkenFrame *pFrame;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1175)     return NULL;
BlinkenMovie.c            1176) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1185)     return NULL;
BlinkenMovie.c            1186)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1191)     return NULL;
BlinkenMovie.c            1192)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1194)   pFrame = NULL;
BlinkenMovie.c            1195)   y = 0;
BlinkenMovie.c            1196) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1197)   // read frames
BlinkenLib/BlinkenMovie.c 1198)   while (!feof(pFile)) {
BlinkenLib/BlinkenMovie.c 1199)     // skip rest of previous line (including newline)
BlinkenLib/BlinkenMovie.c 1200)     while ((chr = fgetc(pFile)) != '\n' && chr != EOF) ;
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)     // info line
BlinkenLib/BlinkenMovie.c 1203)     if (fscanf
BlinkenLib/BlinkenMovie.c 1204)         (pFile, " # %255[A-Za-z0-9] %*[=:] %1023[^\n]", infoType,
BlinkenLib/BlinkenMovie.c 1205)          infoData) == 2) {
BlinkenLib/BlinkenMovie.c 1206)       BlinkenMovieAppendInfo(pMovie, infoType, infoData);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1208)     // start of frame
BlinkenLib/BlinkenMovie.c 1209)     else if (fscanf(pFile, " @ %u", &duration) == 1) {
BlinkenLib/BlinkenMovie.c 1210)       // create new frame and append it to movie
BlinkenLib/BlinkenMovie.c 1211)       pFrame = BlinkenFrameNew(height, width, 1, 255, duration);
BlinkenLib/BlinkenMovie.c 1212)       if (pFrame != NULL) {
BlinkenLib/BlinkenMovie.c 1213)         BlinkenFrameClear(pFrame);
BlinkenLib/BlinkenMovie.c 1214)         if (BlinkenMovieAppendFrame(pMovie, pFrame) != 0) {
BlinkenLib/BlinkenMovie.c 1215)           BlinkenFrameFree(pFrame);
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1218)         y = 0;
BlinkenMovie.c            1219)       }
BlinkenMovie.c            1220)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 8 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1242) 
BlinkenMovie.c            1243)   return pMovie;
BlinkenMovie.c            1244) }
BlinkenMovie.c            1245) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1248)   FILE *pFile;
BlinkenLib/BlinkenMovie.c 1249)   stBlinkenMovie *pMovie;
BlinkenLib/BlinkenMovie.c 1250)   stBlinkenFrame *pFrame;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1251)   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 1252)   char buffer[2048], infoType[256], infoData[1024], pixelFormat[16], pixel[8],
BlinkenLib/BlinkenMovie.c 1253)       *ptr, chr;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1256)     return NULL;
BlinkenMovie.c            1257) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1261)     return NULL;
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)   // 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            1264)   pMovie = NULL;
BlinkenMovie.c            1265) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1267)   pFrame = NULL;
BlinkenMovie.c            1268)   y = 0;
BlinkenMovie.c            1269) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 8 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1291)         channels = 1;
BlinkenMovie.c            1292)         bits = 4;
BlinkenMovie.c            1293)         maxval = 15;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1294)         if ((ptr = strstr(buffer, "height=\"")) != NULL)        // height
BlinkenLib/BlinkenMovie.c 1295)           sscanf(ptr + 8, "%u", &height);
BlinkenLib/BlinkenMovie.c 1296)         if ((ptr = strstr(buffer, "width=\"")) != NULL) // width
BlinkenLib/BlinkenMovie.c 1297)           sscanf(ptr + 7, "%u", &width);
BlinkenLib/BlinkenMovie.c 1298)         if ((ptr = strstr(buffer, "channels=\"")) != NULL)      // channels
BlinkenLib/BlinkenMovie.c 1299)           sscanf(ptr + 10, "%u", &channels);
BlinkenLib/BlinkenMovie.c 1300)         if ((ptr = strstr(buffer, "bits=\"")) != NULL)  // bits
BlinkenLib/BlinkenMovie.c 1301)           sscanf(ptr + 6, "%u", &bits);
BlinkenLib/BlinkenMovie.c 1302)         maxval = (1 << bits) - 1;       // maxval
BlinkenLib/BlinkenMovie.c 1303) 
BlinkenLib/BlinkenMovie.c 1304)         // allocate a new movie
BlinkenLib/BlinkenMovie.c 1305)         pMovie = BlinkenMovieNew(height, width, channels, maxval);
BlinkenLib/BlinkenMovie.c 1306)         if (pMovie == NULL) {
BlinkenLib/BlinkenMovie.c 1307)           fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1308)           return NULL;
BlinkenMovie.c            1309)         }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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 )
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)     // blm tag was already found
BlinkenLib/BlinkenMovie.c 1322)     else        // if( pMovie == NULL )
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1330)       // description tag
BlinkenLib/BlinkenMovie.c 1331)       else if (fscanf(pFile, "description>%2047[^<]", buffer) == 1) {
BlinkenLib/BlinkenMovie.c 1332)         // check if generic info
BlinkenLib/BlinkenMovie.c 1333)         if (sscanf
BlinkenLib/BlinkenMovie.c 1334)             (buffer, "%255[A-Za-z0-9] %*[=:] %1023[^\n]", infoType,
BlinkenLib/BlinkenMovie.c 1335)              infoData) == 2)
BlinkenLib/BlinkenMovie.c 1336)           // add info to movie
BlinkenLib/BlinkenMovie.c 1337)           BlinkenMovieAppendInfo(pMovie, infoType, infoData);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1366)         if ((ptr = strstr(buffer, "duration=\"")) != NULL)      // duration
BlinkenLib/BlinkenMovie.c 1367)           sscanf(ptr + 10, "%u", &duration);
BlinkenLib/BlinkenMovie.c 1368)         // create new frame and append it to movie
BlinkenLib/BlinkenMovie.c 1369)         pFrame = BlinkenFrameNew(height, width, channels, maxval, duration);
BlinkenLib/BlinkenMovie.c 1370)         if (pFrame != NULL) {
BlinkenLib/BlinkenMovie.c 1371)           BlinkenFrameClear(pFrame);
BlinkenLib/BlinkenMovie.c 1372)           if (BlinkenMovieAppendFrame(pMovie, pFrame) != 0) {
BlinkenLib/BlinkenMovie.c 1373)             BlinkenFrameFree(pFrame);
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1376)           y = 0;
BlinkenMovie.c            1377)         }
BlinkenMovie.c            1378)       }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1379)       // row tag
BlinkenLib/BlinkenMovie.c 1380)       else if (fscanf(pFile, "row%c", &chr) == 1 && chr == '>') {
BlinkenLib/BlinkenMovie.c 1381)         if (pFrame != NULL) {
BlinkenLib/BlinkenMovie.c 1382)           // parse row
BlinkenLib/BlinkenMovie.c 1383)           for (x = 0; x < width; x++) {
BlinkenLib/BlinkenMovie.c 1384)             for (c = 0; c < channels; c++) {
BlinkenLib/BlinkenMovie.c 1385)               // read next pixel (one channel of pixel)
BlinkenLib/BlinkenMovie.c 1386)               if (fscanf(pFile, pixelFormat, pixel + 2) != 1) {
BlinkenLib/BlinkenMovie.c 1387)                 x = width;      // also terminate x loop
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1388)                 break;
BlinkenMovie.c            1389)               }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1393)                 break;
BlinkenMovie.c            1394)               }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1395)               // set pixel (one channel of pixel)
BlinkenLib/BlinkenMovie.c 1396)               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            1397)             }
BlinkenMovie.c            1398)           }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1400)         }
BlinkenMovie.c            1401)       }
BlinkenMovie.c            1402) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1409) 
BlinkenMovie.c            1410)   return pMovie;
BlinkenMovie.c            1411) }
BlinkenMovie.c            1412) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1415)   FILE *pFile;
BlinkenLib/BlinkenMovie.c 1416)   stBlinkenMovie *pMovie;
BlinkenLib/BlinkenMovie.c 1417)   stBlinkenFrame *pFrame;
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 11 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1420)   unsigned short headerHeight, headerWidth, headerChannels, headerMaxval;
BlinkenMovie.c            1421)   unsigned long subHeaderMagic, frameStartMarkerMagic;
BlinkenMovie.c            1422)   unsigned short subHeaderSize;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1428)     return NULL;
BlinkenMovie.c            1429) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1440)   headerMagic =
BlinkenLib/BlinkenMovie.c 1441)       (unsigned long)header[0] << 24 | (unsigned long)header[1] << 16 |
BlinkenLib/BlinkenMovie.c 1442)       (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            1443)   headerHeight = (unsigned short)header[4] << 8 | (unsigned short)header[5];
BlinkenMovie.c            1444)   headerWidth = (unsigned short)header[6] << 8 | (unsigned short)header[7];
BlinkenMovie.c            1445)   headerChannels = (unsigned short)header[8] << 8 | (unsigned short)header[9];
BlinkenMovie.c            1446)   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 1447)   headerFramePtr =
BlinkenLib/BlinkenMovie.c 1448)       (unsigned long)header[20] << 24 | (unsigned long)header[21] << 16 |
BlinkenLib/BlinkenMovie.c 1449)       (unsigned long)header[22] << 8 | (unsigned long)header[23];
BlinkenLib/BlinkenMovie.c 1450)   // check magic
BlinkenLib/BlinkenMovie.c 1451)   if (headerMagic != 0x23542666) {
BlinkenLib/BlinkenMovie.c 1452)     fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1453)     return NULL;
BlinkenMovie.c            1454)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1455)   // allocate a new movie
BlinkenLib/BlinkenMovie.c 1456)   pMovie =
BlinkenLib/BlinkenMovie.c 1457)       BlinkenMovieNew(headerHeight, headerWidth, headerChannels,
BlinkenLib/BlinkenMovie.c 1458)                       headerMaxval);
BlinkenLib/BlinkenMovie.c 1459)   if (pMovie == NULL) {
BlinkenLib/BlinkenMovie.c 1460)     fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1461)     return NULL;
BlinkenMovie.c            1462)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1463)   // read subheaders
BlinkenLib/BlinkenMovie.c 1464)   while (ftell(pFile) + 6 <= (long)headerFramePtr) {
BlinkenLib/BlinkenMovie.c 1465)     if (fread(subHeader, 1, 6, pFile) != 6) {
BlinkenLib/BlinkenMovie.c 1466)       BlinkenMovieFree(pMovie);
BlinkenLib/BlinkenMovie.c 1467)       fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1470)     subHeaderMagic =
BlinkenLib/BlinkenMovie.c 1471)         (unsigned long)subHeader[0] << 24 | (unsigned long)subHeader[1] << 16
BlinkenLib/BlinkenMovie.c 1472)         | (unsigned long)subHeader[2] << 8 | (unsigned long)subHeader[3];
BlinkenLib/BlinkenMovie.c 1473)     subHeaderSize =
BlinkenLib/BlinkenMovie.c 1474)         (unsigned short)subHeader[4] << 8 | (unsigned short)subHeader[5];
BlinkenLib/BlinkenMovie.c 1475) 
BlinkenLib/BlinkenMovie.c 1476)     // header fits into gap to frame start
BlinkenLib/BlinkenMovie.c 1477)     if (subHeaderSize >= 6
BlinkenLib/BlinkenMovie.c 1478)         && ftell(pFile) + subHeaderSize - 6 <= (long)headerFramePtr) {
BlinkenLib/BlinkenMovie.c 1479)       // info header
BlinkenLib/BlinkenMovie.c 1480)       if (subHeaderMagic == 0x696E666F) // 'i' 'n' 'f' 'o'
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)         // read rest of info header
BlinkenLib/BlinkenMovie.c 1483)         pInfoHeader = (char *)malloc(subHeaderSize - 6);
BlinkenLib/BlinkenMovie.c 1484)         if (pInfoHeader == NULL) {
BlinkenLib/BlinkenMovie.c 1485)           BlinkenMovieFree(pMovie);
BlinkenLib/BlinkenMovie.c 1486)           fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1487)           return NULL;
BlinkenMovie.c            1488)         }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1489)         if (fread(pInfoHeader, 1, subHeaderSize - 6, pFile) !=
BlinkenLib/BlinkenMovie.c 1490)             (unsigned short)(subHeaderSize - 6)) {
BlinkenLib/BlinkenMovie.c 1491)           free(pInfoHeader);
BlinkenLib/BlinkenMovie.c 1492)           BlinkenMovieFree(pMovie);
BlinkenLib/BlinkenMovie.c 1493)           fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1494)           return NULL;
BlinkenMovie.c            1495)         }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1521)     return NULL;
BlinkenMovie.c            1522)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1523)   frameStartMarkerMagic =
BlinkenLib/BlinkenMovie.c 1524)       (unsigned long)frameStartMarker[0] << 24 | (unsigned long)
BlinkenLib/BlinkenMovie.c 1525)       frameStartMarker[1] << 16 | (unsigned long)frameStartMarker[2] << 8 |
BlinkenLib/BlinkenMovie.c 1526)       (unsigned long)frameStartMarker[3];
BlinkenLib/BlinkenMovie.c 1527)   if (frameStartMarkerMagic != 0x66726D73)      // 'f' 'r' 'm' 's'
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1535)   pFrameData = (unsigned char *)malloc(len);
BlinkenLib/BlinkenMovie.c 1536)   if (pFrameData == NULL) {
BlinkenLib/BlinkenMovie.c 1537)     BlinkenMovieFree(pMovie);
BlinkenLib/BlinkenMovie.c 1538)     fclose(pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1539)     return NULL;
BlinkenMovie.c            1540)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1541)   // read frames
BlinkenLib/BlinkenMovie.c 1542)   for (;;) {
BlinkenLib/BlinkenMovie.c 1543)     // read frame
BlinkenLib/BlinkenMovie.c 1544)     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            1545)       break;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1546)     duration =
BlinkenLib/BlinkenMovie.c 1547)         (unsigned short)pFrameData[0] << 8 | (unsigned short)pFrameData[1];
BlinkenLib/BlinkenMovie.c 1548)     // build frame and append it to movie
BlinkenLib/BlinkenMovie.c 1549)     pFrame =
BlinkenLib/BlinkenMovie.c 1550)         BlinkenFrameNew(headerHeight, headerWidth, headerChannels,
BlinkenLib/BlinkenMovie.c 1551)                         headerMaxval, duration);
BlinkenLib/BlinkenMovie.c 1552)     if (pFrame == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1555)     for (y = 0; y < headerHeight; y++)
BlinkenLib/BlinkenMovie.c 1556)       for (x = 0; x < headerWidth; x++)
BlinkenLib/BlinkenMovie.c 1557)         for (c = 0; c < headerChannels; c++, i++)
BlinkenLib/BlinkenMovie.c 1558)           BlinkenFrameSetPixel(pFrame, y, x, c, pFrameData[i]);
BlinkenLib/BlinkenMovie.c 1559)     if (BlinkenMovieAppendFrame(pMovie, pFrame) != 0) {
BlinkenLib/BlinkenMovie.c 1560)       BlinkenFrameFree(pFrame);
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1571) 
BlinkenMovie.c            1572)   return pMovie;
BlinkenMovie.c            1573) }
BlinkenMovie.c            1574) 
Christian Heimke BlinkenLib v.0.6.0 (2008-05...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c 1580) }
BlinkenLib/BlinkenMovie.c 1581) 
BlinkenLib/BlinkenMovie.c 1582) #endif // #ifdef BLINKENLIB_CFG_MNG
BlinkenLib/BlinkenMovie.c 1583) 
Stefan Schuermans implement reading GIFs

Stefan Schuermans authored 7 years ago

BlinkenLib/BlinkenMovie.c 1584) #ifdef BLINKENLIB_CFG_GIF
BlinkenLib/BlinkenMovie.c 1585) 
BlinkenLib/BlinkenMovie.c 1586) stBlinkenMovie *BlinkenMovieLoadGif(const char *pFilename)
BlinkenLib/BlinkenMovie.c 1587) {
BlinkenLib/BlinkenMovie.c 1588)   return BlinkenGifLoad(pFilename);
BlinkenLib/BlinkenMovie.c 1589) }
BlinkenLib/BlinkenMovie.c 1590) 
BlinkenLib/BlinkenMovie.c 1591) #endif // #ifdef BLINKENLIB_CFG_GIF
BlinkenLib/BlinkenMovie.c 1592) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1594) {
BlinkenMovie.c            1595)   int len;
BlinkenMovie.c            1596) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1600)   len = strlen(pFilename);
BlinkenLib/BlinkenMovie.c 1601)   if (len > 4 && strcmp(pFilename + len - 4, ".blm") == 0)
BlinkenLib/BlinkenMovie.c 1602)     return BlinkenMovieLoadBlm(pFilename);
BlinkenLib/BlinkenMovie.c 1603)   if (len > 4 && strcmp(pFilename + len - 4, ".bmm") == 0)
BlinkenLib/BlinkenMovie.c 1604)     return BlinkenMovieLoadBmm(pFilename);
BlinkenLib/BlinkenMovie.c 1605)   if (len > 4 && strcmp(pFilename + len - 4, ".bml") == 0)
BlinkenLib/BlinkenMovie.c 1606)     return BlinkenMovieLoadBml(pFilename);
BlinkenLib/BlinkenMovie.c 1607)   if (len > 4 && strcmp(pFilename + len - 4, ".bbm") == 0)
BlinkenLib/BlinkenMovie.c 1608)     return BlinkenMovieLoadBbm(pFilename);
Christian Heimke BlinkenLib v.0.6.0 (2008-05...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 7 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1617)   return NULL;
BlinkenMovie.c            1618) }
BlinkenMovie.c            1619) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1635)   // open file
BlinkenLib/BlinkenMovie.c 1636)   pFile = fopen(pFilename, "wt");
BlinkenLib/BlinkenMovie.c 1637)   if (pFile == NULL) {
BlinkenLib/BlinkenMovie.c 1638)     BlinkenMovieFree(pOutMovie);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1641)   // write header line
BlinkenLib/BlinkenMovie.c 1642)   fprintf(pFile, "# BlinkenLights Movie %ux%u\n", pOutMovie->width,
BlinkenLib/BlinkenMovie.c 1643)           pOutMovie->height);
BlinkenLib/BlinkenMovie.c 1644) 
BlinkenLib/BlinkenMovie.c 1645)   // write information lines
BlinkenLib/BlinkenMovie.c 1646)   for (i = 0; i < pOutMovie->infoCnt; i++)
BlinkenLib/BlinkenMovie.c 1647)     fprintf(pFile, "# %s = %s\n", pOutMovie->pppInfos[i][0],
BlinkenLib/BlinkenMovie.c 1648)             pOutMovie->pppInfos[i][1]);
BlinkenLib/BlinkenMovie.c 1649) 
BlinkenLib/BlinkenMovie.c 1650)   // write frames
BlinkenLib/BlinkenMovie.c 1651)   for (i = 0; i < pOutMovie->frameCnt; i++) {
BlinkenLib/BlinkenMovie.c 1652)     fprintf(pFile, "\n@%u\n",
BlinkenLib/BlinkenMovie.c 1653)             BlinkenFrameGetDuration(pOutMovie->ppFrames[i]));
BlinkenLib/BlinkenMovie.c 1654)     for (y = 0; y < pOutMovie->height; y++) {
BlinkenLib/BlinkenMovie.c 1655)       for (x = 0; x < pOutMovie->width; x++) {
BlinkenLib/BlinkenMovie.c 1656)         if (BlinkenFrameGetPixel(pOutMovie->ppFrames[i], y, x, 0) != 0)
BlinkenLib/BlinkenMovie.c 1657)           fprintf(pFile, "1");
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1662)     }
BlinkenMovie.c            1663)   }
BlinkenMovie.c            1664) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1672)   return 0;
BlinkenMovie.c            1673) }
BlinkenMovie.c            1674) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1690)   // open file
BlinkenLib/BlinkenMovie.c 1691)   pFile = fopen(pFilename, "wt");
BlinkenLib/BlinkenMovie.c 1692)   if (pFile == NULL) {
BlinkenLib/BlinkenMovie.c 1693)     BlinkenMovieFree(pOutMovie);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1696)   // write header line
BlinkenLib/BlinkenMovie.c 1697)   fprintf(pFile, "# BlinkenMini Movie %ux%u\n", pOutMovie->width,
BlinkenLib/BlinkenMovie.c 1698)           pOutMovie->height);
BlinkenLib/BlinkenMovie.c 1699) 
BlinkenLib/BlinkenMovie.c 1700)   // write information lines
BlinkenLib/BlinkenMovie.c 1701)   for (i = 0; i < pOutMovie->infoCnt; i++)
BlinkenLib/BlinkenMovie.c 1702)     fprintf(pFile, "# %s = %s\n", pOutMovie->pppInfos[i][0],
BlinkenLib/BlinkenMovie.c 1703)             pOutMovie->pppInfos[i][1]);
BlinkenLib/BlinkenMovie.c 1704) 
BlinkenLib/BlinkenMovie.c 1705)   // write frames
BlinkenLib/BlinkenMovie.c 1706)   for (i = 0; i < pOutMovie->frameCnt; i++) {
BlinkenLib/BlinkenMovie.c 1707)     fprintf(pFile, "\n@%u\n",
BlinkenLib/BlinkenMovie.c 1708)             BlinkenFrameGetDuration(pOutMovie->ppFrames[i]));
BlinkenLib/BlinkenMovie.c 1709)     for (y = 0; y < pOutMovie->height; y++) {
BlinkenLib/BlinkenMovie.c 1710)       fprintf(pFile, "0x%02X",
BlinkenLib/BlinkenMovie.c 1711)               BlinkenFrameGetPixel(pOutMovie->ppFrames[i], y, 0, 0));
BlinkenLib/BlinkenMovie.c 1712)       for (x = 1; x < pOutMovie->width; x++)
BlinkenLib/BlinkenMovie.c 1713)         fprintf(pFile, " 0x%02X",
BlinkenLib/BlinkenMovie.c 1714)                 BlinkenFrameGetPixel(pOutMovie->ppFrames[i], y, x, 0));
BlinkenLib/BlinkenMovie.c 1715)       fprintf(pFile, "\n");
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1742)   val = pOutMovie->maxval;      // get number of bits
BlinkenLib/BlinkenMovie.c 1743)   for (bits = 0; val != 0; val >>= 1, bits++) ;
BlinkenLib/BlinkenMovie.c 1744)   BlinkenMovieResize(pOutMovie, pOutMovie->height, pOutMovie->width,
BlinkenLib/BlinkenMovie.c 1745)                      pOutMovie->channels, (1 << bits) - 1);
BlinkenLib/BlinkenMovie.c 1746) 
BlinkenLib/BlinkenMovie.c 1747)   // open file
BlinkenLib/BlinkenMovie.c 1748)   pFile = fopen(pFilename, "wt");
BlinkenLib/BlinkenMovie.c 1749)   if (pFile == NULL) {
BlinkenLib/BlinkenMovie.c 1750)     BlinkenMovieFree(pOutMovie);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1753)   // write header line
BlinkenLib/BlinkenMovie.c 1754)   fprintf(pFile, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
BlinkenLib/BlinkenMovie.c 1755) 
BlinkenLib/BlinkenMovie.c 1756)   // write blm start tag
BlinkenLib/BlinkenMovie.c 1757)   fprintf(pFile,
BlinkenLib/BlinkenMovie.c 1758)           "<blm width=\"%u\" height=\"%u\" bits=\"%u\" channels=\"%u\">\n",
BlinkenLib/BlinkenMovie.c 1759)           pOutMovie->width, pOutMovie->height, bits, pOutMovie->channels);
BlinkenLib/BlinkenMovie.c 1760) 
BlinkenLib/BlinkenMovie.c 1761)   // write information lines
BlinkenLib/BlinkenMovie.c 1762)   fprintf(pFile, "\t<header>\n");
BlinkenLib/BlinkenMovie.c 1763)   for (i = 0; i < pOutMovie->infoCnt; i++) {
BlinkenLib/BlinkenMovie.c 1764)     if (strcmp(pOutMovie->pppInfos[i][0], "title") == 0)
BlinkenLib/BlinkenMovie.c 1765)       fprintf(pFile, "\t\t<title>%s</title>\n", pOutMovie->pppInfos[i][1]);
BlinkenLib/BlinkenMovie.c 1766)     else if (strcmp(pOutMovie->pppInfos[i][0], "description") == 0)
BlinkenLib/BlinkenMovie.c 1767)       fprintf(pFile, "\t\t<description>%s</description>\n",
BlinkenLib/BlinkenMovie.c 1768)               pOutMovie->pppInfos[i][1]);
BlinkenLib/BlinkenMovie.c 1769)     else if (strcmp(pOutMovie->pppInfos[i][0], "creator") == 0)
BlinkenLib/BlinkenMovie.c 1770)       fprintf(pFile, "\t\t<creator>%s</creator>\n",
BlinkenLib/BlinkenMovie.c 1771)               pOutMovie->pppInfos[i][1]);
BlinkenLib/BlinkenMovie.c 1772)     else if (strcmp(pOutMovie->pppInfos[i][0], "author") == 0)
BlinkenLib/BlinkenMovie.c 1773)       fprintf(pFile, "\t\t<author>%s</author>\n", pOutMovie->pppInfos[i][1]);
BlinkenLib/BlinkenMovie.c 1774)     else if (strcmp(pOutMovie->pppInfos[i][0], "email") == 0)
BlinkenLib/BlinkenMovie.c 1775)       fprintf(pFile, "\t\t<email>%s</email>\n", pOutMovie->pppInfos[i][1]);
BlinkenLib/BlinkenMovie.c 1776)     else if (strcmp(pOutMovie->pppInfos[i][0], "url") == 0)
BlinkenLib/BlinkenMovie.c 1777)       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            1778)     else
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1782)   fprintf(pFile, "\t</header>\n");
BlinkenLib/BlinkenMovie.c 1783) 
BlinkenLib/BlinkenMovie.c 1784)   // write frames
BlinkenLib/BlinkenMovie.c 1785)   for (i = 0; i < pOutMovie->frameCnt; i++) {
BlinkenLib/BlinkenMovie.c 1786)     fprintf(pFile, "\n\t<frame duration=\"%u\">\n",
BlinkenLib/BlinkenMovie.c 1787)             BlinkenFrameGetDuration(pOutMovie->ppFrames[i]));
BlinkenLib/BlinkenMovie.c 1788)     for (y = 0; y < pOutMovie->height; y++) {
BlinkenLib/BlinkenMovie.c 1789)       fprintf(pFile, "\t\t<row>");
BlinkenLib/BlinkenMovie.c 1790)       for (x = 0; x < pOutMovie->width; x++)
BlinkenLib/BlinkenMovie.c 1791)         for (c = 0; c < pOutMovie->channels; c++)
BlinkenLib/BlinkenMovie.c 1792)           fprintf(pFile, bits > 4 ? "%02X" : "%01X",
BlinkenLib/BlinkenMovie.c 1793)                   BlinkenFrameGetPixel(pOutMovie->ppFrames[i], y, x, c));
BlinkenLib/BlinkenMovie.c 1794)       fprintf(pFile, "</row>\n");
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1809)   return 0;
BlinkenMovie.c            1810) }
BlinkenMovie.c            1811) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1814)   unsigned char *pFrameData;
BlinkenLib/BlinkenMovie.c 1815)   FILE *pFile;
BlinkenLib/BlinkenMovie.c 1816)   unsigned char header[24], infoHeader[6], framePointer[4],
BlinkenLib/BlinkenMovie.c 1817)       frameStartMarker[4];
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1824)   // allocate frame data buffer
BlinkenLib/BlinkenMovie.c 1825)   pFrameData =
BlinkenLib/BlinkenMovie.c 1826)       (unsigned char *)malloc(2 +
BlinkenLib/BlinkenMovie.c 1827)                               pMovie->height * pMovie->width *
BlinkenLib/BlinkenMovie.c 1828)                               pMovie->channels);
BlinkenLib/BlinkenMovie.c 1829)   if (pFrameData == NULL)
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1832)   // open file
BlinkenLib/BlinkenMovie.c 1833)   pFile = fopen(pFilename, "wb");
BlinkenLib/BlinkenMovie.c 1834)   if (pFile == NULL) {
BlinkenLib/BlinkenMovie.c 1835)     free(pFrameData);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1840)   header[1] = 0x54;
BlinkenMovie.c            1841)   header[2] = 0x26;
BlinkenMovie.c            1842)   header[3] = 0x66;
BlinkenMovie.c            1843)   header[4] = (unsigned char)(pMovie->height >> 8);
BlinkenMovie.c            1844)   header[5] = (unsigned char)pMovie->height;
BlinkenMovie.c            1845)   header[6] = (unsigned char)(pMovie->width >> 8);
BlinkenMovie.c            1846)   header[7] = (unsigned char)pMovie->width;
BlinkenMovie.c            1847)   header[8] = (unsigned char)(pMovie->channels >> 8);
BlinkenMovie.c            1848)   header[9] = (unsigned char)pMovie->channels;
BlinkenMovie.c            1849)   header[10] = (unsigned char)(pMovie->maxval >> 8);
BlinkenMovie.c            1850)   header[11] = (unsigned char)pMovie->maxval;
BlinkenMovie.c            1851)   header[12] = (unsigned char)(pMovie->frameCnt >> 24);
BlinkenMovie.c            1852)   header[13] = (unsigned char)(pMovie->frameCnt >> 16);
BlinkenMovie.c            1853)   header[14] = (unsigned char)(pMovie->frameCnt >> 8);
BlinkenMovie.c            1854)   header[15] = (unsigned char)pMovie->frameCnt;
BlinkenMovie.c            1855)   duration = 0;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1858)   header[16] = (unsigned char)(duration >> 24);
BlinkenMovie.c            1859)   header[17] = (unsigned char)(duration >> 16);
BlinkenMovie.c            1860)   header[18] = (unsigned char)(duration >> 8);
BlinkenMovie.c            1861)   header[19] = (unsigned char)duration;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1862)   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            1863)   header[21] = 0;
BlinkenMovie.c            1864)   header[22] = 0;
BlinkenMovie.c            1865)   header[23] = 0;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1883)     fwrite(infoHeader, 1, 6, pFile);
BlinkenLib/BlinkenMovie.c 1884)     fwrite(pMovie->pppInfos[i][0], 1, len0, pFile);
BlinkenLib/BlinkenMovie.c 1885)     fwrite("\0", 1, 1, pFile);
BlinkenLib/BlinkenMovie.c 1886)     fwrite(pMovie->pppInfos[i][1], 1, len1, pFile);
BlinkenLib/BlinkenMovie.c 1887)     fwrite("\0", 1, 1, pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1892)   framePointer[0] = (unsigned char)(pos >> 24);
BlinkenMovie.c            1893)   framePointer[1] = (unsigned char)(pos >> 16);
BlinkenMovie.c            1894)   framePointer[2] = (unsigned char)(pos >> 8);
BlinkenMovie.c            1895)   framePointer[3] = (unsigned char)pos;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1896)   fseek(pFile, 20, SEEK_SET);
BlinkenLib/BlinkenMovie.c 1897)   fwrite(framePointer, 1, 4, pFile);
BlinkenLib/BlinkenMovie.c 1898)   fseek(pFile, pos, SEEK_SET);
BlinkenLib/BlinkenMovie.c 1899) 
BlinkenLib/BlinkenMovie.c 1900)   // write frame start marker
BlinkenLib/BlinkenMovie.c 1901)   frameStartMarker[0] = 0x66;   // 'f'
BlinkenLib/BlinkenMovie.c 1902)   frameStartMarker[1] = 0x72;   // 'r'
BlinkenLib/BlinkenMovie.c 1903)   frameStartMarker[2] = 0x6D;   // 'm'
BlinkenLib/BlinkenMovie.c 1904)   frameStartMarker[3] = 0x73;   // 's'
BlinkenLib/BlinkenMovie.c 1905)   fwrite(frameStartMarker, 1, 4, pFile);
BlinkenLib/BlinkenMovie.c 1906) 
BlinkenLib/BlinkenMovie.c 1907)   // write frames
BlinkenLib/BlinkenMovie.c 1908)   for (i = 0; i < pMovie->frameCnt; i++) {
BlinkenLib/BlinkenMovie.c 1909)     val = BlinkenFrameGetDuration(pMovie->ppFrames[i]);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1912)     for (j = 2, y = 0; y < pMovie->height; y++)
BlinkenLib/BlinkenMovie.c 1913)       for (x = 0; x < pMovie->width; x++)
BlinkenLib/BlinkenMovie.c 1914)         for (c = 0; c < pMovie->channels; c++, j++)
BlinkenLib/BlinkenMovie.c 1915)           pFrameData[j] = BlinkenFrameGetPixel(pMovie->ppFrames[i], y, x, c);
BlinkenLib/BlinkenMovie.c 1916)     fwrite(pFrameData, 1, j, pFile);
Christian Heimke BlinkenLib v.0.1.1 (2005-01...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1926)   return 0;
BlinkenMovie.c            1927) }
BlinkenMovie.c            1928) 
Christian Heimke BlinkenLib v.0.6.0 (2008-05...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenMovie.c 1934) }
BlinkenLib/BlinkenMovie.c 1935) 
BlinkenLib/BlinkenMovie.c 1936) #endif // #ifdef BLINKENLIB_CFG_MNG
BlinkenLib/BlinkenMovie.c 1937) 
Stefan Schuermans implement writing GIFs

Stefan Schuermans authored 7 years ago

BlinkenLib/BlinkenMovie.c 1938) #ifdef BLINKENLIB_CFG_GIF
BlinkenLib/BlinkenMovie.c 1939) 
BlinkenLib/BlinkenMovie.c 1940) int BlinkenMovieSaveGif(stBlinkenMovie *pMovie, const char *pFilename)
BlinkenLib/BlinkenMovie.c 1941) {
BlinkenLib/BlinkenMovie.c 1942)   return BlinkenGifSave(pMovie, pFilename);
BlinkenLib/BlinkenMovie.c 1943) }
BlinkenLib/BlinkenMovie.c 1944) 
BlinkenLib/BlinkenMovie.c 1945) #endif // #ifdef BLINKENLIB_CFG_GIF
BlinkenLib/BlinkenMovie.c 1946) 
Stefan Schuermans adaptions for usage in C++

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1948) {
BlinkenMovie.c            1949)   int len;
BlinkenMovie.c            1950) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1954)   len = strlen(pFilename);
BlinkenLib/BlinkenMovie.c 1955)   if (len > 4 && strcmp(pFilename + len - 4, ".blm") == 0)
BlinkenLib/BlinkenMovie.c 1956)     return BlinkenMovieSaveBlm(pMovie, pFilename);
BlinkenLib/BlinkenMovie.c 1957)   if (len > 4 && strcmp(pFilename + len - 4, ".bmm") == 0)
BlinkenLib/BlinkenMovie.c 1958)     return BlinkenMovieSaveBmm(pMovie, pFilename);
BlinkenLib/BlinkenMovie.c 1959)   if (len > 4 && strcmp(pFilename + len - 4, ".bml") == 0)
BlinkenLib/BlinkenMovie.c 1960)     return BlinkenMovieSaveBml(pMovie, pFilename);
BlinkenLib/BlinkenMovie.c 1961)   if (len > 4 && strcmp(pFilename + len - 4, ".bbm") == 0)
BlinkenLib/BlinkenMovie.c 1962)     return BlinkenMovieSaveBbm(pMovie, pFilename);
Christian Heimke BlinkenLib v.0.6.0 (2008-05...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 7 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            1971)   return -1;
BlinkenMovie.c            1972) }
BlinkenMovie.c            1973) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 1981)   char buffer[65536];   // 64kB is more than maximum UDP size
BlinkenLib/BlinkenMovie.c 1982) 
BlinkenLib/BlinkenMovie.c 1983)   for (i = 0; i < pMovie->frameCnt; i++) {
BlinkenLib/BlinkenMovie.c 1984)     len =
BlinkenLib/BlinkenMovie.c 1985)         BlinkenFrameToNetwork(pMovie->ppFrames[i], proto, buffer,
BlinkenLib/BlinkenMovie.c 1986)                               sizeof(buffer));
BlinkenLib/BlinkenMovie.c 1987)     duration = BlinkenFrameGetDuration(pMovie->ppFrames[i]);
BlinkenLib/BlinkenMovie.c 1988)     if (len > 0) {
BlinkenLib/BlinkenMovie.c 1989)       while (duration > 0) {
BlinkenLib/BlinkenMovie.c 1990)         send(udpSocket, buffer, len, 0);
BlinkenLib/BlinkenMovie.c 1991)         dur = maxidle > 0 ? mini(maxidle, duration) : duration;
BlinkenLib/BlinkenMovie.c 1992)         msleep(dur);
BlinkenLib/BlinkenMovie.c 1993)         duration -= dur;
Christian Heimke BlinkenLib v.0.5.4 (2008-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            1994)       }
BlinkenMovie.c            1995)     }
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

BlinkenMovie.c            1996)   }
BlinkenMovie.c            1997) }
BlinkenMovie.c            1998) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            2016)     timeout = 0;
BlinkenMovie.c            2017) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenMovie.c            2019)   pMovie = NULL;
BlinkenMovie.c            2020)   proto = BlinkenProtoNone;
BlinkenMovie.c            2021)   pLastFrame = NULL;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 2022)   lastTime = get_ms();
BlinkenLib/BlinkenMovie.c 2023)   for (;;) {
BlinkenLib/BlinkenMovie.c 2024)     // wait for next frame
BlinkenLib/BlinkenMovie.c 2025)     FD_ZERO(&readFds);
BlinkenLib/BlinkenMovie.c 2026)     FD_SET(udpSocket, &readFds);
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 2029)     // timeout or error
BlinkenLib/BlinkenMovie.c 2030)     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            2031)       break;
BlinkenMovie.c            2032) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 2038)     // get frame from data
BlinkenLib/BlinkenMovie.c 2039)     pFrame = BlinkenFrameFromNetwork(buffer, len, &p);
BlinkenLib/BlinkenMovie.c 2040)     if (pFrame != NULL) {
BlinkenLib/BlinkenMovie.c 2041)       // valid protocol
BlinkenLib/BlinkenMovie.c 2042)       if (p != BlinkenProtoNone) {
BlinkenLib/BlinkenMovie.c 2043)         // first frame
BlinkenLib/BlinkenMovie.c 2044)         if (proto == BlinkenProtoNone)
BlinkenLib/BlinkenMovie.c 2045)           proto = p;    // use this protocol
BlinkenLib/BlinkenMovie.c 2046)         // protocol matches
BlinkenLib/BlinkenMovie.c 2047)         if (p == proto) {
BlinkenLib/BlinkenMovie.c 2048)           // no movie yet
BlinkenLib/BlinkenMovie.c 2049)           if (pMovie == NULL) {
BlinkenLib/BlinkenMovie.c 2050)             // allocate a new movie
BlinkenLib/BlinkenMovie.c 2051)             pMovie = BlinkenMovieNew(BlinkenFrameGetHeight(pFrame),
BlinkenLib/BlinkenMovie.c 2052)                                      BlinkenFrameGetWidth(pFrame),
BlinkenLib/BlinkenMovie.c 2053)                                      BlinkenFrameGetChannels(pFrame),
BlinkenLib/BlinkenMovie.c 2054)                                      BlinkenFrameGetMaxval(pFrame));
BlinkenLib/BlinkenMovie.c 2055)             if (pMovie == NULL) {
BlinkenLib/BlinkenMovie.c 2056)               BlinkenFrameFree(pFrame);
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

BlinkenMovie.c            2057)               break;
BlinkenMovie.c            2058)             }
BlinkenMovie.c            2059)           }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 2060)           // ignore frame if it is equal to last one
BlinkenLib/BlinkenMovie.c 2061)           if (pMovie->frameCnt > 0) {
BlinkenLib/BlinkenMovie.c 2062)             if (BlinkenFrameCompare
BlinkenLib/BlinkenMovie.c 2063)                 (pFrame, pMovie->ppFrames[pMovie->frameCnt - 1]) == 0) {
BlinkenLib/BlinkenMovie.c 2064)               BlinkenFrameFree(pFrame);
Christian Heimke BlinkenLib v.0.5.4 (2008-01...

Christian Heimke authored 13 years ago

BlinkenMovie.c            2065)               continue;
BlinkenMovie.c            2066)             }
BlinkenMovie.c            2067)           }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 2068)           // append frame to movie
BlinkenLib/BlinkenMovie.c 2069)           if (BlinkenMovieAppendFrame(pMovie, pFrame) == 0) {
BlinkenLib/BlinkenMovie.c 2070)             // get current time
BlinkenLib/BlinkenMovie.c 2071)             curTime = get_ms();
BlinkenLib/BlinkenMovie.c 2072)             // set duration of last frame
BlinkenLib/BlinkenMovie.c 2073)             if (pLastFrame != NULL)
BlinkenLib/BlinkenMovie.c 2074)               BlinkenFrameSetDuration(pLastFrame, curTime - lastTime);
BlinkenLib/BlinkenMovie.c 2075)             // 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            2076)             pLastFrame = pFrame;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 2080)         }       // if( p == proto )
BlinkenLib/BlinkenMovie.c 2081)       } // if( p != BlinkenProtoNone )
BlinkenLib/BlinkenMovie.c 2082)       // free frame if it was not appended
BlinkenLib/BlinkenMovie.c 2083)       if (pFrame != NULL)
BlinkenLib/BlinkenMovie.c 2084)         BlinkenFrameFree(pFrame);
BlinkenLib/BlinkenMovie.c 2085)     }   // if( pFrame != NULL )
BlinkenLib/BlinkenMovie.c 2086)   }     // for( ; ; )
BlinkenLib/BlinkenMovie.c 2087) 
BlinkenLib/BlinkenMovie.c 2088)   // get current time
BlinkenLib/BlinkenMovie.c 2089)   curTime = get_ms();
BlinkenLib/BlinkenMovie.c 2090)   // set duration of last frame
BlinkenLib/BlinkenMovie.c 2091)   if (pLastFrame != NULL)
BlinkenLib/BlinkenMovie.c 2092)     BlinkenFrameSetDuration(pLastFrame, curTime - lastTime);
BlinkenLib/BlinkenMovie.c 2093) 
BlinkenLib/BlinkenMovie.c 2094)   // return protocol
BlinkenLib/BlinkenMovie.c 2095)   if (pProto != NULL)
Christian Heimke BlinkenLib v.0.3 (2005-02-16)

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenMovie.c 2097)   // return movie