public static unsafe FakeStruct LoadFromObject(Component com, DataBuffer buffer)
        {
            var img = com as Image;

            if (img == null)
            {
                return(null);
            }
            FakeStruct fake = new FakeStruct(buffer, ImageData.ElementSize);
            ImageData *data = (ImageData *)fake.ip;

            data->alphaHit       = img.alphaHitTestMinimumThreshold;
            data->fillAmount     = img.fillAmount;
            data->fillCenter     = img.fillCenter;
            data->fillClockwise  = img.fillClockwise;
            data->fillMethod     = img.fillMethod;
            data->fillOrigin     = img.fillOrigin;
            data->preserveAspect = img.preserveAspect;
            data->type           = img.type;
            data->color          = img.color;
            if (img.sprite != null)
            {
                var tn = img.sprite.texture.name;
                var sn = img.sprite.name;
                var an = ElementAsset.TxtureFormAsset(img.sprite.texture.name);
                data->assetName   = buffer.AddData(an);
                data->textureName = buffer.AddData(tn);
                data->spriteName  = buffer.AddData(sn);
            }
            if (img.material != null)
            {
                data->shader = buffer.AddData(img.material.shader.name);
            }
            return(fake);
        }
예제 #2
0
 public static extern void ComputeRadialProfile(float[] dst, int radialSteps, int angularSteps, float minradius, float maxradius, Vector2 center, ImageData *src, float mean, bool normalize);
예제 #3
0
 private static extern void glfwSetWindowIcon(WindowHandle window, int count, ImageData *images);