Skip to content

dtl::shape::HalfMixRect (形状クラス)

Kasugaccho edited this page Aug 17, 2019 · 8 revisions

バージョン:0.4.0.0以降

<DTL/Shape/HalfMixRect.hpp>

namespace dtl::shape {
  template <typename T>
  class HalfMixRect;
}

T は1bit以上の型

対応機能

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

例 (C++14)

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

int main() {

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

	dtl::shape::HalfMixRect<shape_t>(0, 1, 2, 3, 4, 5).draw(matrix);

	dtl::console::OutputNumber<shape_t>(",").draw(matrix);
	dtl::console::OutputString<shape_t>("AA", "BB", "CC", "DD", "EE", "FF").draw(matrix);

	return 0;
}

出力

0,0,1,0,1,5,4,0,0,5,0,2,0,2,0,5,
5,0,4,0,0,0,0,0,5,0,3,3,1,2,0,0,
0,0,3,0,1,5,2,0,0,0,0,0,2,0,5,3,
1,5,0,5,0,5,3,2,0,0,0,0,2,2,0,5,
0,0,0,1,1,0,0,0,5,1,0,0,1,3,3,5,
1,0,0,0,0,0,5,0,0,0,2,0,0,0,1,4,
0,0,0,0,5,0,0,1,0,5,0,3,0,0,3,1,
0,0,3,0,0,5,0,0,0,4,1,0,3,4,0,0,
0,0,0,3,4,4,0,2,0,2,0,0,1,5,0,0,
0,0,1,5,0,2,0,4,0,0,0,0,5,0,4,5,
5,4,0,1,0,1,0,2,0,0,4,3,5,4,0,0,
0,3,0,0,1,3,3,0,0,3,0,0,0,0,0,0,
AAAABBAABBFFEEAAAAFFAACCAACCAAFF
FFAAEEAAAAAAAAAAFFAADDDDBBCCAAAA
AAAADDAABBFFCCAAAAAAAAAACCAAFFDD
BBFFAAFFAAFFDDCCAAAAAAAACCCCAAFF
AAAAAABBBBAAAAAAFFBBAAAABBDDDDFF
BBAAAAAAAAAAFFAAAAAACCAAAAAABBEE
AAAAAAAAFFAAAABBAAFFAADDAAAADDBB
AAAADDAAAAFFAAAAAAEEBBAADDEEAAAA
AAAAAADDEEEEAACCAACCAAAABBFFAAAA
AAAABBFFAACCAAEEAAAAAAAAFFAAEEFF
FFEEAABBAABBAACCAAAAEEDDFFEEAAAA
AADDAAAABBDDDDAAAADDAAAAAAAAAAAA

画像

なし

関連項目

dtl::shape::MixRect

Clone this wiki locally