News:

Welcome to the Bridgetek Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ Bridgetek Support

Please refer to our website for detailed information on all our products - Bridgetek - Bridging Technology

Main Menu

Question for method BLENDING

Started by Prog_11, December 03, 2019, 10:46:37 AM

Previous topic - Next topic

Prog_11

Hi,

@ BRT Community: What does your development team say?

@ all: Does anybody know a solution?

pauljiao

I found in ESD 4.8 there is the widget "ESD Circle Line" and "ESD Gradient" can fit most of your requirement, except the semitransparent.  Please have a check the image I enclosed.

pauljiao

Please check the code below in the ESE and it shall get the effect as the enclosed image.

Try to change the "ALPHA_TEST" and replace the value with 125 to see the semi-transparent effect of contour.

Quote
CLEAR_COLOR_RGB(255,255,255)
CLEAR_COLOR_A(255)
CLEAR(1, 1, 1)

CMD_GRADIENT(100, 207, 0x007FFF, 244, 189, 0x7FFF00)

SAVE_CONTEXT()
SCISSOR_XY(100, 100)
SCISSOR_SIZE(100, 100)

COLOR_RGB(255,255,255)
COLOR_A(255)

COLOR_MASK(0,0,0,1)
BLEND_FUNC(ZERO, ZERO) #clear Alpha

BEGIN(RECTS)
VERTEX2II(100,100,0,0)
VERTEX2II(200,200,0,0)

COLOR_A(255) # ALPHA_TEST
BLEND_FUNC(SRC_ALPHA, ZERO) #Set Alpha
POINT_SIZE(800)
BEGIN(POINTS)
VERTEX2II(150,150, 0,0)

BLEND_FUNC(ZERO, ZERO) #clear Alpha
POINT_SIZE(400)
BEGIN(POINTS)
VERTEX2II(150,150, 0,0)

COLOR_RGB(245,58,41)
COLOR_A(255) #ALPHA_TEST
COLOR_MASK(1,1,1,1)
BLEND_FUNC(DST_ALPHA, ONE_MINUS_DST_ALPHA)


BEGIN(RECTS)
VERTEX2II(100,100,0,0)
VERTEX2II(200,200,0,0)

RESTORE_CONTEXT()



Prog_11

Hi pauljiao,

Thanks for your answer, but please have a heart and read my specification. There are still alias effects and the ring should be 100% transparent and the surrounding area should not be.

The very simple problem seems to be more and more an unsolvable problem...

@ BRT Community: What does your development team say?

BRT Community

Hello

Over development team concurs with pauljiaos approach.

Maybe you could provide a render of what exactly you are trying to achieve, I found your original description rather vague/hard to visualise. But it is important to remember EVE is intended for use with low power MCUs to facilitate HMIs, it is not an high power graphics IC and some aliasing effects may be present. As you can see from the range of demos available from the software examples section of our website, EVE is a very capable graphics IC in its own right, but there may be some hardware limitations on what you're trying to achieve.

Best Regards,
BRT Community

mmottola

#20
Quote from: Prog_11 on January 13, 2020, 10:24:06 AM
Hi pauljiao,

Thanks for your answer, but please have a heart and read my specification. There are still alias effects and the ring should be 100% transparent and the surrounding area should not be.

The very simple problem seems to be more and more an unsolvable problem...

@ BRT Community: What does your development team say?

Apologies for bumping an old thread, but I believe the issue was with the aliasing on the inner portion of the ring. By adding an additional point with blending to @pauljiao provided snippet, anti-aliasing of the inner portion can be achieved while still allowing for transparency.


CLEAR_COLOR_RGB(255,255,255)
CLEAR_COLOR_A(255)
CLEAR(1, 1, 1)

CMD_GRADIENT(100, 207, 0x007FFF, 244, 189, 0x7FFF00)

SAVE_CONTEXT()

SCISSOR_XY(100, 100)
SCISSOR_SIZE(101, 101)

COLOR_RGB(255,255,255)
COLOR_A(255)

COLOR_MASK(0,0,0,1)
BLEND_FUNC(ZERO, ZERO)

BEGIN(RECTS)
VERTEX2F(1600, 1600)
VERTEX2F(3200, 3200)

COLOR_A(255) // Circle transparency
BLEND_FUNC(SRC_ALPHA, ZERO)
POINT_SIZE(800)
BEGIN(POINTS)
VERTEX2F(2400, 2400)

BLEND_FUNC(ZERO, ZERO)
POINT_SIZE(384)
BEGIN(POINTS)
VERTEX2F(2400, 2400)

//Anti-aliasing inner portion
BLEND_FUNC(ZERO, ONE_MINUS_SRC_ALPHA)
POINT_SIZE(416)
BEGIN(POINTS)
VERTEX2F(2400, 2400)

COLOR_RGB(245,58,41)
COLOR_A(255)
COLOR_MASK(1,1,1,1)
BLEND_FUNC(DST_ALPHA, ONE_MINUS_DST_ALPHA)

BEGIN(RECTS)
VERTEX2F(1600, 1600)
VERTEX2F(3200, 3200)

RESTORE_CONTEXT()

pauljiao

Thanks mmottola. Your tip works well.