UEFIStarter
a simple UEFI framework
graphics.h
Go to the documentation of this file.
1 
11 #include <Uefi.h>
12 #include <UEFIStarter/graphics.h>
13 
14 
16 #define BYTES_PER_PIXEL sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
17 
19 #define DIFFTEST_DEFAULT_BACKGROUND_UINT32 0x11223344
20 
21 
23 typedef struct
24 {
25  INTN left;
26  INTN top;
27  INTN right;
28  INTN bottom;
30 
32 typedef struct
33 {
35  INTN image_width;
36  INTN image_height;
40 
41 
42 
43 void init_graphics_difftest_ex(graphics_difftest_t *difftest, INTN width, INTN height, UINT32 bgcol);
44 void init_graphics_difftest(graphics_difftest_t *difftest, INTN width, INTN height);
45 
47 void assert_box_equals(bounding_box_t *box, INTN left, INTN top, INTN right, INTN bottom, CHAR16 *message);
48 void assert_differences_within_box(graphics_difftest_t *difftest, INTN min_width, INTN max_width, INTN min_height, INTN max_height, CHAR16 *message);
49 
52 
54 
data type for image change tests
Definition: graphics.h:32
void assert_differences_within_box(graphics_difftest_t *difftest, INTN min_width, INTN max_width, INTN min_height, INTN max_height, CHAR16 *message)
Asserts the bounding box of changes is within given ranges of width and height.
Definition: graphics.c:147
INTN right
the bounding box&#39;s right coordinate
Definition: graphics.h:27
void assert_box_equals(bounding_box_t *box, INTN left, INTN top, INTN right, INTN bottom, CHAR16 *message)
Asserts a bounding box matches expected values.
Definition: graphics.c:129
INTN bottom
the bounding box&#39;s bottom coordinate
Definition: graphics.h:28
INTN image_height
the images&#39; height
Definition: graphics.h:36
void reset_graphics_difftest(graphics_difftest_t *difftest)
Resets a graphics difference test.
Definition: graphics.c:39
void destroy_graphics_difftest(graphics_difftest_t *difftest)
Destroys a graphics difference test structure.
Definition: graphics.c:80
INTN left
the bounding box&#39;s left coordinate
Definition: graphics.h:25
image_t * after
the "after" image
Definition: graphics.h:38
void init_graphics_difftest(graphics_difftest_t *difftest, INTN width, INTN height)
Initializes a default graphics difference test.
Definition: graphics.c:70
image_t * before
the "before" image
Definition: graphics.h:37
INTN top
the bounding box&#39;s top coordinate
Definition: graphics.h:26
data type for bounding boxes
Definition: graphics.h:23
data type for image data, size is dynamic
Definition: graphics.h:69
void reset_bounding_box(bounding_box_t *box)
Initializes a bounding box.
Definition: graphics.c:25
INTN image_width
the images&#39; width
Definition: graphics.h:35
Functions for creating and showing graphics.
void find_bounding_box_for_changes(graphics_difftest_t *difftest)
Compares "before" and "after" images of a difference test and determines the bounding box changes hap...
Definition: graphics.c:91
bounding_box_t box
the expected bounding box for changes
Definition: graphics.h:34
void init_graphics_difftest_ex(graphics_difftest_t *difftest, INTN width, INTN height, UINT32 bgcol)
Initializes a graphics difference test.
Definition: graphics.c:53