<commit_before>#pragma once

#include "common/ResourcesMgr.h"
#include "common/Rect.h"
#include "common/Object.h"

#include <wx/wx.h>

typedef unsigned char uint8_t;

namespace d2d
{
	class Image;
	typedef ResourcesMgr<Image> ImageMgr;

	class Matrix;
	class ISprite;

	class Image : public Object
	{
	public:
		Image();
		Image(const uint8_t* pixel, int width, int height);
		~Image();
		
		bool loadFromFile(const wxString& filepath);
		void reload();

		const wxString& filepath() const { return m_filepath; }

		unsigned int textureID() const { return m_textureID; }
		int channels() const { return m_channels; }

		int clipWidth() const { return m_region.xLength(); }
		int clipHeight() const { return m_region.yLength(); }
		int originWidth() const { return m_width; }
		int originHeight() const { return m_height; }

		void draw(const Matrix& mt, const Rect& r, const ISprite* spr) const;

		Rect getRegion() const { return m_region; }

		const unsigned char* getPixelData() const { return m_pixels; }

	private:
		wxString m_filepath;

		unsigned int m_textureID;
		int m_channels;

		int m_width, m_height;
		Rect m_region;

		const uint8_t* m_pixels;

	}; // Image
}

<commit_msg>[FIXED] image接口兼容<commit_after>#pragma once

#include "common/ResourcesMgr.h"
#include "common/Rect.h"
#include "common/Object.h"

#include <wx/wx.h>

typedef unsigned char uint8_t;

namespace d2d
{
	class Image;
	typedef ResourcesMgr<Image> ImageMgr;

	class Matrix;
	class ISprite;

	class Image : public Object
	{
	public:
		Image();
		Image(const uint8_t* pixel, int width, int height);
		~Image();
		
		bool loadFromFile(const wxString& filepath);
		void reload();

		const wxString& filepath() const { return m_filepath; }

		unsigned int textureID() const { return m_textureID; }
		int channels() const { return m_channels; }

		int clipWidth() const { return m_region.xLength(); }
		int clipHeight() const { return m_region.yLength(); }
		int originWidth() const { return m_width; }
		int originHeight() const { return m_height; }

		void draw(const Matrix& mt, const Rect& r, const ISprite* spr = NULL) const;

		Rect getRegion() const { return m_region; }

		const unsigned char* getPixelData() const { return m_pixels; }

	private:
		wxString m_filepath;

		unsigned int m_textureID;
		int m_channels;

		int m_width, m_height;
		Rect m_region;

		const uint8_t* m_pixels;

	}; // Image
}


{'fraction_non_alphanumeric': 0.10999581764951903, 'fraction_numerical': 0.003345880384776244, 'mean_word_length': 4.155172413793103, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4533085', 'n_tokens_mistral': 881, 'n_tokens_neox': 805, 'n_words': 246}