31 #ifndef _OCPN_PIXEL_H_
32 #define _OCPN_PIXEL_H_
36 wxImage Image_Rotate(wxImage &base_image,
double angle,
37 const wxPoint ¢re_of_rotation,
bool interpolating,
38 wxPoint *offset_after_rotation);
56 #define __PIX_CACHE_WXIMAGE__
61 #define __PIX_CACHE_WXIMAGE__
67 #define __PIX_CACHE_WXIMAGE__
74 #define __PIX_CACHE_WXIMAGE__
78 #define __PIX_CACHE_WXIMAGE__
87 #ifdef __PIX_CACHE_X11IMAGE__
88 #define ocpnUSE_ocpnBitmap
91 #ifdef __PIX_CACHE_PIXBUF__
92 #define ocpnUSE_ocpnBitmap
93 #define opcnUSE_GTK_OPTIMIZE
98 #ifdef __PIX_CACHE_X11IMAGE__
104 #ifdef __PIX_CACHE_WXIMAGE__
107 #ifdef __PIX_CACHE_DIBSECTION__
110 #ifdef __PIX_CACHE_X11IMAGE__
113 #ifdef __PIX_CACHE_PIXBUF__
123 #ifdef __PIX_CACHE_X11IMAGE__
124 #include <wx/x11/private.h>
129 #include <X11/extensions/XShm.h>
133 #include <wx/msw/dib.h>
140 typedef enum RGBO { RGB = 0, BGR } _RGBO;
144 #ifdef __PIX_CACHE_X11IMAGE__
150 ocpnXImage(
int width,
int height);
152 bool PutImage(Pixmap pixmap, GC gc);
155 XShmSegmentInfo shminfo;
161 int m_width, m_height;
175 void SelectIntoDC(wxMemoryDC &dc);
177 RGBO GetRGBO() {
return m_rgbo; }
178 unsigned char *GetpData()
const;
179 int GetLinePitch()
const {
return line_pitch_bytes; }
180 int GetWidth(
void) {
return m_width; }
181 int GetHeight(
void) {
return m_height; }
182 size_t GetLength(
void);
189 int line_pitch_bytes;
192 unsigned char *pData;
194 #ifdef ocpnUSE_ocpnBitmap
202 #ifdef __PIX_CACHE_DIBSECTION__
206 #ifdef __PIX_CACHE_X11IMAGE__
209 ocpnXImage *m_pocpnXI;
214 XShmSegmentInfo *pshminfo;
217 #ifdef __PIX_CACHE_PIXBUF__
218 unsigned char *m_pdata;
223 #ifdef ocpnUSE_ocpnBitmap
231 #include <wx/msw/gdiimage.h>
232 #include <wx/msw/dib.h>
236 #include <wx/x11/private.h>
239 class WXDLLEXPORT wxDC;
240 class WXDLLEXPORT wxControl;
241 class WXDLLEXPORT wxBitmap;
242 class WXDLLEXPORT wxBitmapHandler;
243 class WXDLLEXPORT wxIcon;
244 class WXDLLEXPORT wxMask;
245 class WXDLLEXPORT wxCursor;
246 class WXDLLEXPORT wxControl;
247 class WXDLLEXPORT wxImage;
248 class WXDLLEXPORT wxPalette;
254 class ocpnBitmap :
public wxBitmap {
261 ocpnBitmap(
unsigned char *pPix,
int width,
int height,
int depth) {
262 (void)CreateFromData(pPix, width, height, depth);
267 ocpnBitmap(
const wxImage &image,
int depth) { CreateFromImage(image, depth); }
271 ocpnBitmap(ocpnXImage *ocpn_Ximage,
int width,
int height,
int depth) {
272 CreateFromocpnXImage(ocpn_Ximage, width, height, depth);
280 bool CreateFromData(
void *pPix,
int width,
int height,
int depth);
283 bool CreateFromImage(
const wxImage &image,
int depth);
287 bool CreateFromocpnXImage(ocpnXImage *poXI,
int width,
int height,
int depth);
291 DECLARE_DYNAMIC_CLASS(ocpnBitmap)
308 void SelectObject(wxBitmap &bitmap) { wxMemoryDC::SelectObject(bitmap); }
311 #ifdef ocpnUSE_DIBSECTION
312 void SelectObject(wxDIB &dib);
317 #ifdef ocpnUSE_DIBSECTION
318 wxDIB *m_pselectedDIB;