diff options
| author | gingerBill <bill@gingerbill.org> | 2024-06-29 18:49:57 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2024-06-29 18:49:57 +0100 |
| commit | 930c92929477ea39d46310bbfbd23c19db4d12ac (patch) | |
| tree | a3c86278b8e1f61f90ef078b4afc63a9f5593c2d /core/image/common.odin | |
| parent | 7f05b4caf2e921c02996e1eb357f5988e67df831 (diff) | |
Indentation fixes
Diffstat (limited to 'core/image/common.odin')
| -rw-r--r-- | core/image/common.odin | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/core/image/common.odin b/core/image/common.odin index fed2c1470..07152e7db 100644 --- a/core/image/common.odin +++ b/core/image/common.odin @@ -1313,55 +1313,55 @@ expand_grayscale :: proc(img: ^Image, allocator := context.allocator) -> (ok: bo } switch img.depth { - case 8: - switch img.channels { - case 1: // Turn Gray into RGB - out := mem.slice_data_cast([]RGB_Pixel, buf.buf[:]) - - for p in img.pixels.buf { - out[0] = p // Broadcast gray value into RGB components. - out = out[1:] - } + case 8: + switch img.channels { + case 1: // Turn Gray into RGB + out := mem.slice_data_cast([]RGB_Pixel, buf.buf[:]) - case 2: // Turn Gray + Alpha into RGBA - inp := mem.slice_data_cast([]GA_Pixel, img.pixels.buf[:]) - out := mem.slice_data_cast([]RGBA_Pixel, buf.buf[:]) + for p in img.pixels.buf { + out[0] = p // Broadcast gray value into RGB components. + out = out[1:] + } - for p in inp { - out[0].rgb = p.r // Gray component. - out[0].a = p.g // Alpha component. - } + case 2: // Turn Gray + Alpha into RGBA + inp := mem.slice_data_cast([]GA_Pixel, img.pixels.buf[:]) + out := mem.slice_data_cast([]RGBA_Pixel, buf.buf[:]) - case: - unreachable() + for p in inp { + out[0].rgb = p.r // Gray component. + out[0].a = p.g // Alpha component. } - case 16: - switch img.channels { - case 1: // Turn Gray into RGB - inp := mem.slice_data_cast([]u16, img.pixels.buf[:]) - out := mem.slice_data_cast([]RGB_Pixel_16, buf.buf[:]) + case: + unreachable() + } - for p in inp { - out[0] = p // Broadcast gray value into RGB components. - out = out[1:] - } + case 16: + switch img.channels { + case 1: // Turn Gray into RGB + inp := mem.slice_data_cast([]u16, img.pixels.buf[:]) + out := mem.slice_data_cast([]RGB_Pixel_16, buf.buf[:]) - case 2: // Turn Gray + Alpha into RGBA - inp := mem.slice_data_cast([]GA_Pixel_16, img.pixels.buf[:]) - out := mem.slice_data_cast([]RGBA_Pixel_16, buf.buf[:]) + for p in inp { + out[0] = p // Broadcast gray value into RGB components. + out = out[1:] + } - for p in inp { - out[0].rgb = p.r // Gray component. - out[0].a = p.g // Alpha component. - } + case 2: // Turn Gray + Alpha into RGBA + inp := mem.slice_data_cast([]GA_Pixel_16, img.pixels.buf[:]) + out := mem.slice_data_cast([]RGBA_Pixel_16, buf.buf[:]) - case: - unreachable() + for p in inp { + out[0].rgb = p.r // Gray component. + out[0].a = p.g // Alpha component. } case: unreachable() + } + + case: + unreachable() } |