Struct advent_of_code_2021::day_20::Image [−][src]
struct Image {
pixels: HashSet<(isize, isize)>,
min_x: isize,
max_x: isize,
min_y: isize,
max_y: isize,
default_pixel: bool,
}Expand description
Represents an image as the set of pixels that are on, the bounds of the current image data, and the default value for pixels outside this area.
Fields
pixels: HashSet<(isize, isize)>set of active pixels within (min_x, min_y) .. (max_x, max_y)
min_x: isizelower bound of the image data x co-ordinate values
max_x: isizeupper bound of the image data x co-ordinate values
min_y: isizelower bound of the image data y co-ordinate values
max_y: isizeupper bound of the image data y co-ordinate values
default_pixel: boolThe value of all pixels outside the image data bounds
Implementations
Builds a new image by expanding the area by 1 pixel in all directions, and mapping those based in the image data / default pixel value, finally calculating the new value for the default.
Get if a specific pixel will be active in the next iteration
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Image
impl UnwindSafe for Image
Blanket Implementations
Mutably borrows from an owned value. Read more
