Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
jabibamman committed Oct 29, 2023
2 parents d256f18 + 8196f9e commit 4ca9321
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/types/complex.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#[derive(Debug, Clone, PartialEq)]
pub struct Complex {
pub re: f64,
pub im: f64,
}
32 changes: 32 additions & 0 deletions src/types/messages.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
use crate::types::pixel_data::PixelData;
use crate::types::pixel_intensity::PixelIntensity;
use crate::types::range::Range;
use crate::types::resolution::Resolution;
use crate::types::u8data::U8Data;

#[derive(Debug, Clone, PartialEq)]
pub enum FragmentRequest {
Request {
range: Range,
resolution: Resolution,
max_iter: u32,
},
Cancel,
}

#[derive(Debug, Clone, PartialEq)]
pub struct FragmentTask {
pub id: u32,
pub range: Range,
pub resolution: Resolution,
pub max_iter: u32,
}

#[derive(Debug, Clone, PartialEq)]
pub struct FragmentResult {
pub id: u32,
pub u8_data: U8Data,
pub pixel_data: PixelData,
pub pixel_intensity: Vec<PixelIntensity>,
}

5 changes: 5 additions & 0 deletions src/types/pixel_data.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#[derive(Debug, Clone, PartialEq)]
pub struct PixelData {
pub offset: u32,
pub count: u32,
}
5 changes: 5 additions & 0 deletions src/types/pixel_intensity.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#[derive(Debug, Clone, PartialEq)]
pub struct PixelIntensity {
pub zn: f32,
pub count: f32,
}
5 changes: 5 additions & 0 deletions src/types/point.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#[derive(Debug, Clone, PartialEq)]
pub struct Point {
pub x: f64,
pub y: f64,
}
7 changes: 7 additions & 0 deletions src/types/range.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
use crate::types::point::Point;

#[derive(Debug, Clone, PartialEq)]
pub struct Range {
pub min: Point,
pub max: Point,
}
5 changes: 5 additions & 0 deletions src/types/resolution.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#[derive(Debug, Clone, PartialEq)]
pub struct Resolution {
pub nx: u16,
pub ny: u16,
}
5 changes: 5 additions & 0 deletions src/types/u8data.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#[derive(Debug, Clone, PartialEq)]
pub struct U8Data {
pub offset: u32,
pub count: u32,
}

0 comments on commit 4ca9321

Please sign in to comment.