void picture_rep::internal_copy_to (int x, int y, picture dest, int x1, int y1, int x2, int y2) { for (int yy= y1; yy < y2; yy++) for (int xx= x1; xx < x2; xx++) dest->internal_set_pixel (x + xx, y + yy, internal_get_pixel (xx, yy)); }
color picture_rep::internal_smooth_pixel (double x, double y) { x -= 0.5; y -= 0.5; int x1= (int) floor (x); int y1= (int) floor (y); int x2= x1 + 1; int y2= y1 + 1; double ix1= x2 - x; double ix2= x - x1; double iy1= y2 - y; double iy2= y - y1; color cx1y1= internal_get_pixel (x1, y1); color cx1y2= internal_get_pixel (x1, y2); color cx2y1= internal_get_pixel (x2, y1); color cx2y2= internal_get_pixel (x2, y2); return mix (cx1y1, ix1*iy1, cx1y2, ix1*iy2, cx2y1, ix2*iy1, cx2y2, ix2*iy2); }
inline color get_pixel (int x, int y) { return internal_get_pixel (x + get_origin_x (), y + get_origin_y ()); }