Saturday, December 16th 2017, 7:36pm UTC+1

You are not logged in.

  • Login
  • Register

Raash

Beginner

Date of registration: Oct 29th 2016

Posts: 16

1

Saturday, December 2nd 2017, 9:48pm

Alpha blending not work

Hello.
In the library STemWin540_CM4_IAR_ARGB.а alpha blending does not work. In the library STemWin540_CM4_IAR.A alpha blending works.
Checked various options with functions: GUI_EnableAlpha(), GUI_SetAlpha(), GUI_SetUserAlpha().
Is it a library or configuration problem?

SEGGER - Schoenen

Super Moderator

Date of registration: Aug 13th 2015

Posts: 443

2

Monday, December 4th 2017, 9:27am

Hi,

I gave it a try with the 'Hello World' project offered by STM.

I have changed the library to ARGB and set the define GUI_USE_ARGB to 1 (setting the define is quite important since it is used in some header files, too).
Further I have moved the GUI memory into the external RAM at address 0xC0000000 to be able to allocate more memory (although, this is not required to run a Hello World application). Take care, at 0xC0200000 starts the framebuffer.

After doing the steps above I tried the application below and it on my display appeared a Hello World with an overlay of 50% red.

C/C++ Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "GUI.h"

/*********************************************************************
*
*   	Public code
*
**********************************************************************
*/
/*********************************************************************
*
*   	MainTask
*/
void MainTask(void) {
  GUI_Clear();
  GUI_SetFont(&GUI_Font20_1);
  GUI_DispStringAt("Hello world!", (LCD_GetXSize()-100)/2, (LCD_GetYSize()-20)/2);
  GUI_EnableAlpha(1);
  GUI_SetColor(0x80FF0000);
  GUI_FillRect(0, 0, LCD_GetXSize() - 1, LCD_GetYSize() - 1);
  GUI_EnableAlpha(0);
  while(1);
}


Regards
Sven

Raash

Beginner

Date of registration: Oct 29th 2016

Posts: 16

3

Monday, December 4th 2017, 11:03pm

With this in other examples, all the same.
What version of IAR should it be? I have a 7.50.3.

SEGGER - Schoenen

Super Moderator

Date of registration: Aug 13th 2015

Posts: 443

4

Tuesday, December 5th 2017, 2:53pm

Hi,

It shouldn't matter which IAR version or even which toolchain you are using.

Which color conversion are you using, GUICC_M8888I?
Which device are you using?

I did the test on a STM32F746 Discovery using a clean project for this evalboard from the STM32F7 Cube package.

Regards
Sven

Raash

Beginner

Date of registration: Oct 29th 2016

Posts: 16

5

Tuesday, December 5th 2017, 10:55pm

STM32F429
COLOR_CONVERSION_0 = GUICC_M565
DISPLAY_DRIVER_0 = GUIDRV_LIN_16

Raash

Beginner

Date of registration: Oct 29th 2016

Posts: 16

6

Tuesday, December 5th 2017, 11:55pm

I fixed it.
Could not work for you, because problem in the driver.
You need to fix the function DMA2D_MixColors()


#if (GUI_USE_ARGB == 1)
#define DMA2D_ALPHA_CMP_COLOR 0x00000000
#else
#define DMA2D_ALPHA_CMP_COLOR 0xFF000000
#endif


static LCD_COLOR DMA2D_MixColors(LCD_COLOR Color, LCD_COLOR BkColor, U8 Intens)
{
if((BkColor & 0xFF000000) == DMA2D_ALPHA_CMP_COLOR)
return Color;


uint32_t ColorFG = Color ^ DMA2D_ALPHA_CMP_COLOR;
uint32_t ColorBG = BkColor ^ DMA2D_ALPHA_CMP_COLOR;


...

return (ColorDst ^ DMA2D_ALPHA_CMP_COLOR);
}


I think other functions using Alpha, also need to be fixed.



Why is the function GUI_FillReсt() draws lines? At a resolution of 800 x 480, the test case draws a polygon for a very long time. In fact, there is DMA2D, but it does not fully use the library. This is very sad.



Similar threads