Change-Id: Ia2b7a719fd398e78cc3b11d4f7b02cb81179f65f Reviewed-on: https://review.haiku-os.org/c/haiku/+/3488 Reviewed-by: Jérôme Duval <[email protected]>
73 lines
1022 B
C++
73 lines
1022 B
C++
// BBitmapBuffer.h
|
|
|
|
#include <Bitmap.h>
|
|
|
|
#include "BBitmapBuffer.h"
|
|
|
|
// constructor
|
|
BBitmapBuffer::BBitmapBuffer(BBitmap* bitmap)
|
|
: fBitmap(bitmap)
|
|
{
|
|
}
|
|
|
|
// destructor
|
|
BBitmapBuffer::~BBitmapBuffer()
|
|
{
|
|
}
|
|
|
|
// InitCheck
|
|
status_t
|
|
BBitmapBuffer::InitCheck() const
|
|
{
|
|
status_t ret = B_NO_INIT;
|
|
if (fBitmap.IsSet())
|
|
ret = fBitmap->InitCheck();
|
|
return ret;
|
|
}
|
|
|
|
// ColorSpace
|
|
color_space
|
|
BBitmapBuffer::ColorSpace() const
|
|
{
|
|
if (InitCheck() >= B_OK)
|
|
return fBitmap->ColorSpace();
|
|
return B_NO_COLOR_SPACE;
|
|
}
|
|
|
|
// Bits
|
|
void*
|
|
BBitmapBuffer::Bits() const
|
|
{
|
|
if (InitCheck() >= B_OK)
|
|
return fBitmap->Bits();
|
|
return NULL;
|
|
}
|
|
|
|
// BytesPerRow
|
|
uint32
|
|
BBitmapBuffer::BytesPerRow() const
|
|
{
|
|
if (InitCheck() >= B_OK)
|
|
return fBitmap->BytesPerRow();
|
|
return 0;
|
|
}
|
|
|
|
// Width
|
|
uint32
|
|
BBitmapBuffer::Width() const
|
|
{
|
|
if (InitCheck() >= B_OK)
|
|
return fBitmap->Bounds().IntegerWidth() + 1;
|
|
return 0;
|
|
}
|
|
|
|
// Height
|
|
uint32
|
|
BBitmapBuffer::Height() const
|
|
{
|
|
if (InitCheck() >= B_OK)
|
|
return fBitmap->Bounds().IntegerHeight() + 1;
|
|
return 0;
|
|
}
|
|
|