OpenSim
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
IDynamicTextureManager.cs
Go to the documentation of this file.
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 
28 using System;
29 using System.Drawing;
30 using System.IO;
31 using OpenMetaverse;
32 
33 namespace OpenSim.Region.Framework.Interfaces
34 {
35  public interface IDynamicTextureManager
36  {
37  void RegisterRender(string handleType, IDynamicTextureRender render);
38 
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 
78  UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams,
79  int updateTimer, bool SetBlending, byte AlphaValue);
80 
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  {
155  string InputCommands { get; }
156 
163  Uri InputUri { get; }
164 
168  string InputParams { get; }
169 
173  byte[] Data { get; }
174 
178  Size Size { get; }
179 
184  bool IsReuseable { get; }
185  }
186 }