UnityEngine.ImageConversionModule.cpp 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  1. #include "il2cpp-config.h"
  2. #ifndef _MSC_VER
  3. # include <alloca.h>
  4. #else
  5. # include <malloc.h>
  6. #endif
  7. #include <cstring>
  8. #include <string.h>
  9. #include <stdio.h>
  10. #include <cmath>
  11. #include <limits>
  12. #include <assert.h>
  13. #include <stdint.h>
  14. #include "codegen/il2cpp-codegen.h"
  15. #include "il2cpp-object-internals.h"
  16. // System.Byte[]
  17. struct ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821;
  18. // System.String
  19. struct String_t;
  20. // System.Void
  21. struct Void_t22962CB4C05B1D89B55A6E1139F0E87A90987017;
  22. // UnityEngine.Texture2D
  23. struct Texture2D_tBBF96AC337723E2EF156DF17E09D4379FD05DE1C;
  24. struct ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821;
  25. IL2CPP_EXTERN_C_BEGIN
  26. IL2CPP_EXTERN_C_END
  27. #ifdef __clang__
  28. #pragma clang diagnostic push
  29. #pragma clang diagnostic ignored "-Winvalid-offsetof"
  30. #pragma clang diagnostic ignored "-Wunused-variable"
  31. #endif
  32. // <Module>
  33. struct U3CModuleU3E_t3E933490017077F9EDC981FC79F07E2DEAA09C9D
  34. {
  35. public:
  36. public:
  37. };
  38. // System.Object
  39. struct Il2CppArrayBounds;
  40. // System.Array
  41. // System.ValueType
  42. struct ValueType_t4D0C27076F7C36E76190FB3328E232BCB1CD1FFF : public RuntimeObject
  43. {
  44. public:
  45. public:
  46. };
  47. // Native definition for P/Invoke marshalling of System.ValueType
  48. struct ValueType_t4D0C27076F7C36E76190FB3328E232BCB1CD1FFF_marshaled_pinvoke
  49. {
  50. };
  51. // Native definition for COM marshalling of System.ValueType
  52. struct ValueType_t4D0C27076F7C36E76190FB3328E232BCB1CD1FFF_marshaled_com
  53. {
  54. };
  55. // UnityEngine.ImageConversion
  56. struct ImageConversion_t578D0CCFF2C4D5356FE3356CB8FAEDD456D3FC43 : public RuntimeObject
  57. {
  58. public:
  59. public:
  60. };
  61. // System.Boolean
  62. struct Boolean_tB53F6830F670160873277339AA58F15CAED4399C
  63. {
  64. public:
  65. // System.Boolean System.Boolean::m_value
  66. bool ___m_value_0;
  67. public:
  68. inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Boolean_tB53F6830F670160873277339AA58F15CAED4399C, ___m_value_0)); }
  69. inline bool get_m_value_0() const { return ___m_value_0; }
  70. inline bool* get_address_of_m_value_0() { return &___m_value_0; }
  71. inline void set_m_value_0(bool value)
  72. {
  73. ___m_value_0 = value;
  74. }
  75. };
  76. struct Boolean_tB53F6830F670160873277339AA58F15CAED4399C_StaticFields
  77. {
  78. public:
  79. // System.String System.Boolean::TrueString
  80. String_t* ___TrueString_5;
  81. // System.String System.Boolean::FalseString
  82. String_t* ___FalseString_6;
  83. public:
  84. inline static int32_t get_offset_of_TrueString_5() { return static_cast<int32_t>(offsetof(Boolean_tB53F6830F670160873277339AA58F15CAED4399C_StaticFields, ___TrueString_5)); }
  85. inline String_t* get_TrueString_5() const { return ___TrueString_5; }
  86. inline String_t** get_address_of_TrueString_5() { return &___TrueString_5; }
  87. inline void set_TrueString_5(String_t* value)
  88. {
  89. ___TrueString_5 = value;
  90. Il2CppCodeGenWriteBarrier((void**)(&___TrueString_5), (void*)value);
  91. }
  92. inline static int32_t get_offset_of_FalseString_6() { return static_cast<int32_t>(offsetof(Boolean_tB53F6830F670160873277339AA58F15CAED4399C_StaticFields, ___FalseString_6)); }
  93. inline String_t* get_FalseString_6() const { return ___FalseString_6; }
  94. inline String_t** get_address_of_FalseString_6() { return &___FalseString_6; }
  95. inline void set_FalseString_6(String_t* value)
  96. {
  97. ___FalseString_6 = value;
  98. Il2CppCodeGenWriteBarrier((void**)(&___FalseString_6), (void*)value);
  99. }
  100. };
  101. // System.Byte
  102. struct Byte_tF87C579059BD4633E6840EBBBEEF899C6E33EF07
  103. {
  104. public:
  105. // System.Byte System.Byte::m_value
  106. uint8_t ___m_value_0;
  107. public:
  108. inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Byte_tF87C579059BD4633E6840EBBBEEF899C6E33EF07, ___m_value_0)); }
  109. inline uint8_t get_m_value_0() const { return ___m_value_0; }
  110. inline uint8_t* get_address_of_m_value_0() { return &___m_value_0; }
  111. inline void set_m_value_0(uint8_t value)
  112. {
  113. ___m_value_0 = value;
  114. }
  115. };
  116. // System.IntPtr
  117. struct IntPtr_t
  118. {
  119. public:
  120. // System.Void* System.IntPtr::m_value
  121. void* ___m_value_0;
  122. public:
  123. inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(IntPtr_t, ___m_value_0)); }
  124. inline void* get_m_value_0() const { return ___m_value_0; }
  125. inline void** get_address_of_m_value_0() { return &___m_value_0; }
  126. inline void set_m_value_0(void* value)
  127. {
  128. ___m_value_0 = value;
  129. }
  130. };
  131. struct IntPtr_t_StaticFields
  132. {
  133. public:
  134. // System.IntPtr System.IntPtr::Zero
  135. intptr_t ___Zero_1;
  136. public:
  137. inline static int32_t get_offset_of_Zero_1() { return static_cast<int32_t>(offsetof(IntPtr_t_StaticFields, ___Zero_1)); }
  138. inline intptr_t get_Zero_1() const { return ___Zero_1; }
  139. inline intptr_t* get_address_of_Zero_1() { return &___Zero_1; }
  140. inline void set_Zero_1(intptr_t value)
  141. {
  142. ___Zero_1 = value;
  143. }
  144. };
  145. // UnityEngine.Object
  146. struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 : public RuntimeObject
  147. {
  148. public:
  149. // System.IntPtr UnityEngine.Object::m_CachedPtr
  150. intptr_t ___m_CachedPtr_0;
  151. public:
  152. inline static int32_t get_offset_of_m_CachedPtr_0() { return static_cast<int32_t>(offsetof(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0, ___m_CachedPtr_0)); }
  153. inline intptr_t get_m_CachedPtr_0() const { return ___m_CachedPtr_0; }
  154. inline intptr_t* get_address_of_m_CachedPtr_0() { return &___m_CachedPtr_0; }
  155. inline void set_m_CachedPtr_0(intptr_t value)
  156. {
  157. ___m_CachedPtr_0 = value;
  158. }
  159. };
  160. struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_StaticFields
  161. {
  162. public:
  163. // System.Int32 UnityEngine.Object::OffsetOfInstanceIDInCPlusPlusObject
  164. int32_t ___OffsetOfInstanceIDInCPlusPlusObject_1;
  165. public:
  166. inline static int32_t get_offset_of_OffsetOfInstanceIDInCPlusPlusObject_1() { return static_cast<int32_t>(offsetof(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_StaticFields, ___OffsetOfInstanceIDInCPlusPlusObject_1)); }
  167. inline int32_t get_OffsetOfInstanceIDInCPlusPlusObject_1() const { return ___OffsetOfInstanceIDInCPlusPlusObject_1; }
  168. inline int32_t* get_address_of_OffsetOfInstanceIDInCPlusPlusObject_1() { return &___OffsetOfInstanceIDInCPlusPlusObject_1; }
  169. inline void set_OffsetOfInstanceIDInCPlusPlusObject_1(int32_t value)
  170. {
  171. ___OffsetOfInstanceIDInCPlusPlusObject_1 = value;
  172. }
  173. };
  174. // Native definition for P/Invoke marshalling of UnityEngine.Object
  175. struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_marshaled_pinvoke
  176. {
  177. intptr_t ___m_CachedPtr_0;
  178. };
  179. // Native definition for COM marshalling of UnityEngine.Object
  180. struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_marshaled_com
  181. {
  182. intptr_t ___m_CachedPtr_0;
  183. };
  184. // UnityEngine.Texture
  185. struct Texture_t387FE83BB848001FD06B14707AEA6D5A0F6A95F4 : public Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0
  186. {
  187. public:
  188. public:
  189. };
  190. struct Texture_t387FE83BB848001FD06B14707AEA6D5A0F6A95F4_StaticFields
  191. {
  192. public:
  193. // System.Int32 UnityEngine.Texture::GenerateAllMips
  194. int32_t ___GenerateAllMips_4;
  195. public:
  196. inline static int32_t get_offset_of_GenerateAllMips_4() { return static_cast<int32_t>(offsetof(Texture_t387FE83BB848001FD06B14707AEA6D5A0F6A95F4_StaticFields, ___GenerateAllMips_4)); }
  197. inline int32_t get_GenerateAllMips_4() const { return ___GenerateAllMips_4; }
  198. inline int32_t* get_address_of_GenerateAllMips_4() { return &___GenerateAllMips_4; }
  199. inline void set_GenerateAllMips_4(int32_t value)
  200. {
  201. ___GenerateAllMips_4 = value;
  202. }
  203. };
  204. // UnityEngine.Texture2D
  205. struct Texture2D_tBBF96AC337723E2EF156DF17E09D4379FD05DE1C : public Texture_t387FE83BB848001FD06B14707AEA6D5A0F6A95F4
  206. {
  207. public:
  208. public:
  209. };
  210. #ifdef __clang__
  211. #pragma clang diagnostic pop
  212. #endif
  213. // System.Byte[]
  214. struct ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821 : public RuntimeArray
  215. {
  216. public:
  217. ALIGN_FIELD (8) uint8_t m_Items[1];
  218. public:
  219. inline uint8_t GetAt(il2cpp_array_size_t index) const
  220. {
  221. IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length);
  222. return m_Items[index];
  223. }
  224. inline uint8_t* GetAddressAt(il2cpp_array_size_t index)
  225. {
  226. IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length);
  227. return m_Items + index;
  228. }
  229. inline void SetAt(il2cpp_array_size_t index, uint8_t value)
  230. {
  231. IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length);
  232. m_Items[index] = value;
  233. }
  234. inline uint8_t GetAtUnchecked(il2cpp_array_size_t index) const
  235. {
  236. return m_Items[index];
  237. }
  238. inline uint8_t* GetAddressAtUnchecked(il2cpp_array_size_t index)
  239. {
  240. return m_Items + index;
  241. }
  242. inline void SetAtUnchecked(il2cpp_array_size_t index, uint8_t value)
  243. {
  244. m_Items[index] = value;
  245. }
  246. };
  247. // System.Boolean UnityEngine.ImageConversion::LoadImage(UnityEngine.Texture2D,System.Byte[],System.Boolean)
  248. IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool ImageConversion_LoadImage_mFB317291362399115F8D112D8CE9E8C1BF454C29 (Texture2D_tBBF96AC337723E2EF156DF17E09D4379FD05DE1C * ___tex0, ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821* ___data1, bool ___markNonReadable2, const RuntimeMethod* method);
  249. #ifdef __clang__
  250. #pragma clang diagnostic push
  251. #pragma clang diagnostic ignored "-Winvalid-offsetof"
  252. #pragma clang diagnostic ignored "-Wunused-variable"
  253. #endif
  254. #ifdef __clang__
  255. #pragma clang diagnostic pop
  256. #endif
  257. #ifdef __clang__
  258. #pragma clang diagnostic push
  259. #pragma clang diagnostic ignored "-Winvalid-offsetof"
  260. #pragma clang diagnostic ignored "-Wunused-variable"
  261. #endif
  262. // System.Byte[] UnityEngine.ImageConversion::EncodeToPNG(UnityEngine.Texture2D)
  263. IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821* ImageConversion_EncodeToPNG_m8D67A36A7D81F436CDA108CC5293E15A9CFD5617 (Texture2D_tBBF96AC337723E2EF156DF17E09D4379FD05DE1C * ___tex0, const RuntimeMethod* method)
  264. {
  265. typedef ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821* (*ImageConversion_EncodeToPNG_m8D67A36A7D81F436CDA108CC5293E15A9CFD5617_ftn) (Texture2D_tBBF96AC337723E2EF156DF17E09D4379FD05DE1C *);
  266. static ImageConversion_EncodeToPNG_m8D67A36A7D81F436CDA108CC5293E15A9CFD5617_ftn _il2cpp_icall_func;
  267. if (!_il2cpp_icall_func)
  268. _il2cpp_icall_func = (ImageConversion_EncodeToPNG_m8D67A36A7D81F436CDA108CC5293E15A9CFD5617_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.ImageConversion::EncodeToPNG(UnityEngine.Texture2D)");
  269. ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821* retVal = _il2cpp_icall_func(___tex0);
  270. return retVal;
  271. }
  272. // System.Boolean UnityEngine.ImageConversion::LoadImage(UnityEngine.Texture2D,System.Byte[],System.Boolean)
  273. IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool ImageConversion_LoadImage_mFB317291362399115F8D112D8CE9E8C1BF454C29 (Texture2D_tBBF96AC337723E2EF156DF17E09D4379FD05DE1C * ___tex0, ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821* ___data1, bool ___markNonReadable2, const RuntimeMethod* method)
  274. {
  275. typedef bool (*ImageConversion_LoadImage_mFB317291362399115F8D112D8CE9E8C1BF454C29_ftn) (Texture2D_tBBF96AC337723E2EF156DF17E09D4379FD05DE1C *, ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821*, bool);
  276. static ImageConversion_LoadImage_mFB317291362399115F8D112D8CE9E8C1BF454C29_ftn _il2cpp_icall_func;
  277. if (!_il2cpp_icall_func)
  278. _il2cpp_icall_func = (ImageConversion_LoadImage_mFB317291362399115F8D112D8CE9E8C1BF454C29_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.ImageConversion::LoadImage(UnityEngine.Texture2D,System.Byte[],System.Boolean)");
  279. bool retVal = _il2cpp_icall_func(___tex0, ___data1, ___markNonReadable2);
  280. return retVal;
  281. }
  282. // System.Boolean UnityEngine.ImageConversion::LoadImage(UnityEngine.Texture2D,System.Byte[])
  283. IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool ImageConversion_LoadImage_m94295492E96C38984406A23CC2A3931758ECE86B (Texture2D_tBBF96AC337723E2EF156DF17E09D4379FD05DE1C * ___tex0, ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821* ___data1, const RuntimeMethod* method)
  284. {
  285. bool V_0 = false;
  286. {
  287. Texture2D_tBBF96AC337723E2EF156DF17E09D4379FD05DE1C * L_0 = ___tex0;
  288. ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821* L_1 = ___data1;
  289. bool L_2 = ImageConversion_LoadImage_mFB317291362399115F8D112D8CE9E8C1BF454C29(L_0, L_1, (bool)0, /*hidden argument*/NULL);
  290. V_0 = L_2;
  291. goto IL_000c;
  292. }
  293. IL_000c:
  294. {
  295. bool L_3 = V_0;
  296. return L_3;
  297. }
  298. }
  299. #ifdef __clang__
  300. #pragma clang diagnostic pop
  301. #endif