Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
LoadingRequest.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using System;
4 using System.Collections.Generic;
5 using System.Linq;
6 using System.Text;
7 
8 namespace SiliconStudio.TextureConverter.Requests
9 {
10  /// <summary>
11  /// Request to load a texture, either from a file, or from memory with an <see cref="TexImage"/> or a <see cref="SiliconStudio.Paradox.Graphics.Image"/>
12  /// </summary>
13  internal class LoadingRequest : IRequest
14  {
15 
16  /// <summary>
17  /// The different loading mode : TexImage, file, Paradox Image
18  /// </summary>
19  public enum LoadingMode
20  {
21  TexImage,
22  PdxImage,
23  FilePath,
24  }
25 
26  public override RequestType Type { get { return RequestType.Loading; } }
27 
28  /// <summary>
29  /// The mode used by the request
30  /// </summary>
31  public LoadingMode Mode { set; get; }
32 
33 
34  /// <summary>
35  /// The file path
36  /// </summary>
37  public String FilePath { set; get; }
38 
39 
40  /// <summary>
41  /// The TexImage to be loaded
42  /// </summary>
43  public TexImage Image { set; get; }
44 
45  /// <summary>
46  /// The Paradox Image to be loaded
47  /// </summary>
49 
50  /// <summary>
51  /// Indicate if we should keep the original mip-maps during the load
52  /// </summary>
53  public bool KeepMipMap { get; set; }
54 
55  /// <summary>
56  /// Initializes a new instance of the <see cref="LoadingRequest"/> class to load a texture from a file.
57  /// </summary>
58  /// <param name="filePath">The file path.</param>
59  public LoadingRequest(String filePath)
60  {
61  this.FilePath = filePath;
62  this.Mode = LoadingMode.FilePath;
63  KeepMipMap = false;
64  }
65 
66 
67  /// <summary>
68  /// Initializes a new instance of the <see cref="LoadingRequest"/> class to load a texture from a <see cref="TexImage"/> instance.
69  /// </summary>
70  /// <param name="image">The image.</param>
71  public LoadingRequest(TexImage image)
72  {
73  this.Image = image;
74  this.Mode = LoadingMode.TexImage;
75  KeepMipMap = false;
76  }
77 
78 
79  /// <summary>
80  /// Initializes a new instance of the <see cref="LoadingRequest"/> class to load a texture from a <see cref="SiliconStudio.Paradox.Graphics.Image"/> instance.
81  /// </summary>
82  /// <param name="image">The image.</param>
83  public LoadingRequest(SiliconStudio.Paradox.Graphics.Image image)
84  {
85  this.PdxImage = image;
86  this.Mode = LoadingMode.PdxImage;
87  KeepMipMap = false;
88  }
89 
90  }
91 }
Provides method to instantiate an image 1D/2D/3D supporting TextureArray and mipmaps on the CPU or to...
Definition: Image.cs:88
The type of the serialized type will be passed as a generic arguments of the serializer. Example: serializer of A becomes instantiated as Serializer{A}.