This commit is contained in:
		
							parent
							
								
									5b678a432a
								
							
						
					
					
						commit
						25942b6ee3
					
				
					 12 changed files with 274 additions and 363 deletions
				
			
		| 
						 | 
				
			
			@ -351,7 +351,7 @@ extern "C" {
 | 
			
		|||
 * - the returned instance is freed in some way, either by using a consuming function or
 | 
			
		||||
 *   by explicitly calling `sp_bitmap_free`.
 | 
			
		||||
 */
 | 
			
		||||
Bitmap */*notnull*/ sp_bitmap_clone(const Bitmap *bitmap);
 | 
			
		||||
Bitmap */*notnull*/ sp_bitmap_clone(Bitmap */*notnull*/ bitmap);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Sets the state of all pixels in the [SPBitmap].
 | 
			
		||||
| 
						 | 
				
			
			@ -372,7 +372,7 @@ Bitmap */*notnull*/ sp_bitmap_clone(const Bitmap *bitmap);
 | 
			
		|||
 * - `bitmap` points to a valid [SPBitmap]
 | 
			
		||||
 * - `bitmap` is not written to or read from concurrently
 | 
			
		||||
 */
 | 
			
		||||
void sp_bitmap_fill(Bitmap *bitmap, bool value);
 | 
			
		||||
void sp_bitmap_fill(Bitmap */*notnull*/ bitmap, bool value);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Deallocates a [SPBitmap].
 | 
			
		||||
| 
						 | 
				
			
			@ -386,12 +386,10 @@ void sp_bitmap_fill(Bitmap *bitmap, bool value);
 | 
			
		|||
 * The caller has to make sure that:
 | 
			
		||||
 *
 | 
			
		||||
 * - `bitmap` points to a valid [SPBitmap]
 | 
			
		||||
 * - `bitmap` is not used concurrently or after bitmap call
 | 
			
		||||
 * - `bitmap` was not passed to another consuming function, e.g. to create a [SPCommand]
 | 
			
		||||
 *
 | 
			
		||||
 * [SPCommand]: [crate::SPCommand]
 | 
			
		||||
 */
 | 
			
		||||
void sp_bitmap_free(Bitmap *bitmap);
 | 
			
		||||
void sp_bitmap_free(Bitmap */*notnull*/ bitmap);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Gets the current value at the specified position in the [SPBitmap].
 | 
			
		||||
| 
						 | 
				
			
			@ -413,7 +411,7 @@ void sp_bitmap_free(Bitmap *bitmap);
 | 
			
		|||
 * - `bitmap` points to a valid [SPBitmap]
 | 
			
		||||
 * - `bitmap` is not written to concurrently
 | 
			
		||||
 */
 | 
			
		||||
bool sp_bitmap_get(const Bitmap *bitmap, size_t x, size_t y);
 | 
			
		||||
bool sp_bitmap_get(Bitmap */*notnull*/ bitmap, size_t x, size_t y);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Gets the height in pixels of the [SPBitmap] instance.
 | 
			
		||||
| 
						 | 
				
			
			@ -432,7 +430,7 @@ bool sp_bitmap_get(const Bitmap *bitmap, size_t x, size_t y);
 | 
			
		|||
 *
 | 
			
		||||
 * - `bitmap` points to a valid [SPBitmap]
 | 
			
		||||
 */
 | 
			
		||||
size_t sp_bitmap_height(const Bitmap *bitmap);
 | 
			
		||||
size_t sp_bitmap_height(Bitmap */*notnull*/ bitmap);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Loads a [SPBitmap] with the specified dimensions from the provided data.
 | 
			
		||||
| 
						 | 
				
			
			@ -465,8 +463,7 @@ size_t sp_bitmap_height(const Bitmap *bitmap);
 | 
			
		|||
 */
 | 
			
		||||
Bitmap *sp_bitmap_load(size_t width,
 | 
			
		||||
                       size_t height,
 | 
			
		||||
                       const uint8_t *data,
 | 
			
		||||
                       size_t data_length);
 | 
			
		||||
                       SPByteSlice data);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Creates a new [SPBitmap] with the specified dimensions.
 | 
			
		||||
| 
						 | 
				
			
			@ -531,7 +528,7 @@ Bitmap */*notnull*/ sp_bitmap_new_screen_sized(void);
 | 
			
		|||
 * - `bitmap` points to a valid [SPBitmap]
 | 
			
		||||
 * - `bitmap` is not written to or read from concurrently
 | 
			
		||||
 */
 | 
			
		||||
void sp_bitmap_set(Bitmap *bitmap, size_t x, size_t y, bool value);
 | 
			
		||||
void sp_bitmap_set(Bitmap */*notnull*/ bitmap, size_t x, size_t y, bool value);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Gets an unsafe reference to the data of the [SPBitmap] instance.
 | 
			
		||||
| 
						 | 
				
			
			@ -548,7 +545,7 @@ void sp_bitmap_set(Bitmap *bitmap, size_t x, size_t y, bool value);
 | 
			
		|||
 * - the returned memory range is never accessed after the passed [SPBitmap] has been freed
 | 
			
		||||
 * - the returned memory range is never accessed concurrently, either via the [SPBitmap] or directly
 | 
			
		||||
 */
 | 
			
		||||
