+int bmp_cut_bottom(t_bmp *dst,t_bmp *src,int dz) {
+
+ dst->width=src->width;
+ dst->height=dz;
+
+ if(dz>src->height) {
+ dprintf(src->outfd,"[bmp] cut region greater than image height\n");
+ return B_E_GEOMETRY;
+ }
+
+ /* obsolete - we point to wanted memory instead
+ if(bmp_alloc_map(dst)!=B_SUCCESS) {
+ dprintf(dst->outfd,"[bmp] no map memory\n");
+ return B_E_MEM;
+ }
+ */
+
+ /* obsolete - we point to wanted memory instead
+ memcpy(dst->map,src->map+(src->height-dz)*src->width,
+ dz*src->width*sizeof(t_pixel));
+ */
+ dst->map=src->map+(src->height-dz)*src->width;
+
+ return B_SUCCESS;
+}
+