#include "HxImageRep.h"
Go to the source code of this file.
Functions | |
| HxImageRep L_HXIMAGEREP | HxRotate (HxImageRep img, double alpha, HxGeoIntType gi=LINEAR, int adjustSize=1, HxValue background=HxValue(0)) |
| Rotation (around Z-axis in middle of image). More... | |
|
||||||||||||||||||||||||
|
Rotation (around Z-axis in middle of image). This is the normal rotation in 2D. Alpha in degrees.
00016 {
00017 HxString fname("HxRotate");
00018
00019 if (img.isNull())
00020 {
00021 HxGlobalError::instance()->reportError(fname, img.name(), "null image", HxGlobalError::HX_GE_INVALID);
00022 return HxImageRep();
00023 }
00024
00025 if (img.dimensionality() == 2) {
00026 HxMatrix m =
00027 HxMatrix::translate2d(
00028 img.dimensionSize(1)/2, img.dimensionSize(2)/2) *
00029 HxMatrix::rotate2dDeg(-alpha) * // Y-axis points down
00030 HxMatrix::translate2d(
00031 -img.dimensionSize(1)/2, -img.dimensionSize(2)/2);
00032 return img.geometricOp2d(m, gi, FORWARD, adjustSize, background);
00033 } else {
00034 HxEnvironment::instance()->errorStream()
00035 << "3d rotation not implemented yet" << STD_ENDL;
00036 HxEnvironment::instance()->flush();
00037 return HxImageRep();
00038 }
00039 }
|
1.2.12 written by Dimitri van Heesch,
© 1997-2001