2006-08-27 05:42:42 -04: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 05:40:31 -04:00
|
|
|
#include "wx/dfb/dfbptr.h"
|
2006-08-27 05:42:42 -04:00
|
|
|
|
2007-07-10 12:49:19 -04:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxPixelDataBase;
|
|
|
|
|
2006-08-27 05:42:42 -04:00
|
|
|
wxDFB_DECLARE_INTERFACE(IDirectFBSurface);
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxBitmap
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2007-12-15 12:54:20 -05:00
|
|
|
class WXDLLIMPEXP_CORE wxBitmap : public wxBitmapBase
|
2006-08-27 05:42:42 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxBitmap() {}
|
2006-09-14 10:36:12 -04:00
|
|
|
wxBitmap(const wxIDirectFBSurfacePtr& surface) { Create(surface); }
|
2009-03-14 09:57:51 -04: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 05:42:42 -04:00
|
|
|
wxBitmap(const char bits[], int width, int height, int depth = 1);
|
2008-09-21 16:03:14 -04:00
|
|
|
wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_DEFAULT_TYPE);
|
2006-10-08 04:04:49 -04:00
|
|
|
wxBitmap(const char* const* bits);
|
2006-08-27 05:42:42 -04:00
|
|
|
#if wxUSE_IMAGE
|
2015-11-15 07:49:25 -05:00
|
|
|
wxBitmap(const wxImage& image, int depth = -1, double WXUNUSED(scale) = 1.0);
|
2006-08-27 05:42:42 -04:00
|
|
|
#endif
|
|
|
|
|
2006-09-14 10:36:12 -04:00
|
|
|
bool Create(const wxIDirectFBSurfacePtr& surface);
|
2009-03-14 09:57:51 -04: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 13:15:10 -04:00
|
|
|
bool Create(int width, int height, const wxDC& WXUNUSED(dc))
|
|
|
|
{ return Create(width,height); }
|
2006-08-27 05:42:42 -04: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 16:31:48 -04:00
|
|
|
virtual bool SaveFile(const wxString &name, wxBitmapType type,
|
2009-01-19 08:55:27 -05:00
|
|
|
const wxPalette *palette = NULL) const;
|
2008-09-21 16:03:14 -04:00
|
|
|
virtual bool LoadFile(const wxString &name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE);
|
2006-08-27 05:42:42 -04: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 12:49:19 -04:00
|
|
|
// raw bitmap access support functions
|
|
|
|
void *GetRawData(wxPixelDataBase& data, int bpp);
|
|
|
|
void UngetRawData(wxPixelDataBase& data);
|
|
|
|
|
|
|
|
bool HasAlpha() const;
|
|
|
|
|
2006-08-27 05:42:42 -04:00
|
|
|
// implementation:
|
2018-09-23 23:02:21 -04: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 05:42:42 -04:00
|
|
|
|
|
|
|
// get underlying native representation:
|
2006-09-06 05:40:31 -04:00
|
|
|
wxIDirectFBSurfacePtr GetDirectFBSurface() const;
|
2006-08-27 05:42:42 -04:00
|
|
|
|
|
|
|
protected:
|
2007-12-15 12:54:20 -05:00
|
|
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
|
|
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
2006-08-27 05:42:42 -04:00
|
|
|
|
2007-07-06 18:24:28 -04:00
|
|
|
bool CreateWithFormat(int width, int height, int dfbFormat);
|
|
|
|
|
2015-04-23 07:49:01 -04:00
|
|
|
wxDECLARE_DYNAMIC_CLASS(wxBitmap);
|
2006-08-27 05:42:42 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _WX_DFB_BITMAP_H_
|