Пример #1
0
const char* ARMv7DOpcodeMiscIfThenT1::format()
{
    char opName[6];
    opName[0] = 'i';
    opName[1] = 't';

    unsigned condition = firstCondition();
    unsigned maskBits = mask();
    unsigned blockLength = 0;

    for (unsigned i = 0; i < 4; ++i) {
        if (maskBits & (1 << i)) {
            blockLength = 4 - i;
            break;
        }
    }

    startITBlock(blockLength, condition);

    for (unsigned i = 1; i < blockLength; ++i) {
        unsigned currMaskBit = (maskBits >> (4-i)) & 0x1;
        opName[i + 1] = (currMaskBit ^ (condition & 1)) ? 'e' : 't';
        saveITConditionAt(i, (condition & ~1) | currMaskBit);
    }
    opName[blockLength + 1] = '\0';

    appendInstructionNameNoITBlock(opName);
    appendString(conditionName(condition));

    return m_formatBuffer;
}
Пример #2
0
void thinImage(IplImage *source, IplImage *destination) {
    for (int i = 0; i < 6; i++) {
        //cleanup
        
        for (int i = 1; i < source->height - 2; i++) {
            for (int j = 1; j < source->width - 2; j++) {
                if (cvGet2D(destination, i, j).val[0] == BLACK_PIXEL) {
                    if (firstCondition(destination, i, j) &&
                        secondCondition(destination, i, j) &&
                        thirdCondition(destination, i, j) &&
                        fourthCondition(destination, i, j) &&
                        fifthCondition(destination, i, j) &&
                        sixthCondition(destination, i, j)
                        ) 
                    {
                        cvSet2D(destination, i, j, cvScalarAll(DELETED_PIXEL));
                    }
                }
            }
        }
        
        for (int i = 0; i < source->height - 5; i++) {
            for (int j = 0; j < source->width - 5; j++) {
                if (cvGet2D(destination, i, j).val[0] == DELETED_PIXEL) {
                    cvSet2D(destination, i, j, cvScalarAll(WHITE_PIXEL));
                }
            }
        }

    }
}