replace * with - for bullets in comments

This commit is contained in:
Vinzenz Schroeter 2024-08-29 19:39:18 +02:00
parent 5cb135c7e9
commit 14faeb1238
10 changed files with 211 additions and 127 deletions

View file

@ -44,7 +44,7 @@ impl Connection {
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `packet`: the packet-like to send /// - `packet`: the packet-like to send
/// ///
/// returns: Ok if packet was sent, otherwise socket error /// returns: Ok if packet was sent, otherwise socket error
/// ///

View file

@ -4,7 +4,7 @@ pub trait Grid<T> {
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `x` and `y`: position of the cell to read /// - `x` and `y`: position of the cell to read
/// ///
/// # Panics /// # Panics
/// ///
@ -15,7 +15,7 @@ pub trait Grid<T> {
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `x` and `y`: position of the cell to read /// - `x` and `y`: position of the cell to read
/// ///
/// # Panics /// # Panics
/// ///
@ -26,7 +26,7 @@ pub trait Grid<T> {
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `x` and `y`: position of the cell to read /// - `x` and `y`: position of the cell to read
/// ///
/// returns: Value at position or None /// returns: Value at position or None
fn get_optional(&self, x: isize, y: isize) -> Option<T> { fn get_optional(&self, x: isize, y: isize) -> Option<T> {
@ -41,7 +41,7 @@ pub trait Grid<T> {
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `x` and `y`: position of the cell to read /// - `x` and `y`: position of the cell to read
/// ///
/// returns: the old value or None /// returns: the old value or None
fn set_optional(&mut self, x: isize, y: isize, value: T) -> bool { fn set_optional(&mut self, x: isize, y: isize, value: T) -> bool {

View file

@ -17,8 +17,8 @@ impl PixelGrid {
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `width`: size in pixels in x-direction /// - `width`: size in pixels in x-direction
/// * `height`: size in pixels in y-direction /// - `height`: size in pixels in y-direction
/// ///
/// returns: `PixelGrid` initialized to all pixels off /// returns: `PixelGrid` initialized to all pixels off
/// ///
@ -44,8 +44,8 @@ impl PixelGrid {
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `width`: size in pixels in x-direction /// - `width`: size in pixels in x-direction
/// * `height`: size in pixels in y-direction /// - `height`: size in pixels in y-direction
/// ///
/// returns: `PixelGrid` that contains a copy of the provided data /// returns: `PixelGrid` that contains a copy of the provided data
/// ///
@ -121,8 +121,8 @@ impl Grid<bool> for PixelGrid {
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `x` and `y`: position of the cell /// - `x` and `y`: position of the cell
/// * `value`: the value to write to the cell /// - `value`: the value to write to the cell
/// ///
/// returns: old value of the cell /// returns: old value of the cell
/// ///
@ -143,8 +143,8 @@ impl Grid<bool> for PixelGrid {
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `this`: instance to write to /// - `this`: instance to write to
/// * `value`: the value to set all pixels to /// - `value`: the value to set all pixels to
fn fill(&mut self, value: bool) { fn fill(&mut self, value: bool) {
self.bit_vec.fill(value); self.bit_vec.fill(value);
} }

View file

@ -82,7 +82,7 @@ impl<T: PrimitiveGridType> PrimitiveGrid<T> {
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `x` and `y`: position of the cell /// - `x` and `y`: position of the cell
/// ///
/// # Panics /// # Panics
/// ///
@ -96,7 +96,7 @@ impl<T: PrimitiveGridType> PrimitiveGrid<T> {
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `x` and `y`: position of the cell /// - `x` and `y`: position of the cell
/// ///
/// returns: Reference to cell or None /// returns: Reference to cell or None
pub fn get_ref_mut_optional( pub fn get_ref_mut_optional(
@ -117,8 +117,8 @@ impl<T: PrimitiveGridType> Grid<T> for PrimitiveGrid<T> {
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `x` and `y`: position of the cell /// - `x` and `y`: position of the cell
/// * `value`: the value to write to the cell /// - `value`: the value to write to the cell
/// ///
/// # Panics /// # Panics
/// ///
@ -132,7 +132,7 @@ impl<T: PrimitiveGridType> Grid<T> for PrimitiveGrid<T> {
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `x` and `y`: position of the cell to read /// - `x` and `y`: position of the cell to read
/// ///
/// # Panics /// # Panics
/// ///

View file

@ -12,17 +12,38 @@
#define sp_PIXEL_COUNT (sp_PIXEL_WIDTH * sp_PIXEL_HEIGHT) #define sp_PIXEL_COUNT (sp_PIXEL_WIDTH * sp_PIXEL_HEIGHT)
/** /**
* screen height in pixels * Display height in pixels
*
* # Examples
*
* ```rust
* # use servicepoint::{PIXEL_HEIGHT, PIXEL_WIDTH, PixelGrid};
* let grid = PixelGrid::new(PIXEL_WIDTH, PIXEL_HEIGHT);
* ```
*/ */
#define sp_PIXEL_HEIGHT (sp_TILE_HEIGHT * sp_TILE_SIZE) #define sp_PIXEL_HEIGHT (sp_TILE_HEIGHT * sp_TILE_SIZE)
/** /**
* screen width in pixels * Display width in pixels
*
* # Examples
*
* ```rust
* # use servicepoint::{PIXEL_HEIGHT, PIXEL_WIDTH, PixelGrid};
* let grid = PixelGrid::new(PIXEL_WIDTH, PIXEL_HEIGHT);
* ```
*/ */
#define sp_PIXEL_WIDTH (sp_TILE_WIDTH * sp_TILE_SIZE) #define sp_PIXEL_WIDTH (sp_TILE_WIDTH * sp_TILE_SIZE)
/** /**
* tile count in the y-direction * Display tile count in the y-direction
*
* # Examples
*
* ```rust
* # use servicepoint::{Cp437Grid, TILE_HEIGHT, TILE_WIDTH};
* let grid = Cp437Grid::new(TILE_WIDTH, TILE_HEIGHT);
* ```
*/ */
#define sp_TILE_HEIGHT 20 #define sp_TILE_HEIGHT 20
@ -32,12 +53,32 @@
#define sp_TILE_SIZE 8 #define sp_TILE_SIZE 8
/** /**
* tile count in the x-direction * Display tile count in the x-direction
*
* # Examples
*
* ```rust
* # use servicepoint::{Cp437Grid, TILE_HEIGHT, TILE_WIDTH};
* let grid = Cp437Grid::new(TILE_WIDTH, TILE_HEIGHT);
* ```
*/ */
#define sp_TILE_WIDTH 56 #define sp_TILE_WIDTH 56
/** /**
* Specifies the kind of compression to use. Availability depends on features. * Specifies the kind of compression to use. Availability depends on features.
*
* # Examples
*
* ```rust
* # use servicepoint::{Command, CompressionCode, Origin, PixelGrid};
* // create command without payload compression
* # let pixels = PixelGrid::max_sized();
* _ = Command::BitmapLinearWin(Origin::new(0, 0), pixels, CompressionCode::Uncompressed);
*
* // create command with payload compressed with lzma and appropriate header flags
* # let pixels = PixelGrid::max_sized();
* _ = Command::BitmapLinearWin(Origin::new(0, 0), pixels, CompressionCode::Lzma);
* ```
*/ */
enum sp_CompressionCode enum sp_CompressionCode
#ifdef __cplusplus #ifdef __cplusplus
@ -71,6 +112,18 @@ typedef uint16_t sp_CompressionCode;
/** /**
* A display brightness value, checked for correct value range * A display brightness value, checked for correct value range
*
* # Examples
*
* ```
* # use servicepoint::{Brightness, Command, Connection};
* let b = Brightness::MAX;
* let val: u8 = b.into();
*
* let b = Brightness::try_from(7).unwrap();
* # let connection = Connection::open("127.0.0.1:2342").unwrap();
* let result = connection.send(Command::Brightness(b));
* ```
*/ */
typedef struct sp_Brightness sp_Brightness; typedef struct sp_Brightness sp_Brightness;
@ -79,17 +132,60 @@ typedef struct sp_Brightness sp_Brightness;
*/ */
typedef struct sp_CBitVec sp_CBitVec; typedef struct sp_CBitVec sp_CBitVec;
/**
* C-wrapper for grid containing brightness values.
*/
typedef struct sp_CBrightnessGrid sp_CBrightnessGrid; typedef struct sp_CBrightnessGrid sp_CBrightnessGrid;
/**
* A C-wrapper for grid containing codepage 437 characters.
*
* The encoding is currently not enforced.
*/
typedef struct sp_CCp437Grid sp_CCp437Grid; typedef struct sp_CCp437Grid sp_CCp437Grid;
/** /**
* A command to send to the display. * A low-level display command.
*
* This struct and associated functions implement the UDP protocol for the display.
*
* To send a `Command`, use a `Connection`.
*
* # Examples
*
* ```rust
* # use servicepoint::{Brightness, Command, Connection, Packet};
*
* // create command
* let command = Command::Brightness(Brightness::MAX);
*
* // turn command into Packet
* let packet: Packet = command.clone().into();
*
* // read command from packet
* let round_tripped = Command::try_from(packet).unwrap();
*
* // round tripping produces exact copy
* assert_eq!(command, round_tripped);
*
* // send command
* # let connection = Connection::open("127.0.0.1:2342").unwrap();
* connection.send(command).unwrap();
* ```
*/ */
typedef struct sp_Command sp_Command; typedef struct sp_Command sp_Command;
/** /**
* A connection to the display. * A connection to the display.
*
* # Examples
* ```rust
* # use servicepoint::Command;
* let connection = servicepoint::Connection::open("172.23.42.29:2342")
* .expect("connection failed");
* connection.send(Command::Clear)
* .expect("send failed");
* ```
*/ */
typedef struct sp_Connection sp_Connection; typedef struct sp_Connection sp_Connection;
@ -103,16 +199,6 @@ typedef struct sp_Packet sp_Packet;
*/ */
typedef struct sp_PixelGrid sp_PixelGrid; typedef struct sp_PixelGrid sp_PixelGrid;
/**
* A 2D grid of bytes
*/
typedef struct sp_PrimitiveGrid_Brightness sp_PrimitiveGrid_Brightness;
/**
* A 2D grid of bytes
*/
typedef struct sp_PrimitiveGrid_u8 sp_PrimitiveGrid_u8;
/** /**
* Represents a span of memory (`&mut [u8]` ) as a struct usable by C code. * Represents a span of memory (`&mut [u8]` ) as a struct usable by C code.
* *
@ -140,18 +226,6 @@ typedef struct sp_CByteSlice {
*/ */
typedef size_t sp_Offset; typedef size_t sp_Offset;
/**
* A grid containing brightness values.
*/
typedef struct sp_PrimitiveGrid_Brightness sp_BrightnessGrid;
/**
* A grid containing codepage 437 characters.
*
* The encoding is currently not enforced.
*/
typedef struct sp_PrimitiveGrid_u8 sp_Cp437Grid;
@ -192,7 +266,7 @@ void sp_bit_vec_dealloc(struct sp_CBitVec *this_);
* *
* # Arguments * # Arguments
* *
* * `value`: the value to set all bits to * - `value`: the value to set all bits to
* *
* # Safety * # Safety
* *
@ -208,8 +282,8 @@ void sp_bit_vec_fill(struct sp_CBitVec *this_, bool value);
* *
* # Arguments * # Arguments
* *
* * `this`: instance to read from * - `this`: instance to read from
* * `index`: the bit index to read * - `index`: the bit index to read
* *
* returns: value of the bit * returns: value of the bit
* *
@ -268,7 +342,7 @@ struct sp_CBitVec *sp_bit_vec_load(const uint8_t *data,
* *
* # Arguments * # Arguments
* *
* * `size`: size in bits. * - `size`: size in bits.
* *
* returns: `BitVec` with all bits set to false. * returns: `BitVec` with all bits set to false.
* *
@ -290,9 +364,9 @@ struct sp_CBitVec *sp_bit_vec_new(size_t size);
* *
* # Arguments * # Arguments
* *
* * `this`: instance to write to * - `this`: instance to write to
* * `index`: the bit index to edit * - `index`: the bit index to edit
* * `value`: the value to set the bit to * - `value`: the value to set the bit to
* *
* returns: old value of the bit * returns: old value of the bit
* *
@ -354,8 +428,12 @@ void sp_brightness_grid_dealloc(struct sp_CBrightnessGrid *this_);
* *
* # Arguments * # Arguments
* *
* * `this`: instance to write to * - `this`: instance to write to
* * `value`: the value to set all cells to * - `value`: the value to set all cells to
*
* # Panics
*
* - When providing an invalid brightness value
* *
* # Safety * # Safety
* *
@ -371,8 +449,8 @@ void sp_brightness_grid_fill(struct sp_CBrightnessGrid *this_, uint8_t value);
* *
* # Arguments * # Arguments
* *
* * `this`: instance to read from * - `this`: instance to read from
* * `x` and `y`: position of the cell to read * - `x` and `y`: position of the cell to read
* *
* # Panics * # Panics
* *
@ -394,7 +472,7 @@ uint8_t sp_brightness_grid_get(const struct sp_CBrightnessGrid *this_,
* *
* # Arguments * # Arguments
* *
* * `this`: instance to read from * - `this`: instance to read from
* *
* # Safety * # Safety
* *
@ -445,15 +523,16 @@ struct sp_CBrightnessGrid *sp_brightness_grid_new(size_t width,
* *
* # Arguments * # Arguments
* *
* * `this`: instance to write to * - `this`: instance to write to
* * `x` and `y`: position of the cell * - `x` and `y`: position of the cell
* * `value`: the value to write to the cell * - `value`: the value to write to the cell
* *
* returns: old value of the cell * returns: old value of the cell
* *
* # Panics * # Panics
* *
* When accessing `x` or `y` out of bounds. * - When accessing `x` or `y` out of bounds.
* - When providing an invalid brightness value
* *
* # Safety * # Safety
* *
@ -485,7 +564,7 @@ struct sp_CByteSlice sp_brightness_grid_unsafe_data_ref(struct sp_CBrightnessGri
* *
* # Arguments * # Arguments
* *
* * `this`: instance to read from * - `this`: instance to read from
* *
* # Safety * # Safety
* *
@ -618,7 +697,7 @@ struct sp_Command *sp_command_brightness(uint8_t brightness);
*/ */
struct sp_Command *sp_command_char_brightness(size_t x, struct sp_Command *sp_command_char_brightness(size_t x,
size_t y, size_t y,
sp_BrightnessGrid *byte_grid); struct sp_CBrightnessGrid *byte_grid);
/** /**
* Allocates a new `Command::Clear` instance. * Allocates a new `Command::Clear` instance.
@ -661,7 +740,7 @@ struct sp_Command *sp_command_clone(const struct sp_Command *original);
*/ */
struct sp_Command *sp_command_cp437_data(size_t x, struct sp_Command *sp_command_cp437_data(size_t x,
size_t y, size_t y,
sp_Cp437Grid *byte_grid); struct sp_CCp437Grid *byte_grid);
/** /**
* Deallocates a `Command`. * Deallocates a `Command`.
@ -796,8 +875,8 @@ void sp_cp437_grid_dealloc(struct sp_CCp437Grid *this_);
* *
* # Arguments * # Arguments
* *
* * `this`: instance to write to * - `this`: instance to write to
* * `value`: the value to set all cells to * - `value`: the value to set all cells to
* *
* # Safety * # Safety
* *
@ -813,8 +892,8 @@ void sp_cp437_grid_fill(struct sp_CCp437Grid *this_, uint8_t value);
* *
* # Arguments * # Arguments
* *
* * `this`: instance to read from * - `this`: instance to read from
* * `x` and `y`: position of the cell to read * - `x` and `y`: position of the cell to read
* *
* # Panics * # Panics
* *
@ -836,7 +915,7 @@ uint8_t sp_cp437_grid_get(const struct sp_CCp437Grid *this_,
* *
* # Arguments * # Arguments
* *
* * `this`: instance to read from * - `this`: instance to read from
* *
* # Safety * # Safety
* *
@ -887,9 +966,9 @@ struct sp_CCp437Grid *sp_cp437_grid_new(size_t width,
* *
* # Arguments * # Arguments
* *
* * `this`: instance to write to * - `this`: instance to write to
* * `x` and `y`: position of the cell * - `x` and `y`: position of the cell
* * `value`: the value to write to the cell * - `value`: the value to write to the cell
* *
* returns: old value of the cell * returns: old value of the cell
* *
@ -927,7 +1006,7 @@ struct sp_CByteSlice sp_cp437_grid_unsafe_data_ref(struct sp_CCp437Grid *this_);
* *
* # Arguments * # Arguments
* *
* * `this`: instance to read from * - `this`: instance to read from
* *
* # Safety * # Safety
* *
@ -1013,8 +1092,8 @@ void sp_pixel_grid_dealloc(struct sp_PixelGrid *this_);
* *
* # Arguments * # Arguments
* *
* * `this`: instance to write to * - `this`: instance to write to
* * `value`: the value to set all pixels to * - `value`: the value to set all pixels to
* *
* # Safety * # Safety
* *
@ -1030,8 +1109,8 @@ void sp_pixel_grid_fill(struct sp_PixelGrid *this_, bool value);
* *
* # Arguments * # Arguments
* *
* * `this`: instance to read from * - `this`: instance to read from
* * `x` and `y`: position of the cell to read * - `x` and `y`: position of the cell to read
* *
* # Panics * # Panics
* *
@ -1051,7 +1130,7 @@ bool sp_pixel_grid_get(const struct sp_PixelGrid *this_, size_t x, size_t y);
* *
* # Arguments * # Arguments
* *
* * `this`: instance to read from * - `this`: instance to read from
* *
* # Safety * # Safety
* *
@ -1066,8 +1145,8 @@ size_t sp_pixel_grid_height(const struct sp_PixelGrid *this_);
* *
* # Arguments * # Arguments
* *
* * `width`: size in pixels in x-direction * - `width`: size in pixels in x-direction
* * `height`: size in pixels in y-direction * - `height`: size in pixels in y-direction
* *
* returns: `PixelGrid` that contains a copy of the provided data * returns: `PixelGrid` that contains a copy of the provided data
* *
@ -1094,8 +1173,8 @@ struct sp_PixelGrid *sp_pixel_grid_load(size_t width,
* *
* # Arguments * # Arguments
* *
* * `width`: size in pixels in x-direction * - `width`: size in pixels in x-direction
* * `height`: size in pixels in y-direction * - `height`: size in pixels in y-direction
* *
* returns: `PixelGrid` initialized to all pixels off * returns: `PixelGrid` initialized to all pixels off
* *
@ -1118,9 +1197,9 @@ struct sp_PixelGrid *sp_pixel_grid_new(size_t width,
* *
* # Arguments * # Arguments
* *
* * `this`: instance to write to * - `this`: instance to write to
* * `x` and `y`: position of the cell * - `x` and `y`: position of the cell
* * `value`: the value to write to the cell * - `value`: the value to write to the cell
* *
* returns: old value of the cell * returns: old value of the cell
* *
@ -1158,7 +1237,7 @@ struct sp_CByteSlice sp_pixel_grid_unsafe_data_ref(struct sp_PixelGrid *this_);
* *
* # Arguments * # Arguments
* *
* * `this`: instance to read from * - `this`: instance to read from
* *
* # Safety * # Safety
* *

View file

@ -30,7 +30,7 @@ impl From<CBitVec> for SpBitVec {
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `size`: size in bits. /// - `size`: size in bits.
/// ///
/// returns: `BitVec` with all bits set to false. /// returns: `BitVec` with all bits set to false.
/// ///
@ -107,8 +107,8 @@ pub unsafe extern "C" fn sp_bit_vec_dealloc(this: *mut CBitVec) {
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `this`: instance to read from /// - `this`: instance to read from
/// * `index`: the bit index to read /// - `index`: the bit index to read
/// ///
/// returns: value of the bit /// returns: value of the bit
/// ///
@ -134,9 +134,9 @@ pub unsafe extern "C" fn sp_bit_vec_get(
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `this`: instance to write to /// - `this`: instance to write to
/// * `index`: the bit index to edit /// - `index`: the bit index to edit
/// * `value`: the value to set the bit to /// - `value`: the value to set the bit to
/// ///
/// returns: old value of the bit /// returns: old value of the bit
/// ///
@ -163,7 +163,7 @@ pub unsafe extern "C" fn sp_bit_vec_set(
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `value`: the value to set all bits to /// - `value`: the value to set all bits to
/// ///
/// # Safety /// # Safety
/// ///

View file

@ -96,8 +96,8 @@ pub unsafe extern "C" fn sp_brightness_grid_dealloc(
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `this`: instance to read from /// - `this`: instance to read from
/// * `x` and `y`: position of the cell to read /// - `x` and `y`: position of the cell to read
/// ///
/// # Panics /// # Panics
/// ///
@ -122,15 +122,16 @@ pub unsafe extern "C" fn sp_brightness_grid_get(
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `this`: instance to write to /// - `this`: instance to write to
/// * `x` and `y`: position of the cell /// - `x` and `y`: position of the cell
/// * `value`: the value to write to the cell /// - `value`: the value to write to the cell
/// ///
/// returns: old value of the cell /// returns: old value of the cell
/// ///
/// # Panics /// # Panics
/// ///
/// When accessing `x` or `y` out of bounds. /// - When accessing `x` or `y` out of bounds.
/// - When providing an invalid brightness value
/// ///
/// # Safety /// # Safety
/// ///
@ -154,8 +155,12 @@ pub unsafe extern "C" fn sp_brightness_grid_set(
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `this`: instance to write to /// - `this`: instance to write to
/// * `value`: the value to set all cells to /// - `value`: the value to set all cells to
///
/// # Panics
///
/// - When providing an invalid brightness value
/// ///
/// # Safety /// # Safety
/// ///
@ -177,7 +182,7 @@ pub unsafe extern "C" fn sp_brightness_grid_fill(
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `this`: instance to read from /// - `this`: instance to read from
/// ///
/// # Safety /// # Safety
/// ///
@ -195,7 +200,7 @@ pub unsafe extern "C" fn sp_brightness_grid_width(
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `this`: instance to read from /// - `this`: instance to read from
/// ///
/// # Safety /// # Safety
/// ///

View file

@ -90,8 +90,8 @@ pub unsafe extern "C" fn sp_cp437_grid_dealloc(this: *mut CCp437Grid) {
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `this`: instance to read from /// - `this`: instance to read from
/// * `x` and `y`: position of the cell to read /// - `x` and `y`: position of the cell to read
/// ///
/// # Panics /// # Panics
/// ///
@ -116,9 +116,9 @@ pub unsafe extern "C" fn sp_cp437_grid_get(
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `this`: instance to write to /// - `this`: instance to write to
/// * `x` and `y`: position of the cell /// - `x` and `y`: position of the cell
/// * `value`: the value to write to the cell /// - `value`: the value to write to the cell
/// ///
/// returns: old value of the cell /// returns: old value of the cell
/// ///
@ -146,8 +146,8 @@ pub unsafe extern "C" fn sp_cp437_grid_set(
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `this`: instance to write to /// - `this`: instance to write to
/// * `value`: the value to set all cells to /// - `value`: the value to set all cells to
/// ///
/// # Safety /// # Safety
/// ///
@ -164,7 +164,7 @@ pub unsafe extern "C" fn sp_cp437_grid_fill(this: *mut CCp437Grid, value: u8) {
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `this`: instance to read from /// - `this`: instance to read from
/// ///
/// # Safety /// # Safety
/// ///
@ -180,7 +180,7 @@ pub unsafe extern "C" fn sp_cp437_grid_width(this: *const CCp437Grid) -> usize {
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `this`: instance to read from /// - `this`: instance to read from
/// ///
/// # Safety /// # Safety
/// ///

View file

@ -10,8 +10,8 @@ use crate::c_slice::CByteSlice;
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `width`: size in pixels in x-direction /// - `width`: size in pixels in x-direction
/// * `height`: size in pixels in y-direction /// - `height`: size in pixels in y-direction
/// ///
/// returns: `PixelGrid` initialized to all pixels off /// returns: `PixelGrid` initialized to all pixels off
/// ///
@ -37,8 +37,8 @@ pub unsafe extern "C" fn sp_pixel_grid_new(
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `width`: size in pixels in x-direction /// - `width`: size in pixels in x-direction
/// * `height`: size in pixels in y-direction /// - `height`: size in pixels in y-direction
/// ///
/// returns: `PixelGrid` that contains a copy of the provided data /// returns: `PixelGrid` that contains a copy of the provided data
/// ///
@ -100,8 +100,8 @@ pub unsafe extern "C" fn sp_pixel_grid_dealloc(this: *mut PixelGrid) {
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `this`: instance to read from /// - `this`: instance to read from
/// * `x` and `y`: position of the cell to read /// - `x` and `y`: position of the cell to read
/// ///
/// # Panics /// # Panics
/// ///
@ -126,9 +126,9 @@ pub unsafe extern "C" fn sp_pixel_grid_get(
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `this`: instance to write to /// - `this`: instance to write to
/// * `x` and `y`: position of the cell /// - `x` and `y`: position of the cell
/// * `value`: the value to write to the cell /// - `value`: the value to write to the cell
/// ///
/// returns: old value of the cell /// returns: old value of the cell
/// ///
@ -156,8 +156,8 @@ pub unsafe extern "C" fn sp_pixel_grid_set(
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `this`: instance to write to /// - `this`: instance to write to
/// * `value`: the value to set all pixels to /// - `value`: the value to set all pixels to
/// ///
/// # Safety /// # Safety
/// ///
@ -174,7 +174,7 @@ pub unsafe extern "C" fn sp_pixel_grid_fill(this: *mut PixelGrid, value: bool) {
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `this`: instance to read from /// - `this`: instance to read from
/// ///
/// # Safety /// # Safety
/// ///
@ -190,7 +190,7 @@ pub unsafe extern "C" fn sp_pixel_grid_width(this: *const PixelGrid) -> usize {
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `this`: instance to read from /// - `this`: instance to read from
/// ///
/// # Safety /// # Safety
/// ///

View file

@ -81,11 +81,11 @@ namespace ServicePoint.BindGen
[DllImport(__DllName, EntryPoint = "sp_brightness_grid_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport(__DllName, EntryPoint = "sp_brightness_grid_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern byte sp_brightness_grid_get(CBrightnessGrid* @this, nuint x, nuint y); public static extern byte sp_brightness_grid_get(CBrightnessGrid* @this, nuint x, nuint y);
/// <summary>Sets the value of the specified position in the `BrightnessGrid`. # Arguments * `this`: instance to write to * `x` and `y`: position of the cell * `value`: the value to write to the cell returns: old value of the cell # Panics When accessing `x` or `y` out of bounds. # Safety The caller has to make sure that: - `this` points to a valid `BitVec` - `this` is not written to or read from concurrently</summary> /// <summary>Sets the value of the specified position in the `BrightnessGrid`. # Arguments - `this`: instance to write to - `x` and `y`: position of the cell - `value`: the value to write to the cell returns: old value of the cell # Panics - When accessing `x` or `y` out of bounds. - When providing an invalid brightness value # Safety The caller has to make sure that: - `this` points to a valid `BitVec` - `this` is not written to or read from concurrently</summary>
[DllImport(__DllName, EntryPoint = "sp_brightness_grid_set", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport(__DllName, EntryPoint = "sp_brightness_grid_set", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void sp_brightness_grid_set(CBrightnessGrid* @this, nuint x, nuint y, byte value); public static extern void sp_brightness_grid_set(CBrightnessGrid* @this, nuint x, nuint y, byte value);
/// <summary>Sets the value of all cells in the `BrightnessGrid`. # Arguments * `this`: instance to write to * `value`: the value to set all cells to # Safety The caller has to make sure that: - `this` points to a valid `BrightnessGrid` - `this` is not written to or read from concurrently</summary> /// <summary>Sets the value of all cells in the `BrightnessGrid`. # Arguments * `this`: instance to write to * `value`: the value to set all cells to # Panics - When providing an invalid brightness value # Safety The caller has to make sure that: - `this` points to a valid `BrightnessGrid` - `this` is not written to or read from concurrently</summary>
[DllImport(__DllName, EntryPoint = "sp_brightness_grid_fill", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport(__DllName, EntryPoint = "sp_brightness_grid_fill", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void sp_brightness_grid_fill(CBrightnessGrid* @this, byte value); public static extern void sp_brightness_grid_fill(CBrightnessGrid* @this, byte value);