BitMap

    Boolean matrix.

    A two-dimensional array of boolean values, can be used to efficiently store a binary matrix (every matrix element takes only one bit) and query the values using natural cartesian coordinates.


    • void create_from_image_alpha ( image, float threshold=0.1 )

    Creates a bitmap that matches the given image dimensions, every element of the bitmap is set to if the alpha value of the image at that position is equal to or less, and in other case.


    • get_bit ( Vector2 position ) const

    Returns bitmap’s value at the specified position.


    • get_size ( ) const

    Returns the amount of bitmap elements that are set to .


    • void grow_mask ( int pixels, rect )

    Applies morphological dilation to the bitmap. The first argument is the dilation amount, Rect2 is the area where the dilation will be applied.


    • Array opaque_to_polygons ( rect, float epsilon=2.0 ) const

    • void set_bit ( position, bool bit )

    Sets a rectangular portion of the bitmap to the specified value.