Generated by Doxygen 1.8.14
Neographics
Draw Command

Classes

struct  n_GDrawCommandFlags
 
struct  n_GDrawCommand
 
struct  n_GDrawCommandList
 
struct  n_GDrawCommandImage
 
struct  n_GDrawCommandFrame
 
struct  n_GDrawCommandSequence
 

Macros

#define __N_DRAW_COMMAND_MAXIMUM_SUPPORTED_VERSION   2
 

Typedefs

typedef enum n_GDrawCommandType n_GDrawCommandType
 
typedef enum n_GDrawCommandBWColor n_GDrawCommandBWColor
 
typedef struct n_GDrawCommandFlags n_GDrawCommandFlags
 
typedef bool() n_GDrawCommandListIteratorCb(n_GDrawCommand *command, uint32_t index, void *context)
 

Enumerations

enum  n_GDrawCommandType {
  n_GDrawCommandTypeInvalid = 0, n_GDrawCommandTypePath = 1, n_GDrawCommandTypeCircle = 2, n_GDrawCommandTypePrecisePath = 3,
  n_GDrawCommandTypePreciseCircle = 4
}
 
enum  n_GDrawCommandBWColor { n_GDrawCommandBWColorClear = 0, n_GDrawCommandBWColorBlack = 1, n_GDrawCommandBWColorGray = 2, n_GDrawCommandBWColorWhite = 3 }
 

Functions

struct n_GDrawCommand __attribute ((__packed__)) n_GDrawCommand
 
n_GDrawCommandType n_gdraw_command_get_type (n_GDrawCommand *command)
 
uint16_t n_gdraw_command_get_num_points (n_GDrawCommand *command)
 
n_GColor n_gdraw_command_get_stroke_color (n_GDrawCommand *command)
 
void n_gdraw_command_set_stroke_color (n_GDrawCommand *command, n_GColor stroke_color)
 
uint8_t n_gdraw_command_get_stroke_width (n_GDrawCommand *command)
 
void n_gdraw_command_set_stroke_width (n_GDrawCommand *command, uint8_t stroke_width)
 
n_GColor n_gdraw_command_get_fill_color (n_GDrawCommand *command)
 
void n_gdraw_command_set_fill_color (n_GDrawCommand *command, n_GColor fill_color)
 
n_GPoint n_gdraw_command_get_point (n_GDrawCommand *command, uint16_t index)
 
void n_gdraw_command_set_point (n_GDrawCommand *command, uint16_t index, n_GPoint point)
 
uint16_t n_gdraw_command_get_radius (n_GDrawCommand *command)
 
void n_gdraw_command_set_radius (n_GDrawCommand *command, uint16_t radius)
 
bool n_gdraw_command_get_path_open (n_GDrawCommand *command)
 
void n_gdraw_command_set_path_open (n_GDrawCommand *command, bool path_open)
 
bool n_gdraw_command_get_hidden (n_GDrawCommand *command)
 
void n_gdraw_command_set_hidden (n_GDrawCommand *command, bool hidden)
 
void n_gdraw_command_draw (n_GContext *ctx, n_GDrawCommand *command, n_GPoint offset)
 
void n_gdraw_command_image_draw (n_GContext *ctx, n_GDrawCommandImage *image, n_GPoint offset)
 
void n_gdraw_command_frame_draw (n_GContext *ctx, n_GDrawCommandSequence *sequence, n_GDrawCommandFrame *frame, n_GPoint offset)
 
void n_gdraw_command_list_draw (n_GContext *ctx, n_GDrawCommandList *list, n_GPoint offset)
 
n_GDrawCommandListn_gdraw_command_image_get_command_list (n_GDrawCommandImage *image)
 
n_GDrawCommandListn_gdraw_command_frame_get_command_list (n_GDrawCommandFrame *frame)
 
uint32_t n_gdraw_command_list_get_num_commands (n_GDrawCommandList *list)
 
n_GDrawCommandn_gdraw_command_list_get_command (n_GDrawCommandList *list, uint32_t index)
 
void n_gdraw_command_list_iterate (n_GDrawCommandList *list, n_GDrawCommandListIteratorCb cb, void *cb_context)
 
uint16_t n_gdraw_command_frame_get_duration (n_GDrawCommandFrame *frame)
 
void n_gdraw_command_frame_set_duration (n_GDrawCommandFrame *frame, uint16_t duration)
 
n_GDrawCommandFramen_gdraw_command_sequence_get_frame_by_elapsed (n_GDrawCommandSequence *sequence, uint32_t ms)
 
