moved BitmapBuffer, because it comes in handy in app_server
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12040 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,73 +0,0 @@
|
|||||||
// BitmapBuffer.h
|
|
||||||
|
|
||||||
#include <Bitmap.h>
|
|
||||||
|
|
||||||
#include "BitmapBuffer.h"
|
|
||||||
|
|
||||||
// constructor
|
|
||||||
BitmapBuffer::BitmapBuffer(BBitmap* bitmap)
|
|
||||||
: fBitmap(bitmap)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
// destructor
|
|
||||||
BitmapBuffer::~BitmapBuffer()
|
|
||||||
{
|
|
||||||
delete fBitmap;
|
|
||||||
}
|
|
||||||
|
|
||||||
// InitCheck
|
|
||||||
status_t
|
|
||||||
BitmapBuffer::InitCheck() const
|
|
||||||
{
|
|
||||||
status_t ret = B_NO_INIT;
|
|
||||||
if (fBitmap)
|
|
||||||
ret = fBitmap->InitCheck();
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ColorSpace
|
|
||||||
color_space
|
|
||||||
BitmapBuffer::ColorSpace() const
|
|
||||||
{
|
|
||||||
if (InitCheck() >= B_OK)
|
|
||||||
return fBitmap->ColorSpace();
|
|
||||||
return B_NO_COLOR_SPACE;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Bits
|
|
||||||
void*
|
|
||||||
BitmapBuffer::Bits() const
|
|
||||||
{
|
|
||||||
if (InitCheck() >= B_OK)
|
|
||||||
return fBitmap->Bits();
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
// BytesPerRow
|
|
||||||
uint32
|
|
||||||
BitmapBuffer::BytesPerRow() const
|
|
||||||
{
|
|
||||||
if (InitCheck() >= B_OK)
|
|
||||||
return fBitmap->BytesPerRow();
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Width
|
|
||||||
uint32
|
|
||||||
BitmapBuffer::Width() const
|
|
||||||
{
|
|
||||||
if (InitCheck() >= B_OK)
|
|
||||||
return fBitmap->Bounds().IntegerWidth() + 1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Height
|
|
||||||
uint32
|
|
||||||
BitmapBuffer::Height() const
|
|
||||||
{
|
|
||||||
if (InitCheck() >= B_OK)
|
|
||||||
return fBitmap->Bounds().IntegerHeight() + 1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
// BitmapBuffer.h
|
|
||||||
|
|
||||||
#ifndef BITMAP_BUFFER_H
|
|
||||||
#define BITMAP_BUFFER_H
|
|
||||||
|
|
||||||
#include "RenderingBuffer.h"
|
|
||||||
|
|
||||||
class BBitmap;
|
|
||||||
|
|
||||||
class BitmapBuffer : public RenderingBuffer {
|
|
||||||
public:
|
|
||||||
BitmapBuffer(BBitmap* bitmap);
|
|
||||||
virtual ~BitmapBuffer();
|
|
||||||
|
|
||||||
virtual status_t InitCheck() const;
|
|
||||||
|
|
||||||
virtual color_space ColorSpace() const;
|
|
||||||
virtual void* Bits() const;
|
|
||||||
virtual uint32 BytesPerRow() const;
|
|
||||||
virtual uint32 Width() const;
|
|
||||||
virtual uint32 Height() const;
|
|
||||||
|
|
||||||
// BitmapBuffer
|
|
||||||
const BBitmap* Bitmap() const
|
|
||||||
{ return fBitmap; }
|
|
||||||
private:
|
|
||||||
|
|
||||||
BBitmap* fBitmap;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // BITMAP_BUFFER_H
|
|
||||||
Reference in New Issue
Block a user