This commit is contained in:
Ryan Oldenburg 2022-05-16 18:18:30 -05:00
parent 34fa05da97
commit 50090a8800

View file

@ -892,15 +892,12 @@ proc buildImage(state: var DecoderState): Image =
cb.unsafe[x, y], cb.unsafe[x, y],
cr.unsafe[x, y], cr.unsafe[x, y],
) )
elif state.components.len == 1: elif state.components.len == 1:
let let
cy = state.components[0].channel cy = state.components[0].channel
for y in 0 ..< state.imageHeight: for y in 0 ..< state.imageHeight:
for x in 0 ..< state.imageWidth: for x in 0 ..< state.imageWidth:
result.unsafe[x, y] = grayScaleToRgbx( result.unsafe[x, y] = grayScaleToRgbx(cy.unsafe[x, y])
cy.unsafe[x, y],
)
else: else:
failInvalid() failInvalid()