n_GDrawCommandFramen_gdraw_command_sequence_get_frame_by_index (n_GDrawCommandSequence *sequence, uint32_t index)
 
uint32_t n_gdraw_command_sequence_get_play_count (n_GDrawCommandSequence *sequence)
 
void n_gdraw_command_sequence_set_play_count (n_GDrawCommandSequence *sequence, uint16_t play_count)
 
uint32_t n_gdraw_command_sequence_get_total_duration (n_GDrawCommandSequence *sequence)
 
uint16_t n_gdraw_command_sequence_get_num_frames (n_GDrawCommandSequence *sequence)
 
n_GSize n_gdraw_command_image_get_bounds_size (n_GDrawCommandImage *image)
 
void n_gdraw_command_image_set_bounds_size (n_GDrawCommandImage *image, n_GSize size)
 
n_GSize n_gdraw_command_sequence_get_bounds_size (n_GDrawCommandSequence *sequence)
 
void n_gdraw_command_sequence_set_bounds_size (n_GDrawCommandSequence *sequence, n_GSize size)
 
n_GDrawCommandImagen_gdraw_command_image_create_with_resource (uint32_t resource_id)
 
n_GDrawCommandImagen_gdraw_command_image_clone (n_GDrawCommandImage *image)
 
void n_gdraw_command_image_destroy (n_GDrawCommandImage *image)
 
n_GDrawCommandSequencen_gdraw_command_sequence_create_with_resource (uint32_t resource_id)
 
n_GDrawCommandSequencen_gdraw_command_sequence_clone (n_GDrawCommandSequence *image)
 
void n_gdraw_command_sequence_destroy (n_GDrawCommandSequence *sequence)
 

Detailed Description

Tiny, modifiable, animatable vector graphics.

Typedef Documentation

◆ n_GDrawCommandBWColor

The draw command black/white color allows for specific colors being used to execute the draw command on black/white hardware.

In effect, this is useful for commands that should be rendered with different colors based on the display type without having to spend time changing it at runtime or using separate, platform-specific resources.

◆ n_GDrawCommandFlags

The draw command flags contain the "hidden" attribute as per the original definition, but additionally allow for specific BW colors (see n_GDrawCommandBWColor)

◆ n_GDrawCommandType

The draw command type attribute of a draw command describes the command's type. The precise versions allow for subpixel alignment.

Enumeration Type Documentation

◆ n_GDrawCommandBWColor

The draw command black/white color allows for specific colors being used to execute the draw command on black/white hardware.

In effect, this is useful for commands that should be rendered with different colors based on the display type without having to spend time changing it at runtime or using separate, platform-specific resources.

◆ n_GDrawCommandType

The draw command type attribute of a draw command describes the command's type. The precise versions allow for subpixel alignment.

Function Documentation

◆ __attribute()

struct n_GDrawCommandSequence __attribute ( (__packed__)  )

The contents of a n_GDrawCommand.

A list of n_GDrawCommand(s)

Wrapper around a n_GDrawCommandList which additionally contains viewbox and version information. Prefixed with PDCI as a magic word in storage.

Wrapper around a n_GDrawCommandList which additionally contains frame duration. Multiple of these comprise a n_GDrawCommandSequence.

An animation comprised of n_GDrawCommandFrame(s). Additionally contains play count (zero meaning infinity) and a view box. Prefixed with PDCS as a magic word in storage.

◆ n_gdraw_command_draw()

void n_gdraw_command_draw ( n_GContext ctx,
n_GDrawCommand command,
n_GPoint  offset 
)

Draws a n_GDrawCommand at a given offset.

◆ n_gdraw_command_frame_draw()

void n_gdraw_command_frame_draw ( n_GContext ctx,
n_GDrawCommandSequence sequence,
n_GDrawCommandFrame frame,
n_GPoint  offset 
)

Draws a n_GDrawCommandFrame at a given offset.

◆ n_gdraw_command_frame_get_command_list()

n_GDrawCommandList* n_gdraw_command_frame_get_command_list ( n_GDrawCommandFrame frame)

◆ n_gdraw_command_frame_get_duration()

uint16_t n_gdraw_command_frame_get_duration ( n_GDrawCommandFrame frame)

Gets the duration of a n_GDrawCommandFrame.

◆ n_gdraw_command_frame_set_duration()

void n_gdraw_command_frame_set_duration ( n_GDrawCommandFrame frame,
uint16_t  duration 
)

Sets the duration of a n_GDrawCommandFrame.

◆ n_gdraw_command_get_fill_color()

