<commit_before>#include "PackRegularRect.h"
#include "check_params.h"

#include <drag2d.h>
#include <easypacker.h>

namespace edb
{

std::string PackRegularRect::Command() const
{
	return "pack-rect";
}

std::string PackRegularRect::Description() const
{
	return "pack regular rects which edge are times of 4";
}

std::string PackRegularRect::Usage() const
{
	return Command() + " [src dir] [dst dir]";
}

void PackRegularRect::Run(int argc, char *argv[])
{
	// pack-rect e:\debug\cut e:\debug\pack

	if (!check_number(this, argc, 4)) return;
	if (!check_folder(argv[2])) return;
	if (!check_folder(argv[3])) return;

	Trigger(argv[2], argv[3]);
}

void PackRegularRect::Trigger(const std::string& src_dir, const std::string& dst_dir)
{
	wxArrayString files;
	d2d::FilenameTools::fetchAllFiles(src_dir, files);

	wxString filepath = dst_dir + "\\pack.json";

// 	// pack
// 	libpacker::RegularRectPack rrp(files);
// 	rrp.Pack();
// 	rrp.OutputToText(filepath);
// 
// 	// gen image
// 	libpacker::GenRegularRectImage::Create(filepath);

	// gen binary
	libpacker::GenRegularRectBinary pack(filepath);
	pack.PackToBinary();
}

}<commit_msg>[CHANGED] rrp打开合图，关闭打包bin<commit_after>#include "PackRegularRect.h"
#include "check_params.h"

#include <drag2d.h>
#include <easypacker.h>

namespace edb
{

std::string PackRegularRect::Command() const
{
	return "pack-rect";
}

std::string PackRegularRect::Description() const
{
	return "pack regular rects which edge are times of 4";
}

std::string PackRegularRect::Usage() const
{
	return Command() + " [src dir] [dst dir]";
}

void PackRegularRect::Run(int argc, char *argv[])
{
	// pack-rect e:\debug\cut e:\debug\pack

	if (!check_number(this, argc, 4)) return;
	if (!check_folder(argv[2])) return;
	if (!check_folder(argv[3])) return;

	Trigger(argv[2], argv[3]);
}

void PackRegularRect::Trigger(const std::string& src_dir, const std::string& dst_dir)
{
	wxArrayString files;
	d2d::FilenameTools::fetchAllFiles(src_dir, files);

	wxString filepath = dst_dir + "\\pack.json";

 	// pack
 	libpacker::RegularRectPack rrp(files);
 	rrp.Pack();
 	rrp.OutputToText(filepath);
 
 	// gen image
 	libpacker::GenRegularRectImage::Create(filepath);

// 	// gen binary
// 	libpacker::GenRegularRectBinary pack(filepath);
// 	pack.PackToBinary();
}

}
{'fraction_non_alphanumeric': 0.16571928290336685, 'fraction_numerical': 0.006996064713598601, 'mean_word_length': 5.2684931506849315, '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': '919003', 'n_tokens_mistral': 874, 'n_tokens_neox': 833, 'n_words': 173}