Mercurial > octave
comparison src/gl2ps-renderer.cc @ 9950:7dedfd70dd9f
image printing for fltk backend
author | Shai Ayal <shaiay@users.sourceforge.net> |
---|---|
date | Wed, 09 Dec 2009 15:49:00 -0500 |
parents | 92d8f35ff217 |
children | cd96d29c5efa |
comparison
equal
deleted
inserted
replaced
9949:a6308dcad5ac | 9950:7dedfd70dd9f |
---|---|
143 fontname = "Helvetica"; | 143 fontname = "Helvetica"; |
144 | 144 |
145 // FIXME -- add support for bold and italic | 145 // FIXME -- add support for bold and italic |
146 } | 146 } |
147 | 147 |
148 template <typename T> | |
149 static void | |
150 draw_pixels (GLsizei w, GLsizei h, GLenum format, const T *data) | |
151 { | |
152 OCTAVE_LOCAL_BUFFER (GLfloat, a, 3*w*h); | |
153 | |
154 for (int i = 0; i < 3*w*h; i++) | |
155 a[i] = data[i]; | |
156 | |
157 gl2psDrawPixels (w, h, 0, 0, format, GL_FLOAT, a); | |
158 } | |
159 | |
160 void | |
161 glps_renderer::draw_pixels (GLsizei w, GLsizei h, GLenum format, | |
162 GLenum type, const GLvoid *data) | |
163 { | |
164 if (type == GL_UNSIGNED_SHORT) | |
165 ::draw_pixels (w, h, format, static_cast<const GLushort *> (data)); | |
166 else if (type == GL_UNSIGNED_BYTE) | |
167 ::draw_pixels (w, h, format, static_cast<const GLubyte *> (data)); | |
168 else | |
169 gl2psDrawPixels (w, h, 0, 0, format, type, data); | |
170 } | |
171 | |
148 #endif | 172 #endif |
149 | 173 |
150 /* | 174 /* |
151 ;;; Local Variables: *** | 175 ;;; Local Variables: *** |
152 ;;; mode: C++ *** | 176 ;;; mode: C++ *** |