本文整理汇总了C#中MediaPortal.GUI.Library.TransformMatrix类的典型用法代码示例。如果您正苦于以下问题:C# TransformMatrix类的具体用法?C# TransformMatrix怎么用?C# TransformMatrix使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TransformMatrix类属于MediaPortal.GUI.Library命名空间,在下文中一共展示了TransformMatrix类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CreateScaler
public static TransformMatrix CreateScaler(float scaleX, float scaleY, float scaleZ /*=1.0f*/)
{
TransformMatrix scaler = new TransformMatrix();
scaler.m[0, 0] = scaleX;
scaler.m[1, 1] = scaleY;
scaler.m[2, 2] = scaleZ;
return scaler;
}
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:8,代码来源:TransformMatrix.cs
示例2: CreateTranslation
public static TransformMatrix CreateTranslation(float transX, float transY, float transZ /*=0.0f*/)
{
TransformMatrix translation = new TransformMatrix();
translation.m[0, 3] = transX;
translation.m[1, 3] = transY;
translation.m[2, 3] = transZ;
return translation;
}
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:8,代码来源:TransformMatrix.cs
示例3: FinalTransformBucket
public FinalTransformBucket(TransformMatrix finalTransform, TransformMatrix finalTransformCalibrated)
{
// The matrices on the stack must be copies otherwise they may be illegally manipulated while on the stack.
_finalTransformMatrix = (TransformMatrix)finalTransform.Clone();
_finalTransformMatrixCalibrated = (TransformMatrix)finalTransformCalibrated.Clone();
}
开发者ID:doskabouter,项目名称:MediaPortal-1,代码行数:6,代码来源:GraphicContext.cs
示例4: UpdateFinalTransform
/// <summary>
///
/// </summary>
/// <param name="matrix"></param>
public static void UpdateFinalTransform(TransformMatrix matrix)
{
_finalTransform = matrix;
_finalTransformCalibrated = GetOffsetCorrectionTransform().multiply(matrix);
}
开发者ID:doskabouter,项目名称:MediaPortal-1,代码行数:9,代码来源:GraphicContext.cs
示例5: SetScalingResolution
/// <summary>
///
/// </summary>
/// <param name="posX"></param>
/// <param name="posY"></param>
/// <param name="needsScaling"></param>
public static void SetScalingResolution(int posX, int posY, bool needsScaling)
{
if (!needsScaling)
{
_guiTransform = TransformMatrix.CreateTranslation(posX, posY, 0);
}
Cameras.Clear();
Cameras.Add(new Point(Width / 2, Height / 2));
UpdateCameraPosition(Cameras[Cameras.Count-1]);
// reset the final transform and window transforms
UpdateFinalTransform(_guiTransform);
}
开发者ID:doskabouter,项目名称:MediaPortal-1,代码行数:20,代码来源:GraphicContext.cs
示例6: RotateZ
/// <summary>
/// Rotates the control transform matrix by the specified angle (in degrees) around the z-axis.
/// </summary>
public static void RotateZ(float angle, float x, float y)
{
TransformMatrix m = new TransformMatrix();
angle *= DEGREE_TO_RADIAN;
m.SetZRotation(angle, x, y, 1.0f);
UpdateFinalTransform(ControlTransform.multiplyAssign(m));
}
开发者ID:nio22,项目名称:MediaPortal-1,代码行数:10,代码来源:GraphicContext.cs
示例7: CreateFader
public static TransformMatrix CreateFader(float a)
{
TransformMatrix fader = new TransformMatrix();
fader.alpha = a;
return fader;
}
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:6,代码来源:TransformMatrix.cs
示例8: RenderAnimation
private bool RenderAnimation(uint time)
{
TransformMatrix transform = new TransformMatrix();
// show animation
_showAnimation.Animate(time, true);
UpdateStates(_showAnimation.AnimationType, _showAnimation.CurrentProcess, _showAnimation.CurrentState);
_showAnimation.RenderAnimation(ref transform);
// close animation
_closeAnimation.Animate(time, true);
UpdateStates(_closeAnimation.AnimationType, _closeAnimation.CurrentProcess, _closeAnimation.CurrentState);
_closeAnimation.RenderAnimation(ref transform);
GUIGraphicsContext.SetWindowTransform(transform);
return true;
}
开发者ID:MediaPortal,项目名称:MediaPortal-1,代码行数:14,代码来源:GUIWindow.cs
示例9: Draw
/// <summary>
/// Draw a texture rotated around (x,y) blended with a diffuse texture.
/// </summary>
/// <param name="x"></param>
/// <param name="y"></param>
/// <param name="nw"></param>
/// <param name="nh"></param>
/// <param name="zrot"></param>
/// <param name="uoff"></param>
/// <param name="voff"></param>
/// <param name="umax"></param>
/// <param name="vmax"></param>
/// <param name="color"></param>
/// <param name="diffuseTextureNo"></param>
/// <param name="uoffd"></param>
/// <param name="voffd"></param>
/// <param name="umaxd"></param>
/// <param name="vmaxd"></param>
public void Draw(float x, float y, float nw, float nh, float zrot, float uoff, float voff,
float umax, float vmax, uint color, int blendableTextureNo, float uoffd,
float voffd, float umaxd, float vmaxd, FontEngineBlendMode blendMode)
{
if (_textureNumber >= 0)
{
// Rotate around the x,y point of the specified rectangle; maintain aspect ratio (1.0f)
TransformMatrix localTransform = new TransformMatrix();
localTransform.SetZRotation(zrot, x, y, 1.0f);
TransformMatrix finalTransform = GUIGraphicsContext.GetFinalTransform();
localTransform = finalTransform.multiply(localTransform);
DXNative.FontEngineDrawTexture2(_textureNumber, x, y, nw, nh, uoff, voff, umax, vmax,
color, localTransform.Matrix,
blendableTextureNo, uoffd, voffd, umaxd, vmaxd,
blendMode);
}
}
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:36,代码来源:TextureFrame.cs
示例10: Clone
public object Clone()
{
TransformMatrix matrix = new TransformMatrix();
matrix.assign(this);
return matrix;
}
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:6,代码来源:TransformMatrix.cs
示例11: multiply
public TransformMatrix multiply(TransformMatrix right)
{
TransformMatrix result = new TransformMatrix();
result.m[0, 0] = m[0, 0] * right.m[0, 0] + m[0, 1] * right.m[1, 0] + m[0, 2] * right.m[2, 0];
result.m[0, 1] = m[0, 0] * right.m[0, 1] + m[0, 1] * right.m[1, 1] + m[0, 2] * right.m[2, 1];
result.m[0, 2] = m[0, 0] * right.m[0, 2] + m[0, 1] * right.m[1, 2] + m[0, 2] * right.m[2, 2];
result.m[0, 3] = m[0, 0] * right.m[0, 3] + m[0, 1] * right.m[1, 3] + m[0, 2] * right.m[2, 3] + m[0, 3];
result.m[1, 0] = m[1, 0] * right.m[0, 0] + m[1, 1] * right.m[1, 0] + m[1, 2] * right.m[2, 0];
result.m[1, 1] = m[1, 0] * right.m[0, 1] + m[1, 1] * right.m[1, 1] + m[1, 2] * right.m[2, 1];
result.m[1, 2] = m[1, 0] * right.m[0, 2] + m[1, 1] * right.m[1, 2] + m[1, 2] * right.m[2, 2];
result.m[1, 3] = m[1, 0] * right.m[0, 3] + m[1, 1] * right.m[1, 3] + m[1, 2] * right.m[2, 3] + m[1, 3];
result.m[2, 0] = m[2, 0] * right.m[0, 0] + m[2, 1] * right.m[1, 0] + m[2, 2] * right.m[2, 0];
result.m[2, 1] = m[2, 0] * right.m[0, 1] + m[2, 1] * right.m[1, 1] + m[2, 2] * right.m[2, 1];
result.m[2, 2] = m[2, 0] * right.m[0, 2] + m[2, 1] * right.m[1, 2] + m[2, 2] * right.m[2, 2];
result.m[2, 3] = m[2, 0] * right.m[0, 3] + m[2, 1] * right.m[1, 3] + m[2, 2] * right.m[2, 3] + m[2, 3];
result.alpha = alpha * right.alpha;
return result;
}
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:18,代码来源:TransformMatrix.cs
示例12: multiplyAssign
// multiplication operators
public TransformMatrix multiplyAssign(TransformMatrix right)
{
float t00 = m[0, 0] * right.m[0, 0] + m[0, 1] * right.m[1, 0] + m[0, 2] * right.m[2, 0];
float t01 = m[0, 0] * right.m[0, 1] + m[0, 1] * right.m[1, 1] + m[0, 2] * right.m[2, 1];
float t02 = m[0, 0] * right.m[0, 2] + m[0, 1] * right.m[1, 2] + m[0, 2] * right.m[2, 2];
m[0, 3] = m[0, 0] * right.m[0, 3] + m[0, 1] * right.m[1, 3] + m[0, 2] * right.m[2, 3] + m[0, 3];
m[0, 0] = t00;
m[0, 1] = t01;
m[0, 2] = t02;
t00 = m[1, 0] * right.m[0, 0] + m[1, 1] * right.m[1, 0] + m[1, 2] * right.m[2, 0];
t01 = m[1, 0] * right.m[0, 1] + m[1, 1] * right.m[1, 1] + m[1, 2] * right.m[2, 1];
t02 = m[1, 0] * right.m[0, 2] + m[1, 1] * right.m[1, 2] + m[1, 2] * right.m[2, 2];
m[1, 3] = m[1, 0] * right.m[0, 3] + m[1, 1] * right.m[1, 3] + m[1, 2] * right.m[2, 3] + m[1, 3];
m[1, 0] = t00;
m[1, 1] = t01;
m[1, 2] = t02;
t00 = m[2, 0] * right.m[0, 0] + m[2, 1] * right.m[1, 0] + m[2, 2] * right.m[2, 0];
t01 = m[2, 0] * right.m[0, 1] + m[2, 1] * right.m[1, 1] + m[2, 2] * right.m[2, 1];
t02 = m[2, 0] * right.m[0, 2] + m[2, 1] * right.m[1, 2] + m[2, 2] * right.m[2, 2];
m[2, 3] = m[2, 0] * right.m[0, 3] + m[2, 1] * right.m[1, 3] + m[2, 2] * right.m[2, 3] + m[2, 3];
m[2, 0] = t00;
m[2, 1] = t01;
m[2, 2] = t02;
alpha *= right.alpha;
return this;
}
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:28,代码来源:TransformMatrix.cs
示例13: assign
// assignment operator
public TransformMatrix assign(TransformMatrix right)
{
m[0, 0] = right.m[0, 0];
m[0, 1] = right.m[0, 1];
m[0, 2] = right.m[0, 2];
m[0, 3] = right.m[0, 3];
m[1, 0] = right.m[1, 0];
m[1, 1] = right.m[1, 1];
m[1, 2] = right.m[1, 2];
m[1, 3] = right.m[1, 3];
m[2, 0] = right.m[2, 0];
m[2, 1] = right.m[2, 1];
m[2, 2] = right.m[2, 2];
m[2, 3] = right.m[2, 3];
alpha = right.alpha;
return this;
}
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:20,代码来源:TransformMatrix.cs
示例14: SetWindowTransform
/// <summary>
///
/// </summary>
/// <param name="matrix"></param>
public static void SetWindowTransform(TransformMatrix matrix)
{
// reset the group transform stack
GroupTransforms.Clear();
GroupTransforms.Add(_guiTransform.multiply(matrix));
_bypassUICalibration = 0;
UpdateFinalTransform(GroupTransforms[0]);
}
开发者ID:doskabouter,项目名称:MediaPortal-1,代码行数:12,代码来源:GraphicContext.cs
示例15: Draw
public void Draw(float x, float y, float nw, float nh, float zrot, float uoff, float voff, float umax, float vmax,
int color)
{
if (_textureNumber >= 0)
{
// Rotate around the x,y point of the specified rectangle; maintain aspect ratio (1.0f)
TransformMatrix localTransform = new TransformMatrix();
localTransform.SetZRotation(zrot, x, y, 1.0f);
TransformMatrix finalTransform = GUIGraphicsContext.GetFinalTransform();
localTransform = finalTransform.multiply(localTransform);
FontEngineDrawTexture(_textureNumber, x, y, nw, nh, uoff, voff, umax, vmax, color, localTransform.Matrix);
}
else
{
if (logTextures)
{
Log.Info("fontengine:Draw() ERROR. Texture is disposed:{0} {1}", _textureNumber.ToString(), _imageName);
}
}
}
开发者ID:npcomplete111,项目名称:MediaPortal-1,代码行数:21,代码来源:CachedTexture.cs
示例16: AddTransform
/// <summary>
///
/// </summary>
/// <param name="matrix"></param>
public static void AddTransform(TransformMatrix matrix)
{
GroupTransforms.Add(GroupTransforms.Count > 0
? GroupTransforms[GroupTransforms.Count - 1].multiply(matrix)
: matrix);
UpdateFinalTransform(GroupTransforms[GroupTransforms.Count - 1]);
}
开发者ID:doskabouter,项目名称:MediaPortal-1,代码行数:11,代码来源:GraphicContext.cs
示例17: SetScalingResolution
public static void SetScalingResolution( /*RESOLUTION res,*/ int posX, int posY, bool needsScaling)
{
//m_windowResolution = res;
if (needsScaling)
{
/*
// calculate necessary scalings
float fFromWidth = (float)g_settings.m_ResInfo[res].iWidth;
float fFromHeight = (float)g_settings.m_ResInfo[res].iHeight;
float fToPosX = (float)g_settings.m_ResInfo[m_Resolution].Overscan.left;
float fToPosY = (float)g_settings.m_ResInfo[m_Resolution].Overscan.top;
float fToWidth = (float)g_settings.m_ResInfo[m_Resolution].Overscan.right - fToPosX;
float fToHeight = (float)g_settings.m_ResInfo[m_Resolution].Overscan.bottom - fToPosY;
// add additional zoom to compensate for any overskan built in skin
float fZoom = g_SkinInfo.GetSkinZoom();
if (!g_guiSkinzoom) // lookup gui setting if we didn't have it already
g_guiSkinzoom = (CSettingInt*)g_guiSettings.GetSetting("lookandfeel.skinzoom");
if (g_guiSkinzoom)
fZoom *= (100 + g_guiSkinzoom->GetData()) * 0.01f;
fZoom -= 1.0f;
fToPosX -= fToWidth * fZoom * 0.5f;
fToWidth *= fZoom + 1.0f;
// adjust for aspect ratio as zoom is given in the vertical direction and we don't
// do aspect ratio corrections in the gui code
fZoom = fZoom / g_settings.m_ResInfo[m_Resolution].fPixelRatio;
fToPosY -= fToHeight * fZoom * 0.5f;
fToHeight *= fZoom + 1.0f;
_windowScaleX = fToWidth / fFromWidth;
_windowScaleY = fToHeight / fFromHeight;
TransformMatrix windowOffset = TransformMatrix.CreateTranslation((float)posX, (float)posY);
TransformMatrix guiScaler = TransformMatrix.CreateScaler(fToWidth / fFromWidth, fToHeight / fFromHeight);
TransformMatrix guiOffset = TransformMatrix.CreateTranslation(fToPosX, fToPosY);
_guiTransform = guiOffset * guiScaler * windowOffset;
*/
}
else
{
_guiTransform = TransformMatrix.CreateTranslation((float)posX, (float)posY, 0);
//_windowScaleX = 1.0f;
//_windowScaleY = 1.0f;
}
_cameras.Clear();
_cameras.Add(new Point(Width / 2, Height / 2));
UpdateCameraPosition(_cameras[_cameras.Count-1]);
// reset the final transform and window transforms
UpdateFinalTransform(_guiTransform);
}
开发者ID:nio22,项目名称:MediaPortal-1,代码行数:48,代码来源:GraphicContext.cs
示例18: RotateZ
/// <summary>
/// Rotates the control transform matrix by the specified angle (in degrees) around the z-axis.
/// </summary>
public static void RotateZ(float angle, float x, float y)
{
var m = new TransformMatrix();
angle *= DegreeToRadian;
m.SetZRotation(angle, x, y, 1.0f);
UpdateFinalTransform(ControlTransform.multiplyAssign(m));
}
开发者ID:doskabouter,项目名称:MediaPortal-1,代码行数:10,代码来源:GraphicContext.cs
示例19: AddTransform
public static void AddTransform(TransformMatrix matrix)
{
if (_groupTransforms.Count > 0)
{
_groupTransforms.Add(_groupTransforms[_groupTransforms.Count - 1].multiply(matrix));
}
else
{
_groupTransforms.Add(matrix);
}
UpdateFinalTransform(_groupTransforms[_groupTransforms.Count - 1]);
}
开发者ID:nio22,项目名称:MediaPortal-1,代码行数:12,代码来源:GraphicContext.cs
示例20: RenderAnimation
public void RenderAnimation(ref TransformMatrix matrix)
{
// If we have finished an animation, reset the animation state
// We do this here (rather than in Animate()) as we need the
// currentProcess information in the UpdateStates() function of the
// window and control classes.
// Now do the real animation
if (_currentProcess != AnimationProcess.None)
{
Calculate();
}
if (_currentState == AnimationState.StateApplied)
{
_currentProcess = AnimationProcess.None;
_queuedProcess = AnimationProcess.None;
}
if (_currentState != AnimationState.None)
{
matrix.multiplyAssign(_matrix);
}
}
开发者ID:npcomplete111,项目名称:MediaPortal-1,代码行数:22,代码来源:VisualEffect.cs
注:本文中的MediaPortal.GUI.Library.TransformMatrix类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论