Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1 +0,0 @@
|
|||
type Grayscale_Image is array (Positive range <>, Positive range <>) of Luminance;
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
function Grayscale (Picture : Image) return Grayscale_Image is
|
||||
type Extended_Luminance is range 0..10_000_000;
|
||||
Result : Grayscale_Image (Picture'Range (1), Picture'Range (2));
|
||||
Color : Pixel;
|
||||
begin
|
||||
for I in Picture'Range (1) loop
|
||||
for J in Picture'Range (2) loop
|
||||
Color := Picture (I, J);
|
||||
Result (I, J) :=
|
||||
Luminance
|
||||
( ( 2_126 * Extended_Luminance (Color.R)
|
||||
+ 7_152 * Extended_Luminance (Color.G)
|
||||
+ 722 * Extended_Luminance (Color.B)
|
||||
)
|
||||
/ 10_000
|
||||
);
|
||||
end loop;
|
||||
end loop;
|
||||
return Result;
|
||||
end Grayscale;
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
function Color (Picture : Grayscale_Image) return Image is
|
||||
Result : Image (Picture'Range (1), Picture'Range (2));
|
||||
begin
|
||||
for I in Picture'Range (1) loop
|
||||
for J in Picture'Range (2) loop
|
||||
Result (I, J) := (others => Picture (I, J));
|
||||
end loop;
|
||||
end loop;
|
||||
return Result;
|
||||
end Color;
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
function to_gray(sequence image)
|
||||
sequence color
|
||||
for i = 1 to length(image) do
|
||||
for j = 1 to length(image[i]) do
|
||||
color = and_bits(image[i][j], {#FF0000,#FF00,#FF}) /
|
||||
{#010000,#0100,#01} -- unpack color triple
|
||||
image[i][j] = floor(0.2126*color[1] + 0.7152*color[2] + 0.0722*color[3])
|
||||
end for
|
||||
end for
|
||||
return image
|
||||
end function
|
||||
|
||||
function to_color(sequence image)
|
||||
for i = 1 to length(image) do
|
||||
for j = 1 to length(image[i]) do
|
||||
image[i][j] = image[i][j]*#010101
|
||||
end for
|
||||
end for
|
||||
return image
|
||||
end function
|
||||
Loading…
Add table
Add a link
Reference in a new issue