Stefan Schuermans commited on 2013-08-02 23:04:38
              Showing 10 changed files, with 385 additions and 15 deletions.
            
| ... | ... | 
                      @@ -31,7 +31,8 @@ unsigned char BlinkenColorizerSolid(int step, int channels, int y, int x,  | 
                  
| 31 | 31 | 
                        else  | 
                    
| 32 | 32 | 
                        return 0;  | 
                    
| 33 | 33 | 
                        }  | 
                    
| 34 | 
                        - y = x = 0; // keep compiler quiet  | 
                    |
| 34 | 
                        + (void)x; // keep compiler quiet  | 
                    |
| 35 | 
                        + (void)y; // keep compiler quiet  | 
                    |
| 35 | 36 | 
                        }  | 
                    
| 36 | 37 | 
                         | 
                    
| 37 | 38 | 
                        unsigned char BlinkenColorizerRainbow(int step, int channels, int y, int x,  | 
                    
| ... | ... | 
                      @@ -200,6 +200,20 @@ int main(int argCnt, char **args)  | 
                  
| 200 | 200 | 
                        " generate a test movie\n"  | 
                    
| 201 | 201 | 
                        " -C <file> <src-x>,<src-y> <width>x<height> <dest-x>,<dest-y>\n"  | 
                    
| 202 | 202 | 
                        " copy rectangular section of other movie\n"  | 
                    
| 203 | 
                        + " -Rcw\n"  | 
                    |
| 204 | 
                        + " rotate movie 90 degrees clockwise\n"  | 
                    |
| 205 | 
                        + " -Rccw\n"  | 
                    |
| 206 | 
                        + " rotate movie 90 degrees counter-clockwise\n"  | 
                    |
| 207 | 
                        + " -Rh\n"  | 
                    |
| 208 | 
                        + " rotate movie 180 degrees\n"  | 
                    |
| 209 | 
                        + " -Mh\n"  | 
                    |
| 210 | 
                        + " mirror movie horizontally\n"  | 
                    |
| 211 | 
                        + " -Mv\n"  | 
                    |
| 212 | 
                        + " mirror movie vertically\n"  | 
                    |
| 213 | 
                        + " -Md\n"  | 
                    |
| 214 | 
                        + " mirror movie diagonally (\\)\n"  | 
                    |
| 215 | 
                        + " -Md2\n"  | 
                    |
| 216 | 
                        + " mirror movie diagonally (/)\n"  | 
                    |
| 203 | 217 | 
                        " -o <file>\n"  | 
                    
| 204 | 218 | 
                        " write movie to file (*.blm, *.bmm, *.bml, *.bbm)\n\n"  | 
                    
| 205 | 219 | 
                        "old syntax: %s <input-file> [<output-file>]\n\n",  | 
                    
| ... | ... | 
                      @@ -465,6 +479,69 @@ int main(int argCnt, char **args)  | 
                  
| 465 | 479 | 
                        } else  | 
                    
| 466 | 480 | 
                                 printf("missing file name of source movie for \"-C\"\n");
                       | 
                    
| 467 | 481 | 
                        }  | 
                    
| 482 | 
                        + // rotate movie 90 degrees clockwise  | 
                    |
| 483 | 
                        +    else if (strcmp(args[i], "-Rcw") == 0) {
                       | 
                    |
| 484 | 
                        + if (pMovie == NULL)  | 
                    |
| 485 | 
                        +        printf("no movie loaded to rotate\n");
                       | 
                    |
| 486 | 
                        +      else {
                       | 
                    |
| 487 | 
                        + BlinkenMovieRotateCw(pMovie);  | 
                    |
| 488 | 
                        +        printf("movie rotated 90 degrees clockwise\n");
                       | 
                    |
| 489 | 
                        + }  | 
                    |
| 490 | 
                        + }  | 
                    |
| 491 | 
                        + // rotate movie 90 degrees counter-clockwise  | 
                    |
| 492 | 
                        +    else if (strcmp(args[i], "-Rccw") == 0) {
                       | 
                    |
| 493 | 
                        + if (pMovie == NULL)  | 
                    |
| 494 | 
                        +        printf("no movie loaded to rotate\n");
                       | 
                    |
| 495 | 
                        +      else {
                       | 
                    |
| 496 | 
                        + BlinkenMovieRotateCcw(pMovie);  | 
                    |
| 497 | 
                        +        printf("movie rotated 90 degrees counter-clockwise\n");
                       | 
                    |
| 498 | 
                        + }  | 
                    |
| 499 | 
                        + }  | 
                    |
| 500 | 
                        + // rotate movie 180 degrees  | 
                    |