SPByteSlice sp_bitmap_unsafe_data_ref(Bitmap *bitmap);
 | 
			
		||||
SPByteSlice sp_bitmap_unsafe_data_ref(Bitmap */*notnull*/ bitmap);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Gets the width in pixels of the [SPBitmap] instance.
 | 
			
		||||
| 
						 | 
				
			
			@ -567,7 +564,7 @@ SPByteSlice sp_bitmap_unsafe_data_ref(Bitmap *bitmap);
 | 
			
		|||
 *
 | 
			
		||||
 * - `bitmap` points to a valid [SPBitmap]
 | 
			
		||||
 */
 | 
			
		||||
size_t sp_bitmap_width(const Bitmap *bitmap);
 | 
			
		||||
size_t sp_bitmap_width(Bitmap */*notnull*/ bitmap);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Clones a [SPBitVec].
 | 
			
		||||
| 
						 | 
				
			
			@ -587,7 +584,7 @@ size_t sp_bitmap_width(const Bitmap *bitmap);
 | 
			
		|||
 * - the returned instance is freed in some way, either by using a consuming function or
 | 
			
		||||
 *   by explicitly calling `sp_bitvec_free`.
 | 
			
		||||
 */
 | 
			
		||||
SPBitVec */*notnull*/ sp_bitvec_clone(const SPBitVec *bit_vec);
 | 
			
		||||
SPBitVec */*notnull*/ sp_bitvec_clone(SPBitVec */*notnull*/ bit_vec);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Sets the value of all bits in the [SPBitVec].
 | 
			
		||||
| 
						 | 
				
			
			@ -608,7 +605,7 @@ SPBitVec */*notnull*/ sp_bitvec_clone(const SPBitVec *bit_vec);
 | 
			
		|||
 * - `bit_vec` points to a valid [SPBitVec]
 | 
			
		||||
 * - `bit_vec` is not written to or read from concurrently
 | 
			
		||||
 */
 | 
			
		||||
void sp_bitvec_fill(SPBitVec *bit_vec, bool value);
 | 
			
		||||
void sp_bitvec_fill(SPBitVec */*notnull*/ bit_vec, bool value);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Deallocates a [SPBitVec].
 | 
			
		||||
| 
						 | 
				
			
			@ -627,7 +624,7 @@ void sp_bitvec_fill(SPBitVec *bit_vec, bool value);
 | 
			
		|||
 *
 | 
			
		||||
 * [SPCommand]: [crate::SPCommand]
 | 
			
		||||
 */
 | 
			
		||||
void sp_bitvec_free(SPBitVec *bit_vec);
 | 
			
		||||
void sp_bitvec_free(SPBitVec */*notnull*/ bit_vec);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Gets the value of a bit from the [SPBitVec].
 | 
			
		||||
| 
						 | 
				
			
			@ -651,7 +648,7 @@ void sp_bitvec_free(SPBitVec *bit_vec);
 | 
			
		|||
 * - `bit_vec` points to a valid [SPBitVec]
 | 
			
		||||
 * - `bit_vec` is not written to concurrently
 | 
			
		||||
 */
 | 
			
		||||
bool sp_bitvec_get(const SPBitVec *bit_vec, size_t index);
 | 
			
		||||
bool sp_bitvec_get(SPBitVec */*notnull*/ bit_vec, size_t index);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Returns true if length is 0.
 | 
			
		||||
| 
						 | 
				
			
			@ -670,7 +667,7 @@ bool sp_bitvec_get(const SPBitVec *bit_vec, size_t index);
 | 
			
		|||
 *
 | 
			
		||||
 * - `bit_vec` points to a valid [SPBitVec]
 | 
			
		||||
 */
 | 
			
		||||
bool sp_bitvec_is_empty(const SPBitVec *bit_vec);
 | 
			
		||||
bool sp_bitvec_is_empty(SPBitVec */*notnull*/ bit_vec);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Gets the length of the [SPBitVec] in bits.
 | 
			
		||||
| 
						 | 
				
			
			@ -689,7 +686,7 @@ bool sp_bitvec_is_empty(const SPBitVec *bit_vec);
 | 
			
		|||
 *
 | 
			
		||||
 * - `bit_vec` points to a valid [SPBitVec]
 | 
			
		||||
 */
 | 
			
		||||
size_t sp_bitvec_len(const SPBitVec *bit_vec);
 | 
			
		||||
size_t sp_bitvec_len(SPBitVec */*notnull*/ bit_vec);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Interpret the data as a series of bits and load then into a new [SPBitVec] instance.
 | 
			
		||||
| 
						 | 
				
			
			@ -709,8 +706,7 @@ size_t sp_bitvec_len(const SPBitVec *bit_vec);
 | 
			
		|||
 * - the returned instance is freed in some way, either by using a consuming function or
 | 
			
		||||
 *   by explicitly calling `sp_bitvec_free`.
 | 
			
		||||
 */
 | 
			
		||||
SPBitVec */*notnull*/ sp_bitvec_load(const uint8_t *data,
 | 
			
		||||
                                     size_t data_length);
 | 
			
		||||
