oa::Image

Dense pixels with explicit axis-order and channel-order semantics. Image composes a Matrix instead of erasing its numeric dtype and storage behavior. Construction validates all metadata once; the matrix is thereafter exposed immutably so the image contract cannot be invalidated.

StRust public API

Declaration

pub struct Image { /* private fields */ }
Public Rust declaration.

Public Methods

pub const fn as_matrix(&self) -> &Matrix
pub fn into_matrix(self) -> Matrix
pub fn width(&self) -> usize
pub fn height(&self) -> usize
pub const fn channels(&self) -> usize
pub fn batch_size(&self) -> usize
pub const fn layout(&self) -> ImageLayout
pub const fn format(&self) -> ImageFormat
pub const fn dtype(&self) -> DType
pub fn grayscale(&self) -> Result<Self>
pub fn convert_color(&self, destination_format: ImageFormat) -> Result<Self>
pub fn flip(&self, horizontal: bool, vertical: bool) -> Result<Self>
pub fn rotate(&self, degrees: u32) -> Result<Self>
pub fn resize( &self, width: u32, height: u32, mode: InterpolationMode, ) -> Result<Self>
pub fn crop(&self, x: u32, y: u32, width: u32, height: u32) -> Result<Self>
pub fn center_crop(&self, width: u32, height: u32) -> Result<Self>
pub fn invert(&self, max_value: f32) -> Result<Self>
pub fn brightness_contrast( &self, brightness: f32, contrast: f32, ) -> Result<Self>
pub fn gamma_contrast(&self, gamma: f32, gain: f32) -> Result<Self>
pub fn normalize(&self, parameters: NormalizationParams) -> Result<Self>
pub fn gaussian_blur(&self, sigma: f32, kernel_size: u32) -> Result<Self>
pub fn laplacian(&self, border: BorderMode) -> Result<Self>
pub fn sharpen(&self, amount: f32, border: BorderMode) -> Result<Self>
fn clone(&self) -> Image

Associated Functions

pub fn new( data: Matrix, layout: ImageLayout, format: ImageFormat, ) -> Result<Self>

Public Method Documentation

pub const fn as_matrix( &self ) -> &Matrix
No public source comment is attached to this declaration.
pub fn into_matrix( self ) -> Matrix
No public source comment is attached to this declaration.
pub fn width( &self ) -> usize
No public source comment is attached to this declaration.
pub fn height( &self ) -> usize
No public source comment is attached to this declaration.
pub const fn channels( &self ) -> usize
No public source comment is attached to this declaration.
pub fn batch_size( &self ) -> usize
No public source comment is attached to this declaration.
pub const fn layout( &self ) -> ImageLayout
No public source comment is attached to this declaration.
pub const fn format( &self ) -> ImageFormat
No public source comment is attached to this declaration.
pub const fn dtype( &self ) -> DType
No public source comment is attached to this declaration.
pub fn grayscale( &self ) -> Result<Self>
No public source comment is attached to this declaration.
pub fn convert_color( &self, destination_format: ImageFormat ) -> Result<Self>
No public source comment is attached to this declaration.
pub fn flip( &self, horizontal: bool, vertical: bool ) -> Result<Self>
No public source comment is attached to this declaration.
pub fn rotate( &self, degrees: u32 ) -> Result<Self>
No public source comment is attached to this declaration.
pub fn resize( &self, width: u32, height: u32, mode: InterpolationMode ) -> Result<Self>
No public source comment is attached to this declaration.
pub fn crop( &self, x: u32, y: u32, width: u32, height: u32 ) -> Result<Self>
No public source comment is attached to this declaration.
pub fn center_crop( &self, width: u32, height: u32 ) -> Result<Self>
No public source comment is attached to this declaration.
pub fn invert( &self, max_value: f32 ) -> Result<Self>
No public source comment is attached to this declaration.
pub fn brightness_contrast( &self, brightness: f32, contrast: f32 ) -> Result<Self>
No public source comment is attached to this declaration.
pub fn gamma_contrast( &self, gamma: f32, gain: f32 ) -> Result<Self>
No public source comment is attached to this declaration.
pub fn normalize( &self, parameters: NormalizationParams ) -> Result<Self>
No public source comment is attached to this declaration.
pub fn gaussian_blur( &self, sigma: f32, kernel_size: u32 ) -> Result<Self>
No public source comment is attached to this declaration.
pub fn laplacian( &self, border: BorderMode ) -> Result<Self>
No public source comment is attached to this declaration.
pub fn sharpen( &self, amount: f32, border: BorderMode ) -> Result<Self>
No public source comment is attached to this declaration.
fn clone( &self ) -> Image
No public source comment is attached to this declaration.
pub fn new( data: Matrix, layout: ImageLayout, format: ImageFormat ) -> Result<Self>
No public source comment is attached to this declaration.