Skip to content

dtl::retouch::Average (修正クラス)

Kasugaccho edited this page Aug 17, 2019 · 2 revisions

バージョン:0.4.12.0以降

<DTL/Retouch/Average.hpp>

namespace dtl::retouch {
  template <typename T>
  class Average;
}

T は1bit以上の型

対応機能

機能名 対応
非長方形Matrix 可能✅

例 (C++11)

#include <DTL.hpp>
#include <cstdint>
#include <array>

int main() {

	using shape_t = std::uint_fast8_t;
	std::array<std::array<shape_t, 7>, 7> matrix{ {} };

	dtl::shape::SimplePyramid<shape_t>(99, 10).draw(matrix);

	dtl::console::OutputNumber<shape_t>(",").draw(matrix);
	dtl::console::OutputStringBool<shape_t>("##", "//").drawOperator(matrix, [](const shape_t value) {return value > 50; });

	dtl::retouch::Average<shape_t>().draw(matrix);

	dtl::console::OutputNumber<shape_t>(",").draw(matrix);
	dtl::console::OutputStringBool<shape_t>("##", "//").drawOperator(matrix, [](const shape_t value) {return value > 50; });

	return 0;
}

出力

10,10,10,10,10,10,10,
10,39,39,39,39,39,10,
10,39,69,69,69,39,10,
10,39,69,99,69,39,10,
10,39,69,69,69,39,10,
10,39,39,39,39,39,10,
10,10,10,10,10,10,10,
//////////////
//////////////
////######////
////######////
////######////
//////////////
//////////////
30,30,30,30,30,30,30,
30,30,30,30,30,30,30,
30,30,30,30,30,30,30,
30,30,30,30,30,30,30,
30,30,30,30,30,30,30,
30,30,30,30,30,30,30,
30,30,30,30,30,30,30,
//////////////
//////////////
//////////////
//////////////
//////////////
//////////////
//////////////
Clone this wiki locally