| 501 | 
                        +    else if (strcmp(args[i], "-Rh") == 0) {
                       | 
                    |
| 502 | 
                        + if (pMovie == NULL)  | 
                    |
| 503 | 
                        +        printf("no movie loaded to rotate\n");
                       | 
                    |
| 504 | 
                        +      else {
                       | 
                    |
| 505 | 
                        + BlinkenMovieRotateHalf(pMovie);  | 
                    |
| 506 | 
                        +        printf("movie rotated 180 degrees\n");
                       | 
                    |
| 507 | 
                        + }  | 
                    |
| 508 | 
                        + }  | 
                    |
| 509 | 
                        + // mirror movie horizontally  | 
                    |
| 510 | 
                        +    else if (strcmp(args[i], "-Mh") == 0) {
                       | 
                    |
| 511 | 
                        + if (pMovie == NULL)  | 
                    |
| 512 | 
                        +        printf("no movie loaded to mirror\n");
                       | 
                    |
| 513 | 
                        +      else {
                       | 
                    |
| 514 | 
                        + BlinkenMovieMirrorHor(pMovie);  | 
                    |
| 515 | 
                        +        printf("movie mirrored horizontally\n");
                       | 
                    |
| 516 | 
                        + }  | 
                    |
| 517 | 
                        + }  | 
                    |
| 518 | 
                        + // mirror movie vertically  | 
                    |
| 519 | 
                        +    else if (strcmp(args[i], "-Mv") == 0) {
                       | 
                    |
| 520 | 
                        + if (pMovie == NULL)  | 
                    |
| 521 | 
                        +        printf("no movie loaded to mirror\n");
                       | 
                    |
| 522 | 
                        +      else {
                       | 
                    |
| 523 | 
                        + BlinkenMovieMirrorVer(pMovie);  | 
                    |
| 524 | 
                        +        printf("movie mirrored vertically\n");
                       | 
                    |
| 525 | 
                        + }  | 
                    |
| 526 | 
                        + }  | 
                    |
| 527 | 
                        + // mirror movie diagonally  | 
                    |
| 528 | 
                        +    else if (strcmp(args[i], "-Md") == 0) {
                       | 
                    |
| 529 | 
                        + if (pMovie == NULL)  | 
                    |
| 530 | 
                        +        printf("no movie loaded to mirror\n");
                       | 
                    |
| 531 | 
                        +      else {
                       | 
                    |
| 532 | 
                        + BlinkenMovieMirrorDiag(pMovie);  | 
                    |
| 533 | 
                        +        printf("movie mirrored diagonally (\\)\n");
                       | 
                    |
| 534 | 
                        + }  | 
                    |
| 535 | 
                        + }  | 
                    |
| 536 | 
                        + // mirror movie diagonally  | 
                    |
| 537 | 
                        +    else if (strcmp(args[i], "-Md2") == 0) {
                       | 
                    |
| 538 | 
                        + if (pMovie == NULL)  | 
                    |
| 539 | 
                        +        printf("no movie loaded to mirror\n");
                       | 
                    |
| 540 | 
                        +      else {
                       | 
                    |
| 541 | 
                        + BlinkenMovieMirrorDiag2(pMovie);  | 
                    |
| 542 | 
                        +        printf("movie mirrored diagonally (/)\n");
                       | 
                    |
| 543 | 
                        + }  | 
                    |
| 544 | 
                        + }  | 
                    |
| 468 | 545 | 
                        // write movie  | 
                    
