openATV enigma2
openATV is an open source SetTopBox Graphical user interface.
fblcd.h
Go to the documentation of this file.
1 #ifndef __LCDFB_H
2 #define __LCDFB_H
3 
4 #include <lib/base/eerror.h>
5 #include <linux/fb.h>
6 #include <lib/gdi/lcd.h>
7 #include "gpixmap.h"
8 
9 #ifndef FBIO_WAITFORVSYNC
10 #define FBIO_WAITFORVSYNC _IOW('F', 0x20, uint32_t)
11 #endif
12 
13 #ifndef LCD_DEV
14 # define LCD_DEV "/dev/fb1"
15 #endif
16 
17 class eFbLCD: public eLCD
18 {
19  int m_xRes, m_yRes, m_bpp;
20  int m_brightness, m_gamma, m_alpha;
21  int m_available;
22  struct fb_var_screeninfo m_screeninfo;
23  fb_cmap m_cmap;
24  unsigned char m_ramp[256], m_rampalpha[256]; // RGB ramp 0..255
25  uint16_t m_red[256], m_green[256], m_blue[256], m_trans[256];
26  int m_phys_mem;
27  int m_manual_blit;
28 
29  void calcRamp();
30  int setMode(int xRes, int yRes, int bpp);
31  void getMode();
32  void enableManualBlit();
33  void disableManualBlit();
34  // low level gfx stuff
35  int putCMAP();
36  void save2png(unsigned char* output, int xRes, int yRes);
37  void save2bmp(unsigned char* output, int xRes, int yRes);
38 public:
39  eFbLCD(const char *fb=LCD_DEV);
40  ~eFbLCD();
41  bool detected() { return m_available; }
42  eSize size() { return eSize(m_xRes, m_yRes); }
44  int waitVSync();
45  int setLCDContrast(int contrast) { return 0; };
46  int setLCDBrightness(int brightness);
47  int setLED(int value, int option) { return 0; };
48  void setInverted( unsigned char ) {};
49  void setFlipped(bool) {};
50  bool isOled() const { return 0; };
51  void update(); // blit
52  int lock();
53  void unlock();
54  int islocked() { return locked; }
55  void setDump(bool);
56  void dumpLCD(bool);
57 };
58 
59 #endif
Definition: fblcd.h:18
eSize size()
Definition: fblcd.h:42
void update()
Definition: fblcd.cpp:183
int setLCDContrast(int contrast)
Definition: fblcd.h:45
void setFlipped(bool)
Definition: fblcd.h:49
int waitVSync()
Definition: fblcd.cpp:177
eFbLCD(const char *fb=LCD_DEV)
Definition: fblcd.cpp:19
bool detected()
Definition: fblcd.h:41
bool isOled() const
Definition: fblcd.h:50
int lock()
Definition: fblcd.cpp:197
void dumpLCD(bool)
Definition: fblcd.cpp:288
~eFbLCD()
Definition: fblcd.cpp:83
int islocked()
Definition: fblcd.h:54
void setDump(bool)
Definition: fblcd.cpp:383
void unlock()
Definition: fblcd.cpp:211
int setLCDBrightness(int brightness)
Definition: fblcd.cpp:275
void setInverted(unsigned char)
Definition: fblcd.h:48
int setLED(int value, int option)
Definition: fblcd.h:47
void setPalette(gUnmanagedSurface)
Definition: fblcd.cpp:242
Definition: lcd.h:22
int locked
Definition: lcd.h:33
Definition: esize.h:8
#define LCD_DEV
Definition: fblcd.h:14
value
Definition: Profile.py:29
Definition: gpixmap.h:163