Lines Matching refs:bitmap
24 compress_bitmap_zlib(const BBitmap* bitmap, void** buffer, unsigned* size)
27 if (bitmap) {
28 Bytef* src = (Bytef*)bitmap->Bits();
29 uLong srcLength = bitmap->BitsLength();
39 //printf("zlib compressed %ld bytes bitmap into %d bytes (%f%%)\n", srcLength, *size, ((float)*size / (float)srcLength) * 100.0);
61 BBitmap* bitmap = new BBitmap(frame, 0, format);
62 if (bitmap->IsValid()) {
64 Bytef* dst = (Bytef*)bitmap->Bits();
65 uLongf dstLength = bitmap->BitsLength();
71 if (ret != Z_OK || dstLength != (uint32)bitmap->BitsLength()) {
77 memset(bitmap->Bits(), 0, bitmap->BitsLength());
80 delete bitmap;
81 bitmap = NULL;
83 return bitmap;
90 archive_bitmap(const BBitmap* bitmap, BMessage* into, const char* fieldName)
93 if (bitmap && bitmap->IsValid() && into) {
96 if (compress_bitmap_zlib(bitmap, &buffer, &size)) {
101 ret = into->AddRect("construction bounds", bitmap->Bounds());
103 ret = into->AddInt32("format", bitmap->ColorSpace());
112 extract_bitmap(BBitmap** bitmap, const BMessage* from, const char* fieldName)
115 if (bitmap && from) {
116 *bitmap = NULL;
120 *bitmap = new BBitmap(&bitmapArchive);
123 if (!*bitmap) {
150 *bitmap = decompress_bitmap_zlib(compressedData,
157 if (*bitmap)
158 ret = (*bitmap)->InitCheck();
162 delete *bitmap;
163 *bitmap = NULL;