mirror of
https://github.com/pinnacle-comp/pinnacle.git
synced 2025-01-30 20:34:49 +01:00
Add some docs
This commit is contained in:
parent
063164c07f
commit
e523d4b204
2 changed files with 18 additions and 2 deletions
|
@ -39,8 +39,8 @@ end
|
|||
local render = {}
|
||||
|
||||
---@alias ScalingFilter
|
||||
---| "bilinear"
|
||||
---| "nearest_neighbor"
|
||||
---| "bilinear" Blend between the four closest pixels. May cause scaling to be blurry.
|
||||
---| "nearest_neighbor" Choose the closest pixel. Causes scaling to look pixelated.
|
||||
|
||||
---@type table<ScalingFilter, integer>
|
||||
local filter_name_to_filter_value = {
|
||||
|
|
|
@ -33,6 +33,14 @@ impl Render {
|
|||
}
|
||||
|
||||
/// Set the upscaling filter that will be used for rendering.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use pinnacle_api::render::ScalingFilter;
|
||||
///
|
||||
/// render.set_upscale_filter(ScalingFilter::NearestNeighbor);
|
||||
/// ```
|
||||
pub fn set_upscale_filter(&self, filter: ScalingFilter) {
|
||||
let mut client = self.client.clone();
|
||||
block_on_tokio(client.set_upscale_filter(SetUpscaleFilterRequest {
|
||||
|
@ -42,6 +50,14 @@ impl Render {
|
|||
}
|
||||
|
||||
/// Set the downscaling filter that will be used for rendering.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use pinnacle_api::render::ScalingFilter;
|
||||
///
|
||||
/// render.set_downscale_filter(ScalingFilter::NearestNeighbor);
|
||||
/// ```
|
||||
pub fn set_downscale_filter(&self, filter: ScalingFilter) {
|
||||
let mut client = self.client.clone();
|
||||
block_on_tokio(client.set_downscale_filter(SetDownscaleFilterRequest {
|
||||
|
|
Loading…
Add table
Reference in a new issue