| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
4.5.3 Bitmap in memory
These functions return the created picture (bitmap), its width and height. You may display it by yourself in any graphical library (see also, Widget classes) or save in file (see also, Export to file).
- Method on
mglGraph:const unsigned char *GetRGB () - Method on
mglGraph:voidGetRGB (char *buf,intsize) - Method on
mglGraph:voidGetBGRN (char *buf,intsize) - C function:
const unsigned char *mgl_get_rgb (HMGLgr) Gets RGB bitmap of the current state of the image. Format of each element of bits is: {red, green, blue}. Number of elements is Width*Height. Position of element {i,j} is [3*i + 3*Width*j] (or is [4*i + 4*Width*j] for
GetBGRN()). You have to provide the proper size of the buffer, buf, i.e. the code for Python should look likefrom mathgl import * gr = mglGraph(); bits='\t'; bits=bits.expandtabs(4*gr.GetWidth()*gr.GetHeight()); gr.GetBGRN(bits, len(bits));
- Method on
mglGraph:const unsigned char *GetRGBA () - Method on
mglGraph:voidGetRGBA (char *buf,intsize) - C function:
const unsigned char *mgl_get_rgba (HMGLgr) Gets RGBA bitmap of the current state of the image. Format of each element of bits is: {red, green, blue, alpha}. Number of elements is Width*Height. Position of element {i,j} is [4*i + 4*Width*j].
- Method on
mglGraph:intGetWidth () - Method on
mglGraph:intGetHeight () - C function:
intmgl_get_width (HMGLgr) - C function:
intmgl_get_height (HMGLgr) Gets width and height of the image.
- Method on
mglGraph:mglPointCalcXYZ (intxs,intys) - C function:
voidmgl_calc_xyz (HMGLgr,intxs,intys,mreal *x,mreal *y,mreal *z) Calculate 3D coordinate {x,y,z} for screen point {xs,ys}. At this moment it ignore perspective and transformation formulas (curvilinear coordinates). The calculation are done for the last used InPlot (see Subplots and rotation).
- Method on
mglGraph:mglPointCalcScr (mglPointp) - C function:
voidmgl_calc_scr (HMGLgr,mrealx,mrealy,mrealz,int *xs,int *ys) Calculate screen point {xs,ys} for 3D coordinate {x,y,z}. The calculation are done for the last used InPlot (see Subplots and rotation).
- Method on
mglGraph:voidSetObjId (intid) - C function:
voidmgl_set_obj_id (HMGLgr,intid) Set the numeric id for object or subplot/inplot.
- Method on
mglGraph:intGetObjId (intxs,intys) - C function:
intmgl_get_obj_id (HMGLgr,intxs,intys) Get the numeric id for most upper object at pixel {xs, ys} of the picture.
- Method on
mglGraph:intGetSplId (intxs,intys) - C function:
intmgl_get_spl_id (HMGLgr,intxs,intys) Get the numeric id for most subplot/inplot at pixel {xs, ys} of the picture.
- Method on
mglGraph:voidHighlight (intid) - C function:
voidmgl_highlight (HMGLgr,intid) Highlight the object with given id.
- Method on
mglGraph:longIsActive (intxs,intys,intd=1) - C function:
longmgl_is_active (HMGLgr,intxs,intys,intd) Checks if point {xs, ys} is close to one of active point (i.e. mglBase::Act) with accuracy d and return its index or
-1if not found. Active points are special points which characterize primitives (like edges and so on). This function for advanced users only.
- Method on
mglGraph:longSetDrawReg (intnx=1,intny=1,intm=0) - C function:
longmgl_set_draw_reg (HMGLgr,intnx,intny,intm) Limits drawing region by rectangular area of m-th cell of matrix with sizes nx*ny (like in subplot). This function can be used to update only small region of the image for purposes of higher speed. This function for advanced users only.
| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on March 21, 2014 using texi2html 5.0.
