Add some docs

This commit is contained in:
Ottatop 2024-03-30 03:19:49 -05:00
parent 063164c07f
commit e523d4b204
2 changed files with 18 additions and 2 deletions

View file

@ -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 = {

View file

@ -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 {