本文整理汇总了C++中CFX_PtrArray::GetAt方法的典型用法代码示例。如果您正苦于以下问题:C++ CFX_PtrArray::GetAt方法的具体用法?C++ CFX_PtrArray::GetAt怎么用?C++ CFX_PtrArray::GetAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFX_PtrArray
的用法示例。
在下文中一共展示了CFX_PtrArray::GetAt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getMinCodewordWidth
CFX_ByteString CBC_PDF417Reader::Decode(CBC_BinaryBitmap* image,
FX_BOOL multiple,
int32_t hints,
int32_t& e) {
CFX_ByteString results;
CBC_PDF417DetectorResult* detectorResult =
CBC_Detector::detect(image, hints, multiple, e);
BC_EXCEPTION_CHECK_ReturnValue(e, "");
for (int32_t i = 0; i < detectorResult->getPoints()->GetSize(); i++) {
CFX_PtrArray* points = (CFX_PtrArray*)detectorResult->getPoints()->GetAt(i);
CBC_CommonDecoderResult* ResultTemp = CBC_PDF417ScanningDecoder::decode(
detectorResult->getBits(), (CBC_ResultPoint*)points->GetAt(4),
(CBC_ResultPoint*)points->GetAt(5), (CBC_ResultPoint*)points->GetAt(6),
(CBC_ResultPoint*)points->GetAt(7), getMinCodewordWidth(*points),
getMaxCodewordWidth(*points), e);
if (ResultTemp == NULL) {
delete detectorResult;
e = BCExceptiontNotFoundInstance;
return "";
}
results += ResultTemp->GetText();
delete ResultTemp;
}
delete detectorResult;
return results;
}
示例2: findVertices
CFX_PtrArray* CBC_Detector::findVertices(CBC_CommonBitMatrix* matrix,
int32_t startRow,
int32_t startColumn) {
int32_t height = matrix->GetHeight();
int32_t width = matrix->GetWidth();
CFX_PtrArray* result = new CFX_PtrArray;
result->SetSize(8);
CFX_PtrArray* startptr = findRowsWithPattern(
matrix, height, width, startRow, startColumn, START_PATTERN,
sizeof(START_PATTERN) / sizeof(START_PATTERN[0]));
copyToResult(
result, startptr, INDEXES_START_PATTERN,
sizeof(INDEXES_START_PATTERN) / sizeof(INDEXES_START_PATTERN[0]));
startptr->RemoveAll();
delete startptr;
if (result->GetAt(4) != NULL) {
startColumn = (int32_t)((CBC_ResultPoint*)result->GetAt(4))->GetX();
startRow = (int32_t)((CBC_ResultPoint*)result->GetAt(4))->GetY();
}
CFX_PtrArray* stopptr = findRowsWithPattern(
matrix, height, width, startRow, startColumn, STOP_PATTERN,
sizeof(STOP_PATTERN) / sizeof(STOP_PATTERN[0]));
copyToResult(result, stopptr, INDEXES_STOP_PATTERN,
sizeof(INDEXES_STOP_PATTERN) / sizeof(INDEXES_STOP_PATTERN[0]));
stopptr->RemoveAll();
delete stopptr;
return result;
}
示例3: getCodewords
int32_t
CBC_DetectionResultRowIndicatorColumn::adjustCompleteIndicatorColumnRowNumbers(
CBC_BarcodeMetadata barcodeMetadata) {
CFX_PtrArray* codewords = getCodewords();
setRowNumbers();
removeIncorrectCodewords(codewords, barcodeMetadata);
CBC_BoundingBox* boundingBox = getBoundingBox();
CBC_ResultPoint* top =
m_isLeft ? boundingBox->getTopLeft() : boundingBox->getTopRight();
CBC_ResultPoint* bottom =
m_isLeft ? boundingBox->getBottomLeft() : boundingBox->getBottomRight();
int32_t firstRow = imageRowToCodewordIndex((int32_t)top->GetY());
int32_t lastRow = imageRowToCodewordIndex((int32_t)bottom->GetY());
FX_FLOAT averageRowHeight =
(lastRow - firstRow) / (FX_FLOAT)barcodeMetadata.getRowCount();
int32_t barcodeRow = -1;
int32_t maxRowHeight = 1;
int32_t currentRowHeight = 0;
for (int32_t codewordsRow = firstRow; codewordsRow < lastRow;
codewordsRow++) {
if (codewords->GetAt(codewordsRow) == NULL) {
continue;
}
CBC_Codeword* codeword = (CBC_Codeword*)codewords->GetAt(codewordsRow);
int32_t rowDifference = codeword->getRowNumber() - barcodeRow;
if (rowDifference == 0) {
currentRowHeight++;
} else if (rowDifference == 1) {
maxRowHeight =
maxRowHeight > currentRowHeight ? maxRowHeight : currentRowHeight;
currentRowHeight = 1;
barcodeRow = codeword->getRowNumber();
} else if (rowDifference < 0) {
codewords->SetAt(codewordsRow, NULL);
} else if (codeword->getRowNumber() >= barcodeMetadata.getRowCount()) {
codewords->SetAt(codewordsRow, NULL);
} else if (rowDifference > codewordsRow) {
codewords->SetAt(codewordsRow, NULL);
} else {
int32_t checkedRows;
if (maxRowHeight > 2) {
checkedRows = (maxRowHeight - 2) * rowDifference;
} else {
checkedRows = rowDifference;
}
FX_BOOL closePreviousCodewordFound = checkedRows >= codewordsRow;
for (int32_t i = 1; i <= checkedRows && !closePreviousCodewordFound;
i++) {
closePreviousCodewordFound = codewords->GetAt(codewordsRow - i) != NULL;
}
if (closePreviousCodewordFound) {
codewords->SetAt(codewordsRow, NULL);
} else {
barcodeRow = codeword->getRowNumber();
currentRowHeight = 1;
}
}
}
return (int32_t)(averageRowHeight + 0.5);
}
示例4: adjustRowNumbersFromLRI
int32_t CBC_DetectionResult::adjustRowNumbersFromLRI() {
if (m_detectionResultColumns[0] == NULL) {
return 0;
}
int32_t unadjustedCount = 0;
CFX_PtrArray* codewords =
((CBC_DetectionResultColumn*)m_detectionResultColumns.GetAt(0))
->getCodewords();
for (int32_t codewordsRow = 0; codewordsRow < codewords->GetSize();
codewordsRow++) {
if (codewords->GetAt(codewordsRow) == NULL) {
continue;
}
int32_t rowIndicatorRowNumber =
((CBC_Codeword*)codewords->GetAt(codewordsRow))->getRowNumber();
int32_t invalidRowCounts = 0;
for (int32_t barcodeColumn = 1; barcodeColumn < m_barcodeColumnCount + 1 &&
invalidRowCounts < ADJUST_ROW_NUMBER_SKIP;
barcodeColumn++) {
CBC_Codeword* codeword =
(CBC_Codeword*)((CBC_DetectionResultColumn*)
m_detectionResultColumns[barcodeColumn])
->getCodewords()
->GetAt(codewordsRow);
if (codeword) {
invalidRowCounts = adjustRowNumberIfValid(rowIndicatorRowNumber,
invalidRowCounts, codeword);
if (!codeword->hasValidRowNumber()) {
unadjustedCount++;
}
}
}
}
return unadjustedCount;
}
示例5:
v8::Handle<v8::Object> JS_NewFxDynamicObj(IJS_Runtime* pJSRuntime, IFXJS_Context* pJSContext, int nObjDefnID)
{
v8::Isolate* isolate = (v8::Isolate*)pJSRuntime;
v8::Isolate::Scope isolate_scope(isolate);
if(-1 == nObjDefnID)
{
v8::Local<v8::ObjectTemplate> objTempl = v8::ObjectTemplate::New(isolate);
return objTempl->NewInstance();
}
CFX_PtrArray* pArray = (CFX_PtrArray*)isolate->GetData(0);
if(!pArray) return v8::Handle<v8::Object>();
if(nObjDefnID<0 || nObjDefnID>= pArray->GetSize()) return v8::Handle<v8::Object>();
CJS_ObjDefintion* pObjDef = (CJS_ObjDefintion*)pArray->GetAt(nObjDefnID);
v8::Local<v8::Context> context = isolate->GetCurrentContext();
v8::Local<v8::ObjectTemplate> objTemp = v8::Local<v8::ObjectTemplate>::New(isolate, pObjDef->m_objTemplate);
v8::Local<v8::Object> obj = objTemp->NewInstance();
CJS_PrivateData* pPrivateData = new CJS_PrivateData;
pPrivateData->ObjDefID = nObjDefnID;
obj->SetAlignedPointerInInternalField(0, pPrivateData);
if(pObjDef->m_pConstructor)
pObjDef->m_pConstructor(pJSContext, obj, context->Global()->GetPrototype()->ToObject());
return obj;
}
示例6: JS_ReleaseRuntime
void JS_ReleaseRuntime(IJS_Runtime* pJSRuntime, v8::Persistent<v8::Context>& v8PersistentContext)
{
v8::Isolate* isolate = (v8::Isolate*)pJSRuntime;
v8::Isolate::Scope isolate_scope(isolate);
v8::HandleScope handle_scope(isolate);
v8::Local<v8::Context> context = v8::Local<v8::Context>::New(isolate, v8PersistentContext);
v8::Context::Scope context_scope(context);
CFX_PtrArray* pArray = (CFX_PtrArray*)isolate->GetData(0);
if(!pArray) return ;
for(int i=0; i<pArray->GetSize(); i++)
{
CJS_ObjDefintion* pObjDef = (CJS_ObjDefintion*)pArray->GetAt(i);
if(!pObjDef->m_StaticObj.IsEmpty())
{
v8::Local<v8::Object> pObj = v8::Local<v8::Object>::New(isolate, pObjDef->m_StaticObj);
if(pObjDef->m_pDestructor)
pObjDef->m_pDestructor(pObj);
JS_FreePrivate(pObj);
}
delete pObjDef;
}
delete pArray;
isolate->SetData(0,NULL);
}
示例7: GetLink
CPDF_Link CPDF_LinkList::GetLink(CPDF_Page* pPage, int index)
{
CFX_PtrArray* pPageLinkList = GetPageLinks(pPage);
if (pPageLinkList == NULL) {
return NULL;
}
return (CPDF_Dictionary*)pPageLinkList->GetAt(index);
}
示例8: GetObject
CPDF_PageObject* CPDF_LayoutElement::GetObject(int index)
{
if(m_pTaggedElement == NULL) {
return NULL;
}
CFX_PtrArray *pObj = &m_ObjArray;
int size = pObj->GetSize();
if(index < size) {
return (CPDF_PageObject*)pObj->GetAt(index);
}
return NULL;
}
示例9: delete
CBC_PDF417DetectorResult::~CBC_PDF417DetectorResult() {
for (int32_t i = 0; i < m_points->GetSize(); i++) {
CFX_PtrArray* temp = (CFX_PtrArray*)m_points->GetAt(i);
for (int32_t j = 0; j < temp->GetSize(); j++) {
delete (CBC_ResultPoint*)temp->GetAt(j);
}
temp->RemoveAll();
delete temp;
}
m_points->RemoveAll();
delete m_points;
}
示例10: getBoundingBox
int32_t CBC_DetectionResultRowIndicatorColumn::
adjustIncompleteIndicatorColumnRowNumbers(
CBC_BarcodeMetadata barcodeMetadata) {
CBC_BoundingBox* boundingBox = getBoundingBox();
CBC_ResultPoint* top =
m_isLeft ? boundingBox->getTopLeft() : boundingBox->getTopRight();
CBC_ResultPoint* bottom =
m_isLeft ? boundingBox->getBottomLeft() : boundingBox->getBottomRight();
int32_t firstRow = imageRowToCodewordIndex((int32_t)top->GetY());
int32_t lastRow = imageRowToCodewordIndex((int32_t)bottom->GetY());
FX_FLOAT averageRowHeight =
(lastRow - firstRow) / (FX_FLOAT)barcodeMetadata.getRowCount();
CFX_PtrArray* codewords = getCodewords();
int32_t barcodeRow = -1;
int32_t maxRowHeight = 1;
int32_t currentRowHeight = 0;
for (int32_t codewordsRow = firstRow; codewordsRow < lastRow;
codewordsRow++) {
if (codewords->GetAt(codewordsRow) == NULL) {
continue;
}
CBC_Codeword* codeword = (CBC_Codeword*)codewords->GetAt(codewordsRow);
codeword->setRowNumberAsRowIndicatorColumn();
int32_t rowDifference = codeword->getRowNumber() - barcodeRow;
if (rowDifference == 0) {
currentRowHeight++;
} else if (rowDifference == 1) {
maxRowHeight =
maxRowHeight > currentRowHeight ? maxRowHeight : currentRowHeight;
currentRowHeight = 1;
barcodeRow = codeword->getRowNumber();
} else if (codeword->getRowNumber() >= barcodeMetadata.getRowCount()) {
codewords->SetAt(codewordsRow, NULL);
} else {
barcodeRow = codeword->getRowNumber();
currentRowHeight = 1;
}
}
return (int32_t)(averageRowHeight + 0.5);
}
示例11: adjustRowNumbersFromBothRI
int32_t CBC_DetectionResult::adjustRowNumbersFromBothRI() {
if (m_detectionResultColumns[0] == NULL ||
m_detectionResultColumns[m_barcodeColumnCount + 1] == NULL) {
return 0;
}
CFX_PtrArray* LRIcodewords =
((CBC_DetectionResultColumn*)m_detectionResultColumns[0])->getCodewords();
CFX_PtrArray* RRIcodewords =
((CBC_DetectionResultColumn*)
m_detectionResultColumns[m_barcodeColumnCount + 1])
->getCodewords();
for (int32_t codewordsRow = 0; codewordsRow < LRIcodewords->GetSize();
codewordsRow++) {
if (LRIcodewords->GetAt(codewordsRow) &&
RRIcodewords->GetAt(codewordsRow) &&
((CBC_Codeword*)LRIcodewords->GetAt(codewordsRow))->getRowNumber() ==
((CBC_Codeword*)RRIcodewords->GetAt(codewordsRow))
->getRowNumber()) {
for (int32_t barcodeColumn = 1; barcodeColumn <= m_barcodeColumnCount;
barcodeColumn++) {
CBC_Codeword* codeword =
(CBC_Codeword*)((CBC_DetectionResultColumn*)
m_detectionResultColumns[barcodeColumn])
->getCodewords()
->GetAt(codewordsRow);
if (codeword == NULL) {
continue;
}
codeword->setRowNumber(
((CBC_Codeword*)LRIcodewords->GetAt(codewordsRow))->getRowNumber());
if (!codeword->hasValidRowNumber()) {
((CBC_DetectionResultColumn*)m_detectionResultColumns[barcodeColumn])
->getCodewords()
->SetAt(codewordsRow, NULL);
}
}
}
}
return 0;
}
示例12: CBC_BarcodeMetadata
CBC_BarcodeMetadata*
CBC_DetectionResultRowIndicatorColumn::getBarcodeMetadata() {
CFX_PtrArray* codewords = getCodewords();
CBC_BarcodeValue barcodeColumnCount;
CBC_BarcodeValue barcodeRowCountUpperPart;
CBC_BarcodeValue barcodeRowCountLowerPart;
CBC_BarcodeValue barcodeECLevel;
for (int32_t i = 0; i < codewords->GetSize(); i++) {
CBC_Codeword* codeword = (CBC_Codeword*)codewords->GetAt(i);
if (codeword == NULL) {
continue;
}
codeword->setRowNumberAsRowIndicatorColumn();
int32_t rowIndicatorValue = codeword->getValue() % 30;
int32_t codewordRowNumber = codeword->getRowNumber();
if (!m_isLeft) {
codewordRowNumber += 2;
}
switch (codewordRowNumber % 3) {
case 0:
barcodeRowCountUpperPart.setValue(rowIndicatorValue * 3 + 1);
break;
case 1:
barcodeECLevel.setValue(rowIndicatorValue / 3);
barcodeRowCountLowerPart.setValue(rowIndicatorValue % 3);
break;
case 2:
barcodeColumnCount.setValue(rowIndicatorValue + 1);
break;
}
}
if ((barcodeColumnCount.getValue()->GetSize() == 0) ||
(barcodeRowCountUpperPart.getValue()->GetSize() == 0) ||
(barcodeRowCountLowerPart.getValue()->GetSize() == 0) ||
(barcodeECLevel.getValue()->GetSize() == 0) ||
barcodeColumnCount.getValue()->GetAt(0) < 1 ||
barcodeRowCountUpperPart.getValue()->GetAt(0) +
barcodeRowCountLowerPart.getValue()->GetAt(0) <
CBC_PDF417Common::MIN_ROWS_IN_BARCODE ||
barcodeRowCountUpperPart.getValue()->GetAt(0) +
barcodeRowCountLowerPart.getValue()->GetAt(0) >
CBC_PDF417Common::MAX_ROWS_IN_BARCODE) {
return NULL;
}
CBC_BarcodeMetadata* barcodeMetadata =
new CBC_BarcodeMetadata(barcodeColumnCount.getValue()->GetAt(0),
barcodeRowCountUpperPart.getValue()->GetAt(0),
barcodeRowCountLowerPart.getValue()->GetAt(0),
barcodeECLevel.getValue()->GetAt(0));
removeIncorrectCodewords(codewords, *barcodeMetadata);
return barcodeMetadata;
}
示例13: adjustRowNumbers
int32_t CBC_DetectionResult::adjustRowNumbers() {
int32_t unadjustedCount = adjustRowNumbersByRow();
if (unadjustedCount == 0) {
return 0;
}
for (int32_t barcodeColumn = 1; barcodeColumn < m_barcodeColumnCount + 1;
barcodeColumn++) {
CFX_PtrArray* codewords =
((CBC_DetectionResultColumn*)m_detectionResultColumns[barcodeColumn])
->getCodewords();
for (int32_t codewordsRow = 0; codewordsRow < codewords->GetSize();
codewordsRow++) {
if (codewords->GetAt(codewordsRow) == NULL) {
continue;
}
if (!((CBC_Codeword*)codewords->GetAt(codewordsRow))
->hasValidRowNumber()) {
adjustRowNumbers(barcodeColumn, codewordsRow, codewords);
}
}
}
return unadjustedCount;
}
示例14: JS_InitialRuntime
void JS_InitialRuntime(IJS_Runtime* pJSRuntime,IFXJS_Runtime* pFXRuntime, IFXJS_Context* context, v8::Persistent<v8::Context>& v8PersistentContext)
{
v8::Isolate* isolate = (v8::Isolate*)pJSRuntime;
v8::Isolate::Scope isolate_scope(isolate);
v8::HandleScope handle_scope(isolate);
v8::Persistent<v8::ObjectTemplate>& globalObjTemp = _getGlobalObjectTemplate(pJSRuntime);
v8::Handle<v8::Context> v8Context = v8::Context::New(isolate, NULL, v8::Local<v8::ObjectTemplate>::New(isolate, globalObjTemp));
v8::Context::Scope context_scope(v8Context);
v8::Handle<v8::External> ptr = v8::External::New(isolate, pFXRuntime);
v8Context->SetEmbedderData(1, ptr);
CFX_PtrArray* pArray = (CFX_PtrArray*)isolate->GetData(0);
if(!pArray) return;
for(int i=0; i<pArray->GetSize(); i++)
{
CJS_ObjDefintion* pObjDef = (CJS_ObjDefintion*)pArray->GetAt(i);
CFX_WideString ws = CFX_WideString(pObjDef->objName);
CFX_ByteString bs = ws.UTF8Encode();
v8::Handle<v8::String> objName = v8::String::NewFromUtf8(isolate, bs.c_str(), v8::String::kNormalString, bs.GetLength());
if(pObjDef->objType == JS_DYNAMIC)
{
//Document is set as global object, need to construct it first.
if(ws.Equal(L"Document"))
{
CJS_PrivateData* pPrivateData = new CJS_PrivateData;
pPrivateData->ObjDefID = i;
v8Context->Global()->GetPrototype()->ToObject()->SetAlignedPointerInInternalField(0, pPrivateData);
if(pObjDef->m_pConstructor)
pObjDef->m_pConstructor(context, v8Context->Global()->GetPrototype()->ToObject(), v8Context->Global()->GetPrototype()->ToObject());
}
}
else
{
v8::Handle<v8::Object> obj = JS_NewFxDynamicObj(pJSRuntime, context, i);
v8Context->Global()->Set(objName, obj);
pObjDef->m_StaticObj.Reset(isolate, obj);
}
}
v8PersistentContext.Reset(isolate, v8Context);
}
示例15: JS_GetObjDefnID
int JS_GetObjDefnID(IJS_Runtime * pJSRuntime, const wchar_t* pObjName)
{
v8::Isolate* isolate = (v8::Isolate*)pJSRuntime;
v8::Isolate::Scope isolate_scope(isolate);
CFX_PtrArray* pArray = (CFX_PtrArray*)isolate->GetData(0);
if(!pArray) return -1;
for(int i=0; i<pArray->GetSize(); i++)
{
CJS_ObjDefintion* pObjDef = (CJS_ObjDefintion*)pArray->GetAt(i);
if(FXSYS_wcscmp(pObjDef->objName, pObjName) == 0)
return i;
}
return -1;
}