• AVR Freaks

Hot!Graphics orientation with nano2d

Author
jiggoly
Junior Member
  • Total Posts : 112
  • Reward points : 0
  • Joined: 2016/01/19 15:02:48
  • Location: Spain
  • Status: offline
2018/07/17 02:32:05 (permalink)
0

Graphics orientation with nano2d

Background:
- PIC32MZ2064DAH176 custom board
- WVGA Display 800x480
- MPLAB Harmony 2.06
- MPLABX 4.20
- XC32 2.10
 
I made a simple screen 180º rotation with a 80x80 pixels JPEG graphic to check the issue I have:
First Image is a Blank screen with 2 layers double buffer, layer0 is empty and layer1 has an imagewidget with the picture. Using preprocessing enabled,managed and RGB888 without padding. On MHC nano2d is enabled.

3 attached pictures shows this. The only correct picture is with nano2d without preprocessing.
 

 
Any Help? Thanks.
post edited by jiggoly - 2018/07/17 02:34:26

Attached Image(s)

#1

4 Replies Related Threads

    jiggoly
    Junior Member
    • Total Posts : 112
    • Reward points : 0
    • Joined: 2016/01/19 15:02:48
    • Location: Spain
    • Status: offline
    Re: Graphics orientation with nano2d 2018/07/17 04:14:06 (permalink)
    3 (1)
    Well, quick fix for this...
     
    libaria_init.c file section initialize looks like this (harmony generated):
     
    int32_t libaria_initialize(void)
    {
        laScreen* screen;

        laScheme_Initialize(&defaultScheme, GFX_COLOR_MODE_RGBA_8888);
        defaultScheme.base = 0xC8D0D4FF;
        defaultScheme.highlight = 0xC8D0D4FF;
        defaultScheme.highlightLight = 0xFFFFFFFF;
        defaultScheme.shadow = 0x808080FF;
        defaultScheme.shadowDark = 0x404040FF;
        defaultScheme.foreground = 0xFF;
        defaultScheme.foregroundInactive = 0xD6E3E7FF;
        defaultScheme.foregroundDisabled = 0x808080FF;
        defaultScheme.background = 0xFFFFFFFF;
        defaultScheme.backgroundInactive = 0xD6E3E7FF;
        defaultScheme.backgroundDisabled = 0xC8D0D4FF;
        defaultScheme.text = 0xFF;
        defaultScheme.textHighlight = 0xFFFF;
        defaultScheme.textHighlightText = 0xFFFFFFFF;
        defaultScheme.textInactive = 0xD6E3E7FF;
        defaultScheme.textDisabled = 0x8C9294FF;

        GFX_Set(GFXF_DRAW_PIPELINE_MODE, GFX_PIPELINE_GCUGPU);

        // process images configured for preprocessing
        GFXU_PreprocessImage(&ACIRCLE,0xA88CA000,GFX_COLOR_MODE_RGBA_8888,GFX_TRUE);

        laContext_SetStringTable(&stringTable);

        screen = laScreen_New(LA_FALSE, LA_FALSE, &ScreenCreate_default);
        laScreen_SetOrientation(screen, LA_SCREEN_ORIENTATION_180);
        laContext_AddScreen(screen);

        laContext_SetActiveScreen(0);

     return 0;
    }

     
    If I cut and paste the PreprocessImage function to the end of the function after the orientation is set, it works fine.
    int32_t libaria_initialize(void)
    {
        laScreen* screen;

        laScheme_Initialize(&defaultScheme, GFX_COLOR_MODE_RGBA_8888);
        defaultScheme.base = 0xC8D0D4FF;
        defaultScheme.highlight = 0xC8D0D4FF;
        defaultScheme.highlightLight = 0xFFFFFFFF;
        defaultScheme.shadow = 0x808080FF;
        defaultScheme.shadowDark = 0x404040FF;
        defaultScheme.foreground = 0xFF;
        defaultScheme.foregroundInactive = 0xD6E3E7FF;
        defaultScheme.foregroundDisabled = 0x808080FF;
        defaultScheme.background = 0xFFFFFFFF;
        defaultScheme.backgroundInactive = 0xD6E3E7FF;
        defaultScheme.backgroundDisabled = 0xC8D0D4FF;
        defaultScheme.text = 0xFF;
        defaultScheme.textHighlight = 0xFFFF;
        defaultScheme.textHighlightText = 0xFFFFFFFF;
        defaultScheme.textInactive = 0xD6E3E7FF;
        defaultScheme.textDisabled = 0x8C9294FF;

        GFX_Set(GFXF_DRAW_PIPELINE_MODE, GFX_PIPELINE_GCUGPU);



        laContext_SetStringTable(&stringTable);

        screen = laScreen_New(LA_FALSE, LA_FALSE, &ScreenCreate_default);
        laScreen_SetOrientation(screen, LA_SCREEN_ORIENTATION_180);
        laContext_AddScreen(screen);

        laContext_SetActiveScreen(0);
        
        // process images configured for preprocessing
        GFXU_PreprocessImage(&ACIRCLE,0xA88CA000,GFX_COLOR_MODE_RGBA_8888,GFX_TRUE);
        
     return 0;
    }

     
    Best regards.
    #2
    Ed@Microchip
    Super Member
    • Total Posts : 134
    • Reward points : 0
    • Joined: 2017/04/06 09:39:29
    • Location: 0
    • Status: offline
    Re: Graphics orientation with nano2d 2018/07/19 09:00:51 (permalink)
    0
    Thank you for reporting the issue and a fix. We'll consider this for the next release.
    #3
    jiggoly
    Junior Member
    • Total Posts : 112
    • Reward points : 0
    • Joined: 2016/01/19 15:02:48
    • Location: Spain
    • Status: offline
    Re: Graphics orientation with nano2d 2018/07/20 03:50:23 (permalink)
    0
    You are welcome Ed. Also I´m moving the preprocess code to the initial program to load the preprocess while the logo is showing on the screen. It works perfect.
     
    #4
    kuku
    Junior Member
    • Total Posts : 117
    • Reward points : 0
    • Joined: 2012/03/03 08:05:54
    • Location: 0
    • Status: offline
    Re: Graphics orientation with nano2d 2019/03/23 15:21:25 (permalink)
    0
    I confirm that preprocessing must be move before return. But still something is wrong, image 104x272 is not drawn, I see only background when they are turn on. Other picture who I use (100x100 or 272x480) is drawn OK.

    About the order of the harmony code. I have custom TFT and I must move SYS_PORTS_Initialize(); before GFX_Initialize();
    post edited by kuku - 2019/03/23 15:23:01
    #5
    Jump to:
    © 2019 APG vNext Commercial Version 4.5