Lines Matching refs:bitmap

39 BIcon::SetTo(const BBitmap* bitmap, uint32 flags)
41 if (!bitmap->IsValid())
50 switch (bitmap->ColorSpace()) {
78 // trim the bitmap, if requested and the bitmap actually has alpha
82 if (bitmap->ColorSpace() == B_RGBA32) {
83 error = _TrimBitmap(bitmap,
86 BBitmap* rgb32Bitmap = _ConvertToRGB32(bitmap, true);
99 bitmap = trimmedBitmap;
105 error = _MakeBitmaps(bitmap, flags);
107 if (BBitmap* rgb32Bitmap = _ConvertToRGB32(bitmap, true)) {
121 BIcon::SetBitmap(BBitmap* bitmap, uint32 which)
129 list.ReplaceItem(which, bitmap);
138 return list.AddItem(bitmap);
154 BBitmap* bitmap = new(std::nothrow) BBitmap(bounds, colorSpace);
155 if (bitmap == NULL || !bitmap->IsValid() || !SetBitmap(bitmap, which)) {
156 delete bitmap;
160 return bitmap;
165 BIcon::SetExternalBitmap(const BBitmap* bitmap, uint32 which, uint32 flags)
168 if (bitmap != NULL) {
169 if (!bitmap->IsValid())
173 ourBitmap = const_cast<BBitmap*>(bitmap);
175 ourBitmap = _ConvertToRGB32(bitmap);
182 if (ourBitmap != bitmap)
194 BBitmap* bitmap = new(std::nothrow) BBitmap(bitmapToClone);
195 if (bitmap == NULL || !bitmap->IsValid() || !SetBitmap(bitmap, which)) {
196 delete bitmap;
200 return bitmap;
213 BIcon::UpdateIcon(const BBitmap* bitmap, uint32 flags, BIcon*& _icon)
215 if (bitmap == NULL) {
225 status_t error = icon->SetTo(bitmap, flags);
237 BIcon::SetIconBitmap(const BBitmap* bitmap, uint32 which, uint32 flags,
242 if (bitmap == NULL)
251 status_t error = _icon->SetExternalBitmap(bitmap, which, flags);
265 BIcon::_ConvertToRGB32(const BBitmap* bitmap, bool noAppServerLink)
267 BBitmap* rgb32Bitmap = new(std::nothrow) BBitmap(bitmap->Bounds(),
272 if (!rgb32Bitmap->IsValid() || rgb32Bitmap->ImportBits(bitmap)!= B_OK) {
282 BIcon::_TrimBitmap(const BBitmap* bitmap, bool keepAspect,
285 if (bitmap == NULL || !bitmap->IsValid()
286 || bitmap->ColorSpace() != B_RGBA32) {
290 uint8* bits = (uint8*)bitmap->Bits();
291 uint32 bpr = bitmap->BytesPerRow();
292 uint32 width = bitmap->Bounds().IntegerWidth() + 1;
293 uint32 height = bitmap->Bounds().IntegerHeight() + 1;
324 minInset = min_c(minInset, bitmap->Bounds().right - trimmed.right);
325 minInset = min_c(minInset, bitmap->Bounds().bottom - trimmed.bottom);
326 trimmed = bitmap->Bounds().InsetByCopy(minInset, minInset);
328 trimmed = trimmed & bitmap->Bounds();
335 bits = (uint8*)bitmap->Bits();
353 BIcon::_MakeBitmaps(const BBitmap* bitmap, uint32 flags)
355 // make our own versions of the bitmap
356 BRect b(bitmap->Bounds());
358 color_space format = bitmap->ColorSpace();
387 // copy bitmaps from file bitmap
394 uint8* fBits = (uint8*)bitmap->Bits();
396 int32 fbpr = bitmap->BytesPerRow();