aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs')
-rw-r--r--OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs186
1 files changed, 186 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs b/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs
new file mode 100644
index 0000000..6df5cc2
--- /dev/null
+++ b/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs
@@ -0,0 +1,186 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Drawing;
30using System.IO;
31using OpenMetaverse;
32
33namespace OpenSim.Region.Framework.Interfaces
34{
35 public interface IDynamicTextureManager
36 {
37 void RegisterRender(string handleType, IDynamicTextureRender render);
38
39 /// <summary>
40 /// Used by IDynamicTextureRender implementations to return renders
41 /// </summary>
42 /// <param name='id'></param>
43 /// <param name='data'></param>
44 /// <param name='isReuseable'></param>
45 void ReturnData(UUID id, IDynamicTexture texture);
46
47 UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, string extraParams,
48 int updateTimer);
49 UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, string extraParams,
50 int updateTimer, bool SetBlending, byte AlphaValue);
51 UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, string extraParams,
52 int updateTimer, bool SetBlending, int disp, byte AlphaValue, int face);
53 UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams,
54 int updateTimer);
55
56 /// Apply a dynamically generated texture to all sides of the given prim. The texture is not persisted to the
57 /// asset service.
58 /// </summary>
59 /// <param name="simID">The simulator in which the texture is being generated</param>
60 /// <param name="primID">The prim to which to apply the texture.</param>
61 /// <param name="contentType">The content type to create. Current choices are "vector" to create a vector
62 /// based texture or "image" to create a texture from an image at a particular URL</param>
63 /// <param name="data">The data for the generator</param>
64 /// <param name="extraParams">Parameters for the generator that don't form part of the main data.</param>
65 /// <param name="updateTimer">If zero, the image is never updated after the first generation. If positive
66 /// the image is updated at the given interval. Not implemented for </param>
67 /// <param name="SetBlending">
68 /// If true, the newly generated texture is blended with the appropriate existing ones on the prim
69 /// </param>
70 /// <param name="AlphaValue">
71 /// The alpha value of the generated texture.
72 /// </param>
73 /// <returns>
74 /// The UUID of the texture updater, not the texture UUID. If you need the texture UUID then you will need
75 /// to obtain it directly from the SceneObjectPart. For instance, if ALL_SIDES is set then this texture
76 /// can be obtained as SceneObjectPart.Shape.Textures.DefaultTexture.TextureID
77 /// </returns>
78 UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams,
79 int updateTimer, bool SetBlending, byte AlphaValue);
80
81 /// <summary>
82 /// Apply a dynamically generated texture to the given prim.
83 /// </summary>
84 /// <param name="simID">The simulator in which the texture is being generated</param>
85 /// <param name="primID">The prim to which to apply the texture.</param>
86 /// <param name="contentType">The content type to create. Current choices are "vector" to create a vector
87 /// based texture or "image" to create a texture from an image at a particular URL</param>
88 /// <param name="data">The data for the generator</param>
89 /// <param name="extraParams">Parameters for the generator that don't form part of the main data.</param>
90 /// <param name="updateTimer">If zero, the image is never updated after the first generation. If positive
91 /// the image is updated at the given interval. Not implemented for </param>
92 /// <param name="SetBlending">
93 /// If true, the newly generated texture is blended with the appropriate existing ones on the prim
94 /// </param>
95 /// <param name="disp">
96 /// Display flags. If DISP_EXPIRE then the old texture is deleted if it is replaced by a
97 /// newer generated texture (may not currently be implemented). If DISP_TEMP then the asset is flagged as
98 /// temporary, which often means that it is not persisted to the database.
99 /// </param>
100 /// <param name="AlphaValue">
101 /// The alpha value of the generated texture.
102 /// </param>
103 /// <param name="face">
104 /// The face of the prim on which to put the generated texture. If ALL_SIDES then all sides of the prim are
105 /// set
106 /// </param>
107 /// <returns>
108 /// The UUID of the texture updater, not the texture UUID. If you need the texture UUID then you will need
109 /// to obtain it directly from the SceneObjectPart. For instance, if ALL_SIDES is set then this texture
110 /// can be obtained as SceneObjectPart.Shape.Textures.DefaultTexture.TextureID
111 /// </returns>
112 UUID AddDynamicTextureData(
113 UUID simID, UUID primID, string contentType, string data, string extraParams,
114 int updateTimer, bool SetBlending, int disp, byte AlphaValue, int face);
115
116 void GetDrawStringSize(string contentType, string text, string fontName, int fontSize,
117 out double xSize, out double ySize);
118 }
119
120 public interface IDynamicTextureRender
121 {
122 string GetName();
123 string GetContentType();
124 bool SupportsAsynchronous();
125
126// /// <summary>
127// /// Return true if converting the input body and extra params data will always result in the same byte[] array
128// /// </summary>
129// /// <remarks>
130// /// This method allows the caller to use a previously generated asset if it has one.
131// /// </remarks>
132// /// <returns></returns>
133// /// <param name='bodyData'></param>
134// /// <param name='extraParams'></param>
135// bool AlwaysIdenticalConversion(string bodyData, string extraParams);
136
137 IDynamicTexture ConvertUrl(string url, string extraParams);
138 IDynamicTexture ConvertData(string bodyData, string extraParams);
139
140 bool AsyncConvertUrl(UUID id, string url, string extraParams);
141 bool AsyncConvertData(UUID id, string bodyData, string extraParams);
142
143 void GetDrawStringSize(string text, string fontName, int fontSize,
144 out double xSize, out double ySize);
145 }
146
147 public interface IDynamicTexture
148 {
149 /// <summary>
150 /// Input commands used to generate this data.
151 /// </summary>
152 /// <remarks>
153 /// Null if input commands were not used.
154 /// </remarks>
155 string InputCommands { get; }
156
157 /// <summary>
158 /// Uri used to generate this data.
159 /// </summary>
160 /// <remarks>
161 /// Null if a uri was not used.
162 /// </remarks>
163 Uri InputUri { get; }
164
165 /// <summary>
166 /// Extra input params used to generate this data.
167 /// </summary>
168 string InputParams { get; }
169
170 /// <summary>
171 /// Texture data.
172 /// </summary>
173 byte[] Data { get; }
174
175 /// <summary>
176 /// Size of texture.
177 /// </summary>
178 Size Size { get; }
179
180 /// <summary>
181 /// Signal whether the texture is reuseable (i.e. whether the same input data will always generate the same
182 /// texture).
183 /// </summary>
184 bool IsReuseable { get; }
185 }
186}