diff --git a/Graphics/gl2jpeg.cpp b/Graphics/gl2jpeg.cpp index 84301bc5f605cdd59170005e27ed4fe52183f654..8711789fe637a3720de1c5b0af2b979af5e83de1 100644 --- a/Graphics/gl2jpeg.cpp +++ b/Graphics/gl2jpeg.cpp @@ -2,7 +2,7 @@ * GL2JPEG, an OpenGL to JPEG Printing Library * Copyright (C) 1999-2002 Christophe Geuzaine * - * $Id: gl2jpeg.cpp,v 1.9 2002-05-18 07:56:48 geuzaine Exp $ + * $Id: gl2jpeg.cpp,v 1.10 2002-05-19 19:36:00 geuzaine Exp $ * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -39,18 +39,18 @@ void create_jpeg(FILE *outfile, int width, int height, int quality){ unsigned char *pixels; struct jpeg_compress_struct cinfo; struct jpeg_error_mgr jerr; - JSAMPROW row_pointer[1]; // pointer to JSAMPLE row[s] - int row_stride; // physical row width in image buffer + JSAMPROW row_pointer[1]; + int row_stride; cinfo.err = jpeg_std_error(&jerr); cinfo.err->output_message = my_output_message; jpeg_create_compress(&cinfo); jpeg_stdio_dest(&cinfo, outfile); - cinfo.image_width = width; // image width and height, in pixels + cinfo.image_width = width; // in pixels cinfo.image_height = height; - cinfo.input_components = 3; // # of color components per pixel - cinfo.in_color_space = JCS_RGB; // colorspace of input image + cinfo.input_components = 3; // 3 color components per pixel + cinfo.in_color_space = JCS_RGB; jpeg_set_defaults(&cinfo); jpeg_set_quality(&cinfo, quality, TRUE); jpeg_start_compress(&cinfo, TRUE); @@ -63,11 +63,6 @@ void create_jpeg(FILE *outfile, int width, int height, int quality){ row_stride = width * 3; i=cinfo.image_height-1; while (i >= 0) { - /* - jpeg_write_scanlines expects an array of pointers to scanlines. - Here the array is only one element long, but you could pass - more than one scanline at a time if that's more convenient. - */ row_pointer[0] = &pixels[i * row_stride]; (void) jpeg_write_scanlines(&cinfo, row_pointer, 1); i--;