using System;
using Il2CppInterop.Common.Attributes;
using Il2CppInterop.Runtime;
using Il2CppInterop.Runtime.InteropTypes;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSystem;

namespace UnityEngine.PostProcessing
{
	// Token: 0x020005E0 RID: 1504
	public class PostProcessingComponent<T> : PostProcessingComponentBase where T : PostProcessingModel
	{
		// Token: 0x170035D5 RID: 13781
		// (get) Token: 0x06009FA6 RID: 40870 RVA: 0x00290464 File Offset: 0x0028E664
		// (set) Token: 0x06009FA7 RID: 40871 RVA: 0x002904B4 File Offset: 0x0028E6B4
		public unsafe T model
		{
			[CallerCount(10)]
			[CachedScanResults(RefRangeStart = 7527, RefRangeEnd = 7537, XrefRangeStart = 7527, XrefRangeEnd = 7537, MetadataInitTokenRva = 0L, MetadataInitFlagRva = 0L)]
			get
			{
				IL2CPP.Il2CppObjectBaseToPtrNotNull(this);
				IntPtr* ptr = null;
				IntPtr intPtr2;
				IntPtr intPtr = IL2CPP.il2cpp_runtime_invoke(PostProcessingComponent<T>.NativeMethodInfoPtr_get_model_Public_get_T_0, IL2CPP.Il2CppObjectBaseToPtrNotNull(this), (void**)ptr, ref intPtr2);
				Il2CppException.RaiseExceptionIfNecessary(intPtr2);
				return IL2CPP.PointerToValueGeneric<T>(intPtr, false, true);
			}
			[CallerCount(0)]
			[CachedScanResults(RefRangeStart = 0, RefRangeEnd = 0, XrefRangeStart = 0, XrefRangeEnd = 0, MetadataInitTokenRva = 0L, MetadataInitFlagRva = 0L)]
			set
			{
				IL2CPP.Il2CppObjectBaseToPtrNotNull(this);
				checked
				{
					IntPtr* ptr = stackalloc IntPtr[unchecked((UIntPtr)1) * (UIntPtr)sizeof(IntPtr)];
					IntPtr* ptr2 = ptr;
					T ptr4;
					if (!typeof(T).IsValueType)
					{
						T t = value;
						if (!(t is string))
						{
							ref T ptr3 = (ptr4 = IL2CPP.Il2CppObjectBaseToPtr(t as Il2CppObjectBase));
							if ((ref ptr3) != null)
							{
								ptr4 = ref ptr3;
								if (IL2CPP.il2cpp_class_is_valuetype(IL2CPP.il2cpp_object_get_class(ref ptr3)))
								{
									ptr4 = IL2CPP.il2cpp_object_unbox(ref ptr3);
								}
							}
						}
						else
						{
							ptr4 = IL2CPP.ManagedStringToIl2Cpp(t as string);
						}
					}
					else
					{
						ptr4 = ref value;
					}
					*ptr2 = ref ptr4;
					IntPtr intPtr2;
					IntPtr intPtr = IL2CPP.il2cpp_runtime_invoke(PostProcessingComponent<T>.NativeMethodInfoPtr_set_model_Internal_set_Void_T_0, IL2CPP.Il2CppObjectBaseToPtrNotNull(this), (void**)ptr, ref intPtr2);
					Il2CppException.RaiseExceptionIfNecessary(intPtr2);
				}
			}
		}

		// Token: 0x06009FA8 RID: 40872 RVA: 0x00290560 File Offset: 0x0028E760
		[CallerCount(0)]
		[CachedScanResults(RefRangeStart = 0, RefRangeEnd = 0, XrefRangeStart = 649412, XrefRangeEnd = 649417, MetadataInitTokenRva = 0L, MetadataInitFlagRva = 0L)]
		public unsafe virtual void Init(PostProcessingContext pcontext, T pmodel)
		{
			IL2CPP.Il2CppObjectBaseToPtrNotNull(this);
			IntPtr* ptr;
			checked
			{
				ptr = stackalloc IntPtr[unchecked((UIntPtr)2) * (UIntPtr)sizeof(IntPtr)];
				*ptr = IL2CPP.Il2CppObjectBaseToPtr(pcontext);
			}
			IntPtr* ptr2 = ptr + checked(unchecked((UIntPtr)1) * (UIntPtr)sizeof(IntPtr)) / (UIntPtr)sizeof(IntPtr);
			T ptr4;
			if (!typeof(T).IsValueType)
			{
				T t = pmodel;
				if (!(t is string))
				{
					ref T ptr3 = (ptr4 = IL2CPP.Il2CppObjectBaseToPtr(t as Il2CppObjectBase));
					if ((ref ptr3) != null)
					{
						ptr4 = ref ptr3;
						if (IL2CPP.il2cpp_class_is_valuetype(IL2CPP.il2cpp_object_get_class(ref ptr3)))
						{
							ptr4 = IL2CPP.il2cpp_object_unbox(ref ptr3);
						}
					}
				}
				else
				{
					ptr4 = IL2CPP.ManagedStringToIl2Cpp(t as string);
				}
			}
			else
			{
				ptr4 = ref pmodel;
			}
			*ptr2 = ref ptr4;
			IntPtr intPtr2;
			IntPtr intPtr = IL2CPP.il2cpp_runtime_invoke(IL2CPP.il2cpp_object_get_virtual_method(IL2CPP.Il2CppObjectBaseToPtr(this), PostProcessingComponent<T>.NativeMethodInfoPtr_Init_Public_Virtual_New_Void_PostProcessingContext_T_0), IL2CPP.Il2CppObjectBaseToPtrNotNull(this), (void**)ptr, ref intPtr2);
			Il2CppException.RaiseExceptionIfNecessary(intPtr2);
		}