| 469 | 546 | 
                             else if (strcmp(args[i], "-o") == 0) {
                       | 
                    
| 470 | 547 | 
                               if (i + 1 < argCnt) {
                       | 
                    
| ... | ... | 
                      @@ -686,6 +686,200 @@ void BlinkenFrameCopyRect(stBlinkenFrame *pDest, int destY, int destX,  | 
                  
| 686 | 686 | 
                        BlinkenFrameFree(pSrc);  | 
                    
| 687 | 687 | 
                        }  | 
                    
| 688 | 688 | 
                         | 
                    
| 689 | 
                        +void BlinkenFrameRotateCw(stBlinkenFrame *pFrame)  | 
                    |
| 690 | 
                        +{
                       | 
                    |
| 691 | 
                        + int height, width, channels, y, x, c, i, j;  | 
                    |
| 692 | 
                        + unsigned char **ppData;  | 
                    |
| 693 | 
                        +  | 
                    |
| 694 | 
                        + if (pFrame == NULL)  | 
                    |
| 695 | 
                        + return;  | 
                    |
| 696 | 
                        +  | 
                    |
| 697 | 
                        + // allocate new data array  | 
                    |
| 698 | 
                        + height = pFrame->width;  | 
                    |
| 699 | 
                        + width = pFrame->height;  | 
                    |
| 700 | 
                        + channels = pFrame->channels;  | 
                    |
| 701 | 
                        + ppData =  | 
                    |
| 702 | 
                        + (unsigned char **)BlinkenMalloc2D(height, width * channels,  | 
                    |
| 703 | 
                        + sizeof(unsigned char));  | 
                    |
| 704 | 
                        + if (ppData == NULL)  | 
                    |
| 705 | 
                        + return;  | 
                    |
| 706 | 
                        +  | 
                    |
| 707 | 
                        + // rotate  | 
                    |
| 708 | 
                        +  for (y = 0; y < height; y++) {
                       | 
                    |
| 709 | 
                        +    for (x = 0, i = 0; x < width; x++) {
                       | 
                    |
| 710 | 
                        + j = y * channels;  | 
                    |
| 711 | 
                        + for (c = 0; c < channels; c++, i++, j++)  | 
                    |
| 712 | 
                        + ppData[y][i] = pFrame->ppData[width - 1 - x][j];  | 
                    |
| 713 | 
                        + }  | 
                    |
| 714 | 
                        + }  | 
                    |
| 715 | 
                        +  | 
                    |
| 716 | 
                        + // use new data array  | 
                    |
| 717 | 
                        + pFrame->height = height;  | 
                    |
| 718 | 
                        + pFrame->width = width;  | 
                    |
| 719 | 
                        + free(pFrame->ppData);  | 
                    |
| 720 | 
                        + pFrame->ppData = ppData;  | 
                    |
| 721 | 
                        +}  | 
                    |
| 722 | 
                        +  | 
                    |
| 723 | 
                        +void BlinkenFrameRotateCcw(stBlinkenFrame *pFrame)  | 
                    |
| 724 | 
                        +{
                       | 
                    |
| 725 | 
                        + int height, width, channels, y, x, c, i, j;  | 
                    |
| 726 | 
                        + unsigned char **ppData;  | 
                    |
| 727 | 
                        +  | 
                    |
| 728 | 
                        + if (pFrame == NULL)  | 
                    |
| 729 | 
                        + return;  | 
                    |
| 730 | 
                        +  | 
                    |
| 731 | 
                        + // allocate new data array  | 
                    |
| 732 | 
                        + height = pFrame->width;  | 
                    |
| 733 | 
                        + width = pFrame->height;  | 
                    |
| 734 | 
                        + channels = pFrame->channels;  | 
                    |
| 735 | 
                        + ppData =  | 
                    |
| 736 | 
                        + (unsigned char **)BlinkenMalloc2D(height, width * channels,  | 
                    |
| 737 | 
                        + sizeof(unsigned char));  | 
                    |
| 738 | 
                        + if (ppData == NULL)  | 
                    |
| 739 | 
                        + return;  | 
                    |
| 740 | 
                        +  | 
                    |
| 741 | 
                        + // rotate  | 
                    |
| 742 | 
                        +  for (y = 0; y < height; y++) {
                       | 
                    |
| 743 | 
                        +    for (x = 0, i = 0; x < width; x++) {
                       | 
                    |
| 744 | 
                        + j = (height - 1 - y) * channels;  | 
                    |
| 745 | 
                        + for (c = 0; c < channels; c++, i++, j++)  | 
                    |
| 746 | 
                        + ppData[y][i] = pFrame->ppData[x][j];  | 
                    |
| 747 | 
                        + }  | 
                    |
| 748 | 
                        + }  | 
                    |
| 749 | 
                        +  | 
                    |
| 750 | 
                        + // use new data array  | 
                    |
| 751 | 
                        + pFrame->height = height;  | 
                    |
| 752 | 
                        + pFrame->width = width;  | 
                    |
| 753 | 
                        + free(pFrame->ppData);  | 
                    |
| 754 | 
                        + pFrame->ppData = ppData;  | 
                    |
| 755 | 
                        +}  | 
                    |
| 756 | 
                        +  | 
                    |
| 757 | 
                        +void BlinkenFrameRotateHalf(stBlinkenFrame *pFrame)  | 
                    |
| 758 | 
                        +{
                       | 
                    |
| 759 | 
                        + int y1, y2, x1, x2, c, i1, i2;  | 
                    |
| 760 | 
                        +  | 
                    |
| 761 | 
                        + if (pFrame == NULL)  | 
                    |
| 762 | 
                        + return;  | 
                    |
| 763 | 
                        +  | 
                    |
| 764 | 
                        +  for (y1 = 0, y2 = pFrame->height - 1 ; y1 < pFrame->height; y1++, y2--) {
                       | 
                    |
| 765 | 
                        + for (x1 = 0, x2 = pFrame->width - 1,  | 
                    |
| 766 | 
                        + i1 = 0, i2 = (pFrame->width - 1) * pFrame->channels;  | 
                    |
| 767 | 
                        +         x1 < pFrame->width / 2; x1++, x2--, i2 -= 2 * pFrame->channels) {
                       | 
                    |
| 768 | 
                        +      for (c = 0; c < pFrame->channels; c++, i1++, i2++) {
                       | 
                    |
| 769 | 
                        + unsigned char tmp = pFrame->ppData[y1][i1];  | 
                    |
| 770 | 
                        + pFrame->ppData[y1][i1] = pFrame->ppData[y2][i2];  | 
                    |
| 771 | 
                        + pFrame->ppData[y2][i2] = tmp;  | 
                    |
| 772 | 
                        + }  | 
                    |
| 773 | 
                        + }  | 
                    |
| 774 | 
                        + }  | 
                    |
| 775 | 
                        +}  | 
                    |
| 776 | 
                        +  | 
                    |
| 777 | 
                        +void BlinkenFrameMirrorHor(stBlinkenFrame *pFrame)  | 
                    |
| 778 | 
                        +{
                       | 
                    |
| 779 | 
                        + int y, x1, x2, c, i1, i2;  | 
                    |
| 780 | 
                        +  | 
                    |
| 781 | 
                        + if (pFrame == NULL)  | 
                    |
| 782 | 
                        + return;  | 
                    |
| 783 | 
                        +  | 
                    |
| 784 | 
                        +  for (y = 0; y < pFrame->height; y++) {
                       | 
                    |
| 785 | 
                        + for (x1 = 0, x2 = pFrame->width - 1,  | 
                    |
| 786 | 
                        + i1 = 0, i2 = (pFrame->width - 1) * pFrame->channels;  | 
                    |
| 787 | 
                        +         x1 < pFrame->width / 2; x1++, x2--, i2 -= 2 * pFrame->channels) {
                       | 
                    |
| 788 | 
                        +      for (c = 0; c < pFrame->channels; c++, i1++, i2++) {
                       | 
                    |
| 789 | 
                        + unsigned char tmp = pFrame->ppData[y][i1];  | 
                    |
| 790 | 
                        + pFrame->ppData[y][i1] = pFrame->ppData[y][i2];  | 
                    |
| 791 | 
                        + pFrame->ppData[y][i2] = tmp;  | 
                    |
| 792 | 
                        + }  | 
                    |
| 793 | 
                        + }  | 
                    |
| 794 | 
                        + }  | 
                    |
| 795 | 
                        +}  | 
                    |
| 796 | 
                        +  | 
                    |
| 797 | 
                        +void BlinkenFrameMirrorVer(stBlinkenFrame *pFrame)  | 
                    |
| 798 | 
                        +{
                       | 
                    |
| 799 | 
                        + int y1, y2, x, c, i;  | 
                    |
| 800 | 
                        +  | 
                    |
| 801 | 
                        + if (pFrame == NULL)  | 
                    |
| 802 | 
                        + return;  | 
                    |
| 803 | 
                        +  | 
                    |
| 804 | 
                        +  for (y1 = 0, y2 = pFrame->height - 1; y1 < pFrame->height / 2; y1++, y2--) {
                       | 
                    |
| 805 | 
                        +    for (x = 0, i = 0; x < pFrame->width; x++) {
                       | 
                    |
| 806 | 
                        +      for (c = 0; c < pFrame->channels; c++, i++) {
                       | 
                    |
| 807 | 
                        + unsigned char tmp = pFrame->ppData[y1][i];  | 
                    |
| 808 | 
                        + pFrame->ppData[y1][i] = pFrame->ppData[y2][i];  | 
                    |
| 809 | 
                        + pFrame->ppData[y2][i] = tmp;  | 
                    |
| 810 | 
                        + }  | 
                    |
| 811 | 
                        + }  | 
                    |
| 812 | 
                        + }  | 
                    |
| 813 | 
                        +}  | 
                    |
| 814 | 
                        +  | 
                    |
| 815 | 
                        +void BlinkenFrameMirrorDiag(stBlinkenFrame *pFrame)  | 
                    |
| 816 | 
                        +{
                       | 
                    |
| 817 | 
                        + int height, width, channels, y, x, c, i, j;  | 
                    |
| 818 | 
                        + unsigned char **ppData;  | 
                    |
| 819 | 
                        +  | 
                    |
| 820 | 
                        + if (pFrame == NULL)  | 
                    |
| 821 | 
                        + return;  | 
                    |
| 822 | 
                        +  | 
                    |
| 823 | 
                        + // allocate new data array  | 
                    |
| 824 | 
                        + height = pFrame->width;  | 
                    |
| 825 | 
                        + width = pFrame->height;  | 
                    |
| 826 | 
                        + channels = pFrame->channels;  | 
                    |
| 827 | 
                        + ppData =  | 
                    |
| 828 | 
                        + (unsigned char **)BlinkenMalloc2D(height, width * channels,  | 
                    |
| 829 | 
                        + sizeof(unsigned char));  | 
                    |
| 830 | 
                        + if (ppData == NULL)  | 
                    |
| 831 | 
                        + return;  | 
                    |
| 832 | 
                        +  | 
                    |
| 833 | 
                        + // mirror  | 
                    |
| 834 | 
                        +  for (y = 0; y < height; y++) {
                       | 
                    |
| 835 | 
                        +    for (x = 0, i = 0; x < width; x++) {
                       | 
                    |
| 836 | 
                        + j = y * channels;  | 
                    |
| 837 | 
                        + for (c = 0; c < channels; c++, i++, j++)  | 
                    |
| 838 | 
                        + ppData[y][i] = pFrame->ppData[x][j];  | 
                    |
| 839 | 
                        + }  | 
                    |
| 840 | 
                        + }  | 
                    |
| 841 | 
                        +  | 
                    |
| 842 | 
                        + // use new data array  | 
                    |
| 843 | 
                        + pFrame->height = height;  | 
                    |
| 844 | 
                        + pFrame->width = width;  | 
                    |
| 845 | 
                        + free(pFrame->ppData);  | 
                    |
| 846 | 
                        + pFrame->ppData = ppData;  | 
                    |
| 847 | 
                        +}  | 
                    |
| 848 | 
                        +  | 
                    |
| 849 | 
                        +void BlinkenFrameMirrorDiag2(stBlinkenFrame *pFrame)  | 
                    |
| 850 | 
                        +{
                       | 
                    |
| 851 | 
                        + int height, width, channels, y, x, c, i, j;  | 
                    |
| 852 | 
                        + unsigned char **ppData;  | 
                    |
| 853 | 
                        +  | 
                    |
| 854 | 
                        + if (pFrame == NULL)  | 
                    |
| 855 | 
                        + return;  | 
                    |
| 856 | 
                        +  | 
                    |
| 857 | 
                        + // allocate new data array  | 
                    |
| 858 | 
                        + height = pFrame->width;  | 
                    |
| 859 | 
                        + width = pFrame->height;  | 
                    |
| 860 | 
                        + channels = pFrame->channels;  | 
                    |
| 861 | 
                        + ppData =  | 
                    |
| 862 | 
                        + (unsigned char **)BlinkenMalloc2D(height, width * channels,  | 
                    |
| 863 | 
                        + sizeof(unsigned char));  | 
                    |
| 864 | 
                        + if (ppData == NULL)  | 
                    |
| 865 | 
                        + return;  | 
                    |
| 866 | 
                        +  | 
                    |
| 867 | 
                        + // mirror  | 
                    |
| 868 | 
                        +  for (y = 0; y < height; y++) {
                       | 
                    |
| 869 | 
                        +    for (x = 0, i = 0; x < width; x++) {
                       | 
                    |
| 870 | 
                        + j = (height - 1 - y) * channels;  | 
                    |
| 871 | 
                        + for (c = 0; c < channels; c++, i++, j++)  | 
                    |
| 872 | 
                        + ppData[y][i] = pFrame->ppData[width - 1 - x][j];  | 
                    |
| 873 | 
                        + }  | 
                    |
| 874 | 
                        + }  | 
                    |
| 875 | 
                        +  | 
                    |
| 876 | 
                        + // use new data array  | 
                    |
| 877 | 
                        + pFrame->height = height;  | 
                    |
| 878 | 
                        + pFrame->width = width;  | 
                    |
| 879 | 
                        + free(pFrame->ppData);  | 
                    |
| 880 | 
                        + pFrame->ppData = ppData;  | 
                    |
| 881 | 
                        +}  | 
                    |
| 882 | 
                        +  | 
                    |
| 689 | 883 | 
                        char *BlinkenFrameToString(stBlinkenFrame *pFrame)  | 
                    
| 690 | 884 | 
                         {
                       | 
                    
| 691 | 885 | 
                        int size, y, x, c, i;  | 
                    
| ... | ... | 
                      @@ -55,6 +55,14 @@ void BlinkenFrameCopyRect(stBlinkenFrame *pDest, int destY, int destX,  | 
                  
| 55 | 55 | 
                        stBlinkenFrame *pSrc, int srcY, int srcX,  | 
                    
| 56 | 56 | 
                        int height, int width);  | 
                    
| 57 | 57 | 
                         | 
                    
| 58 | 
                        +void BlinkenFrameRotateCw(stBlinkenFrame *pFrame);  | 
                    |
| 59 | 
                        +void BlinkenFrameRotateCcw(stBlinkenFrame *pFrame);  | 
                    |
| 60 | 
                        +void BlinkenFrameRotateHalf(stBlinkenFrame *pFrame);  | 
                    |
| 61 | 
                        +void BlinkenFrameMirrorHor(stBlinkenFrame *pFrame);  | 
                    |
| 62 | 
                        +void BlinkenFrameMirrorVer(stBlinkenFrame *pFrame);  | 
                    |
| 63 | 
                        +void BlinkenFrameMirrorDiag(stBlinkenFrame *pFrame);  | 
                    |
| 64 | 
                        +void BlinkenFrameMirrorDiag2(stBlinkenFrame *pFrame);  | 
                    |
| 65 | 
                        +  | 
                    |
| 58 | 66 | 
                        char *BlinkenFrameToString(stBlinkenFrame *pFrame);  | 
                    
| 59 | 67 | 
                         | 
                    
| 60 | 68 | 
                        int BlinkenFrameToNetwork(stBlinkenFrame *pFrame, etBlinkenProto proto,  | 
                    
| ... | ... | 
                      @@ -684,6 +684,99 @@ void BlinkenMovieCopyRect(stBlinkenMovie *pDest, int destY, int destX,  | 
                  
| 684 | 684 | 
                        } // while (si < scnt)  | 
                    
| 685 | 685 | 
                        }  | 
                    
| 686 | 686 | 
                         | 
                    
| 687 | 
                        +void BlinkenMovieRotateCw(stBlinkenMovie *pMovie)  | 
                    |
| 688 | 
                        +{
                       | 
                    |
| 689 | 
                        + int tmp, i;  | 
                    |
| 690 | 
                        +  | 
                    |
| 691 | 
                        + if (pMovie == NULL)  | 
                    |
| 692 | 
                        + return;  | 
                    |
| 693 | 
                        +  | 
                    |
| 694 | 
                        + tmp = pMovie->height;  | 
                    |
| 695 | 
                        + pMovie->height = pMovie->width;  | 
                    |
| 696 | 
                        + pMovie->width = tmp;  | 
                    |
| 697 | 
                        +  | 
                    |
| 698 | 
                        + for (i = 0; i < pMovie->frameCnt; i++)  | 
                    |
| 699 | 
                        + BlinkenFrameRotateCw(pMovie->ppFrames[i]);  | 
                    |
| 700 | 
                        +}  | 
                    |
| 701 | 
                        +  | 
                    |
| 702 | 
                        +void BlinkenMovieRotateCcw(stBlinkenMovie *pMovie)  | 
                    |
| 703 | 
                        +{
                       | 
                    |
| 704 | 
                        + int tmp, i;  | 
                    |
| 705 | 
                        +  | 
                    |
| 706 | 
                        + if (pMovie == NULL)  | 
                    |
| 707 | 
                        + return;  | 
                    |
| 708 | 
                        +  | 
                    |
| 709 | 
                        + tmp = pMovie->height;  | 
                    |
| 710 | 
                        + pMovie->height = pMovie->width;  | 
                    |
| 711 | 
                        + pMovie->width = tmp;  | 
                    |
| 712 | 
                        +  | 
                    |
| 713 | 
                        + for (i = 0; i < pMovie->frameCnt; i++)  | 
                    |
| 714 | 
                        + BlinkenFrameRotateCcw(pMovie->ppFrames[i]);  | 
                    |
| 715 | 
                        +}  | 
                    |
| 716 | 
                        +  | 
                    |
| 717 | 
                        +void BlinkenMovieRotateHalf(stBlinkenMovie *pMovie)  | 
                    |
| 718 | 
                        +{
                       | 
                    |
| 719 | 
                        + int i;  | 
                    |
| 720 | 
                        +  | 
                    |
| 721 | 
                        + if (pMovie == NULL)  | 
                    |
| 722 | 
                        + return;  | 
                    |
| 723 | 
                        +  | 
                    |
| 724 | 
                        + for (i = 0; i < pMovie->frameCnt; i++)  | 
                    |
| 725 | 
                        + BlinkenFrameRotateHalf(pMovie->ppFrames[i]);  | 
                    |
| 726 | 
                        +}  | 
                    |
| 727 | 
                        +  | 
                    |
| 728 | 
                        +void BlinkenMovieMirrorHor(stBlinkenMovie *pMovie)  | 
                    |
| 729 | 
                        +{
                       | 
                    |
| 730 | 
                        + int i;  | 
                    |
| 731 | 
                        +  | 
                    |
| 732 | 
                        + if (pMovie == NULL)  | 
                    |
| 733 | 
                        + return;  | 
                    |
| 734 | 
                        +  | 
                    |
| 735 | 
                        + for (i = 0; i < pMovie->frameCnt; i++)  | 
                    |
| 736 | 
                        + BlinkenFrameMirrorHor(pMovie->ppFrames[i]);  | 
                    |
| 737 | 
                        +}  | 
                    |
| 738 | 
                        +  | 
                    |
| 739 | 
                        +void BlinkenMovieMirrorVer(stBlinkenMovie *pMovie)  | 
                    |
| 740 | 
                        +{
                       | 
                    |
| 741 | 
                        + int i;  | 
                    |
| 742 | 
                        +  | 
                    |
| 743 | 
                        + if (pMovie == NULL)  | 
                    |
| 744 | 
                        + return;  | 
                    |
| 745 | 
                        +  | 
                    |
| 746 | 
                        + for (i = 0; i < pMovie->frameCnt; i++)  | 
                    |
| 747 | 
                        + BlinkenFrameMirrorVer(pMovie->ppFrames[i]);  | 
                    |
| 748 | 
                        +}  | 
                    |
| 749 | 
                        +  | 
                    |
| 750 | 
                        +void BlinkenMovieMirrorDiag(stBlinkenMovie *pMovie)  | 
                    |
| 751 | 
                        +{
                       | 
                    |
| 752 | 
                        + int tmp, i;  | 
                    |
| 753 | 
                        +  | 
                    |
| 754 | 
                        + if (pMovie == NULL)  | 
                    |
| 755 | 
                        + return;  | 
                    |
| 756 | 
                        +  | 
                    |
| 757 | 
                        + tmp = pMovie->height;  | 
                    |
| 758 | 
                        + pMovie->height = pMovie->width;  | 
                    |
| 759 | 
                        + pMovie->width = tmp;  | 
                    |
| 760 | 
                        +  | 
                    |
| 761 | 
                        + for (i = 0; i < pMovie->frameCnt; i++)  | 
                    |
| 762 | 
                        + BlinkenFrameMirrorDiag(pMovie->ppFrames[i]);  | 
                    |
| 763 | 
                        +}  | 
                    |
| 764 | 
                        +  | 
                    |
| 765 | 
                        +void BlinkenMovieMirrorDiag2(stBlinkenMovie *pMovie)  | 
                    |
| 766 | 
                        +{
                       | 
                    |
| 767 | 
                        + int tmp, i;  | 
                    |
| 768 | 
                        +  | 
                    |
| 769 | 
                        + if (pMovie == NULL)  | 
                    |
| 770 | 
                        + return;  | 
                    |
| 771 | 
                        +  | 
                    |
| 772 | 
                        + tmp = pMovie->height;  | 
                    |
| 773 | 
                        + pMovie->height = pMovie->width;  | 
                    |
| 774 | 
                        + pMovie->width = tmp;  | 
                    |
| 775 | 
                        +  | 
                    |
| 776 | 
                        + for (i = 0; i < pMovie->frameCnt; i++)  | 
                    |
| 777 | 
                        + BlinkenFrameMirrorDiag2(pMovie->ppFrames[i]);  | 
                    |
| 778 | 
                        +}  | 
                    |
| 779 | 
                        +  | 
                    |
| 687 | 780 | 
                        char *BlinkenMovieToString(stBlinkenMovie *pMovie)  | 
                    
| 688 | 781 | 
                         {
                       | 
                    
| 689 | 782 | 
                        char **strs, *str, *ptr;  | 
                    
| ... | ... | 
                      @@ -1069,7 +1162,7 @@ stBlinkenMovie *BlinkenMovieLoadBbm(const char *pFilename)  | 
                  
| 1069 | 1162 | 
                        stBlinkenMovie *pMovie;  | 
                    
| 1070 | 1163 | 
                        stBlinkenFrame *pFrame;  | 
                    
| 1071 | 1164 | 
                        unsigned char header[24], subHeader[6], frameStartMarker[4];  | 
                    
| 1072 | 
                        - unsigned long headerMagic, headerFrameCnt, headerDuration, headerFramePtr;  | 
                    |
| 1165 | 
                        + unsigned long headerMagic, headerFramePtr;  | 
                    |
| 1073 | 1166 | 
                        unsigned short headerHeight, headerWidth, headerChannels, headerMaxval;  | 
                    
| 1074 | 1167 | 
                        unsigned long subHeaderMagic, frameStartMarkerMagic;  | 
                    
| 1075 | 1168 | 
                        unsigned short subHeaderSize;  | 
                    
| ... | ... | 
                      @@ -1097,12 +1190,6 @@ stBlinkenMovie *BlinkenMovieLoadBbm(const char *pFilename)  | 
                  
| 1097 | 1190 | 
                        headerWidth = (unsigned short)header[6] << 8 | (unsigned short)header[7];  | 
                    
| 1098 | 1191 | 
                        headerChannels = (unsigned short)header[8] << 8 | (unsigned short)header[9];  | 
                    
| 1099 | 1192 | 
                        headerMaxval = (unsigned short)header[10] << 8 | (unsigned short)header[11];  | 
                    
| 1100 | 
                        - headerFrameCnt =  | 
                    |
| 1101 | 
                        - (unsigned long)header[12] << 24 | (unsigned long)header[13] << 16 |  | 
                    |
| 1102 | 
                        - (unsigned long)header[14] << 8 | (unsigned long)header[15];  | 
                    |
| 1103 | 
                        - headerDuration =  | 
                    |
| 1104 | 
                        - (unsigned long)header[16] << 24 | (unsigned long)header[17] << 16 |  | 
                    |
| 1105 | 
                        - (unsigned long)header[18] << 8 | (unsigned long)header[19];  | 
                    |
| 1106 | 1193 | 
                        headerFramePtr =  | 
                    
| 1107 | 1194 | 
                        (unsigned long)header[20] << 24 | (unsigned long)header[21] << 16 |  | 
                    
| 1108 | 1195 | 
                        (unsigned long)header[22] << 8 | (unsigned long)header[23];  | 
                    
| ... | ... | 
                      @@ -69,6 +69,14 @@ void BlinkenMovieCopyRect(stBlinkenMovie *pDest, int destY, int destX,  | 
                  
| 69 | 69 | 
                        stBlinkenMovie *pSrc, int srcY, int srcX,  | 
                    
| 70 | 70 | 
                        int height, int width);  | 
                    
| 71 | 71 | 
                         | 
                    
| 72 | 
                        +void BlinkenMovieRotateCw(stBlinkenMovie *pMovie);  | 
                    |
| 73 | 
                        +void BlinkenMovieRotateCcw(stBlinkenMovie *pMovie);  | 
                    |
| 74 | 
                        +void BlinkenMovieRotateHalf(stBlinkenMovie *pMovie);  | 
                    |
| 75 | 
                        +void BlinkenMovieMirrorHor(stBlinkenMovie *pMovie);  | 
                    |
| 76 | 
                        +void BlinkenMovieMirrorVer(stBlinkenMovie *pMovie);  | 
                    |
| 77 | 
                        +void BlinkenMovieMirrorDiag(stBlinkenMovie *pMovie);  | 
                    |
| 78 | 
                        +void BlinkenMovieMirrorDiag2(stBlinkenMovie *pMovie);  | 
                    |
| 79 | 
                        +  | 
                    |
| 72 | 80 | 
                        char *BlinkenMovieToString(stBlinkenMovie *pMovie);  | 
                    
| 73 | 81 | 
                         | 
                    
| 74 | 82 | 
                        stBlinkenMovie *BlinkenMovieLoadBlm(const char *pFilename);  | 
                    
| ... | ... | 
                      @@ -235,7 +235,7 @@ void BlinkenProtoDetectPacket(const char *pData, int length,  | 
                  
| 235 | 235 | 
                        *pPacket = BlinkenPacketEndRequest;  | 
                    
| 236 | 236 | 
                        return;  | 
                    
| 237 | 237 | 
                        case BlinkenProtoMcufInfoMagic:  | 
                    
| 238 | 
                        -    if (length >= sizeof(magic) + 8) {
                       | 
                    |
| 238 | 
                        +    if (length >= (int)sizeof(magic) + 8) {
                       | 
                    |
| 239 | 239 | 
                        if (pProto)  | 
                    
| 240 | 240 | 
                        *pProto = BlinkenProtoMcuf;  | 
                    
| 241 | 241 | 
                        info = 1; // further processing of info packet below  |