2010-08-04 16:54:58 +08:00
|
|
|
/****************************************************************************
|
|
|
|
Copyright (c) 2010 cocos2d-x.org
|
|
|
|
|
|
|
|
http://www.cocos2d-x.org
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
THE SOFTWARE.
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef __COCOA_CGAFFINETRANSFORM_H__
|
|
|
|
#define __COCOA_CGAFFINETRANSFORM_H__
|
|
|
|
|
2011-03-07 17:11:57 +08:00
|
|
|
#include "CCGeometry.h"
|
2011-12-20 10:39:10 +08:00
|
|
|
#include "CCPlatformMacros.h"
|
|
|
|
|
2010-08-04 16:54:58 +08:00
|
|
|
namespace cocos2d {
|
|
|
|
|
2011-03-07 17:11:57 +08:00
|
|
|
struct CCAffineTransform {
|
2012-04-13 14:09:02 +08:00
|
|
|
CCFloat a, b, c, d;
|
|
|
|
CCFloat tx, ty;
|
2010-08-04 16:54:58 +08:00
|
|
|
};
|
|
|
|
|
2012-04-13 14:09:02 +08:00
|
|
|
CC_DLL CCAffineTransform __CCAffineTransformMake(CCFloat a, CCFloat b, CCFloat c, CCFloat d, CCFloat tx, CCFloat ty);
|
2011-03-07 17:11:57 +08:00
|
|
|
#define CCAffineTransformMake __CCAffineTransformMake
|
2010-08-04 16:54:58 +08:00
|
|
|
|
2011-12-20 10:39:10 +08:00
|
|
|
CC_DLL CCPoint __CCPointApplyAffineTransform(const CCPoint& point, const CCAffineTransform& t);
|
2011-03-07 17:11:57 +08:00
|
|
|
#define CCPointApplyAffineTransform __CCPointApplyAffineTransform
|
2010-08-04 16:54:58 +08:00
|
|
|
|
2011-12-20 10:39:10 +08:00
|
|
|
CC_DLL CCSize __CCSizeApplyAffineTransform(const CCSize& size, const CCAffineTransform& t);
|
2011-03-07 17:11:57 +08:00
|
|
|
#define CCSizeApplyAffineTransform __CCSizeApplyAffineTransform
|
2010-08-04 16:54:58 +08:00
|
|
|
|
2011-12-20 10:39:10 +08:00
|
|
|
CC_DLL CCAffineTransform CCAffineTransformMakeIdentity();
|
|
|
|
CC_DLL CCRect CCRectApplyAffineTransform(const CCRect& rect, const CCAffineTransform& anAffineTransform);
|
2011-08-17 21:19:57 +08:00
|
|
|
|
2011-12-20 10:39:10 +08:00
|
|
|
CC_DLL CCAffineTransform CCAffineTransformTranslate(const CCAffineTransform& t, float tx, float ty);
|
2012-04-13 14:09:02 +08:00
|
|
|
CC_DLL CCAffineTransform CCAffineTransformRotate(const CCAffineTransform& aTransform, CCFloat anAngle);
|
|
|
|
CC_DLL CCAffineTransform CCAffineTransformScale(const CCAffineTransform& t, CCFloat sx, CCFloat sy);
|
2011-12-20 10:39:10 +08:00
|
|
|
CC_DLL CCAffineTransform CCAffineTransformConcat(const CCAffineTransform& t1, const CCAffineTransform& t2);
|
|
|
|
CC_DLL bool CCAffineTransformEqualToTransform(const CCAffineTransform& t1, const CCAffineTransform& t2);
|
|
|
|
CC_DLL CCAffineTransform CCAffineTransformInvert(const CCAffineTransform& t);
|
2010-08-04 16:54:58 +08:00
|
|
|
|
2011-03-07 17:11:57 +08:00
|
|
|
extern const CCAffineTransform CCAffineTransformIdentity;
|
2010-08-04 16:54:58 +08:00
|
|
|
}//namespace cocos2d
|
|
|
|
|
|
|
|
#endif // __COCOA_CGAFFINETRANSFORM_H__
|