Magick++/lib/Options.cpp
// Skew to use in X axis when annotating with text or drawing
Skew to use in X axis when annotating with text or drawing
Skew to use in X axis when annotating with text or drawing
void Magick::Options::transformSkewX ( double skewx_ )
{
  AffineMatrix current = _drawInfo->affine;
  AffineMatrix affine;
  affine.sx=1.0;
  affine.rx=0.0;
  affine.ry=0.0;
  affine.sy=1.0;
  affine.tx=0.0;
  affine.ty=0.0;
  affine.sx=1.0;
  affine.ry=tan(DegreesToRadians(fmod(skewx_,360.0)));
  affine.sy=1.0;
  _drawInfo->affine.sx=current.sx*affine.sx+current.ry*affine.rx;
  _drawInfo->affine.rx=current.rx*affine.sx+current.sy*affine.rx;
  _drawInfo->affine.ry=current.sx*affine.ry+current.ry*affine.sy;
  _drawInfo->affine.sy=current.rx*affine.ry+current.sy*affine.sy;
  _drawInfo->affine.tx=current.sx*affine.tx+current.ry*affine.ty+current.tx;
  _drawInfo->affine.ty=current.rx*affine.tx+current.sy*affine.ty+current.ty;
}
void Magick :: Options :: transformSkewX ( double skewx_ ) { AffineMatrix current = _drawInfo -> affine ; AffineMatrix affine ; affine . sx = 1.0 ; affine . rx = 0.0 ; affine . ry = 0.0 ; affine . sy = 1.0 ; affine . tx = 0.0 ; affine . ty = 0.0 ; affine . sx = 1.0 ; affine . ry = tan ( DegreesToRadians ( fmod ( skewx_ , 360.0 ) ) ) ; affine . sy = 1.0 ; _drawInfo -> affine . sx = current . sx * affine . sx + current . ry * affine . rx ; _drawInfo -> affine . rx = current . rx * affine . sx + current . sy * affine . rx ; _drawInfo -> affine . ry = current . sx * affine . ry + current . ry * affine . sy ; _drawInfo -> affine . sy = current . rx * affine . ry + current . sy * affine . sy ; _drawInfo -> affine . tx = current . sx * affine . tx + current . ry * affine . ty + current . tx ; _drawInfo -> affine . ty = current . rx * affine . tx + current . sy * affine . ty + current . ty ; }
Skew to use in X axis when annotating with text or drawing
Skew to use in X axis when annotating with text or drawing