2006-08-27 09:42:42 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/dfb/bitmap.h
|
|
|
|
// Purpose: wxBitmap class
|
|
|
|
// Author: Vaclav Slavik
|
|
|
|
// Created: 2006-08-04
|
|
|
|
// Copyright: (c) 2006 REA Elektronik GmbH
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_DFB_BITMAP_H_
|
|
|
|
#define _WX_DFB_BITMAP_H_
|
|
|
|
|
2006-09-06 09:40:31 +00:00
|
|
|
#include "wx/dfb/dfbptr.h"
|
2006-08-27 09:42:42 +00:00
|
|
|
|
2007-07-10 16:49:19 +00:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxPixelDataBase;
|
|
|
|
|
2006-08-27 09:42:42 +00:00
|
|
|
wxDFB_DECLARE_INTERFACE(IDirectFBSurface);
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxBitmap
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2007-12-15 17:54:20 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxBitmap : public wxBitmapBase
|
2006-08-27 09:42:42 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxBitmap() {}
|
2006-09-14 14:36:12 +00:00
|
|
|
wxBitmap(const wxIDirectFBSurfacePtr& surface) { Create(surface); }
|
2009-03-14 13:57:51 +00:00
|
|
|
wxBitmap(int width, int height, int depth = -1) { Create(width, height, depth); }
|
|
|
|
wxBitmap(const wxSize& sz, int depth = -1) { Create(sz, depth); }
|
2006-08-27 09:42:42 +00:00
|
|
|
wxBitmap(const char bits[], int width, int height, int depth = 1);
|
2008-09-21 20:03:14 +00:00
|
|
|
wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_DEFAULT_TYPE);
|
2006-10-08 08:04:49 +00:00
|
|
|
wxBitmap(const char* const* bits);
|
2006-08-27 09:42:42 +00:00
|
|
|
#if wxUSE_IMAGE
|
2015-11-15 12:49:25 +00:00
|
|
|
wxBitmap(const wxImage& image, int depth = -1, double WXUNUSED(scale) = 1.0);
|
2006-08-27 09:42:42 +00:00
|
|
|
#endif
|
|
|
|
|
2006-09-14 14:36:12 +00:00
|
|
|
bool Create(const wxIDirectFBSurfacePtr& surface);
|
2009-03-14 13:57:51 +00:00
|
|
|
bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH);
|
|
|
|
bool Create(const wxSize& sz, int depth = wxBITMAP_SCREEN_DEPTH)
|
|
|
|
{ return Create(sz.GetWidth(), sz.GetHeight(), depth); }
|
2013-06-25 17:15:10 +00:00
|
|
|
bool Create(int width, int height, const wxDC& WXUNUSED(dc))
|
|
|
|
{ return Create(width,height); }
|
2006-08-27 09:42:42 +00:00
|
|
|
|
|
|
|
virtual int GetHeight() const;
|
|
|
|
virtual int GetWidth() const;
|
|
|
|
virtual int GetDepth() const;
|
|
|
|
|
|
|
|
#if wxUSE_IMAGE
|
|
|
|
virtual wxImage ConvertToImage() const;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
virtual wxMask *GetMask() const;
|
|
|
|
virtual void SetMask(wxMask *mask);
|
|
|
|
|
|
|
|
virtual wxBitmap GetSubBitmap(const wxRect& rect) const;
|
|
|
|
|
2008-03-25 20:31:48 +00:00
|
|
|
virtual bool SaveFile(const wxString &name, wxBitmapType type,
|
2009-01-19 13:55:27 +00:00
|
|
|
const wxPalette *palette = NULL) const;
|
2008-09-21 20:03:14 +00:00
|
|
|
virtual bool LoadFile(const wxString &name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE);
|
2006-08-27 09:42:42 +00:00
|
|
|
|
|
|
|
#if wxUSE_PALETTE
|
|
|
|
virtual wxPalette *GetPalette() const;
|
|
|
|
virtual void SetPalette(const wxPalette& palette);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// copies the contents and mask of the given (colour) icon to the bitmap
|
|
|
|
virtual bool CopyFromIcon(const wxIcon& icon);
|
|
|
|
|
|
|
|
static void InitStandardHandlers();
|
|
|
|
|
2007-07-10 16:49:19 +00:00
|
|
|
// raw bitmap access support functions
|
|
|
|
void *GetRawData(wxPixelDataBase& data, int bpp);
|
|
|
|
void UngetRawData(wxPixelDataBase& data);
|
|
|
|
|
|
|
|
bool HasAlpha() const;
|
|
|
|
|
2006-08-27 09:42:42 +00:00
|
|
|
// implementation:
|
2018-09-24 03:02:21 +00:00
|
|
|
#if WXWIN_COMPATIBILITY_3_0
|
|
|
|
wxDEPRECATED(virtual void SetHeight(int height));
|
|
|
|
wxDEPRECATED(virtual void SetWidth(int width));
|
|
|
|
wxDEPRECATED(virtual void SetDepth(int depth));
|
|
|
|
#endif
|
2006-08-27 09:42:42 +00:00
|
|
|
|
|
|
|
// get underlying native representation:
|
2006-09-06 09:40:31 +00:00
|
|
|
wxIDirectFBSurfacePtr GetDirectFBSurface() const;
|
2006-08-27 09:42:42 +00:00
|
|
|
|
|
|
|
protected:
|
2007-12-15 17:54:20 +00:00
|
|
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
|
|
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
2006-08-27 09:42:42 +00:00
|
|
|
|
2007-07-06 22:24:28 +00:00
|
|
|
bool CreateWithFormat(int width, int height, int dfbFormat);
|
|
|
|
|
2015-04-23 11:49:01 +00:00
|
|
|
wxDECLARE_DYNAMIC_CLASS(wxBitmap);
|
2006-08-27 09:42:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _WX_DFB_BITMAP_H_
|