Guiliani  Version 2.6 revision 7293 (documentation build 12)
GfxWrapBLU.h
1/*
2* Copyright (C) TES Electronic Solutions GmbH,
3* All Rights Reserved.
4* Contact: info@guiliani.de
5*
6* This file is part of the Guiliani HMI framework
7* for the development of graphical user interfaces on embedded systems.
8*/
9
10#ifndef CGFXWRAPBLU_H
11#define CGFXWRAPBLU_H
12
13#include "GfxWrap.h"
14#include "GUIImageData.h"
15
16#include "blu.h"
17
20{
21public:
25 m_uiRGBSize(0),
26 m_uiAlphaSize(0)
27 {}
28
29 virtual ~CGUIImageDataBLU() {}
30
34 void SetRGBSize(const eC_UInt& uiRGBSize) { m_uiRGBSize = uiRGBSize; }
35
39 eC_UInt GetRGBSize() const { return m_uiRGBSize; }
40
44 void SetAlphaSize(const eC_UInt& uiAlphaSize) { m_uiAlphaSize = uiAlphaSize; }
45
49 eC_UInt GetAlphaSize() const { return m_uiAlphaSize; }
50
54 void SetBytePerPixel(const eC_UByte& ubBPP) { m_ubBPP = ubBPP; }
55
59 eC_UByte GetBytePerPixel() const { return m_ubBPP; }
60
61private:
62 eC_UInt m_uiRGBSize;
63 eC_UInt m_uiAlphaSize;
64 eC_UByte m_ubBPP;
65};
66
70class CGfxWrapBLU : public CGfxWrap
71{
72public:
74 typedef void* (SetFrameBuffer(void*, unsigned long, unsigned long));
75
76public:
83 static eC_Bool CreateInstance(CGfxEnv* pkGfxEnv = NULL);
84
86 void Init();
87
95 void Init(
96 const eC_UInt &uiWidth,
97 const eC_UInt &uiHeight,
98 const eC_UByte &ubBitPerPixel,
99 const eC_UInt uiNumberOfBuffers,
100 void** pkFrameBuffers);
101
102 virtual eC_Bool Refresh(const RefreshCall_t eRefreshCallType);
103
104 virtual void SetCliprect(const CGUIRect &NewClipRect);
105
106 virtual eC_Value SetLineWidth(const eC_Value& vWidth);
107
108 virtual void Line(
109 const eC_Value& vAbsX1, const eC_Value& vAbsY1,
110 const eC_Value& vAbsX2, const eC_Value& vAbsY2);
111
112 virtual void Rect(
113 const eC_Value& vAbsX1, const eC_Value& vAbsY1,
114 const eC_Value& vAbsX2, const eC_Value& vAbsY2);
115
116 virtual void FilledRect(
117 const eC_Value& vAbsX1, const eC_Value& vAbsY1,
118 const eC_Value& vAbsX2, const eC_Value& vAbsY2);
119
120 virtual void Ellipse(
121 const eC_Value& vAbsX1, const eC_Value& vAbsY1,
122 const eC_Value& vAbsX2, const eC_Value& vAbsY2,
123 const eC_Bool &bFilled);
124
125 virtual void Arc(
126 const eC_Value& vX1, const eC_Value& vY1,
127 const eC_Value& vX2, const eC_Value& vY2,
128 const eC_Value& vStartAngle, const eC_Value& vEndAngle,
129 const eC_Value& vRotationAngle,
130 const eC_Bool &bFilled);
131
132 virtual void Ring(
133 const eC_Value& vX1,
134 const eC_Value& vY1,
135 const eC_Value& vX2,
136 const eC_Value& vY2,
137 const eC_Value& vRingWidth,
138 const eC_Value& vStartAngle,
139 const eC_Value& vEndAngle,
140 const eC_Value& vRotationAngle,
141 const eC_Bool & bFilled);
142
143 virtual void Polygon(
144 eC_Value* pvPoints,
145 const eC_UInt& uiCount,
146 const eC_Bool& bFilled);
147
149 const eC_UByte &ubRed,
150 const eC_UByte &ubGreen,
151 const eC_UByte &ubBlue,
152 const eC_UByte &ubAlpha = 255);
153
154 virtual eC_UInt GetImgWidthImpl(const ImageResource_t &eID) const;
155
156 virtual eC_UInt GetImgHeightImpl(const ImageResource_t &eID) const;
157
158 virtual eC_UInt GetImageSize(const ImageResource_t &eID) const;
159
160 virtual void BlitImgExtImpl(
161 const ImageResource_t &eID,
162 const eC_UInt &uiAbsSrcX, const eC_UInt &uiAbsSrcY,
163 const eC_UInt &uiSrcWidth, const eC_UInt &uiSrcHeight,
164 const eC_Value& vAbsDestX, const eC_Value& vAbsDestY,
165 const eC_Value& vDestWidth, const eC_Value& vDestHeight,
166 const eC_UByte &ubAlpha = 255,
167 const eC_Value& vAngle = eC_FromFloat(0),
168 const eC_Value& vRotCenterX = eC_FromFloat(0.5), const eC_Value& vRotCenterY = eC_FromFloat(0.5));
169
170 virtual void BlitImgExtImpl(const CGUIImageData& kImageData, const eC_Value& vAbsDestX, const eC_Value& vAbsDestY);
171
172 virtual void LoadImgImpl(const eC_String& kPath, const ImageResource_t &eID);
173
174 virtual void LoadImgImpl(
175 void* pkMemory,
176 const eC_UInt& uiWidth,
177 const eC_UInt& uiHeight,
178 const eC_UInt& eImageType,
179 const ImageResource_t &eID);
180
181 virtual void UnloadImg(const ImageResource_t &eImageID);
182
183 virtual eC_Bool ImageExists(const ImageResource_t eID) const;
184
185 virtual eC_UInt GetPhysicalScreenWidth();
186
187 virtual eC_UInt GetPhysicalScreenHeight();
188
189 virtual eC_UInt GetVirtualScreenWidth();
190
191 virtual eC_UInt GetVirtualScreenHeight();
192
193 virtual eC_Bool SupportCompressedFonts() const { return true; }
194
198 eC_Bool IsScratchBufferIsUse() const { return m_bScratchbufferInUse; }
199
204
209
210 virtual eC_Bool DrawToBitmap(GUIBitmapPlaneID_t uiBitmapID);
211 virtual eC_Bool DrawToScreen();
212
214 GUIBitmapPlaneID_t uiNewBitmapID,
215 const CGUIObject& rkParentObject,
216 const eC_Value& vWidth, const eC_Value& vHeight);
217
221 void SetFrameBufferFP(SetFrameBuffer pkSetFrameBuffer);
222
226 eC_UByte GetAlphaThreshold() const { return m_ubAlphaThreshold; }
227
231 void SetAlphaThreshold(const eC_UByte& ubAlphaThreshold) { m_ubAlphaThreshold = ubAlphaThreshold; }
232
233protected:
234 virtual eC_Bool SetNOFImagesImpl(const eC_UInt uiNOFImages);
235
236 virtual void StartHandleDraw(const CGUIRect &crkClipRect);
237
241 CGfxWrapBLU(CGfxEnv* pkGfxEnv = NULL);
242
244 virtual ~CGfxWrapBLU();
245
246protected:
249
252
254 __blu_bitmap m_kSourceBitmap;
255 __blu_bitmap m_kScratchPad;
256
259
260 eC_TArray<CGUIImageDataBLU*> m_pkImages;
261
264
266
267 static const eC_UInt cuiSegmentAngle;
268
269private:
273 CGfxWrapBLU(const CGfxWrapBLU& kSource);
274
279 CGfxWrapBLU& operator=(const CGfxWrapBLU& kSource);
280
281 eC_Bool LoadImgDecoder(const eC_String& kPath, const eC_UInt& uiImageIndex);
282 eC_Bool LoadImgBLU(eC_File* pkImageFile, CGUIImageDataBLU& kImageData);
283 eC_Bool LoadImgRAW(eC_File* pkImageFile, CGUIImageDataBLU& kImageData);
284
290 void FillPolygon(blu_point16_t* pkPoints, eC_UInt uiCount, eC_UByte ubMode);
291
296 void DrawPolygon(blu_point16_t* pkPoints, eC_UInt uiCount);
297};
298
299#endif /* CGFXWRAPBLU_H */
ImageResource_t
Enumeration of image resource ids.
Definition: GUIImageResource.h:126
The bitmap plane base class.
Definition: GUIBitmapPlane.h:152
BLU-specific image-data.
Definition: GfxWrapBLU.h:20
eC_UByte GetBytePerPixel() const
Definition: GfxWrapBLU.h:59
eC_UInt GetRGBSize() const
Definition: GfxWrapBLU.h:39
void SetBytePerPixel(const eC_UByte &ubBPP)
Definition: GfxWrapBLU.h:54
eC_UInt GetAlphaSize() const
Definition: GfxWrapBLU.h:49
void SetRGBSize(const eC_UInt &uiRGBSize)
Definition: GfxWrapBLU.h:34
CGUIImageDataBLU()
Constructor.
Definition: GfxWrapBLU.h:23
void SetAlphaSize(const eC_UInt &uiAlphaSize)
Definition: GfxWrapBLU.h:44
Contains information about an image loaded by CGUIImageLoader.
Definition: GUIImageData.h:29
This is the Guiliani base class all controls are derived from.
Definition: GUIObject.h:81
Helper class to supply a platform independent rectangle implementation.
Definition: GUIRect.h:63
Definition: GfxEnv.h:53
BLU-specific graphics-wrapper.
Definition: GfxWrapBLU.h:71
eC_Bool m_bScratchbufferInUse
Whether we're using the scratch buffer instead of the display.
Definition: GfxWrapBLU.h:251
virtual eC_Bool SupportCompressedFonts() const
Definition: GfxWrapBLU.h:193
virtual void Line(const eC_Value &vAbsX1, const eC_Value &vAbsY1, const eC_Value &vAbsX2, const eC_Value &vAbsY2)
the following methods are protected to prevent calling them directly
virtual eC_Bool ImageExists(const ImageResource_t eID) const
virtual eC_UInt GetPhysicalScreenWidth()
virtual eC_Value SetLineWidth(const eC_Value &vWidth)
virtual void LoadImgImpl(const eC_String &kPath, const ImageResource_t &eID)
eC_UInt m_uiCurrentBuffer
currently active framebuffer
Definition: GfxWrapBLU.h:263
virtual eC_UInt GetVirtualScreenHeight()
virtual eC_UInt GetImageSize(const ImageResource_t &eID) const
SetFrameBuffer * m_pkSetFrameBuffer
function-pointer to specific flip-method
Definition: GfxWrapBLU.h:265
virtual void Rect(const eC_Value &vAbsX1, const eC_Value &vAbsY1, const eC_Value &vAbsX2, const eC_Value &vAbsY2)
CGUIRect GetScratchBufferRect() const
Definition: GfxWrapBLU.h:203
void Init(const eC_UInt &uiWidth, const eC_UInt &uiHeight, const eC_UByte &ubBitPerPixel, const eC_UInt uiNumberOfBuffers, void **pkFrameBuffers)
eC_UByte GetAlphaThreshold() const
Definition: GfxWrapBLU.h:226
void SetAlphaThreshold(const eC_UByte &ubAlphaThreshold)
Definition: GfxWrapBLU.h:231
virtual eC_Bool DrawToScreen()
virtual eC_UInt GetImgHeightImpl(const ImageResource_t &eID) const
virtual void FilledRect(const eC_Value &vAbsX1, const eC_Value &vAbsY1, const eC_Value &vAbsX2, const eC_Value &vAbsY2)
eC_Bool IsScratchBufferIsUse() const
Definition: GfxWrapBLU.h:198
virtual void SetCliprect(const CGUIRect &NewClipRect)
CGUIBitmapPlane * CreateGfxDependentBitmap(GUIBitmapPlaneID_t uiNewBitmapID, const CGUIObject &rkParentObject, const eC_Value &vWidth, const eC_Value &vHeight)
CGUIRect m_kScratchbufferRect
Rect describing the scratchpad's position on the screen.
Definition: GfxWrapBLU.h:248
virtual eC_Bool DrawToBitmap(GUIBitmapPlaneID_t uiBitmapID)
__blu_bitmap m_kSourceBitmap
source-bitmap
Definition: GfxWrapBLU.h:254
static const eC_UInt cuiSegmentAngle
angle of segment for arc and ring
Definition: GfxWrapBLU.h:267
void * SetFrameBuffer(void *, unsigned long, unsigned long))
signature for function to set the framebuffer
Definition: GfxWrapBLU.h:74
static eC_Bool CreateInstance(CGfxEnv *pkGfxEnv=NULL)
virtual void StartHandleDraw(const CGUIRect &crkClipRect)
__blu_bitmap * GetDestination()
Definition: GfxWrapBLU.h:208
virtual void BlitImgExtImpl(const CGUIImageData &kImageData, const eC_Value &vAbsDestX, const eC_Value &vAbsDestY)
virtual void SetForegroundColorImpl(const eC_UByte &ubRed, const eC_UByte &ubGreen, const eC_UByte &ubBlue, const eC_UByte &ubAlpha=255)
virtual void Arc(const eC_Value &vX1, const eC_Value &vY1, const eC_Value &vX2, const eC_Value &vY2, const eC_Value &vStartAngle, const eC_Value &vEndAngle, const eC_Value &vRotationAngle, const eC_Bool &bFilled)
virtual eC_Bool Refresh(const RefreshCall_t eRefreshCallType)
virtual void LoadImgImpl(void *pkMemory, const eC_UInt &uiWidth, const eC_UInt &uiHeight, const eC_UInt &eImageType, const ImageResource_t &eID)
virtual eC_UInt GetVirtualScreenWidth()
virtual void UnloadImg(const ImageResource_t &eImageID)
virtual ~CGfxWrapBLU()
Destructor.
virtual eC_UInt GetImgWidthImpl(const ImageResource_t &eID) const
virtual void Ring(const eC_Value &vX1, const eC_Value &vY1, const eC_Value &vX2, const eC_Value &vY2, const eC_Value &vRingWidth, const eC_Value &vStartAngle, const eC_Value &vEndAngle, const eC_Value &vRotationAngle, const eC_Bool &bFilled)
void SetFrameBufferFP(SetFrameBuffer pkSetFrameBuffer)
__blu_bitmap * m_pkDestinationBitmaps
destination-bitmaps
Definition: GfxWrapBLU.h:253
virtual void BlitImgExtImpl(const ImageResource_t &eID, const eC_UInt &uiAbsSrcX, const eC_UInt &uiAbsSrcY, const eC_UInt &uiSrcWidth, const eC_UInt &uiSrcHeight, const eC_Value &vAbsDestX, const eC_Value &vAbsDestY, const eC_Value &vDestWidth, const eC_Value &vDestHeight, const eC_UByte &ubAlpha=255, const eC_Value &vAngle=eC_FromFloat(0), const eC_Value &vRotCenterX=eC_FromFloat(0.5), const eC_Value &vRotCenterY=eC_FromFloat(0.5))
eC_UByte m_ubAlphaThreshold
alpha-threshold
Definition: GfxWrapBLU.h:257
CGfxWrapBLU(CGfxEnv *pkGfxEnv=NULL)
virtual void Ellipse(const eC_Value &vAbsX1, const eC_Value &vAbsY1, const eC_Value &vAbsX2, const eC_Value &vAbsY2, const eC_Bool &bFilled)
virtual eC_UInt GetPhysicalScreenHeight()
virtual eC_Bool SetNOFImagesImpl(const eC_UInt uiNOFImages)
eC_UInt m_uiNumberOfBuffers
number of framebuffers used
Definition: GfxWrapBLU.h:262
__blu_bitmap m_kScratchPad
scratch-buffer
Definition: GfxWrapBLU.h:255
virtual void Polygon(eC_Value *pvPoints, const eC_UInt &uiCount, const eC_Bool &bFilled)
eC_UInt m_uiSizeOfScratchpad
size of sratch-buffer
Definition: GfxWrapBLU.h:258
eC_TArray< CGUIImageDataBLU * > m_pkImages
internal images
Definition: GfxWrapBLU.h:260
The graphics wrapper base class.
Definition: GfxWrap.h:88
RefreshCall_t
Definition: GfxWrap.h:113