31 m_inputWidth = codeWidth;
32 m_inputHeight = codeHeight;
33 int32_t tempWidth = m_inputWidth + 2;
34 int32_t tempHeight = m_inputHeight + 2;
36 moduleHSize =
std::min(moduleHSize, 8.0f);
37 moduleHSize =
std::max(moduleHSize, 1.0f);
38 FX_SAFE_INT32 scaledWidth = tempWidth;
39 FX_SAFE_INT32 scaledHeight = tempHeight;
40 scaledWidth *= moduleHSize;
41 scaledHeight *= moduleHSize;
42 m_outputWidth = scaledWidth.ValueOrDie();
43 m_outputHeight = scaledHeight.ValueOrDie();
51 int32_t width_factor =
static_cast<int32_t>(
52 floor(
static_cast<
float>(
m_Width) / m_outputWidth));
53 int32_t height_factor =
static_cast<int32_t>(
54 floor(
static_cast<
float>(
m_Height) / m_outputHeight));
55 width_factor =
std::max(width_factor, 1);
56 height_factor =
std::max(height_factor, 1);
58 m_outputWidth *= width_factor;
59 m_outputHeight *= height_factor;
63 static_cast<int32_t>(ceil(
static_cast<
float>(m_outputWidth) / tempWidth));
64 m_multiY =
static_cast<int32_t>(
65 ceil(
static_cast<
float>(m_outputHeight) / tempHeight));
67 m_multiX =
std::min(m_multiX, m_multiY);
71 m_leftPadding =
std::max((
m_Width - m_outputWidth) / 2, 0);
72 m_topPadding =
std::max((
m_Height - m_outputHeight) / 2, 0);
74 m_output = std::make_unique<CBC_CommonBitMatrix>(m_inputWidth, m_inputHeight);
75 for (int32_t y = 0; y < m_inputHeight; ++y) {
76 for (int32_t x = 0; x < m_inputWidth; ++x) {
77 if (code[x + y * m_inputWidth] == 1)
93 int32_t leftPos = m_leftPadding;
94 int32_t topPos = m_topPadding;
99 static_cast<
float>(
m_Height) / m_outputHeight
, 0.0
,
106 for (int32_t x = 0; x < m_inputWidth; x++) {
107 for (int32_t y = 0; y < m_inputHeight; y++) {
108 if (m_output->Get(x, y)) {
111 int start_x_output = x + 1;
112 int end_x_output = x + 2;
113 int start_y_output = y + 1;
114 int end_y_output = y + 2;
118 topPos + start_y_output * m_multiY
,
119 leftPos + end_x_output * m_multiX
,
120 topPos + end_y_output * m_multiY
);
bool DrawPath(const CFX_Path &path, const CFX_Matrix *pObject2Device, const CFX_GraphStateData *pGraphState, uint32_t fill_color, uint32_t stroke_color, const CFX_FillRenderOptions &fill_options)