Esempio n. 1
0
            public ImportParameters(TextureConvertParameters textureParameters)
            {
                var asset = textureParameters.Texture;

                // Compute SRgb usage
                // If Texture is in auto mode, use the global settings, else use the settings overridden by the texture asset.
                IsSRgb = textureParameters.Texture.ColorSpace.ToColorSpace(textureParameters.ColorSpace, asset.Hint) == ColorSpace.Linear;

                DesiredSize        = new Size2((int)asset.Width, (int)asset.Height);
                IsSizeInPercentage = asset.IsSizeInPercentage;
                DesiredFormat      = asset.Format;
                DesiredAlpha       = asset.Alpha;
                TextureHint        = asset.Hint;
                GenerateMipmaps    = asset.GenerateMipmaps;
                if (asset.Alpha != AlphaFormat.None)
                {
                    PremultiplyAlpha = asset.PremultiplyAlpha;
                }
                ColorKeyColor    = asset.ColorKeyColor;
                ColorKeyEnabled  = asset.ColorKeyEnabled;
                TextureQuality   = textureParameters.TextureQuality;
                GraphicsPlatform = textureParameters.GraphicsPlatform;
                GraphicsProfile  = textureParameters.GraphicsProfile;
                Platform         = textureParameters.Platform;
            }
Esempio n. 2
0
            public ImportParameters(TextureConvertParameters textureParameters)
            {
                var asset = textureParameters.Texture;

                // Compute SRgb usage
                // If Texture is in auto mode, use the global settings, else use the settings overridden by the texture asset.
                IsSRgb             = textureParameters.Texture.Type.IsSRgb(textureParameters.ColorSpace);
                DesiredSize        = new Size2((int)asset.Width, (int)asset.Height);
                IsSizeInPercentage = asset.IsSizeInPercentage;
                ShouldCompress     = asset.IsCompressed;
                DesiredAlpha       = asset.Type.Alpha;
                TextureHint        = asset.Type.Hint;
                InvertY            = (asset.Type.Hint == TextureHint.NormalMap) ? ((NormapMapTextureType)asset.Type).InvertY : false;
                GenerateMipmaps    = asset.GenerateMipmaps;
                if (asset.Type.Alpha != AlphaFormat.None)
                {
                    PremultiplyAlpha = asset.Type.PremultiplyAlpha;
                }
                ColorKeyColor    = asset.Type.ColorKeyColor;
                ColorKeyEnabled  = asset.Type.ColorKeyEnabled;
                TextureQuality   = textureParameters.TextureQuality;
                GraphicsPlatform = textureParameters.GraphicsPlatform;
                GraphicsProfile  = textureParameters.GraphicsProfile;
                Platform         = textureParameters.Platform;
            }
Esempio n. 3
0
 public static ColorSpace ToColorSpace(this TextureColorSpace textureColorSpace, ColorSpace colorSpaceReference, TextureHint textureHint)
 {
     var colorSpace = colorSpaceReference;
     if (textureHint == TextureHint.Color)
     {
         if (textureColorSpace == TextureColorSpace.Linear)
         {
             colorSpace = ColorSpace.Linear;
         }
         else if (textureColorSpace == TextureColorSpace.Gamma)
         {
             colorSpace = ColorSpace.Gamma;
         }
     }
     return colorSpace;
 }
Esempio n. 4
0
 public ImportParameters(SpriteSheetAssetCompiler.SpriteSheetParameters spriteSheetParameters)
 {
     var asset = spriteSheetParameters.SheetAsset;
     IsSRgb = asset.SRgb;
     DesiredSize = new Size2(100, 100);
     IsSizeInPercentage = true;
     DesiredFormat = asset.Format;
     DesiredAlpha = asset.Alpha;
     TextureHint = TextureHint.Color;
     GenerateMipmaps = asset.GenerateMipmaps;
     PremultiplyAlpha = asset.PremultiplyAlpha;
     ColorKeyColor = asset.ColorKeyColor;
     ColorKeyEnabled = asset.ColorKeyEnabled;
     TextureQuality = spriteSheetParameters.TextureQuality;
     GraphicsPlatform = spriteSheetParameters.GraphicsPlatform;
     GraphicsProfile = spriteSheetParameters.GraphicsProfile;
     Platform = spriteSheetParameters.Platform;
 }
