1#ifndef GYM_PCB_NAVIMAGE
2#define GYM_PCB_NAVIMAGE
6#include "Rasterizer.hpp"
16#define NAV_IMAGE_NUM_CHANS 8
18#define NAV_IMAGE_CHAN_TRACK_T 0
19#define NAV_IMAGE_CHAN_TRACK_B 3
20#define NAV_IMAGE_CHAN_TRACK_M 6
21#define NAV_IMAGE_CHAN_PIN_T 1
22#define NAV_IMAGE_CHAN_PIN_B 4
23#define NAV_IMAGE_CHAN_RATSNEST_T 2
24#define NAV_IMAGE_CHAN_RATSNEST_B 5
25#define NAV_IMAGE_CHAN_VIA 7
34 chan_t Chan[NAV_IMAGE_NUM_CHANS];
36 void addPoint(
const NavPoint&,
char z, chan_t vTB, chan_t vM);
37 void addPin(
char z, chan_t);
38 void addRatsNest(
char z, chan_t);
39 void addTrack(
char z, chan_t vTB, chan_t vM);
42 bool isNonzero()
const;
47template<
typename chan_t>
class NavImage :
public UniformGrid25
49 constexpr static const chan_t FullCoverage = std::is_same_v<chan_t, float> ? 1 : 144;
51 NavImage(
const NavImage<chan_t>&);
53 NavImage(uint w, uint h,
const Bbox_2&, uint numLayers);
55 size_t sizeInBytes()
const {
return getNumPoints2D() *
sizeof(
NavPixel<chan_t>); }
56 int checkFit(
const UniformGrid25&)
const;
60 const NavPixel<chan_t>& at(uint x, uint y)
const {
return mData[y * mSize[0] + x]; }
64 void drawDownscale(
const NavGrid&);
65 void drawStatic(
const PCBoard&);
66 void drawDynamic(
const PCBoard&);
67 void drawRatsNest(
const PCBoard&,
const bool all);
68 void draw(
const Pin&);
70 void draw(
const Track&);
73 static chan_t getLayerMCoverage(uint d);
79 chan_t mLayerMCoverage;
83 char ZLabel(uint z)
const;
85 static Real computeEdgeLen(uint w, uint h,
const Bbox_2&);
87 void draw(
const Via&);
Definition Connection.hpp:17
The grid-representation of the board.
Definition NavGrid.hpp:61
void draw1To1(const NavGrid &)
WARNING: draw1To1() does not set via channel.
Definition NavPoint.hpp:116
Definition PCBoard.hpp:36
Definition Geometry.hpp:155
Definition NavImage.hpp:33