utility ======= .. py:module:: utility Classes ------- .. autoapisummary:: utility.Utility Module Contents --------------- .. py:class:: Utility This module contains utility classes and functions for internal use only. Validate that all color values in the image are integers and within the correct range (0 to 255). If the image contains any float values or out-of-range values, it will raise a ValueError. :param image: The image array to validate (can be RGB or Grayscale). :type image: numpy.ndarray :raises ValueError: If any value in the image is invalid (float or out-of-range). .. py:method:: _input_checker(img_array) :staticmethod: Validate the input image array for proper format, shape, and value range. This function checks if the input image array meets the following conditions: - It is a NumPy array. - It is either a 2D array (grayscale) or a 3D array with three channels (RGB). - It is non-empty and has no zero-sized dimensions. - It has an integer data type. - All values in the array are within the range [0, 255]. :param img_array: The image array to validate. :type img_array: numpy.ndarray :returns: Returns True if all validation checks pass. :rtype: bool :raises TypeError: If the input is not a NumPy array or does not have an integer data type. :raises ValueError: If the input array is not 2D or 3D with three channels, is empty, has zero-sized dimensions, or contains values outside the range [0, 255].