using System;
using Cpp2IlInjected;
using UnityEngine;

namespace UnityStandardAssets.ImageEffects
{
	// Token: 0x020005CE RID: 1486
	[Token(Token = "0x20005CE")]
	[ExecuteInEditMode]
	[RequireComponent(typeof(Camera))]
	[AddComponentMenu("Image Effects/Color Adjustments/Tonemapping")]
	public class Tonemapping : PostEffectsBase
	{
		// Token: 0x06002F5C RID: 12124 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002F5C")]
		[Address(RVA = "0x13019A0", Offset = "0x13007A0", VA = "0x1813019A0", Slot = "4")]
		public override bool CheckResources()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002F5D RID: 12125 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002F5D")]
		[Address(RVA = "0x13027D0", Offset = "0x13015D0", VA = "0x1813027D0")]
		public float UpdateCurve()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002F5E RID: 12126 RVA: 0x00065024 File Offset: 0x00063224
		[Token(Token = "0x6002F5E")]
		[Address(RVA = "0x1301C20", Offset = "0x1300A20", VA = "0x181301C20")]
		private void OnDisable()
		{
			if (this.rt)
			{
				UnityEngine.Object.DestroyImmediate(this.rt);
				this.rt = (ulong)0L;
			}
			if (this.tonemapMaterial)
			{
				UnityEngine.Object.DestroyImmediate(this.tonemapMaterial);
				this.tonemapMaterial = (ulong)0L;
			}
			Texture2D texture2D = this.curveTex;
			if (texture2D)
			{
				UnityEngine.Object.DestroyImmediate(texture2D);
			}
		}

		// Token: 0x06002F5F RID: 12127 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002F5F")]
		[Address(RVA = "0x1301B00", Offset = "0x1300900", VA = "0x181301B00")]
		private bool CreateInternalRenderTexture()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002F60 RID: 12128 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002F60")]
		[Address(RVA = "0x1301DB0", Offset = "0x1300BB0", VA = "0x181301DB0")]
		[ImageEffectTransformsToLDR]
		private void OnRenderImage(RenderTexture source, RenderTexture destination)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002F61 RID: 12129 RVA: 0x0006508C File Offset: 0x0006328C
		[Token(Token = "0x6002F61")]
		[Address(RVA = "0x1302B00", Offset = "0x1301900", VA = "0x181302B00")]
		public Tonemapping()
		{
		}

		// Token: 0x04003969 RID: 14697
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x4003969")]
		public Tonemapping.TonemapperType type = (Tonemapping.TonemapperType)((ulong)3L);

		// Token: 0x0400396A RID: 14698
		[FieldOffset(Offset = "0x2C")]
		[Token(Token = "0x400396A")]
		public Tonemapping.AdaptiveTexSize adaptiveTextureSize = (Tonemapping.AdaptiveTexSize)((ulong)256L);

		// Token: 0x0400396B RID: 14699
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x400396B")]
		public AnimationCurve remapCurve;

		// Token: 0x0400396C RID: 14700
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x400396C")]
		private Texture2D curveTex;

		// Token: 0x0400396D RID: 14701
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x400396D")]
		public float exposureAdjustment = 1.5f;

		// Token: 0x0400396E RID: 14702
		[FieldOffset(Offset = "0x44")]
		[Token(Token = "0x400396E")]
		public float middleGrey = 0.4f;

		// Token: 0x0400396F RID: 14703
		[FieldOffset(Offset = "0x48")]
		[Token(Token = "0x400396F")]
		public float white = 2f;

		// Token: 0x04003970 RID: 14704
		[FieldOffset(Offset = "0x4C")]
		[Token(Token = "0x4003970")]
		public float adaptionSpeed = 1.5f;

		// Token: 0x04003971 RID: 14705
		[FieldOffset(Offset = "0x50")]
		[Token(Token = "0x4003971")]
		public Shader tonemapper;

		// Token: 0x04003972 RID: 14706
		[FieldOffset(Offset = "0x58")]
		[Token(Token = "0x4003972")]
		public bool validRenderTextureFormat = true;

		// Token: 0x04003973 RID: 14707
		[FieldOffset(Offset = "0x60")]
		[Token(Token = "0x4003973")]
		private Material tonemapMaterial;

		// Token: 0x04003974 RID: 14708
		[FieldOffset(Offset = "0x68")]
		[Token(Token = "0x4003974")]
		private RenderTexture rt;

		// Token: 0x04003975 RID: 14709
		[FieldOffset(Offset = "0x70")]
		[Token(Token = "0x4003975")]
		private RenderTextureFormat rtFormat = (RenderTextureFormat)((ulong)2L);

		// Token: 0x020005CF RID: 1487
		[Token(Token = "0x20005CF")]
		public enum TonemapperType
		{
			// Token: 0x04003977 RID: 14711
			[Token(Token = "0x4003977")]
			SimpleReinhard,
			// Token: 0x04003978 RID: 14712
			[Token(Token = "0x4003978")]
			UserCurve,
			// Token: 0x04003979 RID: 14713
			[Token(Token = "0x4003979")]
			Hable,
			// Token: 0x0400397A RID: 14714
			[Token(Token = "0x400397A")]
			Photographic,
			// Token: 0x0400397B RID: 14715
			[Token(Token = "0x400397B")]
			OptimizedHejiDawson,
			// Token: 0x0400397C RID: 14716
			[Token(Token = "0x400397C")]
			AdaptiveReinhard,
			// Token: 0x0400397D RID: 14717
			[Token(Token = "0x400397D")]
			AdaptiveReinhardAutoWhite
		}

		// Token: 0x020005D0 RID: 1488
		[Token(Token = "0x20005D0")]
		public enum AdaptiveTexSize
		{
			// Token: 0x0400397F RID: 14719
			[Token(Token = "0x400397F")]
			Square16 = 16,
			// Token: 0x04003980 RID: 14720
			[Token(Token = "0x4003980")]
			Square32 = 32,
			// Token: 0x04003981 RID: 14721
			[Token(Token = "0x4003981")]
			Square64 = 64,
			// Token: 0x04003982 RID: 14722
			[Token(Token = "0x4003982")]
			Square128 = 128,
			// Token: 0x04003983 RID: 14723
			[Token(Token = "0x4003983")]
			Square256 = 256,
			// Token: 0x04003984 RID: 14724
			[Token(Token = "0x4003984")]
			Square512 = 512,
			// Token: 0x04003985 RID: 14725
			[Token(Token = "0x4003985")]
			Square1024 = 1024
		}
	}
}