SPBitVec */*notnull*/ sp_bitvec_load(SPByteSlice data);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Creates a new [SPBitVec] instance.
 | 
			
		||||
| 
						 | 
				
			
			@ -755,7 +751,7 @@ SPBitVec */*notnull*/ sp_bitvec_new(size_t size);
 | 
			
		|||
 * - `bit_vec` points to a valid [SPBitVec]
 | 
			
		||||
 * - `bit_vec` is not written to or read from concurrently
 | 
			
		||||
 */
 | 
			
		||||
void sp_bitvec_set(SPBitVec *bit_vec, size_t index, bool value);
 | 
			
		||||
void sp_bitvec_set(SPBitVec */*notnull*/ bit_vec, size_t index, bool value);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Gets an unsafe reference to the data of the [SPBitVec] instance.
 | 
			
		||||
| 
						 | 
				
			
			@ -776,7 +772,7 @@ void sp_bitvec_set(SPBitVec *bit_vec, size_t index, bool value);
 | 
			
		|||
 * - the returned memory range is never accessed after the passed [SPBitVec] has been freed
 | 
			
		||||
 * - the returned memory range is never accessed concurrently, either via the [SPBitVec] or directly
 | 
			
		||||
 */
 | 
			
		||||
SPByteSlice sp_bitvec_unsafe_data_ref(SPBitVec *bit_vec);
 | 
			
		||||
SPByteSlice sp_bitvec_unsafe_data_ref(SPBitVec */*notnull*/ bit_vec);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Clones a [SPBrightnessGrid].
 | 
			
		||||
| 
						 | 
				
			
			@ -800,7 +796,7 @@ SPByteSlice sp_bitvec_unsafe_data_ref(SPBitVec *bit_vec);
 | 
			
		|||
 * - the returned instance is freed in some way, either by using a consuming function or
 | 
			
		||||
 *   by explicitly calling `sp_brightness_grid_free`.
 | 
			
		||||
 */
 | 
			
		||||
BrightnessGrid */*notnull*/ sp_brightness_grid_clone(const BrightnessGrid *brightness_grid);
 | 
			
		||||
BrightnessGrid */*notnull*/ sp_brightness_grid_clone(BrightnessGrid */*notnull*/ brightness_grid);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Sets the value of all cells in the [SPBrightnessGrid].
 | 
			
		||||
