IUP
view release on metacpan or search on metacpan
lib/IUP/Canvas.pod view on Meta::CPAN
=head3 cdPixel2MM()
($mm_dx, $mm_dy) = $canvas->cdPixel2MM($dx, $dy);
($mm_dx, $mm_dy) = $canvas->cdfPixel2MM($dx, $dy);
Converts sizes in pixels (canvas coordinates) into millimeters. You can
provide only the desired values and C<undef> for the others. Use this
function to obtain the horizontal and vertical resolution of the canvas
by passing 1 as parameter in dx and dy. The resolution value is
obtained using the formula B<res=1.0/mm>.
=head3 cdOrigin()
$canvas->cdOrigin($x, $y);
$canvas->cdfOrigin($x, $y);
Allows translating the origin - for instance, to the center of the
canvas. The function profits from the architecture of the library to
simulate a translation of the origin, which in fact is never actually
passed to the canvas in the respective driver. It is not related with
lib/IUP/Canvas.pod view on Meta::CPAN
points (1/72 inch) or in pixels (using negative values).
Default values: "B<System>", B<CD_PLAIN>, 12.
You can specify partial parameters using C<undef>, -1 and 0 for typeface,
style and size. When these parameters are specified the current font
parameter is used. For example: C<CanvasFont(undef, -1, 10)> will only
change the font size.
To convert between pixels and points use the function B<cdPixel2MM> to
convert from pixels to millimeters and use the formula "B<(value in
I<points>) = CD_MM2PT * (value in millimeters)>".
In WC, the size is specified in millimeters, but is internally
converted to points.
Fonts can heavily benefit from the ANTIALIAS attribute where available
in the driver.
=for html <p>
<table border="1">
lib/IUP/Internal/MglPlot.xs.inc view on Meta::CPAN
#endif
#### Original C function from <iup_mglplot.h> # void IupMglPlotDrawText(Ihandle* ih, const char* text, double x, double y, double z);
void
_IupMglPlotDrawText(Ihandle* ih, const char* text, double x, double y, double z)
CODE:
#ifdef HAVELIB_IUP_MGLPLOT
IupMglPlotDrawText(ih,text,x,y,z);
#endif
#### Original C function from <iup_mglplot.h> # void IupMglPlotSetFormula(Ihandle* ih, int ds_index, const char* formulaX, const char* formulaY, const char* formulaZ, int count);
void
_IupMglPlotSetFormula(Ihandle* ih, int ds_index, int count, char* formulaX, char* formulaY, char* formulaZ)
CODE:
#ifdef HAVELIB_IUP_MGLPLOT
IupMglPlotSetFormula(ih,ds_index,formulaX,formulaY,formulaZ,count);
#endif
#### Original C function from <iup_mglplot.h> # void IupMglPlotLoadData(Ihandle* ih, int ds_index, const char* filename, int count_x, int count_y, int count_z);
void
_IupMglPlotLoadData(Ihandle* ih, int ds_index, char* filename, ...)
INIT:
int count_x, count_y, count_z;
CODE:
#ifdef HAVELIB_IUP_MGLPLOT
count_x = (items>3) ? myST2INT(3) : 0;
count_y = (items>4) ? myST2INT(4) : 0;
count_z = (items>5) ? myST2INT(5) : 0;
IupMglPlotLoadData(ih,ds_index,filename,count_x,count_y,count_z);
#endif
#### Original C function from <iup_mglplot.h> # void IupMglPlotSetFromFormula(Ihandle* ih, int ds_index, const char* formula, int count_x, int count_y, int count_z);
void
_IupMglPlotSetFromFormula(Ihandle* ih, int ds_index, char* formula, ...)
INIT:
int count_x, count_y, count_z;
CODE:
#ifdef HAVELIB_IUP_MGLPLOT
count_x = (items>3) ? myST2INT(3) : 0;
count_y = (items>4) ? myST2INT(4) : 0;
count_z = (items>5) ? myST2INT(5) : 0;
IupMglPlotSetFromFormula(ih,ds_index,formula,count_x,count_y,count_z);
#endif
#### Original C function from <iup_mglplot.h> # void IupMglPlotSetData(Ihandle* ih, int ds_index, const double* data, int count_x, int count_y, int count_z);
void
_IupMglPlotSetData(Ihandle* ih, int ds_index, SV* data, int count_x, int count_y, int count_z)
CODE:
#ifdef HAVELIB_IUP_MGLPLOT
croak("XXX-FIXME IupMglPlotSetData not implemented");
//XXX-TODO iup.MglPlotSetData(ih: ihandle, ds_index: number, data: table of number) [in Lua]
//IupMglPlotSetData(ih,ds_index,data,count_x,count_y,count_z); /*XXX-FIXME*/
lib/IUP/Internal/Plot.xs.inc view on Meta::CPAN
# int IupPlotLoadData(Ihandle *ih, const char* filename, int strXdata);
# void IupPlotGetSample(Ihandle *ih, int ds_index, int sample_index, double *x, double *y); [in C]
# void IupPlotGetSampleStr(Ihandle *ih, int ds_index, int sample_index, const char* *x, double *y);
# int IupPlotGetSampleSelection(Ihandle *ih, int ds_index, int sample_index); [in C]
# double IupPlotGetSampleExtra(Ihandle *ih, int ds_index, int sample_index); [in C]
# void IupPlotSetSample(Ihandle *ih, int ds_index, int sample_index, double x, double y); [in C]
# void IupPlotSetSampleStr(Ihandle *ih, int ds_index, int sample_index, const char* x, double y);
# void IupPlotSetSampleSelection(Ihandle *ih, int ds_index, int sample_index, int selected);
# void IupPlotSetSampleExtra(Ihandle *ih, int ds_index, int sample_index, double extra); [in C]
# int IupPlotFindSample(Ihandle* ih, double cnv_x, double cnv_y, int *ds_index, int *sample_index); [in C]
# void IupPlotSetFormula(Ihandle* ih, int sample_count, const char* formula, const char* init); [in C]
lib/IUP/MglPlot.pod view on Meta::CPAN
#or
$plot->PlotPaintTo($filename, $width, $height, $dpi);
Plots to a vector imagefile instead of the display canvas. Note: only *.SVG and *.EPS formats are supported.
B<$width> and B<$height> is the size in pixels, and B<$dpi> is the resolution in dots or pixels per inch.
If B<width>, B<$height> or B<$dpi> are 0 the screen equivalent is used.
=head3 PlotSetFormula()
$plot->PlotSetFormula($ds_index, $count, $formulaX); # 1D
#or
$plot->PlotSetFormula($ds_index, $count, $formulaX, $formulaY); # 2D
#or
$plot->PlotSetFormula($ds_index, $count, $formulaX, $formulaY, $formulaZ); # 3D
Same as PlotSet1D/2D/3D but data is generated from a formula. If
B<$count> is 0 the current size is used. If 2D data then B<$formulaY>
must be non C<undef>. If 3D data then B<$formulaZ> must be non C<undef>. The
variables of the formulas must be x, y and/or z. Coordinates are
evaluated in the [0,1] interval. There is no difference between lower
or upper case in formulas. I<Linear data only.>
The operators and functions can be:
+ - * / ^ (^=integer power)
< > = & | (logical operators, &=true if a and b both nonzero, |=true if x or y nonzero)
sqrt(a) pow(a,b) log(a,b) ln(a) lg(a) (ln(a)=log(e,a) lg(a)=log(10,a)
abs(a) sign(a) mod(a,b) step(a) int(a) rnd pi
abs(a) sign(a) mod(a,b) step(a) int(a) rnd pi
sin(a) cos(a) tan(a) asin(a) acos(a) atan(a)
sinh(a) cosh(a) tanh(a) asinh(a) acosh(a) atanh(a)
=head3 PlotSetFromFormula()
$plot->PlotSetFromFormula($ds_index, $formula);
#or
$plot->PlotSetFromFormula($ds_index, $formula, $count_x);
#or
$plot->PlotSetFromFormula($ds_index, $formula, $count_x, $count_y);
#or
$plot->PlotSetFromFormula($ds_index, $formula, $count_x, $count_y, $count_z);
Same as L<PlotSetData|/"PlotSetData()"> but data is generated from a formula. If
all B<$count_*> are 0 (or undef) the current size remains, and the existing data is
preserved but overwritten if the formula results that. If any
B<$count_*> is NOT zero then the existing data size is removed. The
variables of the formulas must be x, y and/or z. Coordinates are
evaluated in the [0,1] interval. There is no difference between lower
or upper case in formulas. The operators and functions can be:
+ - * / ^ (^=integer power)
< > = & | (logical operators, &=true if a and b both nonzero, |=true if x or y nonzero)
sqrt(a) pow(a,b) log(a,b) ln(a) lg(a) (ln(a)=log(e,a) lg(a)=log(10,a)
abs(a) sign(a) mod(a,b) step(a) int(a) rnd pi
sin(a) cos(a) tan(a) asin(a) acos(a) atan(a)
sinh(a) cosh(a) tanh(a) asinh(a) acosh(a) atanh(a)
DS_COUNT is set to count_x*count_x*count_y.
( run in 0.275 second using v1.01-cache-2.11-cpan-26ccb49234f )