EMAN2
Static Public Member Functions | Static Private Attributes | List of all members
EMAN::GLUtil Class Reference

#include <glutil.h>

Static Public Member Functions

static unsigned int gen_glu_mipmaps (const EMData *const emdata)
 create an OpenGL mipmap set More...
 
static unsigned int gen_gl_texture (const EMData *const emdata, GLenum format=GL_LUMINANCE)
 create an OpenGL texture More...
 
static unsigned int render_amp8_gl_texture (EMData *emdata, int x0, int y0, int ixsize, int iysize, int bpl, float scale, int mingray, int maxgray, float render_min, float render_max, float gamma, int flags)
 create an OpenGL texture using render_amp8 More...
 
static int nearest_projected_points (const vector< float > &model_matrix, const vector< float > &proj_matrix, const vector< int > &view_matrix, const vector< Vec3f > &points, const float mouse_x, const float mouse_y, const float &nearnes)
 Determine the intersection of .... More...
 
static void colored_rectangle (const vector< float > &data, const float &alpha, const bool center_point=false)
 
static void mx_bbox (const vector< float > &data, const vector< float > &text_color, const vector< float > &bg_color)
 
static EMBytes render_amp8 (EMData *emdata, int x, int y, int xsize, int ysize, int bpl, float scale, int min_gray, int max_gray, float min_render, float max_render, float gamma, int flags)
 Render the image into an 8-bit image. More...
 
static unsigned long get_isosurface_dl (MarchingCubes *mc, unsigned int tex_id=0, bool surface_face_z=false, bool recontour=true)
 Get an isosurface display list Traverses the tree, marches the cubes, and renders a display list using the associated vertices and normals Uses OpenGL arrays for maximum performance DEPRECATED. More...
 
static void render_using_VBOs (MarchingCubes *mc, unsigned int tex_id=0, bool surface_face_z=false)
 Render a isosurface using buffer objects, this uses non-deprecated methods and improves performance. More...
 
static void contour_isosurface (MarchingCubes *mc)
 Recountour isosurface, for use with VBOs. More...
 
static void glLoadMatrix (const Transform &xform)
 Load a EMAN style transform to open GL w/o having to go through python Calls glLoadTransposeMatrix rather than glLoadMatrix to convert between C/C++/Python row-major format and openGL's Column major format. More...
 
static void glMultMatrix (const Transform &xform)
 Mult a EMAN style transform to open GL w/o having to go through python Calls glMultTransposeMatrix rather than glMultMatrix to convert between C/C++/Python row-major format and openGL's Column major format. More...
 
static void glDrawBoundingBox (float width, float height, float depth)
 Draw a bounding box. More...
 
static void glDrawDisk (float radius, int spokes)
 

Static Private Attributes

static GLuint buffer [2]
 

Detailed Description

Definition at line 52 of file glutil.h.

Member Function Documentation

◆ colored_rectangle()

static void EMAN::GLUtil::colored_rectangle ( const vector< float > &  data,
const float &  alpha,
const bool  center_point = false 
)
static

◆ contour_isosurface()

static void EMAN::GLUtil::contour_isosurface ( MarchingCubes mc)
static

Recountour isosurface, for use with VBOs.

◆ gen_gl_texture()

static unsigned int EMAN::GLUtil::gen_gl_texture ( const EMData *const  emdata,
GLenum  format = GL_LUMINANCE 
)
static

create an OpenGL texture

Parameters
emdataThe image data that will be used to create the texture
formatglTexImage() sets its internalFormat and format parameters to this value. Can be GL_COLOR_INDEX, GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_RGB, GL_BGR, GL_RGBA, GL_BGRA, GL_LUMINANCE, or GL_LUMINANCE_ALPHA
Returns
the texture id used in the call to glBindTextures

◆ gen_glu_mipmaps()

static unsigned int EMAN::GLUtil::gen_glu_mipmaps ( const EMData *const  emdata)
static

create an OpenGL mipmap set

Returns
the texture id used in the call to glBindTextures

