}
result
-_Canvas::DrawBitmap(const Point& point, const _Bitmap& bitmap, const Point& pivot, double degree)
+_Canvas::DrawBitmap(const _Util::Point<double>& point, const _Bitmap& bitmap, const _Util::Point<double>& pivot, double degree)
{
SysTryReturnResult(NID_GRP, &bitmap && bitmap.IsValid(), E_INVALID_ARG, "The source bitmap is invalid.\n");
_ApplySrcBitmapAttrib(srcImage, bitmap, bitmap.__isOpaqueAllOver);
// angle, xOffset, yOffset
- Tizen::Graphics::_Effect::RotateDesc rotateDesc = { int(degree), pivot.x, pivot.y };
- bool pass = Tizen::Graphics::_Effect::RotateImage(dstImage, point.x - clipRect.x, point.y - clipRect.y, srcImage, rotateDesc, alphaConstant);
+ Tizen::Graphics::_Effect::RotateDesc rotateDesc = { int(degree), int(pivot.x), int(pivot.y) };
+ bool pass = Tizen::Graphics::_Effect::RotateImage(dstImage, int(point.x) - clipRect.x, int(point.y) - clipRect.y, srcImage, rotateDesc, alphaConstant);
SysTryReturnResult(NID_GRP, pass, E_INVALID_ARG, "The source bitmap is invalid.\n");
result DrawBitmap(const Rectangle& destRect, const _Bitmap& srcBitmap, const Rectangle& srcRect);
result DrawBitmapForNinePatchedBitmap(const Rectangle& destRect, const _Bitmap& srcBitmap, const Rectangle& srcRect);
result DrawBitmap(const Point& point, const _Bitmap& bitmap, FlipDirection dir);
- result DrawBitmap(const Point& point, const _Bitmap& bitmap, const Point& pivot, double degree);
+ result DrawBitmap(const _Util::Point<double>& point, const _Bitmap& bitmap, const _Util::Point<double>& pivot, double degree);
result DrawNinePatchedBitmap(const Rectangle& rect, const _Bitmap& bitmap);
result DrawNineTiledBitmap(const Rectangle& rect, const _Bitmap& bitmap);
{
SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet.");
- SysTryReturnResult(NID_GRP, BITMAP_IS_VALID(bitmap), E_INVALID_ARG, "The source bitmap is invalid.");
-
- EXTRACT_BITMAPEX(pBitmapEx, bitmap);
-
- if (_ResUtil::NeedToConvertCoord())
- {
- Tizen::Graphics::Dimension virSize;
- Tizen::Graphics::Dimension phySize;
- bool lazyScaling = Tizen::Graphics::_IsLazyScalingBitmap(bitmap, virSize, phySize);
-
- Point pcPoint = _ResUtil::ConvertToPhyCoord(vcPoint);
- Point pcPivot = _ResUtil::ConvertToPhyCoord(vcPivot);
-
- if (lazyScaling)
- {
- EXTRACT_SCALED_BITMAPEX(pScaledBitmapEx, bitmap);
-
- return this->_pNativeCanvas->DrawBitmap(pcPoint, *pScaledBitmapEx, pcPivot, double(degree));
- }
- else
- {
- return this->_pNativeCanvas->DrawBitmap(pcPoint, *pBitmapEx, pcPivot, double(degree));
- }
- }
- else
- {
- return this->_pNativeCanvas->DrawBitmap(vcPoint, *pBitmapEx, vcPivot, double(degree));
- }
+ return this->DrawBitmap(FloatPoint(float(vcPoint.x), float(vcPoint.y)), bitmap, FloatPoint(float(vcPivot.x), float(vcPivot.y)), float(degree));
}
result
FloatPoint pcPointF = _ResUtil::ConvertToPhyCoord(vcPointF);
FloatPoint pcPivotF = _ResUtil::ConvertToPhyCoord(vcPivotF);
- Point pcPoint(_FloatToIntForPos(pcPointF.x), _FloatToIntForPos(pcPointF.y));
- Point pcPivot(_FloatToIntForPos(pcPivotF.x), _FloatToIntForPos(pcPivotF.y));
+ _Util::Point<double> pcPointD = _Util::Convert<FloatPoint, _Util::Point<double> >(pcPointF);
+ _Util::Point<double> pcPivotD = _Util::Convert<FloatPoint, _Util::Point<double> >(pcPivotF);
if (lazyScaling)
{
EXTRACT_SCALED_BITMAPEX(pScaledBitmapEx, bitmap);
- return this->_pNativeCanvas->DrawBitmap(pcPoint, *pScaledBitmapEx, pcPivot, double(degree));
+ return this->_pNativeCanvas->DrawBitmap(pcPointD, *pScaledBitmapEx, pcPivotD, double(degree));
}
else
{
- return this->_pNativeCanvas->DrawBitmap(pcPoint, *pBitmapEx, pcPivot, double(degree));
+ return this->_pNativeCanvas->DrawBitmap(pcPointD, *pBitmapEx, pcPivotD, double(degree));
}
}
else
{
- Point vcPoint(_FloatToIntForPos(vcPointF.x), _FloatToIntForPos(vcPointF.y));
- Point vcPivot(_FloatToIntForPos(vcPivotF.x), _FloatToIntForPos(vcPivotF.y));
-
- return this->_pNativeCanvas->DrawBitmap(vcPoint, *pBitmapEx, vcPivot, double(degree));
+ return this->_pNativeCanvas->DrawBitmap(_Util::Convert<FloatPoint, _Util::Point<double> >(vcPointF), *pBitmapEx, _Util::Convert<FloatPoint, _Util::Point<double> >(vcPivotF), double(degree));
}
}
return transform;
}
+pixman_transform_t GetTransform(double xDest, double yDest, double degree, double xPivot, double yPivot)
+{
+ pixman_transform_t transform;
+
+ double c = cos(degree * 3.141592 / 180.0);
+ double s = sin(degree * 3.141592 / 180.0);
+
+ pixman_transform_init_identity(&transform);
+
+ pixman_transform_translate(&transform, NULL, pixman_double_to_fixed(-xDest), pixman_double_to_fixed(-yDest));
+ pixman_transform_rotate(&transform, NULL, pixman_double_to_fixed(c), pixman_double_to_fixed(s));
+ pixman_transform_translate(&transform, NULL, pixman_double_to_fixed(xPivot), pixman_double_to_fixed(yPivot));
+
+ return transform;
+}
+
pixman_transform_t GetTransform(int srcWidth, int srcHeight, int dstWidth, int dstHeight)
{
pixman_transform_t transform;
return CompositePixmap(dstImage, srcImage, rop, filter, transform, PIXMAN_REPEAT_NORMAL);
}
-bool RotatePixmap(Tizen::Graphics::_Util::Pixmap& dstImage, const Tizen::Graphics::_Util::Pixmap& srcImage, Tizen::Graphics::BitmapDrawingQuality drawingQuality, Tizen::Graphics::CompositeMode compositeMode, int xDest, int yDest, double degree, int xPivot, int yPivot)
+bool RotatePixmap(Tizen::Graphics::_Util::Pixmap& dstImage, const Tizen::Graphics::_Util::Pixmap& srcImage, Tizen::Graphics::BitmapDrawingQuality drawingQuality, Tizen::Graphics::CompositeMode compositeMode, double xDest, double yDest, double degree, double xPivot, double yPivot)
{
if (dstImage.width <= 0 || dstImage.height <= 0)
{
ResizePixmap(Tizen::Graphics::_Util::Pixmap& dstImage, const Tizen::Graphics::_Util::Pixmap& srcImage, Tizen::Graphics::BitmapScalingQuality scalingQuality);
bool
-RotatePixmap(Tizen::Graphics::_Util::Pixmap& dstImage, const Tizen::Graphics::_Util::Pixmap& srcImage, Tizen::Graphics::BitmapDrawingQuality drawingQuality, Tizen::Graphics::CompositeMode compositeMode, int xDest, int yDest, double degree, int xPivot, int yPivot);
+RotatePixmap(Tizen::Graphics::_Util::Pixmap& dstImage, const Tizen::Graphics::_Util::Pixmap& srcImage, Tizen::Graphics::BitmapDrawingQuality drawingQuality, Tizen::Graphics::CompositeMode compositeMode, double xDest, double yDest, double degree, double xPivot, double yPivot);
bool
FlipPixmap(Tizen::Graphics::_Util::Pixmap& dstImage, const Tizen::Graphics::_Util::Pixmap& srcImage, Tizen::Graphics::BitmapDrawingQuality drawingQuality, Tizen::Graphics::CompositeMode compositeMode, int xDest, int yDest);