n_GColor n_gdraw_command_get_fill_color ( n_GDrawCommand command)

Gets the fill n_GColor of a given n_GDrawCommand.

◆ n_gdraw_command_get_hidden()

bool n_gdraw_command_get_hidden ( n_GDrawCommand command)

Gets the visibility of a given n_GDrawCommand.

◆ n_gdraw_command_get_num_points()

uint16_t n_gdraw_command_get_num_points ( n_GDrawCommand command)

Gets the amount of n_GPoint(s) of a given n_GDrawCommand.

◆ n_gdraw_command_get_path_open()

bool n_gdraw_command_get_path_open ( n_GDrawCommand command)

Gets whether the given n_GDrawCommand is open at the ends (assuming its n_GDrawCommandType is n_GDrawCommandTypePath or n_GDrawCommandTypePrecisePath).

◆ n_gdraw_command_get_point()

n_GPoint n_gdraw_command_get_point ( n_GDrawCommand command,
uint16_t  index 
)

Gets the n_GPoint at a given index of a given n_GDrawCommand.

◆ n_gdraw_command_get_radius()

uint16_t n_gdraw_command_get_radius ( n_GDrawCommand command)

Gets the radius of a given n_GDrawCommand (assuming its n_GDrawCommandType is n_GDrawCommandTypeCircle or n_GDrawCommandTypePreciseCircle).

◆ n_gdraw_command_get_stroke_color()

n_GColor n_gdraw_command_get_stroke_color ( n_GDrawCommand command)

Gets the stroke n_GColor of a given n_GDrawCommand.

◆ n_gdraw_command_get_stroke_width()

uint8_t n_gdraw_command_get_stroke_width ( n_GDrawCommand command)

Gets the stroke width of a given n_GDrawCommand.

◆ n_gdraw_command_get_type()

n_GDrawCommandType n_gdraw_command_get_type ( n_GDrawCommand command)

Gets the n_GDrawCommandType of a given n_GDrawCommand.

◆ n_gdraw_command_image_clone()

n_GDrawCommandImage* n_gdraw_command_image_clone ( n_GDrawCommandImage image)

Duplicates a n_GDrawCommandImage.

◆ n_gdraw_command_image_create_with_resource()

n_GDrawCommandImage* n_gdraw_command_image_create_with_resource ( uint32_t  resource_id)

Loads a n_GDrawCommandImage resource.

◆ n_gdraw_command_image_destroy()

void n_gdraw_command_image_destroy ( n_GDrawCommandImage image)

◆ n_gdraw_command_image_draw()

void n_gdraw_command_image_draw ( n_GContext ctx,
n_GDrawCommandImage image,
n_GPoint  offset 
)

Draws a n_GDrawCommandImage at a given offset.

◆ n_gdraw_command_image_get_bounds_size()

n_GSize n_gdraw_command_image_get_bounds_size ( n_GDrawCommandImage image)

Gets the n_GSize demarking the outside of a n_GDrawCommandImage.

Note
When being drawn, this doesn't actually do anything: The image contents aren't cropped to this bounds size.

◆ n_gdraw_command_image_get_command_list()

n_GDrawCommandList* n_gdraw_command_image_get_command_list ( n_GDrawCommandImage image)

◆ n_gdraw_command_image_set_bounds_size()

void n_gdraw_command_image_set_bounds_size ( n_GDrawCommandImage image,
n_GSize  size 
)

Sets the n_GSize demarking the outside of a n_GDrawCommandImage.

Note
When being drawn, this doesn't actually do anything: The image contents aren't cropped to this bounds size.

◆ n_gdraw_command_list_draw()

void n_gdraw_command_list_draw ( n_GContext ctx,
n_GDrawCommandList list,
n_GPoint  offset 
)

Draws a n_GDrawCommandList at a given offset.

◆ n_gdraw_command_list_get_command()

n_GDrawCommand* n_gdraw_command_list_get_command ( n_GDrawCommandList list,
uint32_t  index 
)

Get the n_GDrawCommand at a given index in a given n_GDrawCommandList.

◆ n_gdraw_command_list_get_num_commands()

uint32_t n_gdraw_command_list_get_num_commands ( n_GDrawCommandList list)

Gets the amount of n_GDrawCommand(s) in a given n_GDrawCommandList.

◆ n_gdraw_command_list_iterate()

void n_gdraw_command_list_iterate ( n_GDrawCommandList list,
n_GDrawCommandListIteratorCb  cb,
void *  cb_context 
)

◆ n_gdraw_command_sequence_clone()

n_GDrawCommandSequence* n_gdraw_command_sequence_clone ( n_GDrawCommandSequence image)

Duplicates a n_GDrawCommandSequence.

◆ n_gdraw_command_sequence_create_with_resource()

n_GDrawCommandSequence* n_gdraw_command_sequence_create_with_resource ( uint32_t  resource_id)

Loads a n_GDrawCommandSequence resource.

◆ n_gdraw_command_sequence_destroy()

void n_gdraw_command_sequence_destroy ( n_GDrawCommandSequence sequence)

◆ n_gdraw_command_sequence_get_bounds_size()

n_GSize n_gdraw_command_sequence_get_bounds_size ( n_GDrawCommandSequence sequence)

Gets the n_GSize demarking the outside of a n_GDrawCommandSequence.

Note
When being drawn, this doesn't actually do anything: The image contents aren't cropped to this bounds size.

◆ n_gdraw_command_sequence_get_frame_by_elapsed()

n_GDrawCommandFrame* n_gdraw_command_sequence_get_frame_by_elapsed ( n_GDrawCommandSequence sequence,
uint32_t  ms 
)

Gets the frame of a given n_GDrawCommandSequence based on a given elapsed time.

◆ n_gdraw_command_sequence_get_frame_by_index()

n_GDrawCommandFrame* n_gdraw_command_sequence_get_frame_by_index ( n_GDrawCommandSequence sequence,
uint32_t  index 
)

Gets the frame of a given n_GDrawCommandSequence based on its index.

◆ n_gdraw_command_sequence_get_num_frames()

uint16_t n_gdraw_command_sequence_get_num_frames ( n_GDrawCommandSequence sequence)

Gets amount of frames in a n_GDrawCommandSequence.

◆ n_gdraw_command_sequence_get_play_count()

uint32_t n_gdraw_command_sequence_get_play_count ( n_GDrawCommandSequence sequence)

Gets the play count of a given n_GDrawCommandSequence. (0: infinity)

◆ n_gdraw_command_sequence_get_total_duration()

uint32_t n_gdraw_command_sequence_get_total_duration ( n_GDrawCommandSequence sequence)

Gets the total duration of a n_GDrawCommandSequence.

◆ n_gdraw_command_sequence_set_bounds_size()

void n_gdraw_command_sequence_set_bounds_size ( n_GDrawCommandSequence sequence,
n_GSize  size 
)

Sets the n_GSize demarking the outside of a n_GDrawCommandSequence.

Note
When being drawn, this doesn't actually do anything: The image contents aren't cropped to this bounds size.

◆ n_gdraw_command_sequence_set_play_count()

void n_gdraw_command_sequence_set_play_count ( n_GDrawCommandSequence sequence,
uint16_t  play_count 
)

Sets the play count of a given n_GDrawCommandSequence. (0: infinity)

◆ n_gdraw_command_set_fill_color()

void n_gdraw_command_set_fill_color ( n_GDrawCommand command,
n_GColor  fill_color 
)

Sets the fill n_GColor of a given n_GDrawCommand.

◆ n_gdraw_command_set_hidden()

void n_gdraw_command_set_hidden ( n_GDrawCommand command,
bool  hidden 
)

Sets the visibility of a given n_GDrawCommand.

◆ n_gdraw_command_set_path_open()

void n_gdraw_command_set_path_open ( n_GDrawCommand command,
bool  path_open 
)

Sets whether the given n_GDrawCommand is open at the ends (assuming its n_GDrawCommandType is n_GDrawCommandTypePath or n_GDrawCommandTypePrecisePath).

◆ n_gdraw_command_set_point()

void n_gdraw_command_set_point ( n_GDrawCommand command,
uint16_t  index,
n_GPoint  point 
)

Sets the n_GPoint at a given index of a given n_GDrawCommand.

◆ n_gdraw_command_set_radius()

void n_gdraw_command_set_radius ( n_GDrawCommand command,
uint16_t  radius 
)

Sets the radius of a given n_GDrawCommand (assuming its n_GDrawCommandType is n_GDrawCommandTypeCircle or n_GDrawCommandTypePreciseCircle).

◆ n_gdraw_command_set_stroke_color()

void n_gdraw_command_set_stroke_color ( n_GDrawCommand command,
n_GColor  stroke_color 
)

Sets the stroke n_GColor of a given n_GDrawCommand.

◆ n_gdraw_command_set_stroke_width()

void n_gdraw_command_set_stroke_width ( n_GDrawCommand command,
uint8_t  stroke_width 
)

Sets the stroke width of a given n_GDrawCommand.