예제 #1
0
파일: image.c 프로젝트: bierdaci/egui
static void image16_copy_from_pixbuf(GalImage *image,
		eint dx, eint dy, 
		GalPixbuf *pixbuf,
		eint sx, eint sy,
		eint w, eint h)
{
    eint x, y;
    euint16 *p;

	if (image->negative) {
		p = (euint16 *)(image->pixels + image->rowbytes * (dy + h - 1) + dx * image->pixelbytes);
		for (y = 0; y < h; y++) {
			for (x = 0; x < w; x++)
				p[x] = pixbuf_read_pixel16(pixbuf, x + sx, y + sy);
			p -= image->w;
		}
	}
	else {
		p = (euint16 *)(image->pixels + image->rowbytes * dy + dx * image->pixelbytes);
		for (y = 0; y < h; y++) {
			for (x = 0; x < w; x++)
				p[x] = pixbuf_read_pixel16(pixbuf, x + sx, y + sy);
			p += image->w;
		}
	}
}
예제 #2
0
파일: image.c 프로젝트: guygal/egui
static void image16_copy_from_pixbuf(GalImage *image,
		eint dx, eint dy, 
		GalPixbuf *pixbuf,
		eint sx, eint sy,
		eint w, eint h)
{
    eint x, y;
    euint16 *dst_buf = (euint16 *)(image->pixels + image->rowbytes * dy + dx * image->pixelbytes);

    for (y = 0; y < h; y++) {
        for (x = 0; x < w; x++)
            dst_buf[x] = pixbuf_read_pixel16(pixbuf, x + sx, y + sy);
        dst_buf += image->w;
    }
}