diff options
author | cc <cc@localhost> | 2025-08-20 20:11:11 -0700 |
---|---|---|
committer | cc <cc@localhost> | 2025-08-20 20:11:11 -0700 |
commit | d459729f67e4a83ce361dcf2bc6d5d75f427e23d (patch) | |
tree | 9027ac247ea2deff211ce12da4dfee9f72dba5d7 /src/label_formats/large_label_format.rs | |
parent | abdbc42639d0acd6fc0db381f7cbe6a37928643f (diff) |
More descriptive names
Diffstat (limited to 'src/label_formats/large_label_format.rs')
-rw-r--r-- | src/label_formats/large_label_format.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/label_formats/large_label_format.rs b/src/label_formats/large_label_format.rs index 121a4df..f717ac5 100644 --- a/src/label_formats/large_label_format.rs +++ b/src/label_formats/large_label_format.rs @@ -42,25 +42,25 @@ fn flood(source: &LargeLabelFormat, destination: &mut Vec<u16>, } } -pub fn compress_large_labels(buffer: LargeLabelFormat) -> LabelFormat { +pub fn compress_large_labels(largelabels: LargeLabelFormat) -> LabelFormat { let mut label: u16 = 1; - let mut output_buffer: Vec<u16> = vec![0u16; buffer.buffer.len()]; - for y in 0..buffer.height { - for x in 0..buffer.width { - let index = x + y*buffer.width; - if buffer.buffer[index] == 0 { + let mut output_buffer: Vec<u16> = vec![0u16; largelabels.buffer.len()]; + for y in 0..largelabels.height { + for x in 0..largelabels.width { + let index = x + y*largelabels.width; + if largelabels.buffer[index] == 0 { continue; } if output_buffer[index] == 0 { - let color = buffer.buffer[index]; - flood(&buffer, &mut output_buffer, x, y, color, label); + let color = largelabels.buffer[index]; + flood(&largelabels, &mut output_buffer, x, y, color, label); label += 1; } } } return LabelFormat { buffer: output_buffer, - width: buffer.width, - height: buffer.height, + width: largelabels.width, + height: largelabels.height, }; } |