37 int src_x, src_y, width, height, dst_x, dst_y;
39 int line_width = image->bytes_per_line;
44 switch ( image->bits_per_pixel )
51 char *srcline, *dstline;
52 register char *src, *dst;
57 srcline = image->data + line_width * (src_y+height-1) +
59 dstline = image->data + line_width * (dst_y+height-1) +
62 if ( src_x < dst_x ) {
64 while ( --height >= 0 ) {
65 src = srcline + width - 1;
69 duff8( counter, *dst-- = *src-- );
71 srcline -= line_width;
72 dstline -= line_width;
77 while ( --height >= 0 ) {
78 src = srcline - width + 1;
82 duff8( counter, *dst++ = *src++ );
84 srcline -= line_width;
85 dstline -= line_width;
91 srcline = image->data + line_width * src_y + src_x;
92 dstline = image->data + line_width * dst_y + dst_x;
94 if ( src_x < dst_x ) {
97 while ( --height >= 0 ) {
98 src = srcline + width - 1;
102 duff8( counter, *dst-- = *src-- );
104 srcline += line_width;
105 dstline += line_width;
109 srcline += width - 1;
110 while ( --height >= 0 ) {
111 src = srcline - width + 1;
115 duff8( counter, *dst++ = *src++ );
117 srcline += line_width;
118 dstline += line_width;
127 register long *srcline, *dstline;
128 register long *src, *dst;
132 srcline = (
long *) ((
char *)image->data +
133 line_width * (src_y+height-1) +
134 src_x *
sizeof(
long));
135 dstline = (
long *) ((
char *)image->data +
136 line_width * (dst_y+height-1) +
137 dst_x *
sizeof(
long));
139 if ( src_x < dst_x ) {
141 dstline += width - 1;
142 while ( --height >= 0 ) {
143 src = srcline + width - 1;
146 while ( src >= srcline )
149 srcline -= line_width/
sizeof(
long);
150 dstline -= line_width/
sizeof(
long);
154 srcline += width - 1;
155 while ( --height >= 0 ) {
156 src = srcline - width + 1;
159 while ( src <= srcline )
162 srcline -= line_width/
sizeof(
long);
163 dstline -= line_width/
sizeof(
long);
169 srcline = (
long *) ((
char *)image->data + line_width * src_y +
170 src_x *
sizeof(
long));
171 dstline = (
long *) ((
char *)image->data + line_width * dst_y +
172 dst_x *
sizeof(
long));
174 if ( src_x < dst_x ) {
176 dstline += width - 1;
177 while ( --height >= 0 ) {
178 src = srcline + width - 1;
181 while ( src >= srcline )
184 srcline += line_width/
sizeof(
long);
185 dstline += line_width/
sizeof(
long);
189 srcline += width - 1;
190 while ( --height >= 0 ) {
191 src = srcline - width + 1;
194 while ( src <= srcline )
197 srcline += line_width/
sizeof(
long);
198 dstline += line_width/
sizeof(
long);
int XCopyImage(XImage *image, int src_x, int src_y, int width, int height, int dst_x, int dst_y)
#define duff8(counter, block)