Unpacks binary data from a character buffer into the image's pixel array.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(format_pnm), | intent(inout) | :: | this | |||
character(len=1), | intent(in) | :: | buffer(:) |
pure subroutine decode_binary_pbm_pixels(this, buffer) class(format_pnm), intent(inout) :: this character(len=1), intent(in) :: buffer(:) integer :: row, col, nbytes nbytes = (this%width+7)/8 do concurrent (row = 0:this%height-1, col = 0:this%width-1) this%pixels(row+1, col+1) = ibits(ichar(buffer(row*nbytes+col/8+1)), 7-mod(col, 8), 1) end do end subroutine decode_binary_pbm_pixels