"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/Graphics/Pictures/effect.cpp" between
TeXmacs-1.99.4-src.tar.gz and TeXmacs-1.99.5-src.tar.gz

About: GNU TeXmacs is a what-you-see-is-what-you-get scientific text editor, which was both inspired by TeX and GNU Emacs.

effect.cpp  (TeXmacs-1.99.4-src):effect.cpp  (TeXmacs-1.99.5-src)
skipping to change at line 61 skipping to change at line 61
/****************************************************************************** /******************************************************************************
* Unmodified argument * Unmodified argument
******************************************************************************/ ******************************************************************************/
class argument_effect_rep: public effect_rep { class argument_effect_rep: public effect_rep {
int nr; int nr;
public: public:
argument_effect_rep (int nr2): nr (nr2) {} argument_effect_rep (int nr2): nr (nr2) {}
rectangle get_logical_extents (array<rectangle> rs) { return rs[nr]; } rectangle get_logical_extents (array<rectangle> rs) { return rs[nr]; }
rectangle get_extents (array<rectangle> rs) { return rs[nr]; } rectangle get_extents (array<rectangle> rs) { return rs[nr]; }
picture apply (array<picture> pics, SI pixel) { return pics[nr]; } picture apply (array<picture> pics, SI pixel) {
(void) pixel; return pics[nr]; }
}; };
effect argument_effect (int nr) { effect argument_effect (int nr) {
return tm_new<argument_effect_rep> (nr); } return tm_new<argument_effect_rep> (nr); }
/****************************************************************************** /******************************************************************************
* Turbulence effect
******************************************************************************/
class turbulence_effect_rep: public effect_rep {
effect eff;
long seed;
double w, h;
int octaves;
bool frac_sum;
public:
turbulence_effect_rep (effect e, long s, double w2, double h2, int o, bool f):
eff (e), seed (s), w (w2), h (h2), octaves (o), frac_sum (f) {}
rectangle get_logical_extents (array<rectangle> rs) {
return eff->get_logical_extents (rs); }
rectangle get_extents (array<rectangle> rs) {
return eff->get_extents (rs); }
picture apply (array<picture> pics, SI pixel) {
if (frac_sum)
return fractal_noise (eff->apply (pics, pixel), seed,
w / pixel, h / pixel, octaves);
else
return turbulence (eff->apply (pics, pixel), seed,
w / pixel, h / pixel, octaves); }
};
effect turbulence (effect e, long s, double w, double h, int oct) {
return tm_new<turbulence_effect_rep> (e, s, w, h, oct, false); }
effect fractal_noise (effect e, long s, double w, double h, int oct) {
return tm_new<turbulence_effect_rep> (e, s, w, h, oct, true); }
/******************************************************************************
* Coordinate transformations * Coordinate transformations
******************************************************************************/ ******************************************************************************/
class move_effect_rep: public effect_rep { class move_effect_rep: public effect_rep {
effect eff; effect eff;
double dx, dy; double dx, dy;
public: public:
move_effect_rep (effect eff2, double dx2, double dy2): move_effect_rep (effect eff2, double dx2, double dy2):
eff (eff2), dx (dx2), dy (dy2) {} eff (eff2), dx (dx2), dy (dy2) {}
rectangle get_extents (array<rectangle> rs) { rectangle get_extents (array<rectangle> rs) {
skipping to change at line 270 skipping to change at line 302
effect blur (effect eff, effect pen) { effect blur (effect eff, effect pen) {
return tm_new<blur_effect_rep> (eff, pen); } return tm_new<blur_effect_rep> (eff, pen); }
effect outline (effect eff, effect pen) { effect outline (effect eff, effect pen) {
return tm_new<outline_effect_rep> (eff, pen); } return tm_new<outline_effect_rep> (eff, pen); }
effect thicken (effect eff, effect pen) { effect thicken (effect eff, effect pen) {
return tm_new<thicken_effect_rep> (eff, pen); } return tm_new<thicken_effect_rep> (eff, pen); }
effect erode (effect eff, effect pen) { effect erode (effect eff, effect pen) {
return tm_new<erode_effect_rep> (eff, pen); } return tm_new<erode_effect_rep> (eff, pen); }
/****************************************************************************** /******************************************************************************
* Effects that depend on randomization
******************************************************************************/
class degrade_effect_rep: public effect_rep {
effect eff;
double wx, wy, th, sh;
public:
degrade_effect_rep (effect e2, double Wx, double Wy, double Th, double Sh):
eff (e2), wx (Wx), wy (Wy), th (Th), sh (Sh) {}
rectangle get_extents (array<rectangle> rs) {
return eff->get_extents (rs); }
picture apply (array<picture> pics, SI pixel) {
return degrade (eff->apply (pics, pixel),
wx / pixel, wy / pixel, th, sh); }
};
effect degrade (effect eff, double wx, double wy, double th, double sh) {
return tm_new<degrade_effect_rep> (eff, wx, wy, th, sh); }
class distort_effect_rep: public effect_rep {
effect eff;
double wx, wy, rx, ry;
public:
distort_effect_rep (effect e2, double Wx, double Wy, double Rx, double Ry):
eff (e2), wx (Wx), wy (Wy), rx (Rx), ry (Ry) {}
rectangle get_extents (array<rectangle> rs) {
return eff->get_extents (rs); }
picture apply (array<picture> pics, SI pixel) {
return distort (eff->apply (pics, pixel),
wx / pixel, wy / pixel, rx / pixel, ry / pixel); }
};
effect distort (effect eff, double wx, double wy, double rx, double ry) {
return tm_new<distort_effect_rep> (eff, wx, wy, rx, ry); }
class gnaw_effect_rep: public effect_rep {
effect eff;
double wx, wy, rx, ry;
public:
gnaw_effect_rep (effect e2, double Wx, double Wy, double Rx, double Ry):
eff (e2), wx (Wx), wy (Wy), rx (Rx), ry (Ry) {}
rectangle get_extents (array<rectangle> rs) {
return eff->get_extents (rs); }
picture apply (array<picture> pics, SI pixel) {
return gnaw (eff->apply (pics, pixel),
wx / pixel, wy / pixel, rx / pixel, ry / pixel); }
};
effect gnaw (effect eff, double wx, double wy, double rx, double ry) {
return tm_new<gnaw_effect_rep> (eff, wx, wy, rx, ry); }
/******************************************************************************
* Composing various effects * Composing various effects
******************************************************************************/ ******************************************************************************/
class compose_effect_rep: public effect_rep { class compose_effect_rep: public effect_rep {
array<effect> effs; array<effect> effs;
composition_mode mode; composition_mode mode;
public: public:
compose_effect_rep (array<effect> e, composition_mode m): compose_effect_rep (array<effect> e, composition_mode m):
effs (e), mode (m) { effs (e), mode (m) {
ASSERT (N (effs) > 0, "at least one effect expected"); } ASSERT (N (effs) > 0, "at least one effect expected"); }
skipping to change at line 431 skipping to change at line 515
else if (is_func (t, EFF_BUBBLE, 3)) { else if (is_func (t, EFF_BUBBLE, 3)) {
effect eff= build_effect (t[0]); effect eff= build_effect (t[0]);
double r = as_double (t[1]); double r = as_double (t[1]);
double a = as_double (t[2]); double a = as_double (t[2]);
return bubble (eff, r, a); return bubble (eff, r, a);
} }
else if (is_func (t, EFF_GAUSSIAN, 1)) { else if (is_func (t, EFF_GAUSSIAN, 1)) {
double r= as_double (t[0]); double r= as_double (t[0]);
return gaussian_pen_effect (r); return gaussian_pen_effect (r);
} }
else if (is_func (t, EFF_TURBULENCE, 5)) {
effect e= build_effect (t[0]);
int s= as_int (t[1]);
double w= as_double (t[2]);
double h= as_double (t[3]);
int o= as_int (t[4]);
return turbulence (e, s, w, h, o);
}
else if (is_func (t, EFF_FRACTAL_NOISE, 5)) {
effect e= build_effect (t[0]);
int s= as_int (t[1]);
double w= as_double (t[2]);
double h= as_double (t[3]);
int o= as_int (t[4]);
return fractal_noise (e, s, w, h, o);
}
else if (is_func (t, EFF_GAUSSIAN, 3)) { else if (is_func (t, EFF_GAUSSIAN, 3)) {
double rx= as_double (t[0]); double rx= as_double (t[0]);
double ry= as_double (t[1]); double ry= as_double (t[1]);
double a = as_double (t[2]); double a = as_double (t[2]);
return gaussian_pen_effect (rx, ry, a); return gaussian_pen_effect (rx, ry, a);
} }
else if (is_func (t, EFF_OVAL, 1)) { else if (is_func (t, EFF_OVAL, 1)) {
double r= as_double (t[0]); double r= as_double (t[0]);
return oval_pen_effect (r); return oval_pen_effect (r);
} }
skipping to change at line 482 skipping to change at line 582
else if (is_func (t, EFF_THICKEN, 2)) { else if (is_func (t, EFF_THICKEN, 2)) {
effect eff = build_effect (t[0]); effect eff = build_effect (t[0]);
effect pen= build_effect (t[1]); effect pen= build_effect (t[1]);
return thicken (eff, pen); return thicken (eff, pen);
} }
else if (is_func (t, EFF_ERODE, 2)) { else if (is_func (t, EFF_ERODE, 2)) {
effect eff = build_effect (t[0]); effect eff = build_effect (t[0]);
effect pen= build_effect (t[1]); effect pen= build_effect (t[1]);
return erode (eff, pen); return erode (eff, pen);
} }
else if (is_func (t, EFF_DEGRADE, 5)) {
effect eff= build_effect (t[0]);
double wx = as_double (t[1]);
double wy = as_double (t[2]);
double th = as_double (t[3]);
double sh = as_double (t[4]);
return degrade (eff, wx, wy, th, sh);
}
else if (is_func (t, EFF_DISTORT, 5)) {
effect eff= build_effect (t[0]);
double wx = as_double (t[1]);
double wy = as_double (t[2]);
double rx = as_double (t[3]);
double ry = as_double (t[4]);
return distort (eff, wx, wy, rx, ry);
}
else if (is_func (t, EFF_GNAW, 5)) {
effect eff= build_effect (t[0]);
double wx = as_double (t[1]);
double wy = as_double (t[2]);
double rx = as_double (t[3]);
double ry = as_double (t[4]);
return gnaw (eff, wx, wy, rx, ry);
}
else if (is_func (t, EFF_SUPERPOSE)) { else if (is_func (t, EFF_SUPERPOSE)) {
array<effect> effs= build_effects (A(t)); array<effect> effs= build_effects (A(t));
return superpose (effs); return superpose (effs);
} }
else if (is_func (t, EFF_ADD)) { else if (is_func (t, EFF_ADD)) {
array<effect> effs= build_effects (A(t)); array<effect> effs= build_effects (A(t));
return add (effs); return add (effs);
} }
else if (is_func (t, EFF_SUB)) { else if (is_func (t, EFF_SUB)) {
array<effect> effs= build_effects (A(t)); array<effect> effs= build_effects (A(t));
 End of changes. 5 change blocks. 
1 lines changed or deleted 125 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS