summaryrefslogtreecommitdiff
path: root/fxbarcode
diff options
context:
space:
mode:
Diffstat (limited to 'fxbarcode')
-rw-r--r--fxbarcode/cbc_codabar.cpp6
-rw-r--r--fxbarcode/cbc_codabar.h2
-rw-r--r--fxbarcode/cbc_code128.cpp6
-rw-r--r--fxbarcode/cbc_code128.h2
-rw-r--r--fxbarcode/cbc_code39.cpp6
-rw-r--r--fxbarcode/cbc_code39.h2
-rw-r--r--fxbarcode/cbc_codebase.h2
-rw-r--r--fxbarcode/cbc_datamatrix.cpp2
-rw-r--r--fxbarcode/cbc_datamatrix.h2
-rw-r--r--fxbarcode/cbc_ean13.cpp6
-rw-r--r--fxbarcode/cbc_ean13.h2
-rw-r--r--fxbarcode/cbc_ean8.cpp6
-rw-r--r--fxbarcode/cbc_ean8.h2
-rw-r--r--fxbarcode/cbc_pdf417i.cpp2
-rw-r--r--fxbarcode/cbc_pdf417i.h2
-rw-r--r--fxbarcode/cbc_qrcode.cpp2
-rw-r--r--fxbarcode/cbc_qrcode.h2
-rw-r--r--fxbarcode/cbc_upca.cpp6
-rw-r--r--fxbarcode/cbc_upca.h2
-rw-r--r--fxbarcode/oned/BC_OneDimWriter.cpp20
-rw-r--r--fxbarcode/oned/BC_OneDimWriter.h3
-rw-r--r--fxbarcode/oned/BC_OnedCodaBarWriter.cpp5
-rw-r--r--fxbarcode/oned/BC_OnedCodaBarWriter.h3
-rw-r--r--fxbarcode/oned/BC_OnedCode39Writer.cpp5
-rw-r--r--fxbarcode/oned/BC_OnedCode39Writer.h3
25 files changed, 41 insertions, 60 deletions
diff --git a/fxbarcode/cbc_codabar.cpp b/fxbarcode/cbc_codabar.cpp
index d1501212cc..a8729b64c6 100644
--- a/fxbarcode/cbc_codabar.cpp
+++ b/fxbarcode/cbc_codabar.cpp
@@ -47,7 +47,7 @@ bool CBC_Codabar::SetWideNarrowRatio(int8_t ratio) {
return GetOnedCodaBarWriter()->SetWideNarrowRatio(ratio);
}
-bool CBC_Codabar::Encode(const CFX_WideStringC& contents, bool isDevice) {
+bool CBC_Codabar::Encode(const CFX_WideStringC& contents) {
if (contents.IsEmpty())
return false;
@@ -64,8 +64,8 @@ bool CBC_Codabar::Encode(const CFX_WideStringC& contents, bool isDevice) {
if (!data)
return false;
- return pWriter->RenderResult(filtercontents.AsStringC(), data.get(), outWidth,
- isDevice);
+ return pWriter->RenderResult(filtercontents.AsStringC(), data.get(),
+ outWidth);
}
bool CBC_Codabar::RenderDevice(CFX_RenderDevice* device,
diff --git a/fxbarcode/cbc_codabar.h b/fxbarcode/cbc_codabar.h
index 3877819f8d..092b840f49 100644
--- a/fxbarcode/cbc_codabar.h
+++ b/fxbarcode/cbc_codabar.h
@@ -20,7 +20,7 @@ class CBC_Codabar : public CBC_OneCode {
~CBC_Codabar() override;
// CBC_OneCode:
- bool Encode(const CFX_WideStringC& contents, bool isDevice) override;
+ bool Encode(const CFX_WideStringC& contents) override;
bool RenderDevice(CFX_RenderDevice* device,
const CFX_Matrix* matrix) override;
BC_TYPE GetType() override;
diff --git a/fxbarcode/cbc_code128.cpp b/fxbarcode/cbc_code128.cpp
index 93a4ae88f4..d802b28a17 100644
--- a/fxbarcode/cbc_code128.cpp
+++ b/fxbarcode/cbc_code128.cpp
@@ -35,7 +35,7 @@ bool CBC_Code128::SetTextLocation(BC_TEXT_LOC location) {
return GetOnedCode128Writer()->SetTextLocation(location);
}
-bool CBC_Code128::Encode(const CFX_WideStringC& contents, bool isDevice) {
+bool CBC_Code128::Encode(const CFX_WideStringC& contents) {
if (contents.IsEmpty())
return false;
@@ -54,8 +54,8 @@ bool CBC_Code128::Encode(const CFX_WideStringC& contents, bool isDevice) {
pWriter->Encode(byteString, format, outWidth, outHeight));
if (!data)
return false;
- return pWriter->RenderResult(encodeContents.AsStringC(), data.get(), outWidth,
- isDevice);
+ return pWriter->RenderResult(encodeContents.AsStringC(), data.get(),
+ outWidth);
}
bool CBC_Code128::RenderDevice(CFX_RenderDevice* device,
diff --git a/fxbarcode/cbc_code128.h b/fxbarcode/cbc_code128.h
index 603587f908..571ee7e5a0 100644
--- a/fxbarcode/cbc_code128.h
+++ b/fxbarcode/cbc_code128.h
@@ -20,7 +20,7 @@ class CBC_Code128 : public CBC_OneCode {
~CBC_Code128() override;
// CBC_OneCode:
- bool Encode(const CFX_WideStringC& contents, bool isDevice) override;
+ bool Encode(const CFX_WideStringC& contents) override;
bool RenderDevice(CFX_RenderDevice* device,
const CFX_Matrix* matrix) override;
BC_TYPE GetType() override;
diff --git a/fxbarcode/cbc_code39.cpp b/fxbarcode/cbc_code39.cpp
index 97debaa88f..a46af14b9a 100644
--- a/fxbarcode/cbc_code39.cpp
+++ b/fxbarcode/cbc_code39.cpp
@@ -31,7 +31,7 @@ CBC_Code39::CBC_Code39()
CBC_Code39::~CBC_Code39() {}
-bool CBC_Code39::Encode(const CFX_WideStringC& contents, bool isDevice) {
+bool CBC_Code39::Encode(const CFX_WideStringC& contents) {
if (contents.IsEmpty())
return false;
@@ -47,8 +47,8 @@ bool CBC_Code39::Encode(const CFX_WideStringC& contents, bool isDevice) {
pWriter->Encode(byteString, format, outWidth, outHeight));
if (!data)
return false;
- return pWriter->RenderResult(renderContents.AsStringC(), data.get(), outWidth,
- isDevice);
+ return pWriter->RenderResult(renderContents.AsStringC(), data.get(),
+ outWidth);
}
bool CBC_Code39::RenderDevice(CFX_RenderDevice* device,
diff --git a/fxbarcode/cbc_code39.h b/fxbarcode/cbc_code39.h
index 4dea641a4f..66974c0947 100644
--- a/fxbarcode/cbc_code39.h
+++ b/fxbarcode/cbc_code39.h
@@ -21,7 +21,7 @@ class CBC_Code39 : public CBC_OneCode {
~CBC_Code39() override;
// CBC_OneCode:
- bool Encode(const CFX_WideStringC& contents, bool isDevice) override;
+ bool Encode(const CFX_WideStringC& contents) override;
bool RenderDevice(CFX_RenderDevice* device,
const CFX_Matrix* matrix) override;
BC_TYPE GetType() override;
diff --git a/fxbarcode/cbc_codebase.h b/fxbarcode/cbc_codebase.h
index ac9aaabcbb..f1a7b03ae2 100644
--- a/fxbarcode/cbc_codebase.h
+++ b/fxbarcode/cbc_codebase.h
@@ -26,7 +26,7 @@ class CBC_CodeBase {
virtual ~CBC_CodeBase();
virtual BC_TYPE GetType() = 0;
- virtual bool Encode(const CFX_WideStringC& contents, bool isDevice) = 0;
+ virtual bool Encode(const CFX_WideStringC& contents) = 0;
virtual bool RenderDevice(CFX_RenderDevice* device,
const CFX_Matrix* matrix) = 0;
diff --git a/fxbarcode/cbc_datamatrix.cpp b/fxbarcode/cbc_datamatrix.cpp
index f1c98ced02..91ed10e8e0 100644
--- a/fxbarcode/cbc_datamatrix.cpp
+++ b/fxbarcode/cbc_datamatrix.cpp
@@ -31,7 +31,7 @@ CBC_DataMatrix::CBC_DataMatrix()
CBC_DataMatrix::~CBC_DataMatrix() {}
-bool CBC_DataMatrix::Encode(const CFX_WideStringC& contents, bool isDevice) {
+bool CBC_DataMatrix::Encode(const CFX_WideStringC& contents) {
int32_t outWidth = 0;
int32_t outHeight = 0;
auto* pWriter = GetDataMatrixWriter();
diff --git a/fxbarcode/cbc_datamatrix.h b/fxbarcode/cbc_datamatrix.h
index 73294f1a9e..9f6c914fb4 100644
--- a/fxbarcode/cbc_datamatrix.h
+++ b/fxbarcode/cbc_datamatrix.h
@@ -20,7 +20,7 @@ class CBC_DataMatrix : public CBC_CodeBase {
~CBC_DataMatrix() override;
// CBC_OneCode:
- bool Encode(const CFX_WideStringC& contents, bool isDevice) override;
+ bool Encode(const CFX_WideStringC& contents) override;
bool RenderDevice(CFX_RenderDevice* device,
const CFX_Matrix* matrix) override;
BC_TYPE GetType() override;
diff --git a/fxbarcode/cbc_ean13.cpp b/fxbarcode/cbc_ean13.cpp
index ac08a9d53e..3606527142 100644
--- a/fxbarcode/cbc_ean13.cpp
+++ b/fxbarcode/cbc_ean13.cpp
@@ -50,7 +50,7 @@ CFX_WideString CBC_EAN13::Preprocess(const CFX_WideStringC& contents) {
return encodeContents;
}
-bool CBC_EAN13::Encode(const CFX_WideStringC& contents, bool isDevice) {
+bool CBC_EAN13::Encode(const CFX_WideStringC& contents) {
if (contents.IsEmpty())
return false;
@@ -65,8 +65,8 @@ bool CBC_EAN13::Encode(const CFX_WideStringC& contents, bool isDevice) {
pWriter->Encode(byteString, format, outWidth, outHeight));
if (!data)
return false;
- return pWriter->RenderResult(encodeContents.AsStringC(), data.get(), outWidth,
- isDevice);
+ return pWriter->RenderResult(encodeContents.AsStringC(), data.get(),
+ outWidth);
}
bool CBC_EAN13::RenderDevice(CFX_RenderDevice* device,
diff --git a/fxbarcode/cbc_ean13.h b/fxbarcode/cbc_ean13.h
index 11d40bb386..8a62151685 100644
--- a/fxbarcode/cbc_ean13.h
+++ b/fxbarcode/cbc_ean13.h
@@ -21,7 +21,7 @@ class CBC_EAN13 : public CBC_OneCode {
~CBC_EAN13() override;
// CBC_OneCode:
- bool Encode(const CFX_WideStringC& contents, bool isDevice) override;
+ bool Encode(const CFX_WideStringC& contents) override;
bool RenderDevice(CFX_RenderDevice* device,
const CFX_Matrix* matrix) override;
BC_TYPE GetType() override;
diff --git a/fxbarcode/cbc_ean8.cpp b/fxbarcode/cbc_ean8.cpp
index ce2cf2ba79..7fbe07fd7f 100644
--- a/fxbarcode/cbc_ean8.cpp
+++ b/fxbarcode/cbc_ean8.cpp
@@ -48,7 +48,7 @@ CFX_WideString CBC_EAN8::Preprocess(const CFX_WideStringC& contents) {
return encodeContents;
}
-bool CBC_EAN8::Encode(const CFX_WideStringC& contents, bool isDevice) {
+bool CBC_EAN8::Encode(const CFX_WideStringC& contents) {
if (contents.IsEmpty())
return false;
@@ -63,8 +63,8 @@ bool CBC_EAN8::Encode(const CFX_WideStringC& contents, bool isDevice) {
pWriter->Encode(byteString, format, outWidth, outHeight));
if (!data)
return false;
- return pWriter->RenderResult(encodeContents.AsStringC(), data.get(), outWidth,
- isDevice);
+ return pWriter->RenderResult(encodeContents.AsStringC(), data.get(),
+ outWidth);
}
bool CBC_EAN8::RenderDevice(CFX_RenderDevice* device,
diff --git a/fxbarcode/cbc_ean8.h b/fxbarcode/cbc_ean8.h
index d0f6ff8965..df0ca6246a 100644
--- a/fxbarcode/cbc_ean8.h
+++ b/fxbarcode/cbc_ean8.h
@@ -20,7 +20,7 @@ class CBC_EAN8 : public CBC_OneCode {
~CBC_EAN8() override;
// CBC_OneCode:
- bool Encode(const CFX_WideStringC& contents, bool isDevice) override;
+ bool Encode(const CFX_WideStringC& contents) override;
bool RenderDevice(CFX_RenderDevice* device,
const CFX_Matrix* matrix) override;
BC_TYPE GetType() override;
diff --git a/fxbarcode/cbc_pdf417i.cpp b/fxbarcode/cbc_pdf417i.cpp
index 23ad3ef74d..545a7d8cbf 100644
--- a/fxbarcode/cbc_pdf417i.cpp
+++ b/fxbarcode/cbc_pdf417i.cpp
@@ -40,7 +40,7 @@ void CBC_PDF417I::SetTruncated(bool truncated) {
GetPDF417Writer()->SetTruncated(truncated);
}
-bool CBC_PDF417I::Encode(const CFX_WideStringC& contents, bool isDevice) {
+bool CBC_PDF417I::Encode(const CFX_WideStringC& contents) {
int32_t outWidth = 0;
int32_t outHeight = 0;
auto* pWriter = GetPDF417Writer();
diff --git a/fxbarcode/cbc_pdf417i.h b/fxbarcode/cbc_pdf417i.h
index 2d1c8d3284..73f99d3579 100644
--- a/fxbarcode/cbc_pdf417i.h
+++ b/fxbarcode/cbc_pdf417i.h
@@ -20,7 +20,7 @@ class CBC_PDF417I : public CBC_CodeBase {
~CBC_PDF417I() override;
// CBC_CodeBase:
- bool Encode(const CFX_WideStringC& contents, bool isDevice) override;
+ bool Encode(const CFX_WideStringC& contents) override;
bool RenderDevice(CFX_RenderDevice* device,
const CFX_Matrix* matrix) override;
BC_TYPE GetType() override;
diff --git a/fxbarcode/cbc_qrcode.cpp b/fxbarcode/cbc_qrcode.cpp
index 6565623db2..297ce77212 100644
--- a/fxbarcode/cbc_qrcode.cpp
+++ b/fxbarcode/cbc_qrcode.cpp
@@ -37,7 +37,7 @@ bool CBC_QRCode::SetErrorCorrectionLevel(int32_t level) {
return GetQRCodeWriter()->SetErrorCorrectionLevel(level);
}
-bool CBC_QRCode::Encode(const CFX_WideStringC& contents, bool isDevice) {
+bool CBC_QRCode::Encode(const CFX_WideStringC& contents) {
int32_t outWidth = 0;
int32_t outHeight = 0;
CBC_QRCodeWriter* pWriter = GetQRCodeWriter();
diff --git a/fxbarcode/cbc_qrcode.h b/fxbarcode/cbc_qrcode.h
index 684993364e..638726769c 100644
--- a/fxbarcode/cbc_qrcode.h
+++ b/fxbarcode/cbc_qrcode.h
@@ -20,7 +20,7 @@ class CBC_QRCode : public CBC_CodeBase {
~CBC_QRCode() override;
// CBC_CodeBase:
- bool Encode(const CFX_WideStringC& contents, bool isDevice) override;
+ bool Encode(const CFX_WideStringC& contents) override;
bool RenderDevice(CFX_RenderDevice* device,
const CFX_Matrix* matrix) override;
BC_TYPE GetType() override;
diff --git a/fxbarcode/cbc_upca.cpp b/fxbarcode/cbc_upca.cpp
index 85b5d549ab..f4c273f764 100644
--- a/fxbarcode/cbc_upca.cpp
+++ b/fxbarcode/cbc_upca.cpp
@@ -49,7 +49,7 @@ CFX_WideString CBC_UPCA::Preprocess(const CFX_WideStringC& contents) {
return encodeContents;
}
-bool CBC_UPCA::Encode(const CFX_WideStringC& contents, bool isDevice) {
+bool CBC_UPCA::Encode(const CFX_WideStringC& contents) {
if (contents.IsEmpty())
return false;
@@ -66,8 +66,8 @@ bool CBC_UPCA::Encode(const CFX_WideStringC& contents, bool isDevice) {
pWriter->Encode(byteString, format, outWidth, outHeight));
if (!data)
return false;
- return pWriter->RenderResult(encodeContents.AsStringC(), data.get(), outWidth,
- isDevice);
+ return pWriter->RenderResult(encodeContents.AsStringC(), data.get(),
+ outWidth);
}
bool CBC_UPCA::RenderDevice(CFX_RenderDevice* device,
diff --git a/fxbarcode/cbc_upca.h b/fxbarcode/cbc_upca.h
index ef77297be2..5955230c46 100644
--- a/fxbarcode/cbc_upca.h
+++ b/fxbarcode/cbc_upca.h
@@ -20,7 +20,7 @@ class CBC_UPCA : public CBC_OneCode {
~CBC_UPCA() override;
// CBC_CodeBase:
- bool Encode(const CFX_WideStringC& contents, bool isDevice) override;
+ bool Encode(const CFX_WideStringC& contents) override;
bool RenderDevice(CFX_RenderDevice* device,
const CFX_Matrix* matrix) override;
BC_TYPE GetType() override;
diff --git a/fxbarcode/oned/BC_OneDimWriter.cpp b/fxbarcode/oned/BC_OneDimWriter.cpp
index 2927dda3af..1f96c4575b 100644
--- a/fxbarcode/oned/BC_OneDimWriter.cpp
+++ b/fxbarcode/oned/BC_OneDimWriter.cpp
@@ -285,8 +285,7 @@ bool CBC_OneDimWriter::RenderDeviceResult(CFX_RenderDevice* device,
bool CBC_OneDimWriter::RenderResult(const CFX_WideStringC& contents,
uint8_t* code,
- int32_t codeLength,
- bool isDevice) {
+ int32_t codeLength) {
if (codeLength < 1)
return false;
@@ -299,28 +298,15 @@ bool CBC_OneDimWriter::RenderResult(const CFX_WideStringC& contents,
m_outputHScale =
m_Width > 0 ? static_cast<float>(m_Width) / static_cast<float>(codeLength)
: 1.0;
- if (!isDevice) {
- m_outputHScale =
- std::max(m_outputHScale, static_cast<float>(m_ModuleWidth));
- }
float dataLengthScale = 1.0;
if (m_iDataLenth > 0 && contents.GetLength() != 0)
dataLengthScale = float(contents.GetLength()) / float(m_iDataLenth);
if (m_iDataLenth > 0 && contents.GetLength() == 0)
dataLengthScale = float(1) / float(m_iDataLenth);
m_multiple = 1;
- if (!isDevice) {
- m_multiple = (int32_t)ceil(m_outputHScale * dataLengthScale);
- }
- int32_t outputHeight = 1;
- if (!isDevice)
- outputHeight = m_Height ? m_Height : std::max(20, m_ModuleHeight);
- int32_t outputWidth = codeLength;
- if (!isDevice)
- outputWidth = (int32_t)(codeLength * m_multiple / dataLengthScale);
+ const int32_t outputHeight = 1;
+ const int32_t outputWidth = codeLength;
m_barWidth = m_Width;
- if (!isDevice)
- m_barWidth = codeLength * m_multiple;
m_output.clear();
for (int32_t inputX = 0, outputX = leftPadding * m_multiple;
diff --git a/fxbarcode/oned/BC_OneDimWriter.h b/fxbarcode/oned/BC_OneDimWriter.h
index c220f382ee..2d604b5b51 100644
--- a/fxbarcode/oned/BC_OneDimWriter.h
+++ b/fxbarcode/oned/BC_OneDimWriter.h
@@ -26,8 +26,7 @@ class CBC_OneDimWriter : public CBC_Writer {
virtual bool RenderResult(const CFX_WideStringC& contents,
uint8_t* code,
- int32_t codeLength,
- bool isDevice);
+ int32_t codeLength);
virtual bool CheckContentValidity(const CFX_WideStringC& contents) = 0;
virtual CFX_WideString FilterContents(const CFX_WideStringC& contents) = 0;
virtual CFX_WideString RenderTextContents(const CFX_WideStringC& contents);
diff --git a/fxbarcode/oned/BC_OnedCodaBarWriter.cpp b/fxbarcode/oned/BC_OnedCodaBarWriter.cpp
index 5a56acb37c..03a733a8c2 100644
--- a/fxbarcode/oned/BC_OnedCodaBarWriter.cpp
+++ b/fxbarcode/oned/BC_OnedCodaBarWriter.cpp
@@ -197,8 +197,7 @@ CFX_WideString CBC_OnedCodaBarWriter::encodedContents(
bool CBC_OnedCodaBarWriter::RenderResult(const CFX_WideStringC& contents,
uint8_t* code,
- int32_t codeLength,
- bool isDevice) {
+ int32_t codeLength) {
return CBC_OneDimWriter::RenderResult(encodedContents(contents).AsStringC(),
- code, codeLength, isDevice);
+ code, codeLength);
}
diff --git a/fxbarcode/oned/BC_OnedCodaBarWriter.h b/fxbarcode/oned/BC_OnedCodaBarWriter.h
index 94933612f5..6a5f315073 100644
--- a/fxbarcode/oned/BC_OnedCodaBarWriter.h
+++ b/fxbarcode/oned/BC_OnedCodaBarWriter.h
@@ -27,8 +27,7 @@ class CBC_OnedCodaBarWriter : public CBC_OneDimWriter {
int32_t hints) override;
bool RenderResult(const CFX_WideStringC& contents,
uint8_t* code,
- int32_t codeLength,
- bool isDevice) override;
+ int32_t codeLength) override;
bool CheckContentValidity(const CFX_WideStringC& contents) override;
CFX_WideString FilterContents(const CFX_WideStringC& contents) override;
void SetDataLength(int32_t length) override;
diff --git a/fxbarcode/oned/BC_OnedCode39Writer.cpp b/fxbarcode/oned/BC_OnedCode39Writer.cpp
index ba8769ed95..72d7dc4df8 100644
--- a/fxbarcode/oned/BC_OnedCode39Writer.cpp
+++ b/fxbarcode/oned/BC_OnedCode39Writer.cpp
@@ -245,11 +245,10 @@ bool CBC_OnedCode39Writer::encodedContents(const CFX_WideStringC& contents,
bool CBC_OnedCode39Writer::RenderResult(const CFX_WideStringC& contents,
uint8_t* code,
- int32_t codeLength,
- bool isDevice) {
+ int32_t codeLength) {
CFX_WideString encodedCon;
if (!encodedContents(contents, &encodedCon))
return false;
return CBC_OneDimWriter::RenderResult(encodedCon.AsStringC(), code,
- codeLength, isDevice);
+ codeLength);
}
diff --git a/fxbarcode/oned/BC_OnedCode39Writer.h b/fxbarcode/oned/BC_OnedCode39Writer.h
index 4892a1f8d5..fe57d3ca9a 100644
--- a/fxbarcode/oned/BC_OnedCode39Writer.h
+++ b/fxbarcode/oned/BC_OnedCode39Writer.h
@@ -25,8 +25,7 @@ class CBC_OnedCode39Writer : public CBC_OneDimWriter {
int32_t& outLength) override;
bool RenderResult(const CFX_WideStringC& contents,
uint8_t* code,
- int32_t codeLength,
- bool isDevice) override;
+ int32_t codeLength) override;
bool CheckContentValidity(const CFX_WideStringC& contents) override;
CFX_WideString FilterContents(const CFX_WideStringC& contents) override;
CFX_WideString RenderTextContents(const CFX_WideStringC& contents) override;