rem: ofs = x*(HAS_ALPHA(image) ? 4 : 3);
add: ofs = x*(HAS_ALPHA(image) ? 4 : 3) + y*total_line_size;;
context: RGetSubImage(RImage *image, int x, int y, unsigned width, unsigned height){    int i, ofs;    RImage *new_image;    unsigned total_line_size, line_size;        assert(image!=NULL);    assert(x>=0 && y>=0);    assert(x<image->width && y<image->height);    assert(width>0 && height>0);        if (x+width > image->width)	width = image->width-x;    if (y+height > image->height)	height = image->height-y;    new_image = RCreateImage(width, height, HAS_ALPHA(image));    if (!new_image)	return NULL;    new_image->background = image->background;    total_line_size = image->width * (HAS_ALPHA(image) ? 4 : 3);    line_size = width * (HAS_ALPHA(image) ? 4 : 3);    ofs = x*(HAS_ALPHA(image) ? 4 : 3);    for (i=0; i<height; i++) {	memcpy(&new_image->data[i*line_size], 	       &image->data[i*total_line_size+ofs], line_size);    }    return new_image;}