UEFIStarter
a simple UEFI framework
Macros | Functions | Variables
rotation.c File Reference

This application demonstrates image rotation and bilinear interpolation. More...

#include <Uefi.h>
#include <Library/UefiLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <math.h>
#include <stdio.h>
#include <UEFIStarter/graphics.h>
#include <UEFIStarter/core.h>

Macros

#define ARG_RADIUS   args[0].value.uint64
 shortcut macro to access "radius" command-line parameter
 
#define RGBA(R, G, B, A)   {B,G,R,A}
 shortcut macro: defines an EFI_GRAPHICS_OUTPUT_BLT_PIXEL color value More...
 

Functions

void draw_gradient ()
 This draws an animated gradient. More...
 
void draw_circle ()
 internal: draws the image to be rotated to the full-screen graphics buffer
 
void rotate_buffer ()
 Animates a rotating image.
 
int main (int argc, char **argv_ascii)
 Main function, gets invoked by UEFI shell. More...
 

Variables

EFI_GRAPHICS_OUTPUT_BLT_PIXEL * buffer2
 additional buffer required to rotate image
 
cmdline_argument_t args []
 list of command-line arguments More...
 
cmdline_argument_group_t arggroup ={ L"Application-specific options" ,sizeof( args )/sizeof(cmdline_argument_t), args }
 application-specific command-line argument group
 

Detailed Description

This application demonstrates image rotation and bilinear interpolation.

You'll need to run this in a graphics-capable environment, see gop.c

Author
Richard Nusser
License
GPLv3 (see http://www.gnu.org/licenses/)
See also
https://github.com/rinusser/UEFIStarter

Macro Definition Documentation

◆ RGBA

#define RGBA (   R,
  G,
  B,
 
)    {B,G,R,A}

shortcut macro: defines an EFI_GRAPHICS_OUTPUT_BLT_PIXEL color value

Parameters
Rred
Ggreen
Bblue
Aalpha/reserved

Function Documentation

◆ draw_gradient()

void draw_gradient ( )

This draws an animated gradient.

It's actually a bilinear interpolation between the 4 corners of the screen: the corner colors change between frames.

◆ main()

int main ( int  argc,
char **  argv_ascii 
)

Main function, gets invoked by UEFI shell.

Parameters
argcthe number of command-line arguments passed
argv_asciithe command-line arguments passed, as ASCII
Returns
an EFI status code for the shell

Variable Documentation

◆ args

Initial value:
={
{{uint64:50},ARG_INT,NULL,L"-radius",L"circle radius [px]"}
}
integer
Definition: cmdline.h:23

list of command-line arguments