// Token: 0x06002B59 RID: 11097 RVA: 0x000A87E0 File Offset: 0x000A69E0 public static Enum14 smethod_1(Stream data_stream) { Enum14 result; using (Stream3 stream = new Stream3(data_stream)) { using (BinaryReader binaryReader = new BinaryReader(stream)) { stream.smethod_36(); binaryReader.ReadByte(); binaryReader.ReadByte(); short num = stream.smethod_36(); stream.smethod_36(); stream.smethod_36(); short num2 = stream.smethod_36(); switch (num) { case 1: case 2: result = Enum14.const_3; break; case 3: switch (num2) { case 2: result = Enum14.const_2; break; case 3: result = Enum14.const_1; break; case 4: result = Enum14.const_0; break; default: throw new NotSupportedException(string.Format("ZSIZE: '{0}' is not supported.", num2)); } break; default: throw new NotSupportedException(string.Format("DIMENSION: '{0}' is not supported.", num)); } } } return(result); }
// Token: 0x06002B5A RID: 11098 RVA: 0x000A88D0 File Offset: 0x000A6AD0 public static Bitmap smethod_2(Stream data_stream) { Bitmap result; using (Stream3 stream = new Stream3(data_stream)) { using (BinaryReader binaryReader = new BinaryReader(stream)) { stream.smethod_36(); byte b = binaryReader.ReadByte(); binaryReader.ReadByte(); short num = stream.smethod_36(); short num2 = stream.smethod_36(); short num3 = stream.smethod_36(); short num4 = stream.smethod_36(); stream.smethod_34(); stream.smethod_34(); stream.smethod_34(); binaryReader.ReadBytes(80); stream.smethod_34(); binaryReader.ReadBytes(404); int num5 = (int)(num3 * num4); Class486.Class487[] array = new Class486.Class487[num5]; int num6 = 0; if (b == 1) { for (int i = 0; i < num5; i++) { array[i] = new Class486.Class487(); array[i].int_0 = stream.smethod_34(); } for (int j = 0; j < num5; j++) { array[j].int_1 = stream.smethod_34(); } for (int k = 0; k < num5; k++) { array[k].byte_0 = new byte[(int)num2]; } Array.Reverse(array); if (num == 1) { Class486.smethod_6(stream, array[0]); } else { if (num != 2) { if (num != 3) { throw new InvalidDataException("Invalid SGI image format."); } } foreach (Class486.Class487 tbl in array) { Class486.smethod_6(stream, tbl); num6++; } } } Struct33[,] array3 = new Struct33[(int)num2, (int)num3]; int num7 = 0; num6 = 0; bool flag; if (num == 3) { switch (num4) { case 2: flag = true; for (int m = 0; m < (int)num4; m++) { int num8 = (int)num3 * m; num7 = 0; num6 = 0; for (int n = num8; n < num8 + (int)num3; n++) { Class486.Class487 @class = array[n]; foreach (byte b2 in @class.byte_0) { switch (m) { case 0: array3[num7, num6].A = b2; break; case 1: array3[num7, num6].R = b2; array3[num7, num6].G = b2; array3[num7, num6].B = b2; break; } num7++; } num7 = 0; num6++; } } break; case 3: case 4: flag = (num4 == 4); for (int num10 = (int)(num4 - 1); num10 >= 0; num10--) { int num11 = (int)num3 * ((int)num4 - num10 - 1); num7 = 0; num6 = 0; for (int num12 = num11; num12 < num11 + (int)num3; num12++) { Class486.Class487 class2 = array[num12]; foreach (byte b3 in class2.byte_0) { switch (num10) { case 0: array3[num7, num6].R = b3; break; case 1: array3[num7, num6].G = b3; break; case 2: array3[num7, num6].B = b3; break; case 3: array3[num7, num6].A = b3; break; } num7++; } num7 = 0; num6++; } } break; default: throw new NotSupportedException(string.Format("ZSIZE: '{0}' is not supported.", num4)); } } else { flag = true; foreach (Class486.Class487 class3 in array) { foreach (byte b4 in class3.byte_0) { array3[num7, num6].R = b4; array3[num7, num6].G = b4; array3[num7, num6].B = b4; array3[num7, num6].A = b4; num7++; } num7 = 0; num6++; } } Bitmap bitmap = null; try { if (flag) { bitmap = new Bitmap((int)num2, (int)num3, PixelFormat.Format32bppArgb); } else { bitmap = new Bitmap((int)num2, (int)num3, PixelFormat.Format32bppRgb); } Class486.smethod_3(bitmap, array3); result = bitmap; } catch { if (bitmap != null) { bitmap.Dispose(); } throw; } } } return(result); }