/*************************************************************************** * Copyright (c) 2024 Microsoft Corporation * * This program and the accompanying materials are made available under the * terms of the MIT License which is available at * https://opensource.org/licenses/MIT. * * SPDX-License-Identifier: MIT **************************************************************************/ /**************************************************************************/ /**************************************************************************/ /** */ /** GUIX Component */ /** */ /** Display Management (Display) */ /** */ /**************************************************************************/ #define GX_SOURCE_CODE /* Include necessary system files. */ #include "gx_api.h" #include "gx_context.h" #include "gx_system.h" #include "gx_display.h" #include "gx_image_reader.h" /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _gx_display_driver_565rgb_rotated_png_draw PORTABLE C */ /* 6.1.3 */ /* AUTHOR */ /* */ /* Kenneth Maxwell, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ /* 565rgb format display driver PNG drawing function. */ /* */ /* INPUT */ /* */ /* context Drawing context */ /* xpos x-coord of top-left draw point*/ /* ypos y-coord of top-left draw point*/ /* pixelmap Pointer to GX_PIXELMAP struct */ /* */ /* OUTPUT */ /* */ /* None */ /* */ /* CALLS */ /* */ /* _gx_image_reader_create */ /* _gx_image_reader_start */ /* _gx_display_driver_565rgb_rotated_pixelmap_draw */ /* _gx_system_memory_free */ /* */ /* CALLED BY */ /* */ /* Application Code */ /* GUIX Internal Code */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 12-31-2020 Kenneth Maxwell Initial Version 6.1.3 */ /* */ /**************************************************************************/ #if defined(GX_SOFTWARE_DECODER_SUPPORT) VOID _gx_display_driver_565rgb_rotated_png_draw(GX_DRAW_CONTEXT *context, INT xpos, INT ypos, GX_PIXELMAP *pixelmap) { GX_IMAGE_READER image_reader; GX_PIXELMAP pic_outmap; GX_UBYTE mode = GX_IMAGE_READER_MODE_ALPHA; if (context->gx_draw_context_display->gx_display_rotation_angle == GX_SCREEN_ROTATION_CW) { mode |= GX_IMAGE_READER_MODE_ROTATE_CW; } else { mode |= GX_IMAGE_READER_MODE_ROTATE_CCW; } _gx_image_reader_create(&image_reader, pixelmap -> gx_pixelmap_data, (INT)(pixelmap -> gx_pixelmap_data_size), GX_COLOR_FORMAT_565RGB, mode); if (_gx_image_reader_start(&image_reader, &pic_outmap) == GX_SUCCESS) { _gx_display_driver_565rgb_rotated_pixelmap_draw(context, xpos, ypos, &pic_outmap); _gx_system_memory_free((VOID *)pic_outmap.gx_pixelmap_data); if (pic_outmap.gx_pixelmap_aux_data) { _gx_system_memory_free((VOID *)pic_outmap.gx_pixelmap_aux_data); } } } #endif