* Fixed a swapping bug for 16 bit colorspaces

* Added some comments
* Added some checking to avoid noop shifts
* Added buffer length checks
* Implemented (as Stephan suggested) a version of ConvertBits() that takes offsets.
This new version allows to move a region of the source into a region (possibly not at the same point) on the dest while converting colorspaces on the fly.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16592 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz
2006-03-05 23:53:33 +00:00
parent 8413da2383
commit bdc6f9e7ef
4 changed files with 258 additions and 136 deletions
+3 -2
View File
@@ -519,8 +519,9 @@ BBitmap::ImportBits(const void *data, int32 length, int32 bpr, int32 offset,
if (bpr < 0)
bpr = get_bytes_per_row(colorSpace, width);
return BPrivate::ConvertBits(data, fBasePtr, bpr, fBytesPerRow,
colorSpace, fColorSpace, width, fBounds.IntegerHeight() + 1);
return BPrivate::ConvertBits(data, fBasePtr, length, fSize, bpr,
fBytesPerRow, colorSpace, fColorSpace, width,
fBounds.IntegerHeight() + 1);
}
// ImportBits