summaryrefslogtreecommitdiffstats
path: root/lib/libvgl/bitmap.c
diff options
context:
space:
mode:
authornsouch <nsouch@FreeBSD.org>2001-01-13 11:30:17 +0000
committernsouch <nsouch@FreeBSD.org>2001-01-13 11:30:17 +0000
commita5fd80c2f50ce9eac5e6ae428320a9f4cf65238a (patch)
tree1de7b3a3598deed6d5ca5a6b8e6ec5885985355e /lib/libvgl/bitmap.c
parent759414f218cbac7e3bb7e789f8f86f917cd37003 (diff)
downloadFreeBSD-src-a5fd80c2f50ce9eac5e6ae428320a9f4cf65238a.zip
FreeBSD-src-a5fd80c2f50ce9eac5e6ae428320a9f4cf65238a.tar.gz
Add Truecolor 16 and 32bits support. Note that 24bits modes are not
supported since it's not easy to put 3 bytes accross 64Kb windows of memory. This should not be such a problem with linear framebuffers. There is no major interface modification except that the color type becomes u_long instead of byte. So one just need to recompile his application. Approved by: Soren Schmidt <sos@freebsd.dk>
Diffstat (limited to 'lib/libvgl/bitmap.c')
-rw-r--r--lib/libvgl/bitmap.c41
1 files changed, 40 insertions, 1 deletions
diff --git a/lib/libvgl/bitmap.c b/lib/libvgl/bitmap.c
index 177d171..6498e26 100644
--- a/lib/libvgl/bitmap.c
+++ b/lib/libvgl/bitmap.c
@@ -143,12 +143,31 @@ WriteVerticalLine(VGLBitmap *dst, int x, int y, int width, byte *line)
width -= i;
}
break;
+ case VIDBUF16S:
+ case VIDBUF24S:
+ case VIDBUF32S:
+ width = width * dst->PixelBytes;
+ pos = (dst->VXsize * y + x) * dst->PixelBytes;
+ while (width > 0) {
+ offset = VGLSetSegment(pos);
+ i = min(VGLAdpInfo.va_window_size - offset, width);
+ bcopy(line, dst->Bitmap + offset, i);
+ line += i;
+ pos += i;
+ width -= i;
+ }
+ break;
case VIDBUF8:
case MEMBUF:
address = dst->Bitmap + dst->VXsize * y + x;
bcopy(line, address, width);
break;
-
+ case VIDBUF16:
+ case VIDBUF24:
+ case VIDBUF32:
+ address = dst->Bitmap + (dst->VXsize * y + x) * dst->PixelBytes;
+ bcopy(line, address, width * dst->PixelBytes);
+ break;
default:
}
}
@@ -238,11 +257,31 @@ read_planar:
width -= i;
}
break;
+ case VIDBUF16S:
+ case VIDBUF24S:
+ case VIDBUF32S:
+ width = width * src->PixelBytes;
+ pos = (src->VXsize * y + x) * src->PixelBytes;
+ while (width > 0) {
+ offset = VGLSetSegment(pos);
+ i = min(VGLAdpInfo.va_window_size - offset, width);
+ bcopy(src->Bitmap + offset, line, i);
+ line += i;
+ pos += i;
+ width -= i;
+ }
+ break;
case VIDBUF8:
case MEMBUF:
address = src->Bitmap + src->VXsize * y + x;
bcopy(address, line, width);
break;
+ case VIDBUF16:
+ case VIDBUF24:
+ case VIDBUF32:
+ address = src->Bitmap + (src->VXsize * y + x) * src->PixelBytes;
+ bcopy(address, line, width * src->PixelBytes);
+ break;
default:
}
}
OpenPOWER on IntegriCloud