Skip to content

Would this also be a bit better? #33

Description

@aliveanyang
	public class stbi__context
	{
		public byte[] _tempBuffer;
		public int img_n = 0;
		public int img_out_n = 0;
		public uint img_x = 0;
		public uint img_y = 0;

		private long _offset;

		public stbi__context(Stream stream)
		{
			if (stream == null)
				throw new ArgumentNullException("stream");

            _offset = stream.Position;
            Stream = stream;

        }

    public Stream Stream { get; }

        public long Seek(long offset, SeekOrigin origin)
        {
            if (origin == SeekOrigin.Begin)
            {
                return Stream.Seek(this._offset + offset, origin);
            }
            else
            {
                return Stream.Seek(offset, origin);
            }
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions