/* the C part of the Data.Bitmap library (c) 2009 Balazs Komuves */ #include #include "bm.h" // ----------------------------------------------------------------------------- void c_memset(word8 *q, int count, word8 x) { memset(q,x,count); } // (from, to, count) void c_memcpy(word8 *p, word8 *q, int count) { memcpy(q,p,count); } // ----------------------------------------------------------------------------- #define K_WORD8 1 #define K_WORD16 2 #define K_WORD32 3 #define K_FLOAT 4 #define PLUSPTR(P,TYP,K) P=(TYP*)(((word8*)P)+K); // ----------------------------------------------------------------------------- #define C_EXTRACT_CHANNEL(TYP) \ void c_extract_channel_ ## TYP \ ( int width, int height \ , TYP *p1, int nchn1, int pad1, int ofs1 \ , TYP *p2, int nchn2, int pad2, int ofs2 \ ) \ { int x,y; \ TYP *q1,*q2; \ q1 = p1 + ofs1; \ q2 = p2 + ofs2; \ for(y=0;y