blob: 032ff6c19700727eacae2766e09f6ce034ba8b45 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
package body Bit_Ops is
function Bitwise_Or (X, Y : Byte) return Byte is
X_Bits : Pixel with Address => X'Address;
Y_Bits : Pixel with Address => Y'Address;
Bits : aliased Pixel;
Bits_Byte : Byte with Address => Bits'Address;
begin
Bits := X_Bits or Y_Bits;
return Bits_Byte;
end Bitwise_Or;
function Bitwise_And (X, Y : Byte) return Byte is
X_Bits : Pixel with Address => X'Address;
Y_Bits : Pixel with Address => Y'Address;
Bits : aliased Pixel;
Bits_Byte : Byte with Address => Bits'Address;
begin
Bits := X_Bits and Y_Bits;
return Bits_Byte;
end Bitwise_And;
function Bitwise_Xor (X, Y : Byte) return Byte is
X_Bits : Pixel with Address => X'Address;
Y_Bits : Pixel with Address => Y'Address;
Bits : aliased Pixel;
Bits_Byte : Byte with Address => Bits'Address;
begin
Bits := X_Bits xor Y_Bits;
return Bits_Byte;
end Bitwise_Xor;
end Bit_Ops;
|