<commit_before>﻿using OpenKh.Kh2;
using OpenKh.Tools.Common;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Media;
using Xe.Tools.Wpf.Models;
using static OpenKh.Tools.LayoutViewer.ViewModels.TexturesViewModel;

namespace OpenKh.Tools.LayoutViewer.ViewModels
{
    public class TexturesViewModel : GenericListModel<TextureModel>
    {
        public class TextureModel
        {
            private readonly Imgd imgd;

            public TextureModel(int index, Imgd imgd)
            {
                this.imgd = imgd;
                Index = index;
                Image = imgd.GetBimapSource();
            }

            public int Index { get; }

            public ImageSource Image { get; }

            public override string ToString() => $"{Index}: image {imgd.Size.Width}x{imgd.Size.Height}";
        }

        public TexturesViewModel(IEnumerable<Imgd> images) :
            this(images.Select((x, i) => new TextureModel(i, x)))
        {

        }

        public TexturesViewModel(IEnumerable<TextureModel> list) :
            base(list)
        {
        }

        protected override TextureModel OnNewItem()
        {
            throw new System.NotImplementedException();
        }
    }
}<commit_msg>TextureModel expose the Imgd Texture<commit_after>﻿using OpenKh.Kh2;
using OpenKh.Tools.Common;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Media;
using Xe.Tools.Wpf.Models;
using static OpenKh.Tools.LayoutViewer.ViewModels.TexturesViewModel;

namespace OpenKh.Tools.LayoutViewer.ViewModels
{
    public class TexturesViewModel : GenericListModel<TextureModel>
    {
        public class TextureModel
        {
            public TextureModel(int index, Imgd imgd)
            {
                Index = index;
                Texture = imgd;
                Image = imgd.GetBimapSource();
            }

            public int Index { get; }

            public Imgd Texture { get; }

            public ImageSource Image { get; }

            public override string ToString() => $"{Index}: image {Texture.Size.Width}x{Texture.Size.Height}";
        }

        public TexturesViewModel(IEnumerable<Imgd> images) :
            this(images.Select((x, i) => new TextureModel(i, x)))
        {

        }

        public TexturesViewModel(IEnumerable<TextureModel> list) :
            base(list)
        {
        }

        protected override TextureModel OnNewItem()
        {
            throw new System.NotImplementedException();
        }
    }
}
{'fraction_non_alphanumeric': 0.09209486166007905, 'fraction_numerical': 0.0007905138339920949, 'mean_word_length': 2.0716019417475726, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3629603', 'n_tokens_mistral': 728, 'n_tokens_neox': 687, 'n_words': 150}