microvg  8.0.3
microvg
Data Structures | Typedefs | Functions
vg_path.h File Reference

MicroEJ MicroVG library low level API: implementation of Path. More...

#include "vg_configuration.h"
#include <sni.h>
#include <stddef.h>

Go to the source code of this file.

Data Structures

struct  MICROVG_PATH_HEADER
 Map a jbyte array that represents a path. More...
 

Typedefs

typedef struct MICROVG_PATH_HEADER VG_PATH_HEADER_t
 Map a jbyte array that represents a path.
 

Functions

uint8_t VG_PATH_get_path_encoder_format (void)
 Gets the path's array format used to encode the commands and parameters. This format is stored into the path's header. More...
 
uint32_t VG_PATH_convert_path_command (jint command)
 Converts the command in destination format. More...
 
void VG_PATH_initialize (void)
 Initializes the path builder. More...
 
uint32_t VG_PATH_get_path_header_size (void)
 Gets the path's array header size. More...
 
uint32_t VG_PATH_get_path_command_size (jint command, uint32_t nbParams)
 Gets the size to add in the path array to encode the command and its parameters. More...
 
uint32_t VG_PATH_append_path_command0 (jbyte *path, jint array_length, jint cmd)
 Appends the command with zero parameter in the path's array. More...
 
uint32_t VG_PATH_append_path_command1 (jbyte *path, jint array_length, jint cmd, jfloat x, jfloat y)
 Appends the command with 1 point parameter in the path's array. More...
 
uint32_t VG_PATH_append_path_command2 (jbyte *path, jint array_length, jint cmd, jfloat x1, jfloat y1, jfloat x2, jfloat y2)
 Appends the command with 2 points parameter in the path's array. More...
 
uint32_t VG_PATH_append_path_command3 (jbyte *path, jint array_length, jint cmd, jfloat x1, jfloat y1, jfloat x2, jfloat y2, jfloat x3, jfloat y3)
 Appends the command with 3 points parameter in the path's array. More...
 
uint32_t VG_PATH_get_command_parameter_number (jint command)
 Gets the number of parameters for a specific command. More...
 

Detailed Description

MicroEJ MicroVG library low level API: implementation of Path.

Author
MicroEJ Developer Team
Version
8.0.3

Definition in file vg_path.h.

Function Documentation

◆ VG_PATH_append_path_command0()

uint32_t VG_PATH_append_path_command0 ( jbyte *  path,
jint  array_length,
jint  cmd 
)

Appends the command with zero parameter in the path's array.

The caller ensures the path's array is large enough to encode the command and its parameters.

The default implementation uses 32-bit fields for the command and for each data.

Parameters
[in]paththe path's array
[in]array_lengththe length of the array
[in]cmdthe command to add
Returns
LLVG_SUCCESS on a success, or the missing space in the array in bytes
See also
VG_PATH_get_path_command_size(jint, uint32_t)

◆ VG_PATH_append_path_command1()

uint32_t VG_PATH_append_path_command1 ( jbyte *  path,
jint  array_length,
jint  cmd,
jfloat  x,
jfloat  y 
)

Appends the command with 1 point parameter in the path's array.

Parameters
[in]paththe path's array
[in]array_lengththe length of the array
[in]cmdthe command to add
[in]xthe command data 1.
[in]ythe command data 2.
Returns
LLVG_SUCCESS on a success, or the missing space in the array in bytes
See also
VG_PATH_append_path_command0()

◆ VG_PATH_append_path_command2()

uint32_t VG_PATH_append_path_command2 ( jbyte *  path,
jint  array_length,
jint  cmd,
jfloat  x1,
jfloat  y1,
jfloat  x2,
jfloat  y2 
)

Appends the command with 2 points parameter in the path's array.

Parameters
[in]paththe path's array
[in]array_lengththe length of the array
[in]cmdthe command to add
[in]x1the command data 1.
[in]y1the command data 2.
[in]x2the command data 3.
[in]y2the command data 4.
Returns
LLVG_SUCCESS on a success, or the missing space in the array in bytes
See also
VG_PATH_append_path_command0()

◆ VG_PATH_append_path_command3()

uint32_t VG_PATH_append_path_command3 ( jbyte *  path,
jint  array_length,
jint  cmd,
jfloat  x1,
jfloat  y1,
jfloat  x2,
jfloat  y2,
jfloat  x3,
jfloat  y3 
)

Appends the command with 3 points parameter in the path's array.

Parameters
[in]paththe path's array
[in]array_lengththe length of the array
[in]cmdthe command to add
[in]x1the command data 1.
[in]y1the command data 2.
[in]x2the command data 3.
[in]y2the command data 4.
[in]x3the command data 5.
[in]y3the command data 6.
Returns
LLVG_SUCCESS on a success, or the missing space in the array in bytes
See also
VG_PATH_append_path_command0()

◆ VG_PATH_convert_path_command()

uint32_t VG_PATH_convert_path_command ( jint  command)

Converts the command in destination format.

Parameters
[in]commandthe command to convert
Returns
the converted command

◆ VG_PATH_get_command_parameter_number()

uint32_t VG_PATH_get_command_parameter_number ( jint  command)

Gets the number of parameters for a specific command.

Parameters
[in]commandthe command.
Returns
the number of parameters for the given command.

◆ VG_PATH_get_path_command_size()

uint32_t VG_PATH_get_path_command_size ( jint  command,
uint32_t  nbParams 
)

Gets the size to add in the path array to encode the command and its parameters.

The default implementation uses 32-bit fields for the command and for each data.

Parameters
[in]commandthe command to add.
[in]nbParamsthe available number of command's parameters
Returns
the size to add in the path array.

◆ VG_PATH_get_path_encoder_format()

uint8_t VG_PATH_get_path_encoder_format ( void  )

Gets the path's array format used to encode the commands and parameters. This format is stored into the path's header.

Returns
the path's format

◆ VG_PATH_get_path_header_size()

uint32_t VG_PATH_get_path_header_size ( void  )

Gets the path's array header size.

The default implementation returns sizeof(VG_PATH_HEADER_t).

Returns
the size in bytes.

◆ VG_PATH_initialize()

void VG_PATH_initialize ( void  )

Initializes the path builder.

The default implementation does nothing.