oxedyne/fe2o3/fe2o3_text/tests/detect_corpus/rust/declarations_only.txt
1.1 KiB, 1 run
created by r1870400018:12044, which is this file's identity for as long as the history lasts, whatever it is later renamed to
download · who wrote it · its history
| 1 | /// Pixel format for image buffers. |
| 2 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] |
| 3 | pub enum PixelFormat { |
| 4 | Rgba8, |
| 5 | Rgb8, |
| 6 | Greyscale8, |
| 7 | Greyscale16, |
| 8 | } |
| 9 | |
| 10 | /// Image buffer metadata. |
| 11 | pub struct ImageHeader { |
| 12 | pub width: u32, |
| 13 | pub height: u32, |
| 14 | pub format: PixelFormat, |
| 15 | pub dpi: Option<f64>, |
| 16 | } |
| 17 | |
| 18 | /// Colour space for rendering. |
| 19 | #[derive(Debug, Clone, Copy)] |
| 20 | pub enum ColourSpace { |
| 21 | Srgb, |
| 22 | LinearRgb, |
| 23 | DisplayP3, |
| 24 | AdobeRgb, |
| 25 | } |
| 26 | |
| 27 | /// Blend mode for compositing layers. |
| 28 | pub enum BlendMode { |
| 29 | Normal, |
| 30 | Multiply, |
| 31 | Screen, |
| 32 | Overlay, |
| 33 | SoftLight, |
| 34 | HardLight, |
| 35 | Difference, |
| 36 | } |
| 37 | |
| 38 | /// A rectangular region within an image. |
| 39 | pub struct Rect { |
| 40 | pub x: u32, |
| 41 | pub y: u32, |
| 42 | pub width: u32, |
| 43 | pub height: u32, |
| 44 | } |
| 45 | |
| 46 | /// Image transform operations. |
| 47 | pub trait Transform { |
| 48 | fn rotate(&self, degrees: f64) -> Self; |
| 49 | fn scale(&self, factor: f64) -> Self; |
| 50 | fn crop(&self, region: &Rect) -> Self; |
| 51 | fn flip_horizontal(&self) -> Self; |
| 52 | fn flip_vertical(&self) -> Self; |
| 53 | } |
| 54 | |
| 55 | /// Interpolation method for scaling. |
| 56 | pub enum Interpolation { |
| 57 | Nearest, |
| 58 | Bilinear, |
| 59 | Bicubic, |
| 60 | Lanczos3, |
| 61 | } |