UiUiUi
A user interface library for micro controller sketches based on U8g2
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
UISize Class Referencefinal

Representation of a size, i.e. More...

#include <UISize.h>

Collaboration diagram for UISize:
Collaboration graph
[legend]

Public Member Functions

 UISize (uint16_t width, uint16_t height)
 Initialize a size from a width and a height.
 
 UISize (UISize *other)
 Initialize a size from another size.
 
 UISize ()
 Initialize a size without width or height (both 0).
 
void set (uint16_t width, uint16_t height)
 Set height from a numeric width and height.
 
void set (UISize *other)
 Set size from another referenced height.
 
void cumulateBoth (UISize *other)
 Cumulate width and height of this and the referenced size into this size.
 
void maxWidthCumulateHeight (UISize *other)
 Cumulate the heights of this and the other size and take the maximum of both widths, write everything into this.
 
void cumulateWidthMaxHeight (UISize *other)
 Cumulate the widths of this and the other size and take the maximum of both heights, write everything into this.
 
void maxBoth (UISize *other)
 Take the maximum of widths and height of this and the other size and write it into this.
 
void shrinkTo (UISize *other)
 Shrink this so that neither width nor height is larger than the one of other.
 
bool isEmpty ()
 Return true if this size is empty, i.e. More...
 
void debugPrint (const char *label)
 Debug output of this size with some prepended label.
 

Static Public Member Functions

static uint16_t my_max (uint16_t a, uint16_t b)
 Static helper method: maximum of two given uint16_t fields.
 
static uint16_t my_min (uint16_t a, uint16_t b)
 Static helper method: maximum of two given uint16_t fields.
 
static uint16_t max_len_or (uint16_t a)
 Static helper method: restrict given value to MAX_LEN at most.
 

Public Attributes

uint16_t width
 Width.
 
uint16_t height
 Height.
 

Static Public Attributes

static const uint16_t MAX_LEN =32767
 Less than half of max value so that addition of two does not overflow. More...
 
static const UISize MAX_SIZE
 UISize representing maximal size in all directions.
 
static const UISize EMPTY
 UISize representing an empty size (both directions 0)
 

Detailed Description

Representation of a size, i.e.

a width and a height.

Member Function Documentation

◆ isEmpty()

bool UISize::isEmpty ( )

Return true if this size is empty, i.e.

it has neither width nor height, i.e. both are 0.

Member Data Documentation

◆ MAX_LEN

const uint16_t UISize::MAX_LEN =32767
static

Less than half of max value so that addition of two does not overflow.

Representation of a size, i.e.

a width and a height.


The documentation for this class was generated from the following files: