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 } |
Tiny, modifiable, animatable vector graphics.
typedef enum n_GDrawCommandBWColor 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.
typedef struct n_GDrawCommandFlags 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)
typedef enum n_GDrawCommandType n_GDrawCommandType |
The draw command type attribute of a draw command describes the command's type. The precise
versions allow for subpixel alignment.
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.
enum n_GDrawCommandType |
The draw command type attribute of a draw command describes the command's type. The precise
versions allow for subpixel alignment.
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.
void n_gdraw_command_draw | ( | n_GContext * | ctx, |
n_GDrawCommand * | command, | ||
n_GPoint | offset | ||
) |
Draws a n_GDrawCommand at a given offset.
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_GDrawCommandList* n_gdraw_command_frame_get_command_list | ( | n_GDrawCommandFrame * | frame | ) |
Gets the n_GDrawCommandList of a given n_GDrawCommandFrame.
uint16_t n_gdraw_command_frame_get_duration | ( | n_GDrawCommandFrame * | frame | ) |
Gets the duration of a n_GDrawCommandFrame.
void n_gdraw_command_frame_set_duration | ( | n_GDrawCommandFrame * | frame, |
uint16_t | duration | ||
) |
Sets the duration of a n_GDrawCommandFrame.
n_GColor n_gdraw_command_get_fill_color | ( | n_GDrawCommand * | command | ) |
Gets the fill n_GColor of a given n_GDrawCommand.
bool n_gdraw_command_get_hidden | ( | n_GDrawCommand * | command | ) |
Gets the visibility of a given n_GDrawCommand.
uint16_t n_gdraw_command_get_num_points | ( | n_GDrawCommand * | command | ) |
Gets the amount of n_GPoint(s) of a given n_GDrawCommand.
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_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.
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_GColor n_gdraw_command_get_stroke_color | ( | n_GDrawCommand * | command | ) |
Gets the stroke n_GColor of a given n_GDrawCommand.
uint8_t n_gdraw_command_get_stroke_width | ( | n_GDrawCommand * | command | ) |
Gets the stroke width of a given n_GDrawCommand.
n_GDrawCommandType n_gdraw_command_get_type | ( | n_GDrawCommand * | command | ) |
Gets the n_GDrawCommandType of a given n_GDrawCommand.
n_GDrawCommandImage* n_gdraw_command_image_clone | ( | n_GDrawCommandImage * | image | ) |
Duplicates a n_GDrawCommandImage.
n_GDrawCommandImage* n_gdraw_command_image_create_with_resource | ( | uint32_t | resource_id | ) |
Loads a n_GDrawCommandImage resource.
void n_gdraw_command_image_destroy | ( | n_GDrawCommandImage * | image | ) |
Frees a n_GDrawCommandImage.
void n_gdraw_command_image_draw | ( | n_GContext * | ctx, |
n_GDrawCommandImage * | image, | ||
n_GPoint | offset | ||
) |
Draws a n_GDrawCommandImage at a given offset.
n_GSize n_gdraw_command_image_get_bounds_size | ( | n_GDrawCommandImage * | image | ) |
Gets the n_GSize demarking the outside of a n_GDrawCommandImage.
n_GDrawCommandList* n_gdraw_command_image_get_command_list | ( | n_GDrawCommandImage * | image | ) |
Gets the n_GDrawCommandList of a given n_GDrawCommandImage.
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.
void n_gdraw_command_list_draw | ( | n_GContext * | ctx, |
n_GDrawCommandList * | list, | ||
n_GPoint | offset | ||
) |
Draws a n_GDrawCommandList at a given offset.
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.
uint32_t n_gdraw_command_list_get_num_commands | ( | n_GDrawCommandList * | list | ) |
Gets the amount of n_GDrawCommand(s) in a given n_GDrawCommandList.
void n_gdraw_command_list_iterate | ( | n_GDrawCommandList * | list, |
n_GDrawCommandListIteratorCb | cb, | ||
void * | cb_context | ||
) |
Iterates over n_GDrawCommand(s) in a n_GDrawCommandList.
n_GDrawCommandSequence* n_gdraw_command_sequence_clone | ( | n_GDrawCommandSequence * | image | ) |
Duplicates a n_GDrawCommandSequence.
n_GDrawCommandSequence* n_gdraw_command_sequence_create_with_resource | ( | uint32_t | resource_id | ) |
Loads a n_GDrawCommandSequence resource.
void n_gdraw_command_sequence_destroy | ( | n_GDrawCommandSequence * | sequence | ) |
Frees a n_GDrawCommandSequence.
n_GSize n_gdraw_command_sequence_get_bounds_size | ( | n_GDrawCommandSequence * | sequence | ) |
Gets the n_GSize demarking the outside of a n_GDrawCommandSequence.
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_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.
uint16_t n_gdraw_command_sequence_get_num_frames | ( | n_GDrawCommandSequence * | sequence | ) |
Gets amount of frames in a n_GDrawCommandSequence.
uint32_t n_gdraw_command_sequence_get_play_count | ( | n_GDrawCommandSequence * | sequence | ) |
Gets the play count of a given n_GDrawCommandSequence. (0: infinity)
uint32_t n_gdraw_command_sequence_get_total_duration | ( | n_GDrawCommandSequence * | sequence | ) |
Gets the total duration of a n_GDrawCommandSequence.
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.
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)
void n_gdraw_command_set_fill_color | ( | n_GDrawCommand * | command, |
n_GColor | fill_color | ||
) |
Sets the fill n_GColor of a given n_GDrawCommand.
void n_gdraw_command_set_hidden | ( | n_GDrawCommand * | command, |
bool | hidden | ||
) |
Sets the visibility of a given n_GDrawCommand.
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).
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.
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).
void n_gdraw_command_set_stroke_color | ( | n_GDrawCommand * | command, |
n_GColor | stroke_color | ||
) |
Sets the stroke n_GColor of a given n_GDrawCommand.
void n_gdraw_command_set_stroke_width | ( | n_GDrawCommand * | command, |
uint8_t | stroke_width | ||
) |
Sets the stroke width of a given n_GDrawCommand.