◆ get_isosurface_dl()

static unsigned long EMAN::GLUtil::get_isosurface_dl ( MarchingCubes mc,
unsigned int  tex_id = 0,
bool  surface_face_z = false,
bool  recontour = true 
)
static

Get an isosurface display list Traverses the tree, marches the cubes, and renders a display list using the associated vertices and normals Uses OpenGL arrays for maximum performance DEPRECATED.

Returns
an OpenGL display list number

◆ glDrawBoundingBox()

static void EMAN::GLUtil::glDrawBoundingBox ( float  width,
float  height,
float  depth 
)
static

Draw a bounding box.

This is done on the C side to simplify vertex arrays

◆ glDrawDisk()

static void EMAN::GLUtil::glDrawDisk ( float  radius,
int  spokes 
)
static

◆ glLoadMatrix()

static void EMAN::GLUtil::glLoadMatrix ( const Transform xform)
static

Load a EMAN style transform to open GL w/o having to go through python Calls glLoadTransposeMatrix rather than glLoadMatrix to convert between C/C++/Python row-major format and openGL's Column major format.

Parameters
xformThe Transform to apply

◆ glMultMatrix()

static void EMAN::GLUtil::glMultMatrix ( const Transform xform)
static

Mult a EMAN style transform to open GL w/o having to go through python Calls glMultTransposeMatrix rather than glMultMatrix to convert between C/C++/Python row-major format and openGL's Column major format.

Parameters
xformThe Transform to apply

◆ mx_bbox()

static void EMAN::GLUtil::mx_bbox ( const vector< float > &  data,
const vector< float > &  text_color,
const vector< float > &  bg_color 
)
static

◆ nearest_projected_points()

static int EMAN::GLUtil::nearest_projected_points ( const vector< float > &  model_matrix,
const vector< float > &  proj_matrix,
const vector< int > &  view_matrix,
const vector< Vec3f > &  points,
const float  mouse_x,
const float  mouse_y,
const float &  nearnes 
)
static

Determine the intersection of ....

just ask David Woolford

◆ render_amp8()

static EMBytes EMAN::GLUtil::render_amp8 ( EMData emdata,
int  x,
int  y,
int  xsize,
int  ysize,
int  bpl,
float  scale,
int  min_gray,
int  max_gray,
float  min_render,
float  max_render,
float  gamma,
int  flags 
)
static

Render the image into an 8-bit image.

2D images only. flags provide a way to do unusual things with this function, such as calculating a histogram of the rendered area.

Parameters
xorigin of the area to render
y
xsizesize of the area to render in output pixels
ysize
bplbytes per line, if asrgb remember *3
scalescale factor for rendering
min_grayminimum gray value to render (0-255)
max_graymaximum gray value to render (0-255)
min_renderfloat image density corresponding to min_gray
max_renderfloat image density corresponding to max_gray
gamma
flags1-RGB (24 bit) rendering,2-add a 256 int greyscale histogram to the end of the image array,4-invert y axis,8-render 32 bit 0xffRRGGBB,16-Color display of complex images
Exceptions
ImageDimensionExceptionIf the image is not 2D.

◆ render_amp8_gl_texture()

static unsigned int EMAN::GLUtil::render_amp8_gl_texture ( EMData emdata,
int  x0,
int  y0,
int  ixsize,
int  iysize,
int  bpl,
float  scale,
int  mingray,
int  maxgray,
float  render_min,
float  render_max,
float  gamma,
int  flags 
)
static

create an OpenGL texture using render_amp8

Returns
the texture id used in the call to glBindTextures

◆ render_using_VBOs()

static void EMAN::GLUtil::render_using_VBOs ( MarchingCubes mc,
unsigned int  tex_id = 0,
bool  surface_face_z = false 
)
static

Render a isosurface using buffer objects, this uses non-deprecated methods and improves performance.

Member Data Documentation

◆ buffer

GLuint EMAN::GLUtil::buffer[2]
staticprivate

Definition at line 133 of file glutil.h.


The documentation for this class was generated from the following file: