本文整理汇总了C#中LWF.ColorTransform类的典型用法代码示例。如果您正苦于以下问题:C# ColorTransform类的具体用法?C# ColorTransform怎么用?C# ColorTransform使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ColorTransform类属于LWF命名空间,在下文中一共展示了ColorTransform类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Object
public Object(LWF lwf, Movie parent, Type type, int objId)
{
m_lwf = lwf;
m_parent = parent;
m_type = type;
m_objectId = objId;
m_matrix = new Matrix();
m_colorTransform = new ColorTransform();
m_execCount = 0;
}
示例2: CalcColor
public static void CalcColor(Color dst, Color c, ColorTransform t)
{
#if LWF_USE_ADDITIONALCOLOR
dst.red = c.red * t.multi.red + t.add.red;
dst.green = c.green * t.multi.green + t.add.green;
dst.blue = c.blue * t.multi.blue + t.add.blue;
dst.alpha = c.alpha * t.multi.alpha + t.add.alpha;
#else
dst.red = c.red * t.multi.red;
dst.green = c.green * t.multi.green;
dst.blue = c.blue * t.multi.blue;
dst.alpha = c.alpha * t.multi.alpha;
#endif
}
示例3: CalcColorTransform
public static void CalcColorTransform(ColorTransform dst,
ColorTransform src0, ColorTransform src1)
{
dst.multi.red = src0.multi.red * src1.multi.red;
dst.multi.green = src0.multi.green * src1.multi.green;
dst.multi.blue = src0.multi.blue * src1.multi.blue;
dst.multi.alpha = src0.multi.alpha * src1.multi.alpha;
#if LWF_USE_ADDITIONALCOLOR
dst.add.red = src0.add.red * src1.multi.red + src1.add.red;
dst.add.green = src0.add.green * src1.multi.green + src1.add.green;
dst.add.blue = src0.add.blue * src1.multi.blue + src1.add.blue;
dst.add.alpha = src0.add.alpha * src1.multi.alpha + src1.add.alpha;
#endif
}
示例4: Object
public Object(LWF lwf, Movie parent, Type type, int objId)
{
m_lwf = lwf;
m_parent = parent;
m_type = type;
m_objectId = objId;
m_matrixId = -1;
m_colorTransformId = -1;
m_matrixIdChanged = true;
m_colorTransformIdChanged = true;
m_matrix = new Matrix(0, 0, 0, 0, 0, 0);
m_colorTransform = new ColorTransform(0, 0, 0, 0);
m_execCount = 0;
m_updated = false;
}
示例5: CalcColorTransform
public static ColorTransform CalcColorTransform(LWF lwf,
ColorTransform dst, ColorTransform src0, int src1Id)
{
if (src1Id == 0) {
dst.Set(src0);
} else if ((src1Id & (int)Constant.COLORTRANSFORM_FLAG) == 0) {
AlphaTransform alphaTransform =
lwf.data.alphaTransforms[src1Id];
dst.multi.red = src0.multi.red;
dst.multi.green = src0.multi.green;
dst.multi.blue = src0.multi.blue;
dst.multi.alpha = src0.multi.alpha * alphaTransform.alpha;
#if LWF_USE_ADDITIONALCOLOR
dst.add.Set(src0.add);
#endif
} else {
int colorTransformId = src1Id & ~(int)Constant.COLORTRANSFORM_FLAG;
ColorTransform src1 = lwf.data.colorTransforms[colorTransformId];
CalcColorTransform(dst, src0, src1);
}
return dst;
}
示例6: Update
public override void Update(Matrix m, ColorTransform c)
{
int n = m_displayList.Length;
for (int i = 0; i < n; ++i)
m_displayList[i].Update(m, c);
}
示例7: Update
public override void Update(Matrix m, ColorTransform c)
{
if (!m_active)
return;
if (this.totalFrames == 0) {
m_active = true;
}
bool matrixChanged;
bool colorTransformChanged;
if (m_overriding) {
matrixChanged = true;
colorTransformChanged = true;
} else {
matrixChanged = m_matrix.SetWithComparing(m);
colorTransformChanged = m_colorTransform.SetWithComparing(c);
}
if (m_property.hasMatrix) {
matrixChanged = true;
m = Utility.CalcMatrix(m_matrix0, m_matrix, m_property.matrix);
} else {
m = m_matrix;
}
if (m_property.hasColorTransform) {
colorTransformChanged = true;
c = Utility.CalcColorTransform(
m_colorTransform0, m_colorTransform, m_property.colorTransform);
} else {
c = m_colorTransform;
}
if (m_attachedLWFs != null) {
m_needsUpdateAttachedLWFs = false;
m_needsUpdateAttachedLWFs |=
m_matrixForAttachedLWFs.SetWithComparing(m);
m_needsUpdateAttachedLWFs |=
m_colorTransformForAttachedLWFs.SetWithComparing(c);
}
for (int dlDepth = 0; dlDepth < m_data.depths; ++dlDepth) {
Object obj = m_displayList[dlDepth];
if (obj != null)
UpdateObject(obj, m, c, matrixChanged, colorTransformChanged);
}
if (m_bitmapClips != null) {
foreach (BitmapClip bitmapClip in m_bitmapClips.Values)
if (bitmapClip != null)
bitmapClip.Update(m, c);
}
if (m_attachedMovies != null) {
foreach (Movie movie in m_attachedMovieList.Values)
if (movie != null)
UpdateObject(movie,
m, c, matrixChanged, colorTransformChanged);
}
}
示例8: Update
public virtual void Update(Matrix m, ColorTransform c)
{
Utility.CalcMatrix(m_lwf, m_matrix, m, m_dataMatrixId);
Utility.CopyColorTransform(m_colorTransform, c);
m_lwf.RenderObject();
}
示例9: CopyColorTransform
public static ColorTransform CopyColorTransform(
ColorTransform dst, ColorTransform src)
{
if (src == null)
dst.Clear();
else
dst.Set(src);
return dst;
}
示例10: ForceExec
public int ForceExec(
Matrix matrix = null, ColorTransform colorTransform = null)
{
return Exec(0, matrix, colorTransform);
}
示例11: Update
public void Update(
Matrix matrix = null, ColorTransform colorTransform = null)
{
++m_updateCount;
Matrix m = CalcMatrix(matrix);
ColorTransform c = CalcColorTransform(colorTransform);
m_renderingIndex = 0;
m_renderingIndexOffsetted = 0;
m_rootMovie.Update(m, c);
m_renderingCount = m_renderingIndex;
m_propertyDirty = false;
}
示例12: Update
public virtual void Update(Matrix m, ColorTransform c)
{
m_updated = true;
if (m != null) {
Utility.CalcMatrix(m_lwf, m_matrix, m, m_dataMatrixId);
m_matrixIdChanged = false;
}
if (c != null) {
Utility.CopyColorTransform(m_colorTransform, c);
m_colorTransformIdChanged = false;
}
m_lwf.RenderObject();
}
示例13: LWF
public LWF(Data lwfData, IRendererFactory r)
{
m_data = lwfData;
interactive = m_data.buttonConditions.Length > 0;
m_frameRate = m_data.header.frameRate;
m_execLimit = 3;
m_tick = 1.0f / m_frameRate;
m_roundOffTick = m_tick * ROUND_OFF_TICK_RATE;
m_attachVisible = true;
m_interceptByNotAllowOrDenyButtons = true;
m_intercepted = false;
scaleByStage = 1.0f;
m_pointX = Single.MinValue;
m_pointY = Single.MinValue;
m_pressing = false;
m_instanceId = ++m_instanceOffset;
m_alive = true;
if (!interactive && m_data.frames.Length == 1)
DisableExec();
m_property = new Property(this);
m_instances = new IObject[m_data.instanceNames.Length];
InitEvent();
m_movieCommands = new MovieCommands();
m_programObjectConstructors =
new ProgramObjectConstructor[m_data.programObjects.Length];
m_textDictionary = new TextDictionary();
m_matrix = new Matrix();
m_matrixIdentity = new Matrix();
m_colorTransform = new ColorTransform();
m_colorTransformIdentity = new ColorTransform();
Init();
SetRendererFactory(r);
}
示例14: Update
public override void Update(Matrix m, ColorTransform c)
{
base.Update(m, c);
if (m_handler != null && m_handler.update != null)
m_handler.update(this);
}
示例15: Update
public override void Update(Matrix m, ColorTransform c)
{
base.Update(m, c);
if (m_renderer != null)
m_renderer.Update(m_matrix, m_colorTransform);
}