Esempio n. 5
0
 public ImportParameters(TextureConvertParameters textureParameters)
 {
     var asset = textureParameters.Texture;
     IsSRgb = asset.SRgb;
     DesiredSize = new Size2((int)asset.Width, (int)asset.Height);
     IsSizeInPercentage = asset.IsSizeInPercentage;
     DesiredFormat = asset.Format;
     DesiredAlpha = asset.Alpha;
     TextureHint = asset.Hint;
     GenerateMipmaps = asset.GenerateMipmaps;
     PremultiplyAlpha = asset.PremultiplyAlpha;
     ColorKeyColor  = asset.ColorKeyColor;
     ColorKeyEnabled = asset.ColorKeyEnabled;
     TextureQuality = textureParameters.TextureQuality;
     GraphicsPlatform = textureParameters.GraphicsPlatform;
     GraphicsProfile = textureParameters.GraphicsProfile;
     Platform = textureParameters.Platform;
 }
Esempio n. 6
0
            public ImportParameters(SpriteSheetAssetCompiler.SpriteSheetParameters spriteSheetParameters)
            {
                var asset = spriteSheetParameters.SheetAsset;

                IsSRgb             = asset.SRgb;
                DesiredSize        = new Size2(100, 100);
                IsSizeInPercentage = true;
                DesiredFormat      = asset.Format;
                DesiredAlpha       = asset.Alpha;
                TextureHint        = TextureHint.Color;
                GenerateMipmaps    = asset.GenerateMipmaps;
                PremultiplyAlpha   = asset.PremultiplyAlpha;
                ColorKeyColor      = asset.ColorKeyColor;
                ColorKeyEnabled    = asset.ColorKeyEnabled;
                TextureQuality     = spriteSheetParameters.TextureQuality;
                GraphicsPlatform   = spriteSheetParameters.GraphicsPlatform;
                GraphicsProfile    = spriteSheetParameters.GraphicsProfile;
                Platform           = spriteSheetParameters.Platform;
            }
Esempio n. 7
0
            public ImportParameters(TextureConvertParameters textureParameters)
            {
                var asset = textureParameters.Texture;

                IsSRgb             = asset.SRgb;
                DesiredSize        = new Size2((int)asset.Width, (int)asset.Height);
                IsSizeInPercentage = asset.IsSizeInPercentage;
                DesiredFormat      = asset.Format;
                DesiredAlpha       = asset.Alpha;
                TextureHint        = asset.Hint;
                GenerateMipmaps    = asset.GenerateMipmaps;
                PremultiplyAlpha   = asset.PremultiplyAlpha;
                ColorKeyColor      = asset.ColorKeyColor;
                ColorKeyEnabled    = asset.ColorKeyEnabled;
                TextureQuality     = textureParameters.TextureQuality;
                GraphicsPlatform   = textureParameters.GraphicsPlatform;
                GraphicsProfile    = textureParameters.GraphicsProfile;
                Platform           = textureParameters.Platform;
            }
