MCPcopy Create free account
hub / github.com/MITK/MITK / AdjustImageSize

Method AdjustImageSize

Modules/Annotation/src/mitkVtkLogoRepresentation.cpp:35–51  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

33
34//----------------------------------------------------------------------
35inline void mitkVtkLogoRepresentation::AdjustImageSize(double /*o*/[2], double borderSize[2], double imageSize[2])
36{
37 // Scale the image to fit with in the border.
38 // Also update the origin so the image is centered.
39 double r0 = borderSize[0] / imageSize[0];
40 double r1 = borderSize[1] / imageSize[1];
41 if (r0 > r1)
42 {
43 imageSize[0] *= r1;
44 imageSize[1] *= r1;
45 }
46 else
47 {
48 imageSize[0] *= r0;
49 imageSize[1] *= r0;
50 }
51}
52
53//-------------------------------------------------------------------------
54void mitkVtkLogoRepresentation::BuildRepresentation()

Callers 1

BuildRepresentationMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected