/*************************************************************************** * 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 */ /** */ /** Utility (Utility) */ /** */ /**************************************************************************/ #define GX_SOURCE_CODE /* Include necessary system files. */ #include "gx_api.h" #include "gx_system.h" #include "gx_utility.h" GX_CALLER_CHECKING_EXTERNS /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _gxe_utility_pixelmap_resize PORTABLE C */ /* 6.1 */ /* AUTHOR */ /* */ /* Kenneth Maxwell, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ /* This function checks for errors in the utility pixelmap resize */ /* function call. */ /* */ /* INPUT */ /* */ /* src The source pixelmap */ /* destination The resized pixelmap to be */ /* returned */ /* width New width */ /* height New height */ /* */ /* OUTPUT */ /* */ /* None */ /* */ /* CALLS */ /* */ /* _gx_utility_pixelmap_resize Actual utility pixelmap */ /* resize function */ /* */ /* CALLED BY */ /* */ /* Application Code */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Kenneth Maxwell Initial Version 6.0 */ /* 09-30-2020 Kenneth Maxwell Modified comment(s), */ /* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _gxe_utility_pixelmap_resize(GX_PIXELMAP *src, GX_PIXELMAP *destination, INT width, INT height) { UINT status; /* Check for invalid input pointers. */ if ((src == GX_NULL) || (destination == GX_NULL)) { return GX_PTR_ERROR; } /* Check for valid value. */ if ((width <= 0) && (height <= 0)) { return GX_INVALID_VALUE; } /* Check for pixelmap flags. */ if (src -> gx_pixelmap_flags & GX_PIXELMAP_COMPRESSED) { return GX_NOT_SUPPORTED; } if (!_gx_system_memory_allocator || !_gx_system_memory_free) { return GX_SYSTEM_MEMORY_ERROR; } /* Call the actual utility pixelmap resize function. */ status = _gx_utility_pixelmap_resize(src, destination, width, height); return status; }