		// Token: 0x06009FA9 RID: 40873 RVA: 0x00290630 File Offset: 0x0028E830
		[CallerCount(0)]
		[CachedScanResults(RefRangeStart = 0, RefRangeEnd = 0, XrefRangeStart = 649417, XrefRangeEnd = 649418, MetadataInitTokenRva = 0L, MetadataInitFlagRva = 0L)]
		public unsafe override PostProcessingModel GetModel()
		{
			IL2CPP.Il2CppObjectBaseToPtrNotNull(this);
			IntPtr* ptr = null;
			IntPtr intPtr2;
			IntPtr intPtr = IL2CPP.il2cpp_runtime_invoke(IL2CPP.il2cpp_object_get_virtual_method(IL2CPP.Il2CppObjectBaseToPtr(this), PostProcessingComponent<T>.NativeMethodInfoPtr_GetModel_Public_Virtual_PostProcessingModel_0), IL2CPP.Il2CppObjectBaseToPtrNotNull(this), (void**)ptr, ref intPtr2);
			Il2CppException.RaiseExceptionIfNecessary(intPtr2);
			IntPtr intPtr3 = intPtr;
			return (intPtr3 != 0) ? new PostProcessingModel(intPtr3) : null;
		}

		// Token: 0x06009FAA RID: 40874 RVA: 0x00290694 File Offset: 0x0028E894
		[CallerCount(54)]
		[CachedScanResults(RefRangeStart = 225610, RefRangeEnd = 225664, XrefRangeStart = 225610, XrefRangeEnd = 225664, MetadataInitTokenRva = 0L, MetadataInitFlagRva = 0L)]
		public unsafe PostProcessingComponent()
			: this(IL2CPP.il2cpp_object_new(Il2CppClassPointerStore<PostProcessingComponent<T>>.NativeClassPtr))
		{
			IntPtr* ptr = null;
			IntPtr intPtr2;
			IntPtr intPtr = IL2CPP.il2cpp_runtime_invoke(PostProcessingComponent<T>.NativeMethodInfoPtr__ctor_Protected_Void_0, IL2CPP.Il2CppObjectBaseToPtrNotNull(this), (void**)ptr, ref intPtr2);
			Il2CppException.RaiseExceptionIfNecessary(intPtr2);
		}

		// Token: 0x06009FAB RID: 40875 RVA: 0x002906E0 File Offset: 0x0028E8E0
		// Note: this type is marked as 'beforefieldinit'.
		static PostProcessingComponent()
		{
			Il2CppClassPointerStore<PostProcessingComponent<T>>.NativeClassPtr = IL2CPP.il2cpp_class_from_type(Type.internal_from_handle(IL2CPP.il2cpp_class_get_type(IL2CPP.GetIl2CppClass("Assembly-CSharp.dll", "UnityEngine.PostProcessing", "PostProcessingComponent`1"))).MakeGenericType(new Il2CppReferenceArray<Type>(new Type[] { Type.internal_from_handle(IL2CPP.il2cpp_class_get_type(Il2CppClassPointerStore<T>.NativeClassPtr)) })).TypeHandle.value);
			IL2CPP.il2cpp_runtime_class_init(Il2CppClassPointerStore<PostProcessingComponent<T>>.NativeClassPtr);
			PostProcessingComponent<T>.NativeFieldInfoPtr__model_k__BackingField = IL2CPP.GetIl2CppField(Il2CppClassPointerStore<PostProcessingComponent<T>>.NativeClassPtr, "<model>k__BackingField");
			PostProcessingComponent<T>.NativeMethodInfoPtr_get_model_Public_get_T_0 = IL2CPP.GetIl2CppMethodByToken(Il2CppClassPointerStore<PostProcessingComponent<T>>.NativeClassPtr, 100675778);
			PostProcessingComponent<T>.NativeMethodInfoPtr_set_model_Internal_set_Void_T_0 = IL2CPP.GetIl2CppMethodByToken(Il2CppClassPointerStore<PostProcessingComponent<T>>.NativeClassPtr, 100675779);
			PostProcessingComponent<T>.NativeMethodInfoPtr_Init_Public_Virtual_New_Void_PostProcessingContext_T_0 = IL2CPP.GetIl2CppMethodByToken(Il2CppClassPointerStore<PostProcessingComponent<T>>.NativeClassPtr, 100675780);
			PostProcessingComponent<T>.NativeMethodInfoPtr_GetModel_Public_Virtual_PostProcessingModel_0 = IL2CPP.GetIl2CppMethodByToken(Il2CppClassPointerStore<PostProcessingComponent<T>>.NativeClassPtr, 100675781);
			PostProcessingComponent<T>.NativeMethodInfoPtr__ctor_Protected_Void_0 = IL2CPP.GetIl2CppMethodByToken(Il2CppClassPointerStore<PostProcessingComponent<T>>.NativeClassPtr, 100675782);
		}

