Logo Search packages:      
Sourcecode: blender version File versions

void IMB_rectop ( struct ImBuf dbuf,
struct ImBuf sbuf,
int  destx,
int  desty,
int  srcx,
int  srcy,
int  width,
int  height,
void(*)(unsigned int *, unsigned int *, int, int)  operation,
int  value 
)

Attention:
Defined in rectop.c

Definition at line 62 of file rectop.c.

References IMB_rectop(), ImBuf::rect, ImBuf::x, and ImBuf::y.

Referenced by IMB_de_interlace(), IMB_rectop(), and IMB_rectoptot().

{
      unsigned int *drect,*srect;
      int tmp;

      if (dbuf == 0) return;
      if (operation == 0) return;

      if (destx < 0){
            srcx -= destx ;
            width += destx ;
            destx = 0;
      }
      if (srcx < 0){
            destx -= srcx ;
            width += destx ;
            srcx = 0;
      }
      if (desty < 0){
            srcy -= desty ;
            height += desty ;
            desty = 0;
      }
      if (srcy < 0){
            desty -= srcy ;
            height += desty ;
            srcy = 0;
      }

      tmp = dbuf->x - destx;
      if (width > tmp) width = tmp;
        tmp = dbuf->y  - desty;
      if (height > tmp) height = tmp;

      drect = dbuf->rect + desty * dbuf->x + destx;
      destx = dbuf->x;

      if (sbuf){
                tmp = sbuf->x - srcx;
            if (width > tmp) width = tmp;
                tmp = sbuf->y - srcy;
            if (height > tmp) height = tmp;

            if (width <= 0) return;
            if (height <= 0) return;

              srect = sbuf->rect;
            srect += srcy * sbuf->x;
            srect += srcx;
            srcx = sbuf->x;
      } else{
            if (width <= 0) return;
            if (height <= 0) return;

            srect = drect;
            srcx = destx;
      }

      for (;height > 0; height--){
            operation(drect,srect,width, value);
            drect += destx;
            srect += srcx;
      }
}


Generated by  Doxygen 1.6.0   Back to index