Elight.Utility/Files/DataMatrix/DmtxImage.cs

(开头部分) 8KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;

namespace DataMatrix.net
{
	// Token: 0x0200001E RID: 30
	internal class DmtxImage
	{
		// Token: 0x06000155 RID: 341 RVA: 0x0000CB98 File Offset: 0x0000AD98
		internal DmtxImage(byte[] pxl, int width, int height, DmtxPackOrder pack)
		{
			this.BitsPerChannel = new int[4];
			this.ChannelStart = new int[4];
			if (pxl == null || width < 1 || height < 1)
			{
				throw new ArgumentException("Cannot create image of size null");
			}
			this.Pxl = pxl;
			this.Width = width;
			this.Height = height;
			this.PixelPacking = pack;
			this.BitsPerPixel = DmtxCommon.GetBitsPerPixel(pack);
			this.BytesPerPixel = this.BitsPerPixel / 8;
			this._rowPadBytes = 0;
			this.RowSizeBytes = this.Width * this.BytesPerPixel + this._rowPadBytes;
			this.ImageFlip = DmtxFlip.DmtxFlipNone;
			this.ChannelCount = 0;
			if (pack <= DmtxPackOrder.DmtxPack8bppK)
			{
				if (pack == DmtxPackOrder.DmtxPackCustom)
				{
					return;
				}
				if (pack == DmtxPackOrder.DmtxPack1bppK)
				{
					throw new ArgumentException("Cannot create image: not supported pack order!");
				}
				if (pack == DmtxPackOrder.DmtxPack8bppK)
				{
					this.SetChannel(0, 8);
					return;
				}
			}
			else
			{
				switch (pack)
				{
				case DmtxPackOrder.DmtxPack16bppRGB:
				case DmtxPackOrder.DmtxPack16bppBGR:
				case DmtxPackOrder.DmtxPack16bppYCbCr:
					this.SetChannel(0, 5);
					this.SetChannel(5, 5);
					this.SetChannel(10, 5);
					return;
				case DmtxPackOrder.DmtxPack16bppRGBX:
				case DmtxPackOrder.DmtxPack16bppBGRX:
					this.SetChannel(0, 5);
					this.SetChannel(5, 5);
					this.SetChannel(10, 5);
					return;
				case DmtxPackOrder.DmtxPack16bppXRGB:
后面还有 243 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。