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",
67 BBitmap* bitmap = new BBitmap(frame, 0, format);
68 if (bitmap->IsValid()) {
70 Bytef* dst = (Bytef*)bitmap->Bits();
71 uLongf dstLength = bitmap->BitsLength();
77 if (ret != Z_OK || dstLength != (uint32)bitmap->BitsLength()) {
83 memset(bitmap->Bits(), 0, bitmap->BitsLength());
86 delete bitmap;
87 bitmap = NULL;
89 return bitmap;
96 archive_bitmap(const BBitmap* bitmap, BMessage* into, const char* fieldName)
99 if (bitmap && bitmap->IsValid() && into) {
102 if (compress_bitmap_zlib(bitmap, &buffer, &size)) {
107 ret = into->AddRect("construction bounds", bitmap->Bounds());
109 ret = into->AddInt32("format", bitmap->ColorSpace());
118 extract_bitmap(BBitmap** bitmap, const BMessage* from, const char* fieldName)
121 if (bitmap && from) {
122 *bitmap = NULL;
126 *bitmap = new BBitmap(&bitmapArchive);
129 if (!*bitmap) {
156 *bitmap = decompress_bitmap_zlib(compressedData,
163 if (*bitmap)
164 ret = (*bitmap)->InitCheck();
168 delete *bitmap;
169 *bitmap = NULL;