File: /home/oboss/Users/gec/sources/Demonstrator/Payload/payload-science_manager-image_representation.ads

1     --% Compilation Unit: Payload.Science_Manager.Image_Representation
2     --
3     --% Category: Package Declaration
4     --
5     --% Release:  $Name:  $
6     --
7     --% Version:  $Revision: 2.1 $
8     --
9     --% Author:   $Author: gec $
10     --
11     --% Revision Log:
12     --    $Log: payload-science_manager-image_representation.ads,v $
13     --    Revision 2.1  2004/02/13 16:16:47  gec
14     --    Merged results of Demonstrator development on to main OBOSS trunk.
15     --
16     --    Revision 1.1.2.2  2004/02/04 13:07:43  gec
17     --    Added payload environment simulations.
18     --
19     --    Revision 1.1.2.1  2004/01/26 10:14:01  gec
20     --    Partial update of payload application process according to Demonstrator
21     --+    specification. Applicable for integration testing.
22     --
23     --
24     --% Project: OBOSS
25     --
26     --% Copyright (C) 2004 by Terma A/S
27     --  Proprietary and intellectual rights of Terma A/S, Denmark,
28     --  are involved in the subject-matter of this material and
29     --  all manufacturing, reproduction, use, disclosure, and
30     --  sales rights pertaining to such subject-matter are
31     --  expressly reserved. This material is submitted for a
32     --  specific purpose as agreed, and the recipient by
33     --  accepting this material agrees that this material will
34     --  not be used, copied, or reproduced in whole or in part
35     --  nor its contents revealed in any manner or to any person,
36     --  except to meet the purpose for which it was submitted and
37     --  subject to the terms of the agreement.
38     --
39     --% Target Dependencies:
40     --    None
41     --% Compiler Dependencies:
42     --    None
43     
44     --~-----------------------------------------------------------------------------
45     
46     with Source_Data_Stream;
47     with Basic_Types;
48     package Payload.Science_Manager.Image_Representation is
49     
50        --% Library Package:
51        --    Abstracty data type implementing payload images and associated
52        --+    operations
53        --% Active Tasks:
54        -->   None
55        --% Passive Tasks:
56        -->   None
57     
58        -- Pixels are plain integers
59        subtype Pixel is Basic_Types.Byte;
60        -- Total image size in pixels
61        Image_Size : constant := 1_024;
62        -- Number of rows in the image
63        Rows_Per_Image : constant := 4;
64        -- Number of pixels across the image
65        Pixels_Per_Row : constant := Image_Size / Rows_Per_Image;
66     
67        -- Definition of indices for image rows
68        type Optional_Row_Index is range 0 .. Rows_Per_Image;
69        Void_Row_Index : constant Optional_Row_Index := 0;
70        subtype Row_Index is Optional_Row_Index range 1 .. Rows_Per_Image;
71        -- Representation if singel row in image
72        type Image_Row is new Basic_Types.Byte_Array (1 .. Pixels_Per_Row);
73     
74        -- Representation of partial image
75        type Image_Data is array (Optional_Row_Index range <>) of Image_Row;
76        -- Representation of complete image
77        subtype Complete_Image is Image_Data (Row_Index);
78     
79        -- Representation of a possibly partial image
80     
81        type Partial_Image(Number_Of_Rows : Optional_Row_Index := Void_Row_Index)
82              is
83           record
84              Rows : Image_Data (Row_Index'First .. Number_Of_Rows);
85           end record;
86     
87     
88        --% Subprogram:
89        --    Calculate size of given image in bits
90        --% Parameter Constraints:
91        -->   None
92        --% Exceptions Raised:
93        -->   None
94        function Derive_Image_Bit_Size
95              (The_Image : in     Partial_Image)
96              return Basic_Types.Bit_Size;
97     
98        --% Subprogram:
99        --    Append row of pixels to end of write stream.
100        --% Parameter Constraints:
101        -->   None
102        --% Exceptions Raised:
103        -->    Source_Data_Stream.Write_Stream_Exhausted - End of stream was met
104        --+    while appending pixels.
105        procedure Put
106              (Stream  : in out Source_Data_Stream.Write_Stream;
107               The_Row : in     Image_Row);
108     
109        --% Subprogram:
110        --    Append a (partial) image to end of write stream.
111        --% Parameter Constraints:
112        -->   None
113        --% Exceptions Raised:
114        -->    Source_Data_Stream.Write_Stream_Exhausted - End of stream was met
115        --+    while appending pixels.
116        procedure Put
117              (Stream    : in out Source_Data_Stream.Write_Stream;
118               The_Image : in     Partial_Image);
119     
120     
121     end Payload.science_Manager.image_Representation;
122     
123     --~-----------------------------------------------------------------------------
124