jcsample.h 744 B

12345678910111213141516171819202122232425262728
  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.
  6. * For conditions of distribution and use, see the accompanying README.ijg
  7. * file.
  8. */
  9. LOCAL(void)
  10. expand_right_edge(JSAMPARRAY image_data, int num_rows, JDIMENSION input_cols,
  11. JDIMENSION output_cols)
  12. {
  13. register JSAMPROW ptr;
  14. register JSAMPLE pixval;
  15. register int count;
  16. int row;
  17. int numcols = (int)(output_cols - input_cols);
  18. if (numcols > 0) {
  19. for (row = 0; row < num_rows; row++) {
  20. ptr = image_data[row] + input_cols;
  21. pixval = ptr[-1]; /* don't need GETJSAMPLE() here */
  22. for (count = numcols; count > 0; count--)
  23. *ptr++ = pixval;
  24. }
  25. }
  26. }