Binary Complement
1 개요
이미지의 값을 binary로 표현하여, Operand의 값이 이면 의 보수, 이면 의 보수를 반환합니다.
2 알고리즘 상세 설명
이진법으로 표현된 수 의 의 보수는 주로 ~로 표기되며, 이는 의 각 자리수가 이면 , 이면 으로 변환된 값입니다. 또한 의 의 보수란, 와 더했을 때 이 되는 값을 말하며, 따라서 와 그 값이 같습니다.
위 두 가지 정의와 합치되면서 모든 Operand에 대해 적절한 값을 제공하기 위하여, Binary Complement의 반환값은 두 Unsigned Int 에 대하여 로 정의됩니다.
Source Value | Operand Value | Destination Value |
---|---|---|
![]() |
![]() |
![]() |
Fig. Source and Destination values of Binary Complement
3 예제
COperationBinaryComplement binaryComplement;
CFLImage fliSourceImage;
fliSourceImage.Load(L"Created Image");
binaryComplement.SetSourceImage(fliSourceImage);
CMultiVar<uint64_t> mvScalarValue(2, 128, 64);
binaryComplement.SetScalarValue(mvScalarValue);
binaryComplement.Execute();