Exemplo n.º 1
0
        public RawJTEX(Stream input)
        {
            using (var br = new BinaryReaderX(input))
            {
                //Header
                JTEXRawHeader = br.ReadStruct <RawHeader>();

                //Add image
                br.BaseStream.Position = JTEXRawHeader.dataStart;
                var settings = new ImageSettings
                {
                    Width         = JTEXRawHeader.width,
                    Height        = JTEXRawHeader.height,
                    Format        = ImageSettings.ConvertFormat(JTEXRawHeader.format),
                    PadToPowerOf2 = false
                };
                Image = Common.Load(br.ReadBytes((int)(br.BaseStream.Length - JTEXRawHeader.dataStart)), settings);
            }
        }
Exemplo n.º 2
0
        public RawJTEX(Stream input)
        {
            using (var br = new BinaryReaderX(input))
            {
                //Header
                JTEXRawHeader = br.ReadStruct <RawHeader>();

                //Add image
                br.BaseStream.Position = JTEXRawHeader.dataStart;
                settings = new ImageSettings
                {
                    Width   = JTEXRawHeader.virWidth,
                    Height  = JTEXRawHeader.virHeight,
                    Format  = Support.Format[JTEXRawHeader.format],
                    Swizzle = new CTRSwizzle(JTEXRawHeader.width, JTEXRawHeader.height)
                };
                Image = Kontract.Image.Common.Load(br.ReadBytes((int)(br.BaseStream.Length - JTEXRawHeader.dataStart)), settings);
            }
        }