		// Token: 0x06009FAC RID: 40876 RVA: 0x002907C3 File Offset: 0x0028E9C3
		public PostProcessingComponent(IntPtr pointer)
			: base(pointer)
		{
		}

		// Token: 0x170035D4 RID: 13780
		// (get) Token: 0x06009FAD RID: 40877 RVA: 0x002907CC File Offset: 0x0028E9CC
		// (set) Token: 0x06009FAE RID: 40878 RVA: 0x002907F8 File Offset: 0x0028E9F8
		public unsafe T _model_k__BackingField
		{
			get
			{
				IntPtr intPtr = IL2CPP.Il2CppObjectBaseToPtrNotNull(this) + (IntPtr)IL2CPP.il2cpp_field_get_offset(PostProcessingComponent<T>.NativeFieldInfoPtr__model_k__BackingField);
				return IL2CPP.PointerToValueGeneric<T>(intPtr, true, false);
			}
			set
			{
				IntPtr intPtr = IL2CPP.Il2CppObjectBaseToPtrNotNull(this);
				IntPtr intPtr2 = intPtr + (IntPtr)IL2CPP.il2cpp_field_get_offset(PostProcessingComponent<T>.NativeFieldInfoPtr__model_k__BackingField);
				Type typeFromHandle = typeof(T);
				if (!typeFromHandle.IsValueType)
				{
					if (!string.Equals(typeFromHandle.FullName, "System.String"))
					{
						IntPtr intPtr4;
						IntPtr intPtr3 = (intPtr4 = IL2CPP.Il2CppObjectBaseToPtr(value as Il2CppObjectBase));
						if (intPtr3 != 0)
						{
							intPtr4 = intPtr3;
							if (IL2CPP.il2cpp_class_is_valuetype(IL2CPP.il2cpp_object_get_class(intPtr3)))
							{
								IntPtr intPtr5 = intPtr3;
								cpblk(intPtr2, IL2CPP.il2cpp_object_unbox(intPtr3), IL2CPP.il2cpp_class_value_size(IL2CPP.il2cpp_object_get_class(intPtr5), (UIntPtr)0));
								return;
							}
						}
						IL2CPP.il2cpp_gc_wbarrier_set_field(intPtr, intPtr2, intPtr4);
					}
					else
					{
						IL2CPP.il2cpp_gc_wbarrier_set_field(intPtr, intPtr2, IL2CPP.ManagedStringToIl2Cpp(value as string));
					}
				}
				else
				{
					*intPtr2 = value;
				}
			}
		}

		// Token: 0x04006B3D RID: 27453
		private static readonly IntPtr NativeFieldInfoPtr__model_k__BackingField;

		// Token: 0x04006B3E RID: 27454
		private static readonly IntPtr NativeMethodInfoPtr_get_model_Public_get_T_0;

		// Token: 0x04006B3F RID: 27455
		private static readonly IntPtr NativeMethodInfoPtr_set_model_Internal_set_Void_T_0;

		// Token: 0x04006B40 RID: 27456
		private static readonly IntPtr NativeMethodInfoPtr_Init_Public_Virtual_New_Void_PostProcessingContext_T_0;

		// Token: 0x04006B41 RID: 27457
		private static readonly IntPtr NativeMethodInfoPtr_GetModel_Public_Virtual_PostProcessingModel_0;

		// Token: 0x04006B42 RID: 27458
		private static readonly IntPtr NativeMethodInfoPtr__ctor_Protected_Void_0;
	}
}
