MCPcopy Create free account
hub / github.com/MapServer/MapServer / invert

Method invert

renderers/agg/include/agg_trans_perspective.h:336–359  ·  view source on GitHub ↗

------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

334
335 //------------------------------------------------------------------------
336 inline bool trans_perspective::invert()
337 {
338 double d0 = sy * w2 - w1 * ty;
339 double d1 = w0 * ty - shy * w2;
340 double d2 = shy * w1 - w0 * sy;
341 double d = sx * d0 + shx * d1 + tx * d2;
342 if(d == 0.0)
343 {
344 sx = shy = w0 = shx = sy = w1 = tx = ty = w2 = 0.0;
345 return false;
346 }
347 d = 1.0 / d;
348 trans_perspective a = *this;
349 sx = d * d0;
350 shy = d * d1;
351 w0 = d * d2;
352 shx = d * (a.w1 *a.tx - a.shx*a.w2);
353 sy = d * (a.sx *a.w2 - a.w0 *a.tx);
354 w1 = d * (a.w0 *a.shx - a.sx *a.w1);
355 tx = d * (a.shx*a.ty - a.sy *a.tx);
356 ty = d * (a.shy*a.tx - a.sx *a.ty);
357 w2 = d * (a.sx *a.sy - a.shy*a.shx);
358 return true;
359 }
360
361 //------------------------------------------------------------------------
362 inline bool trans_perspective::quad_to_square(const double* q)

Callers 6

agg2RenderPixmapSymbolFunction · 0.80
operator ~Method · 0.80
inverse_transformMethod · 0.80
operator ~Method · 0.80
agg_trans_affine.hFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected