return B_SUCCESS;
}
-int bmp_cut_bottom(t_bmp *dst,t_bmp *src,int dz) {
+int bmp_cut_grab_bottom(t_bmp *dst,t_bmp *src,int dz,unsigned char m) {
int off;
return B_E_MEM;
}
- off=(src->height-dz-1)*src->width;
- printf("debug: off = %d height = %d dz = %d\n",off,src->height,dz);
- memcpy(dst->map,&(src->map[off]),dz*src->width*sizeof(t_pixel));
+ off=(m==GRAB)?0:(src->height-dz)*src->width;
+ memcpy(dst->map,src->map+off,dz*src->width*sizeof(t_pixel));
return B_SUCCESS;
}