26 #if defined (HAVE_CONFIG_H) 30 #if defined (HAVE_OSMESA_H) 32 #elif defined (HAVE_GL_OSMESA_H) 33 # include <GL/osmesa.h> 54 #if defined (HAVE_OSMESA) 96 #if defined (HAVE_OSMESA) 98 int nargin = args.length ();
105 if (! (args(1).is_string () && args(2).is_string ()))
106 error (
"__osmesa_print__: FILE and TERM must be strings");
111 int h = args(0).double_value ();
113 if (! (fobj && fobj.
isa (
"figure")))
114 error (
"__osmesa_print__: H must be a valid figure handle");
119 bool internal =
true;
122 GLsizei Width =
static_cast<GLsizei
> (bb(2));
123 GLsizei Height =
static_cast<GLsizei
> (bb(3));
126 OSMesaContext ctx = OSMesaCreateContextExt (OSMESA_RGBA, 16, 0, 0,
nullptr);
128 error (
"__osmesa_print__: OSMesaCreateContext failed!\n");
134 if (! OSMesaMakeCurrent (ctx, buffer, GL_UNSIGNED_BYTE, Width, Height))
135 error (
"__osmesa_print__: OSMesaMakeCurrent failed!\n");
143 glGetIntegerv (GL_DEPTH_BITS, &z);
144 glGetIntegerv (GL_STENCIL_BITS, &
s);
145 if (z != 16 ||
s != 0)
146 error (
"__osmesa_print__: Depth and stencil doesn't match," 147 " are you sure you are using OSMesa >= 9.0?");
151 bool v = fp.is_visible ();
155 outer_frame.
add_fcn (reset_visibility, &fp);
181 assert (
sizeof (GLubyte) == 1);
183 unsigned char *
p =
reinterpret_cast<unsigned char *
>(img.
fortran_vec ());
184 memcpy (
p, buffer, (4 * Width * Height));
202 OSMesaDestroyContext (ctx);
208 octave_unused_parameter (args);
For example cd octave end example noindent changes the current working directory to file
static const idx_vector colon
OCTINTERP_API void print_usage(void)
virtual void draw(const graphics_object &go, bool toplevel=true)
const T * fortran_vec(void) const
void add_fcn(void(*fcn)(void))
void error(const char *fmt,...)
bool isa(const std::string &go_name) const
MArray< T > permute(const Array< octave_idx_type > &vec, bool inv=false) const
void gl2ps_print(const graphics_object &fig, const std::string &stream, const std::string &term)
base_properties & get_properties(void)
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
static graphics_object get_object(double val)
#define DEFUN_DLD(name, args_name, nargout_name, doc)
Macro to define an at run time dynamically loadable builtin function.
virtual void finish(void)
Vector representing the dimensions (size) of an Array.
void err_disabled_feature(const std::string &fcn, const std::string &feature, const std::string &pkg)
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
static idx_vector make_range(octave_idx_type start, octave_idx_type step, octave_idx_type len)