rotate.c

Go to the documentation of this file.
00001 #ifndef ROTATE_C
00002 #define ROTATE_C
00003 #include "rotate.h"
00004               
00005   unsigned short int notEqual ( unsigned short int *fbbuf, 
00006                                 unsigned short int *cmpbuf,
00007                                 unsigned long  int  size ) {
00008   unsigned short int 
00009       nCounter,
00010       returnValue = 0;                                
00011   for (nCounter = 0; nCounter < size; nCounter++) {
00012     if (*cmpbuf++ != *fbbuf++) {
00013       returnValue = 1;
00014       break;
00015     }; // end of [if]
00016   }; // end of [for]
00017   return returnValue;
00018 }; // end of [notEqual]
00019 
00020 /*
00021  * x: width  --- of the HW framebuffer (mmap)
00022  * y: height --/
00023  * nCounterX: [x] iterator   --- both in respect to the HW mmap Layout
00024  * nCounterY: [y] iterator   --/
00025  *
00026  * the template iterates Pxy [0,0]   ... [x-1,  0]
00027  *                           [0,1]   ... [x-1,  1]
00028  *                                   ...
00029  *                           [0,y-1] ... [x-1,y-1]
00030  */              
00031 #define  FUNCTIONNAME rotate90 
00032 
00033 #define  SWAP
00034 
00035 #define  FUNCTIONX ((y-1)-nCounterY)
00036 
00037 #define  FUNCTIONY nCounterX
00038 
00039 #define  FUNCTION(nCounterX, nCounterY) (FUNCTIONX + FUNCTIONY * y)
00040 #include "rotatetemplate.c"
00041 #undef   FUNCTION
00042 #undef   FUNCTIONY
00043 #undef   FUNCTIONX
00044 #undef   SWAP
00045 #undef   FUNCTIONNAME
00046 // ---
00047 #define  FUNCTIONNAME rotate0
00048 #define  FUNCTIONX nCounterX
00049 #define  FUNCTIONY nCounterY
00050 #define  FUNCTION(nCounterX, nCounterY) (PIXELPOSITION)
00051 #include "rotatetemplate.c"
00052 #undef   FUNCTION
00053 #undef   FUNCTIONY
00054 #undef   FUNCTIONX
00055 #undef   FUNCTIONNAME
00056 // ---
00057 #define  FUNCTIONNAME rotate180
00058 #define  FUNCTIONX ((x-1)-nCounterX)
00059 #define  FUNCTIONY ((y-1)-nCounterY)
00060 #define  FUNCTION(nCounterX, nCounterY) (FUNCTIONX + FUNCTIONY * x)
00061 #include "rotatetemplate.c"
00062 #undef   FUNCTION
00063 #undef   FUNCTIONY
00064 #undef   FUNCTIONX
00065 #undef   FUNCTIONNAME
00066 // ---
00067 #define  FUNCTIONNAME rotate270
00068 #define  SWAP
00069 #define  FUNCTIONX nCounterY
00070 #define  FUNCTIONY ((x-1)-nCounterX)
00071 #define  FUNCTION(nCounterX, nCounterY) (FUNCTIONX + FUNCTIONY * y)
00072 #include "rotatetemplate.c"
00073 #undef   FUNCTION
00074 #undef   FUNCTIONY
00075 #undef   FUNCTIONX
00076 #undef   SWAP
00077 #undef   FUNCTIONNAME
00078 
00079 #endif