OSDN Git Service

DTXMania089リリースに際してのtag付け。
[dtxmania/dtxmania.git] / 110401(DTXMania089) / SlimDXc_Jun2010(VC++2008) / source / direct3d11 / Texture2D11.h
1 /*\r
2 * Copyright (c) 2007-2010 SlimDX Group\r
3\r
4 * Permission is hereby granted, free of charge, to any person obtaining a copy\r
5 * of this software and associated documentation files (the "Software"), to deal\r
6 * in the Software without restriction, including without limitation the rights\r
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
8 * copies of the Software, and to permit persons to whom the Software is\r
9 * furnished to do so, subject to the following conditions:\r
10\r
11 * The above copyright notice and this permission notice shall be included in\r
12 * all copies or substantial portions of the Software.\r
13\r
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
20 * THE SOFTWARE.\r
21 */\r
22 #pragma once\r
23 \r
24 #include "Enums11.h"\r
25 #include "Resource11.h"\r
26 #include "ImageLoadInformation11.h"\r
27 \r
28 namespace SlimDX\r
29 {\r
30         ref class DataRectangle;\r
31         \r
32         namespace Direct3D11\r
33         {\r
34                 ref class Device;\r
35                 ref class DeviceContext;\r
36                 value class Texture2DDescription;\r
37                 \r
38                 /// <summary>\r
39                 /// Represents a two-dimensional texture.\r
40                 /// </summary>\r
41                 /// <unmanaged>ID3D11Texture2D</unmanaged>\r
42                 public ref class Texture2D : public Resource\r
43                 {\r
44                         COMOBJECT(ID3D11Texture2D, Texture2D);\r
45                         \r
46                 private:\r
47                         static ID3D11Texture2D* Build( SlimDX::Direct3D11::Device^ device, Texture2DDescription description, D3D11_SUBRESOURCE_DATA* data ); \r
48                 \r
49                 public:\r
50                         /// <summary>\r
51                         /// Gets the texture description.\r
52                         /// </summary>\r
53                         property Texture2DDescription Description\r
54                         {\r
55                                 Texture2DDescription get();\r
56                         }\r
57                         \r
58                         /// <summary>\r
59                         /// Initializes a new instance of the <see cref="Texture2D"/> class.\r
60                         /// </summary>\r
61                         /// <param name="device">The device with which to associate the texture.</param>\r
62                         /// <param name="description">The description of the texture.</param>\r
63                         Texture2D( SlimDX::Direct3D11::Device^ device, Texture2DDescription description );\r
64                         \r
65                         /// <summary>\r
66                         /// Initializes a new instance of the <see cref="Texture2D"/> class.\r
67                         /// </summary>\r
68                         /// <param name="device">The device with which to associate the texture.</param>\r
69                         /// <param name="description">The description of the texture.</param>\r
70                         /// <param name="data">The initial texture data.</param>\r
71                         Texture2D( SlimDX::Direct3D11::Device^ device, Texture2DDescription description, DataRectangle^ data );\r
72                         \r
73                         /// <summary>\r
74                         /// Initializes a new instance of the <see cref="Texture2D"/> class.\r
75                         /// </summary>\r
76                         /// <param name="device">The device with which to associate the texture.</param>\r
77                         /// <param name="description">The description of the texture.</param>\r
78                         /// <param name="data">An array of initial texture data for each subresource.</param>\r
79                         Texture2D( SlimDX::Direct3D11::Device^ device, Texture2DDescription description, array<DataRectangle^>^ data );\r
80                         \r
81                         /// <summary>\r
82                         /// Loads a texture from an image file.\r
83                         /// </summary>\r
84                         /// <param name="device">The device used to load the texture.</param>\r
85                         /// <param name="fileName">Path to the file on disk.</param>\r
86                         /// <returns>The loaded texture object.</returns>\r
87                         static Texture2D^ FromFile( SlimDX::Direct3D11::Device^ device, System::String^ fileName );\r
88 \r
89                         /// <summary>\r
90                         /// Loads a texture from an image file.\r
91                         /// </summary>\r
92                         /// <param name="device">The device used to load the texture.</param>\r
93                         /// <param name="fileName">Path to the file on disk.</param>\r
94                         /// <param name="loadInfo">Specifies information used to load the texture.</param>\r
95                         /// <returns>The loaded texture object.</returns>\r
96                         static Texture2D^ FromFile( SlimDX::Direct3D11::Device^ device, System::String^ fileName, ImageLoadInformation loadInfo );\r
97 \r
98                         /// <summary>\r
99                         /// Loads a texture from an image in memory.\r
100                         /// </summary>\r
101                         /// <param name="device">The device used to load the texture.</param>\r
102                         /// <param name="memory">Array of memory containing the image data to load.</param>\r
103                         /// <returns>The loaded texture object.</returns>\r
104                         static Texture2D^ FromMemory( SlimDX::Direct3D11::Device^ device, array<System::Byte>^ memory );\r
105 \r
106                         /// <summary>\r
107                         /// Loads a texture from an image in memory.\r
108                         /// </summary>\r
109                         /// <param name="device">The device used to load the texture.</param>\r
110                         /// <param name="memory">Array of memory containing the image data to load.</param>\r
111                         /// <param name="loadInfo">Specifies information used to load the texture.</param>\r
112                         /// <returns>The loaded texture object.</returns>\r
113                         static Texture2D^ FromMemory( SlimDX::Direct3D11::Device^ device, array<System::Byte>^ memory, ImageLoadInformation loadInfo );\r
114 \r
115                         /// <summary>\r
116                         /// Loads a texture from a stream of data.\r
117                         /// </summary>\r
118                         /// <param name="device">The device used to load the texture.</param>\r
119                         /// <param name="stream">A stream containing the image data to load.</param>\r
120                         /// <param name="sizeInBytes">Size of the image to load.</param>\r
121                         /// <returns>The loaded texture object.</returns>\r
122                         static Texture2D^ FromStream( SlimDX::Direct3D11::Device^ device, System::IO::Stream^ stream, int sizeInBytes );\r
123 \r
124                         /// <summary>\r
125                         /// Loads a texture from a stream of data.\r
126                         /// </summary>\r
127                         /// <param name="device">The device used to load the texture.</param>\r
128                         /// <param name="stream">A stream containing the image data to load.</param>\r
129                         /// <param name="sizeInBytes">Size of the image to load.</param>\r
130                         /// <param name="loadInfo">Specifies information used to load the texture.</param>\r
131                         /// <returns>The loaded texture object.</returns>\r
132                         static Texture2D^ FromStream( SlimDX::Direct3D11::Device^ device, System::IO::Stream^ stream, int sizeInBytes, ImageLoadInformation loadInfo );\r
133 \r
134                         /// <summary>\r
135                         /// Saves a texture to file.\r
136                         /// </summary>\r
137                         /// <param name="context">The device used to save the texture.</param>\r
138                         /// <param name="texture">The texture to save.</param>\r
139                         /// <param name="format">The format the texture will be saved as.</param>\r
140                         /// <param name="fileName">Name of the destination output file where the texture will be saved.</param>\r
141                         /// <returns>A <see cref="SlimDX::Result"/> object describing the result of the operation.</returns>\r
142                         static Result ToFile( DeviceContext^ context, Texture2D^ texture, ImageFileFormat format, System::String^ fileName );\r
143 \r
144                         /// <summary>\r
145                         /// Saves a texture to a stream.\r
146                         /// </summary>\r
147                         /// <param name="context">The device used to save the texture.</param>\r
148                         /// <param name="texture">The texture to save.</param>\r
149                         /// <param name="format">The format the texture will be saved as.</param>\r
150                         /// <param name="stream">Destination memory stream where the image will be saved.</param>\r
151                         /// <returns>A <see cref="SlimDX::Result"/> object describing the result of the operation.</returns>\r
152                         static Result ToStream( DeviceContext^ context, Texture2D^ texture, ImageFileFormat format, System::IO::Stream^ stream );\r
153 \r
154                         /// <summary>\r
155                         /// Converts a height map into a normal map. The (x,y,z) components of each normal are mapped to the (r,g,b) channels of the output texture.\r
156                         /// </summary>\r
157                         /// <param name="context">The device used to create the normal map.</param>\r
158                         /// <param name="source">The source height map texture.</param>\r
159                         /// <param name="destination">The destination texture.</param>\r
160                         /// <param name="flags">One or more flags that control generation of normal maps.</param>\r
161                         /// <param name="channel">One or more flag specifying the source of height information.</param>\r
162                         /// <param name="amplitude">Constant value multiplier that increases (or decreases) the values in the normal map. Higher values usually make bumps more visible, lower values usually make bumps less visible.</param>\r
163                         /// <returns>A <see cref="SlimDX::Result"/> object describing the result of the operation.</returns>\r
164                         static Result ComputeNormalMap(DeviceContext^ context, Texture2D^ source, Texture2D^ destination, NormalMapFlags flags, Channel channel, float amplitude);\r
165                 };\r
166         }\r
167 };