projects
/
my-code
/
api.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
0e23b0f
)
bmp_cut tests
author
hackbard
<hackbard>
Tue, 19 Oct 2004 09:42:04 +0000
(09:42 +0000)
committer
hackbard
<hackbard>
Tue, 19 Oct 2004 09:42:04 +0000
(09:42 +0000)
bmp/bmp.c
patch
|
blob
|
history
diff --git
a/bmp/bmp.c
b/bmp/bmp.c
index
d42eefd
..
520b283
100644
(file)
--- a/
bmp/bmp.c
+++ b/
bmp/bmp.c
@@
-140,8
+140,6
@@
int bmp_write_file(t_bmp *bmp) {
int bmp_cut_bottom(t_bmp *dst,t_bmp *src,int dz) {
int bmp_cut_bottom(t_bmp *dst,t_bmp *src,int dz) {
- int off;
-
dst->width=src->width;
dst->height=dz;
dst->width=src->width;
dst->height=dz;
@@
-150,14
+148,18
@@
int bmp_cut_bottom(t_bmp *dst,t_bmp *src,int dz) {
return B_E_GEOMETRY;
}
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;
}
if(bmp_alloc_map(dst)!=B_SUCCESS) {
dprintf(dst->outfd,"[bmp] no map memory\n");
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));
+ /* 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;
}
return B_SUCCESS;
}