3 #include "ServerBitmap.h"
5 #include "BitmapBuffer.h"
7 // TODO: It should be more or less guaranteed that this object
8 // is not used if InitCheck() returns an error, so the checks
9 // in all thos functions should probably be removed...
12 BitmapBuffer::BitmapBuffer(ServerBitmap
* bitmap
)
18 BitmapBuffer::~BitmapBuffer()
20 // We don't own the ServerBitmap
25 BitmapBuffer::InitCheck() const
27 status_t ret
= B_NO_INIT
;
29 ret
= fBitmap
->IsValid() ? B_OK
: B_ERROR
;
35 BitmapBuffer::ColorSpace() const
37 if (InitCheck() >= B_OK
)
38 return fBitmap
->ColorSpace();
39 return B_NO_COLOR_SPACE
;
44 BitmapBuffer::Bits() const
46 if (InitCheck() >= B_OK
)
47 return fBitmap
->Bits();
53 BitmapBuffer::BytesPerRow() const
55 if (InitCheck() >= B_OK
)
56 return fBitmap
->BytesPerRow();
62 BitmapBuffer::Width() const
64 if (InitCheck() >= B_OK
)
65 return fBitmap
->Width();
71 BitmapBuffer::Height() const
73 if (InitCheck() >= B_OK
)
74 return fBitmap
->Height();