pub fn column_running_sum(image: &GrayImage, column: u32, buffer: &mut [u32], padding: u32) {
    // TODO: faster, more formats
    let (width, height) = image.dimensions();
    assert!(
        // assertion 1
        buffer.len() >= height as usize + 2 * padding as usize,
        "Buffer length {} is less than {} + 2 * {}",
        buffer.len(),
        height,
        padding
    );
    assert!(
        // assertion 2
        column < width,
        "column out of bounds: {} >= {}",
        column,
        width
    );
    assert!(
        // assertion 3
        height > 0,
        "image is empty"
    );

    let first = image.get_pixel(column, 0)[0] as u32;
    let last = image.get_pixel(column, height - 1)[0] as u32;

    let mut sum = 0;

    for b in &mut buffer[..padding as usize] {
        sum += first;
        *b = sum;
    }
    // JUSTIFICATION:
    //  Benefit
    //      Using checked indexing here makes this function take 1.8x longer, as measured by bench_column_running_sum
    //  Correctness
    //      column is in bounds due to assertion 2.
    //      height + padding - 1 < buffer.len() due to assertions 1 and 3.
    unsafe {
        for y in 0..height {
            sum += image.unsafe_get_pixel(column, y)[0] as u32;
            *buffer.get_unchecked_mut(y as usize + padding as usize) = sum;
        }
    }
    for b in &mut buffer[padding as usize + height as usize..] {
        sum += last;
        *b = sum;
    }
}
Computes the running sum of one column of image, padded
at the top and bottom. The padding is by continuity.
Takes a reference to buffer so that this can be reused
for all columns in an image.

# Panics
- If `buffer.len() < 2 * padding + image.height()`.
- If `column >= image.width()`.
- If `image.height() == 0`.

# Examples
```
# extern crate image;
# #[macro_use]
# extern crate imageproc;
# fn main() {
use imageproc::integral_image::column_running_sum;

let image = gray_image!(
1, 4;
2, 5;
3, 6);

// Buffer has length two greater than image height, hence padding of 1
let mut buffer = [0; 5];
column_running_sum(&image, 0, &mut buffer, 1);

// The image is padded by continuity on top and bottom
assert_eq!(buffer, [1, 2, 4, 7, 10]);
# }
```
src/integral_image.rs