add constants for brightness in C api
This commit is contained in:
		
							parent
							
								
									a858261540
								
							
						
					
					
						commit
						16a0afe08d
					
				
					 3 changed files with 26 additions and 0 deletions
				
			
		|  | @ -8,6 +8,21 @@ | |||
| #include <stdint.h> | ||||
| #include <stdlib.h> | ||||
| 
 | ||||
| /**
 | ||||
|  * Count of possible brightness values | ||||
|  */ | ||||
| #define SP_BRIGHTNESS_LEVELS 12 | ||||
| 
 | ||||
| /**
 | ||||
|  * see [Brightness::MAX] | ||||
|  */ | ||||
| #define SP_BRIGHTNESS_MAX 11 | ||||
| 
 | ||||
| /**
 | ||||
|  * see [Brightness::MIN] | ||||
|  */ | ||||
| #define SP_BRIGHTNESS_MIN 0 | ||||
| 
 | ||||
| /**
 | ||||
|  * pixel count on whole screen | ||||
|  */ | ||||
|  |  | |||
|  | @ -4,9 +4,17 @@ | |||
| 
 | ||||
| use crate::SPByteSlice; | ||||
| use servicepoint::{Brightness, DataRef, Grid, PrimitiveGrid}; | ||||
| use std::convert::Into; | ||||
| use std::intrinsics::transmute; | ||||
| use std::ptr::NonNull; | ||||
| 
 | ||||
| /// see [Brightness::MIN]
 | ||||
| pub const SP_BRIGHTNESS_MIN: u8 = 0; | ||||
| /// see [Brightness::MAX]
 | ||||
| pub const SP_BRIGHTNESS_MAX: u8 = 11; | ||||
| /// Count of possible brightness values
 | ||||
| pub const SP_BRIGHTNESS_LEVELS: u8 = 12; | ||||
| 
 | ||||
| /// A grid containing brightness values.
 | ||||
| ///
 | ||||
| /// # Examples
 | ||||
|  |  | |||
|  | @ -17,6 +17,9 @@ namespace ServicePoint.BindGen | |||
|         public const nuint SP_TILE_SIZE = 8; | ||||
|         public const nuint SP_TILE_WIDTH = 56; | ||||
|         public const nuint SP_TILE_HEIGHT = 20; | ||||
|         public const byte SP_BRIGHTNESS_MIN = 0; | ||||
|         public const byte SP_BRIGHTNESS_MAX = 11; | ||||
|         public const byte SP_BRIGHTNESS_LEVELS = 12; | ||||
| 
 | ||||
| 
 | ||||
|         /// <summary> | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Vinzenz Schroeter
						Vinzenz Schroeter