Esempio n. 8
0
            public ImportParameters(TextureConvertParameters textureParameters)
            {
                var asset = textureParameters.Texture;

                // Compute SRgb usage
                // If Texture is in auto mode, use the global settings, else use the settings overridden by the texture asset. 
                IsSRgb = textureParameters.Texture.ColorSpace.ToColorSpace(textureParameters.ColorSpace, asset.Hint) == ColorSpace.Linear;

                DesiredSize = new Size2((int)asset.Width, (int)asset.Height);
                IsSizeInPercentage = asset.IsSizeInPercentage;
                DesiredFormat = asset.Format;
                DesiredAlpha = asset.Alpha;
                TextureHint = asset.Hint;
                GenerateMipmaps = asset.GenerateMipmaps;
                PremultiplyAlpha = asset.PremultiplyAlpha;
                ColorKeyColor  = asset.ColorKeyColor;
                ColorKeyEnabled = asset.ColorKeyEnabled;
                TextureQuality = textureParameters.TextureQuality;
                GraphicsPlatform = textureParameters.GraphicsPlatform;
                GraphicsProfile = textureParameters.GraphicsProfile;
                Platform = textureParameters.Platform;
            }
Esempio n. 9
0
            public ImportParameters(SpriteSheetAssetCompiler.SpriteSheetParameters spriteSheetParameters)
            {
                var asset = spriteSheetParameters.SheetAsset;

                // Compute SRgb usage
                // If Texture is in auto mode, use the global settings, else use the settings overridden by the texture asset.
                IsSRgb = asset.ColorSpace.ToColorSpace(spriteSheetParameters.ColorSpace, TextureHint.Color) == ColorSpace.Linear;

                DesiredSize        = new Size2(100, 100);
                IsSizeInPercentage = true;
                DesiredFormat      = asset.Format;
                DesiredAlpha       = asset.Alpha;
                TextureHint        = TextureHint.Color;
                GenerateMipmaps    = asset.GenerateMipmaps;
                PremultiplyAlpha   = asset.PremultiplyAlpha;
                ColorKeyColor      = asset.ColorKeyColor;
                ColorKeyEnabled    = asset.ColorKeyEnabled;
                TextureQuality     = spriteSheetParameters.TextureQuality;
                GraphicsPlatform   = spriteSheetParameters.GraphicsPlatform;
                GraphicsProfile    = spriteSheetParameters.GraphicsProfile;
                Platform           = spriteSheetParameters.Platform;
            }
Esempio n. 10
0
            public ImportParameters(SpriteSheetAssetCompiler.SpriteSheetParameters spriteSheetParameters)
            {
                var asset = spriteSheetParameters.SheetAsset;

                // Compute SRgb usage
                // If Texture is in auto mode, use the global settings, else use the settings overridden by the texture asset. 
                IsSRgb = asset.ColorSpace.ToColorSpace(spriteSheetParameters.ColorSpace, TextureHint.Color) == ColorSpace.Linear;

                DesiredSize = new Size2(100, 100);
                IsSizeInPercentage = true;
                DesiredFormat = asset.Format;
                DesiredAlpha = asset.Alpha;
                TextureHint = TextureHint.Color;
                GenerateMipmaps = asset.GenerateMipmaps;
                PremultiplyAlpha = asset.PremultiplyAlpha;
                ColorKeyColor = asset.ColorKeyColor;
                ColorKeyEnabled = asset.ColorKeyEnabled;
                TextureQuality = spriteSheetParameters.TextureQuality;
                GraphicsPlatform = spriteSheetParameters.GraphicsPlatform;
                GraphicsProfile = spriteSheetParameters.GraphicsProfile;
                Platform = spriteSheetParameters.Platform;
            }
Esempio n. 11
0
        public static ColorSpace ToColorSpace(this TextureColorSpace textureColorSpace, ColorSpace colorSpaceReference, TextureHint textureHint)
        {
            var colorSpace = ColorSpace.Gamma;

            if (textureHint == TextureHint.Color)
            {
                colorSpace = colorSpaceReference;
                if (textureColorSpace == TextureColorSpace.Linear)
                {
                    colorSpace = ColorSpace.Linear;
                }
                else if (textureColorSpace == TextureColorSpace.Gamma)
                {
                    colorSpace = ColorSpace.Gamma;
                }
            }
            return(colorSpace);
        }