Skip to content
Snippets Groups Projects
Commit b7266209 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

typos

parent 28d0d582
Branches
Tags
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* GL2JPEG, an OpenGL to JPEG Printing Library * GL2JPEG, an OpenGL to JPEG Printing Library
* Copyright (C) 1999-2002 Christophe Geuzaine * 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 * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * 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){ ...@@ -39,18 +39,18 @@ void create_jpeg(FILE *outfile, int width, int height, int quality){
unsigned char *pixels; unsigned char *pixels;
struct jpeg_compress_struct cinfo; struct jpeg_compress_struct cinfo;
struct jpeg_error_mgr jerr; struct jpeg_error_mgr jerr;
JSAMPROW row_pointer[1]; // pointer to JSAMPLE row[s] JSAMPROW row_pointer[1];
int row_stride; // physical row width in image buffer int row_stride;
cinfo.err = jpeg_std_error(&jerr); cinfo.err = jpeg_std_error(&jerr);
cinfo.err->output_message = my_output_message; cinfo.err->output_message = my_output_message;
jpeg_create_compress(&cinfo); jpeg_create_compress(&cinfo);
jpeg_stdio_dest(&cinfo, outfile); 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.image_height = height;
cinfo.input_components = 3; // # of color components per pixel cinfo.input_components = 3; // 3 color components per pixel
cinfo.in_color_space = JCS_RGB; // colorspace of input image cinfo.in_color_space = JCS_RGB;
jpeg_set_defaults(&cinfo); jpeg_set_defaults(&cinfo);
jpeg_set_quality(&cinfo, quality, TRUE); jpeg_set_quality(&cinfo, quality, TRUE);
jpeg_start_compress(&cinfo, TRUE); jpeg_start_compress(&cinfo, TRUE);
...@@ -63,11 +63,6 @@ void create_jpeg(FILE *outfile, int width, int height, int quality){ ...@@ -63,11 +63,6 @@ void create_jpeg(FILE *outfile, int width, int height, int quality){
row_stride = width * 3; row_stride = width * 3;
i=cinfo.image_height-1; i=cinfo.image_height-1;
while (i >= 0) { 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]; row_pointer[0] = &pixels[i * row_stride];
(void) jpeg_write_scanlines(&cinfo, row_pointer, 1); (void) jpeg_write_scanlines(&cinfo, row_pointer, 1);
i--; i--;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment