You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was wondering if it would be a good idea to serdify some of the constants and settings that the aravis bindings are generating.
While the genicam standard does provide the information from most gige cameras (my use case), application settings for developers are likely to be co-located in one place (yaml, json, toml).
An example of some of the pixel formats below.
use aravis::PixelFormat;use serde::{Deserialize, de::Visitor};#[derive(Copy,Clone)]pubstructCameraPixelFormat(pubPixelFormat);impl<'de>Deserialize<'de>forCameraPixelFormat{fndeserialize<D>(deserializer:D) -> Result<Self,D::Error>whereD: serde::Deserializer<'de>,{
deserializer.deserialize_str(PixelFormatVisitor{})}}pubstructPixelFormatVisitor{}impl<'de>Visitor<'de>forPixelFormatVisitor{typeValue = CameraPixelFormat;fnexpecting(&self,formatter:&mut std::fmt::Formatter) -> std::fmt::Result{
formatter.write_str("Could not deserialise CameraPixelFormat")}fnvisit_str<E>(self,v:&str) -> Result<Self::Value,E>whereE: serde::de::Error,{match v {"RGB_8_PACKER" => Ok(CameraPixelFormat(PixelFormat::RGB_8_PACKED)),"BAYER_RG_8" => Ok(CameraPixelFormat(PixelFormat::BAYER_RG_8)),"RGB_8_PLANAR" => Ok(CameraPixelFormat(PixelFormat::RGB_8_PLANAR)),
_ => Err(serde::de::Error::custom("Unknown pixel format {v:?}")),}}}
The text was updated successfully, but these errors were encountered:
Hi,
I was wondering if it would be a good idea to serdify some of the constants and settings that the aravis bindings are generating.
While the genicam standard does provide the information from most gige cameras (my use case), application settings for developers are likely to be co-located in one place (yaml, json, toml).
An example of some of the pixel formats below.
The text was updated successfully, but these errors were encountered: