DRC | 2204820 | 2015-01-08 06:18:33 +0000 | [diff] [blame] | 1 | /* |
| 2 | * jcsample.h |
| 3 | * |
| 4 | * This file was part of the Independent JPEG Group's software: |
| 5 | * Copyright (C) 1991-1996, Thomas G. Lane. |
DRC | 7e3acc0 | 2015-10-10 10:25:46 -0500 | [diff] [blame^] | 6 | * For conditions of distribution and use, see the accompanying README.ijg |
| 7 | * file. |
DRC | 2204820 | 2015-01-08 06:18:33 +0000 | [diff] [blame] | 8 | */ |
| 9 | |
| 10 | LOCAL(void) |
| 11 | expand_right_edge (JSAMPARRAY image_data, int num_rows, |
| 12 | JDIMENSION input_cols, JDIMENSION output_cols) |
| 13 | { |
| 14 | register JSAMPROW ptr; |
| 15 | register JSAMPLE pixval; |
| 16 | register int count; |
| 17 | int row; |
| 18 | int numcols = (int) (output_cols - input_cols); |
| 19 | |
| 20 | if (numcols > 0) { |
| 21 | for (row = 0; row < num_rows; row++) { |
| 22 | ptr = image_data[row] + input_cols; |
| 23 | pixval = ptr[-1]; /* don't need GETJSAMPLE() here */ |
| 24 | for (count = numcols; count > 0; count--) |
| 25 | *ptr++ = pixval; |
| 26 | } |
| 27 | } |
| 28 | } |