| 
						 | 
				
			
			@ -822,7 +818,8 @@ BrightnessGrid */*notnull*/ sp_brightness_grid_clone(const BrightnessGrid *brigh
 | 
			
		|||
 * - `brightness_grid` points to a valid [SPBrightnessGrid]
 | 
			
		||||
 * - `brightness_grid` is not written to or read from concurrently
 | 
			
		||||
 */
 | 
			
		||||
void sp_brightness_grid_fill(BrightnessGrid *brightness_grid, uint8_t value);
 | 
			
		||||
void sp_brightness_grid_fill(BrightnessGrid */*notnull*/ brightness_grid,
 | 
			
		||||
                             uint8_t value);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Deallocates a [SPBrightnessGrid].
 | 
			
		||||
| 
						 | 
				
			
			@ -845,7 +842,7 @@ void sp_brightness_grid_fill(BrightnessGrid *brightness_grid, uint8_t value);
 | 
			
		|||
 *
 | 
			
		||||
 * [SPCommand]: [crate::SPCommand]
 | 
			
		||||
 */
 | 
			
		||||
void sp_brightness_grid_free(BrightnessGrid *brightness_grid);
 | 
			
		||||
void sp_brightness_grid_free(BrightnessGrid */*notnull*/ brightness_grid);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Gets the current value at the specified position.
 | 
			
		||||
| 
						 | 
				
			
			@ -869,7 +866,7 @@ void sp_brightness_grid_free(BrightnessGrid *brightness_grid);
 | 
			
		|||
 * - `brightness_grid` points to a valid [SPBrightnessGrid]
 | 
			
		||||
 * - `brightness_grid` is not written to concurrently
 | 
			
		||||
 */
 | 
			
		||||
uint8_t sp_brightness_grid_get(const BrightnessGrid *brightness_grid,
 | 
			
		||||
uint8_t sp_brightness_grid_get(BrightnessGrid */*notnull*/ brightness_grid,
 | 
			
		||||
                               size_t x,
 | 
			
		||||
                               size_t y);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -892,7 +889,7 @@ uint8_t sp_brightness_grid_get(const BrightnessGrid *brightness_grid,
 | 
			
		|||
 *
 | 
			
		||||
 * - `brightness_grid` points to a valid [SPBrightnessGrid]
 | 
			
		||||
 */
 | 
			
		||||
size_t sp_brightness_grid_height(const BrightnessGrid *brightness_grid);
 | 
			
		||||
size_t sp_brightness_grid_height(BrightnessGrid */*notnull*/ brightness_grid);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Loads a [SPBrightnessGrid] with the specified dimensions from the provided data.
 | 
			
		||||
| 
						 | 
				
			
			@ -915,8 +912,7 @@ size_t sp_brightness_grid_height(const BrightnessGrid *brightness_grid);
 | 
			
		|||
 */
 | 
			
		||||
BrightnessGrid *sp_brightness_grid_load(size_t width,
 | 
			
		||||
                                        size_t height,
 | 
			
		||||
                                        const uint8_t *data,
 | 
			
		||||
                                        size_t data_length);
 | 
			
		||||
                                        SPByteSlice data);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Creates a new [SPBrightnessGrid] with the specified dimensions.
 | 
			
		||||
| 
						 | 
				
			
			@ -957,7 +953,7 @@ BrightnessGrid */*notnull*/ sp_brightness_grid_new(size_t width,
 | 
			
		|||
 * - `brightness_grid` points to a valid [SPBrightnessGrid]
 | 
			
		||||
 * - `brightness_grid` is not written to or read from concurrently
 | 
			
		||||
 */
 | 
			
		||||
void sp_brightness_grid_set(BrightnessGrid *brightness_grid,
 | 
			
		||||
void sp_brightness_grid_set(BrightnessGrid */*notnull*/ brightness_grid,
 | 
			
		||||
                            size_t x,
 | 
			
		||||
                            size_t y,
 | 
			
		||||
                            uint8_t value);
 | 
			
		||||
| 
						 | 
				
			
			@ -983,7 +979,7 @@ void sp_brightness_grid_set(BrightnessGrid *brightness_grid,
 | 
			
		|||
 * - the returned memory range is never accessed after the passed [SPBrightnessGrid] has been freed
 | 
			
		||||
 * - the returned memory range is never accessed concurrently, either via the [SPBrightnessGrid] or directly
 | 
			
		||||
 */
 | 
			
		||||
SPByteSlice sp_brightness_grid_unsafe_data_ref(BrightnessGrid *brightness_grid);
 | 
			
		||||
SPByteSlice sp_brightness_grid_unsafe_data_ref(BrightnessGrid */*notnull*/ brightness_grid);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Gets the width of the [SPBrightnessGrid] instance.
 | 
			
		||||
| 
						 | 
				
			
			@ -1004,7 +1000,7 @@ SPByteSlice sp_brightness_grid_unsafe_data_ref(BrightnessGrid *brightness_grid);
 | 
			
		|||
 *
 | 
			
		||||
 * - `brightness_grid` points to a valid [SPBrightnessGrid]
 | 
			
		||||
 */
 | 
			
		||||
size_t sp_brightness_grid_width(const BrightnessGrid *brightness_grid);
 | 
			
		||||
size_t sp_brightness_grid_width(BrightnessGrid */*notnull*/ brightness_grid);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Clones a [SPCharGrid].
 | 
			
		||||
| 
						 | 
				
			
			@ -1024,7 +1020,7 @@ size_t sp_brightness_grid_width(const BrightnessGrid *brightness_grid);
 | 
			
		|||
 * - the returned instance is freed in some way, either by using a consuming function or
 | 
			
		||||
 *   by explicitly calling `sp_char_grid_free`.
 | 
			
		||||
 */
 | 
			
		||||
CharGrid */*notnull*/ sp_char_grid_clone(const CharGrid *char_grid);
 | 
			
		||||
CharGrid */*notnull*/ sp_char_grid_clone(CharGrid */*notnull*/ char_grid);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Sets the value of all cells in the [SPCharGrid].
 | 
			
		||||
| 
						 | 
				
			
			@ -1045,7 +1041,7 @@ CharGrid */*notnull*/ sp_char_grid_clone(const CharGrid *char_grid);
 | 
			
		|||
 * - `char_grid` points to a valid [SPCharGrid]
 | 
			
		||||
 * - `char_grid` is not written to or read from concurrently
 | 
			
		||||
 */
 | 
			
		||||
void sp_char_grid_fill(CharGrid *char_grid, uint32_t value);
 | 
			
		||||
void sp_char_grid_fill(CharGrid */*notnull*/ char_grid, uint32_t value);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Deallocates a [SPCharGrid].
 | 
			
		||||
| 
						 | 
				
			
			@ -1064,7 +1060,7 @@ void sp_char_grid_fill(CharGrid *char_grid, uint32_t value);
 | 
			
		|||
 *
 | 
			
		||||
 * [SPCommand]: [crate::SPCommand]
 | 
			
		||||
 */
 | 
			
		||||
void sp_char_grid_free(CharGrid *char_grid);
 | 
			
		||||
void sp_char_grid_free(CharGrid */*notnull*/ char_grid);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Gets the current value at the specified position.
 | 
			
		||||
| 
						 | 
				
			
			@ -1086,7 +1082,7 @@ void sp_char_grid_free(CharGrid *char_grid);
 | 
			
		|||
 * - `char_grid` points to a valid [SPCharGrid]
 | 
			
		||||
 * - `char_grid` is not written to concurrently
 | 
			
		||||
 */
 | 
			
		||||
uint32_t sp_char_grid_get(const CharGrid *char_grid, size_t x, size_t y);
 | 
			
		||||
uint32_t sp_char_grid_get(CharGrid */*notnull*/ char_grid, size_t x, size_t y);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Gets the height of the [SPCharGrid] instance.
 | 
			
		||||
| 
						 | 
				
			
			@ -1105,7 +1101,7 @@ uint32_t sp_char_grid_get(const CharGrid *char_grid, size_t x, size_t y);
 | 
			
		|||
 *
 | 
			
		||||
 * - `char_grid` points to a valid [SPCharGrid]
 | 
			
		||||
 */
 | 
			
		||||
size_t sp_char_grid_height(const CharGrid *char_grid);
 | 
			
		||||
size_t sp_char_grid_height(CharGrid */*notnull*/ char_grid);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Loads a [SPCharGrid] with the specified dimensions from the provided data.
 | 
			
		||||
| 
						 | 
				
			
			@ -1129,8 +1125,7 @@ size_t sp_char_grid_height(const CharGrid *char_grid);
 | 
			
		|||
 */
 | 
			
		||||
CharGrid */*notnull*/ sp_char_grid_load(size_t width,
 | 
			
		||||
                                        size_t height,
 | 
			
		||||
                                        const uint8_t *data,
 | 
			
		||||
                                        size_t data_length);
 | 
			
		||||
                                        SPByteSlice data);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Creates a new [SPCharGrid] with the specified dimensions.
 | 
			
		||||
| 
						 | 
				
			
			@ -1172,7 +1167,10 @@ CharGrid */*notnull*/ sp_char_grid_new(size_t width,
 | 
			
		|||
 *
 | 
			
		||||
 * [SPBitVec]: [crate::SPBitVec]
 | 
			
		||||
 */
 | 
			
		||||
void sp_char_grid_set(CharGrid *char_grid, size_t x, size_t y, uint32_t value);
 | 
			
		||||
void sp_char_grid_set(CharGrid */*notnull*/ char_grid,
 | 
			
		||||
                      size_t x,
 | 
			
		||||
                      size_t y,
 | 
			
		||||
                      uint32_t value);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Gets the width of the [SPCharGrid] instance.
 | 
			
		||||
| 
						 | 
				
			
			@ -1191,7 +1189,7 @@ void sp_char_grid_set(CharGrid *char_grid, size_t x, size_t y, uint32_t value);
 | 
			
		|||
 *
 | 
			
		||||
 * - `char_grid` points to a valid [SPCharGrid]
 | 
			
		||||
 */
 | 
			
		||||
size_t sp_char_grid_width(const CharGrid *char_grid);
 | 
			
		||||
size_t sp_char_grid_width(CharGrid */*notnull*/ char_grid);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Set pixel data starting at the pixel offset on screen.
 | 
			
		||||
| 
						 | 
				
			
			@ -1221,7 +1219,7 @@ size_t sp_char_grid_width(const CharGrid *char_grid);
 | 
			
		|||
 *   by explicitly calling `sp_command_free`.
 | 
			
		||||
 */
 | 
			
		||||
Command *sp_command_bitmap_linear(size_t offset,
 | 
			
		||||
                                  SPBitVec *bit_vec,
 | 
			
		||||
                                  SPBitVec */*notnull*/ bit_vec,
 | 
			
		||||
                                  CompressionCode compression);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
| 
						 | 
				
			
			@ -1252,7 +1250,7 @@ Command *sp_command_bitmap_linear(size_t offset,
 | 
			
		|||
 *   by explicitly calling `sp_command_free`.
 | 
			
		||||
 */
 | 
			
		||||
Command *sp_command_bitmap_linear_and(size_t offset,
 | 
			
		||||
                                      SPBitVec *bit_vec,
 | 
			
		||||
                                      SPBitVec */*notnull*/ bit_vec,
 | 
			
		||||
                                      CompressionCode compression);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
| 
						 | 
				
			
			@ -1283,7 +1281,7 @@ Command *sp_command_bitmap_linear_and(size_t offset,
 | 
			
		|||
 *   by explicitly calling `sp_command_free`.
 | 
			
		||||
 */
 | 
			
		||||
Command *sp_command_bitmap_linear_or(size_t offset,
 | 
			
		||||
                                     SPBitVec *bit_vec,
 | 
			
		||||
                                     SPBitVec */*notnull*/ bit_vec,
 | 
			
		||||
                                     CompressionCode compression);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
| 
						 | 
				
			
			@ -1310,7 +1308,7 @@ Command *sp_command_bitmap_linear_or(size_t offset,
 | 
			
		|||
 */
 | 
			
		||||
Command *sp_command_bitmap_linear_win(size_t x,
 | 
			
		||||
                                      size_t y,
 | 
			
		||||
                                      Bitmap *bitmap,
 | 
			
		||||
                                      Bitmap */*notnull*/ bitmap,
 | 
			
		||||
                                      CompressionCode compression);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
| 
						 | 
				
			
			@ -1341,7 +1339,7 @@ Command *sp_command_bitmap_linear_win(size_t x,
 | 
			
		|||
 *   by explicitly calling `sp_command_free`.
 | 
			
		||||
 */
 | 
			
		||||
Command *sp_command_bitmap_linear_xor(size_t offset,
 | 
			
		||||
                                      SPBitVec *bit_vec,
 | 
			
		||||
                                      SPBitVec */*notnull*/ bit_vec,
 | 
			
		||||
                                      CompressionCode compression);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
| 
						 | 
				
			
			@ -1384,7 +1382,7 @@ Command */*notnull*/ sp_command_brightness(uint8_t brightness);
 | 
			
		|||
 */
 | 
			
		||||
Command */*notnull*/ sp_command_char_brightness(size_t x,
 | 
			
		||||
                                                size_t y,
 | 
			
		||||
                                                BrightnessGrid *grid);
 | 
			
		||||
                                                BrightnessGrid */*notnull*/ grid);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Set all pixels to the off state.
 | 
			
		||||
| 
						 | 
				
			
			@ -1426,7 +1424,7 @@ Command */*notnull*/ sp_command_clear(void);
 | 
			
		|||
 * - the returned [SPCommand] instance is freed in some way, either by using a consuming function or
 | 
			
		||||
 *   by explicitly calling `sp_command_free`.
 | 
			
		||||
 */
 | 
			
		||||
Command */*notnull*/ sp_command_clone(const Command *command);
 | 
			
		||||
Command */*notnull*/ sp_command_clone(Command */*notnull*/ command);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Show codepage 437 encoded text on the screen.
 | 
			
		||||
| 
						 | 
				
			
			@ -1450,7 +1448,7 @@ Command */*notnull*/ sp_command_clone(const Command *command);
 | 
			
		|||
 */
 | 
			
		||||
Command */*notnull*/ sp_command_cp437_data(size_t x,
 | 
			
		||||
                                           size_t y,
 | 
			
		||||
                                           Cp437Grid *grid);
 | 
			
		||||
                                           Cp437Grid */*notnull*/ grid);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * A yet-to-be-tested command.
 | 
			
		||||
| 
						 | 
				
			
			@ -1488,7 +1486,7 @@ Command */*notnull*/ sp_command_fade_out(void);
 | 
			
		|||
 * - `command` is not used concurrently or after this call
 | 
			
		||||
 * - `command` was not passed to another consuming function, e.g. to create a [SPPacket]
 | 
			
		||||
 */
 | 
			
		||||
void sp_command_free(Command *command);
 | 
			
		||||
void sp_command_free(Command */*notnull*/ command);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Kills the udp daemon on the display, which usually results in a restart.
 | 
			
		||||
| 
						 | 
				
			
			@ -1541,7 +1539,7 @@ Command */*notnull*/ sp_command_hard_reset(void);
 | 
			
		|||
 * - the returned [SPCommand] instance is freed in some way, either by using a consuming function or
 | 
			
		||||
 *   by explicitly calling `sp_command_free`.
 | 
			
		||||
 */
 | 
			
		||||
Command *sp_command_try_from_packet(Packet *packet);
 | 
			
		||||
Command *sp_command_try_from_packet(Packet */*notnull*/ packet);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Show UTF-8 encoded text on the screen.
 | 
			
		||||
| 
						 | 
				
			
			@ -1565,7 +1563,7 @@ Command *sp_command_try_from_packet(Packet *packet);
 | 
			
		|||
 */
 | 
			
		||||
Command */*notnull*/ sp_command_utf8_data(size_t x,
 | 
			
		||||
                                          size_t y,
 | 
			
		||||
                                          CharGrid *grid);
 | 
			
		||||
                                          CharGrid */*notnull*/ grid);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Closes and deallocates a [SPConnection].
 | 
			
		||||
| 
						 | 
				
			
			@ -1581,7 +1579,7 @@ Command */*notnull*/ sp_command_utf8_data(size_t x,
 | 
			
		|||
 * - `connection` points to a valid [SPConnection]
 | 
			
		||||
 * - `connection` is not used concurrently or after this call
 | 
			
		||||
 */
 | 
			
		||||
void sp_connection_free(UdpConnection *connection);
 | 
			
		||||
void sp_connection_free(UdpConnection */*notnull*/ connection);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Creates a new instance of [SPConnection].
 | 
			
		||||
| 
						 | 
				
			
			@ -1599,7 +1597,7 @@ void sp_connection_free(UdpConnection *connection);
 | 
			
		|||
 * - the returned instance is freed in some way, either by using a consuming function or
 | 
			
		||||
 *   by explicitly calling `sp_connection_free`.
 | 
			
		||||
 */
 | 
			
		||||
UdpConnection *sp_connection_open(const char *host);
 | 
			
		||||
UdpConnection *sp_connection_open(char */*notnull*/ host);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Sends a [SPCommand] to the display using the [SPConnection].
 | 
			
		||||
| 
						 | 
				
			
			@ -1621,8 +1619,8 @@ UdpConnection *sp_connection_open(const char *host);
 | 
			
		|||
 * - `command` points to a valid instance of [SPPacket]
 | 
			
		||||
 * - `command` is not used concurrently or after this call
 | 
			
		||||
 */
 | 
			
		||||
bool sp_connection_send_command(const UdpConnection *connection,
 | 
			
		||||
                                Command *command);
 | 
			
		||||
bool sp_connection_send_command(UdpConnection */*notnull*/ connection,
 | 
			
		||||
                                Command */*notnull*/ command);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Sends a [SPPacket] to the display using the [SPConnection].
 | 
			
		||||
| 
						 | 
				
			
			@ -1644,7 +1642,8 @@ bool sp_connection_send_command(const UdpConnection *connection,
 | 
			
		|||
 * - `packet` points to a valid instance of [SPPacket]
 | 
			
		||||
 * - `packet` is not used concurrently or after this call
 | 
			
		||||
 */
 | 
			
		||||
bool sp_connection_send_packet(const UdpConnection *connection, Packet *packet);
 | 
			
		||||
bool sp_connection_send_packet(UdpConnection */*notnull*/ connection,
 | 
			
		||||
                               Packet */*notnull*/ packet);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Clones a [SPCp437Grid].
 | 
			
		||||
| 
						 | 
				
			
			@ -1664,7 +1663,7 @@ bool sp_connection_send_packet(const UdpConnection *connection, Packet *packet);
 | 
			
		|||
 * - the returned instance is freed in some way, either by using a consuming function or
 | 
			
		||||
 *   by explicitly calling `sp_cp437_grid_free`.
 | 
			
		||||
 */
 | 
			
		||||
Cp437Grid */*notnull*/ sp_cp437_grid_clone(const Cp437Grid *cp437_grid);
 | 
			
		||||
Cp437Grid */*notnull*/ sp_cp437_grid_clone(Cp437Grid */*notnull*/ cp437_grid);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Sets the value of all cells in the [SPCp437Grid].
 | 
			
		||||
| 
						 | 
				
			
			@ -1685,7 +1684,7 @@ Cp437Grid */*notnull*/ sp_cp437_grid_clone(const Cp437Grid *cp437_grid);
 | 
			
		|||
 * - `cp437_grid` points to a valid [SPCp437Grid]
 | 
			
		||||
 * - `cp437_grid` is not written to or read from concurrently
 | 
			
		||||
 */
 | 
			
		||||
void sp_cp437_grid_fill(Cp437Grid *cp437_grid, uint8_t value);
 | 
			
		||||
void sp_cp437_grid_fill(Cp437Grid */*notnull*/ cp437_grid, uint8_t value);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Deallocates a [SPCp437Grid].
 | 
			
		||||
| 
						 | 
				
			
			@ -1704,7 +1703,7 @@ void sp_cp437_grid_fill(Cp437Grid *cp437_grid, uint8_t value);
 | 
			
		|||
 *
 | 
			
		||||
 * [SPCommand]: [crate::SPCommand]
 | 
			
		||||
 */
 | 
			
		||||
void sp_cp437_grid_free(Cp437Grid *cp437_grid);
 | 
			
		||||
void sp_cp437_grid_free(Cp437Grid */*notnull*/ cp437_grid);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Gets the current value at the specified position.
 | 
			
		||||
| 
						 | 
				
			
			@ -1726,7 +1725,9 @@ void sp_cp437_grid_free(Cp437Grid *cp437_grid);
 | 
			
		|||
 * - `cp437_grid` points to a valid [SPCp437Grid]
 | 
			
		||||
 * - `cp437_grid` is not written to concurrently
 | 
			
		||||
 */
 | 
			
		||||
uint8_t sp_cp437_grid_get(const Cp437Grid *cp437_grid, size_t x, size_t y);
 | 
			
		||||
uint8_t sp_cp437_grid_get(Cp437Grid */*notnull*/ cp437_grid,
 | 
			
		||||
                          size_t x,
 | 
			
		||||
                          size_t y);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Gets the height of the [SPCp437Grid] instance.
 | 
			
		||||
| 
						 | 
				
			
			@ -1745,7 +1746,7 @@ uint8_t sp_cp437_grid_get(const Cp437Grid *cp437_grid, size_t x, size_t y);
 | 
			
		|||
 *
 | 
			
		||||
 * - `cp437_grid` points to a valid [SPCp437Grid]
 | 
			
		||||
 */
 | 
			
		||||
size_t sp_cp437_grid_height(const Cp437Grid *cp437_grid);
 | 
			
		||||
size_t sp_cp437_grid_height(Cp437Grid */*notnull*/ cp437_grid);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Loads a [SPCp437Grid] with the specified dimensions from the provided data.
 | 
			
		||||
| 
						 | 
				
			
			@ -1768,8 +1769,7 @@ size_t sp_cp437_grid_height(const Cp437Grid *cp437_grid);
 | 
			
		|||
 */
 | 
			
		||||
Cp437Grid *sp_cp437_grid_load(size_t width,
 | 
			
		||||
                              size_t height,
 | 
			
		||||
                              const uint8_t *data,
 | 
			
		||||
                              size_t data_length);
 | 
			
		||||
                              SPByteSlice data);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Creates a new [SPCp437Grid] with the specified dimensions.
 | 
			
		||||
| 
						 | 
				
			
			@ -1811,7 +1811,7 @@ Cp437Grid */*notnull*/ sp_cp437_grid_new(size_t width,
 | 
			
		|||
 *
 | 
			
		||||
 * [SPBitVec]: [crate::SPBitVec]
 | 
			
		||||
 */
 | 
			
		||||
void sp_cp437_grid_set(Cp437Grid *cp437_grid,
 | 
			
		||||
void sp_cp437_grid_set(Cp437Grid */*notnull*/ cp437_grid,
 | 
			
		||||
                       size_t x,
 | 
			
		||||
                       size_t y,
 | 
			
		||||
                       uint8_t value);
 | 
			
		||||
| 
						 | 
				
			
			@ -1833,7 +1833,7 @@ void sp_cp437_grid_set(Cp437Grid *cp437_grid,
 | 
			
		|||
 * - the returned memory range is never accessed after the passed [SPCp437Grid] has been freed
 | 
			
		||||
 * - the returned memory range is never accessed concurrently, either via the [SPCp437Grid] or directly
 | 
			
		||||
 */
 | 
			
		||||
SPByteSlice sp_cp437_grid_unsafe_data_ref(Cp437Grid *cp437_grid);
 | 
			
		||||
SPByteSlice sp_cp437_grid_unsafe_data_ref(Cp437Grid */*notnull*/ cp437_grid);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Gets the width of the [SPCp437Grid] instance.
 | 
			
		||||
| 
						 | 
				
			
			@ -1852,7 +1852,7 @@ SPByteSlice sp_cp437_grid_unsafe_data_ref(Cp437Grid *cp437_grid);
 | 
			
		|||
 *
 | 
			
		||||
 * - `cp437_grid` points to a valid [SPCp437Grid]
 | 
			
		||||
 */
 | 
			
		||||
size_t sp_cp437_grid_width(const Cp437Grid *cp437_grid);
 | 
			
		||||
size_t sp_cp437_grid_width(Cp437Grid */*notnull*/ cp437_grid);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Clones a [SPPacket].
 | 
			
		||||
| 
						 | 
				
			
			@ -1872,7 +1872,7 @@ size_t sp_cp437_grid_width(const Cp437Grid *cp437_grid);
 | 
			
		|||
 * - the returned instance is freed in some way, either by using a consuming function or
 | 
			
		||||
 *   by explicitly calling `sp_packet_free`.
 | 
			
		||||
 */
 | 
			
		||||
Packet */*notnull*/ sp_packet_clone(const Packet *packet);
 | 
			
		||||
Packet */*notnull*/ sp_packet_clone(Packet */*notnull*/ packet);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Deallocates a [SPPacket].
 | 
			
		||||
| 
						 | 
				
			
			@ -1888,7 +1888,7 @@ Packet */*notnull*/ sp_packet_clone(const Packet *packet);
 | 
			
		|||
 * - `packet` points to a valid [SPPacket]
 | 
			
		||||
 * - `packet` is not used concurrently or after this call
 | 
			
		||||
 */
 | 
			
		||||
void sp_packet_free(Packet *packet);
 | 
			
		||||
void sp_packet_free(Packet */*notnull*/ packet);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Turns a [SPCommand] into a [SPPacket].
 | 
			
		||||
| 
						 | 
				
			
			@ -1909,7 +1909,7 @@ void sp_packet_free(Packet *packet);
 | 
			
		|||
 * - the returned [SPPacket] instance is freed in some way, either by using a consuming function or
 | 
			
		||||
 *   by explicitly calling `sp_packet_free`.
 | 
			
		||||
 */
 | 
			
		||||
Packet *sp_packet_from_command(Command *command);
 | 
			
		||||
Packet *sp_packet_from_command(Command */*notnull*/ command);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Creates a raw [SPPacket] from parts.
 | 
			
		||||
| 
						 | 
				
			
			@ -1938,14 +1938,13 @@ Packet *sp_packet_from_command(Command *command);
 | 
			
		|||
 *   by explicitly calling [sp_packet_free].
 | 
			
		||||
 */
 | 
			
		||||
Packet */*notnull*/ sp_packet_from_parts(Header header,
 | 
			
		||||
                                         const uint8_t *payload,
 | 
			
		||||
                                         size_t payload_len);
 | 
			
		||||
                                         const SPByteSlice *payload);
 | 
			
		||||
 | 
			
		||||
Header *sp_packet_get_header(Packet *packet);
 | 
			
		||||
Header */*notnull*/ sp_packet_get_header(Packet */*notnull*/ packet);
 | 
			
		||||
 | 
			
		||||
SPByteSlice sp_packet_get_payload(Packet *packet);
 | 
			
		||||
SPByteSlice sp_packet_get_payload(Packet */*notnull*/ packet);
 | 
			
		||||
 | 
			
		||||
void sp_packet_set_payload(Packet *packet, SPByteSlice data);
 | 
			
		||||
void sp_packet_set_payload(Packet */*notnull*/ packet, SPByteSlice data);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Tries to load a [SPPacket] from the passed array with the specified length.
 | 
			
		||||
| 
						 | 
				
			
			@ -1965,10 +1964,9 @@ void sp_packet_set_payload(Packet *packet, SPByteSlice data);
 | 
			
		|||
 * - the returned [SPPacket] instance is freed in some way, either by using a consuming function or
 | 
			
		||||
 *   by explicitly calling `sp_packet_free`.
 | 
			
		||||
 */
 | 
			
		||||
Packet *sp_packet_try_load(const uint8_t *data,
 | 
			
		||||
                           size_t length);
 | 
			
		||||
Packet *sp_packet_try_load(SPByteSlice data);
 | 
			
		||||
 | 
			
		||||
void sp_packet_write_to(const Packet *packet, SPByteSlice buffer);
 | 
			
		||||
void sp_packet_write_to(Packet */*notnull*/ packet, SPByteSlice buffer);
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}  // extern "C"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue