STFishFinder API  API version 0.0.0, Documentation version 3 -PRELIMINARY-
STFF-ImageColumn.h
Go to the documentation of this file.
1 ///
2 /// @file STFF-ImageColumn.h
3 ///
4 /// Header file for the STFF::ImageColumn class.
5 ///
6 /// @copyright
7 /// Copyright (c) 2012-2015 Sifferman Technology, LLC. All rights reserved.
8 ///
9 
10 #ifndef STFF_ImageColumn_h_
11 #define STFF_ImageColumn_h_
12 
13 #include "STFF-FishFinder.h"
14 
15 
16 namespace STFF {
17 
18  // forward declaration
19  class STFishFinder;
20 
21  ////////////////////////////////////////////////////////////////////
22  /// @class ImageColumn
23  ///
24  /// The ImageColumn class is a container for sample data retrieved
25  /// from a single sonar ping.
26  ///
27  /// The sample data is stored within each ImageColumn instance
28  /// privately in packed form.
29  /// The sample data may be retrieved by calling GetImageData(),
30  /// at which time it is unpacked and sample-rate converted to fit
31  /// the dimensions and offset required by the viewing window.
32  ///
33  // The resolution of the sample data stored within instances
34  // of this class might vary from one instance to the next depending
35  // on the bandwidth loading of the black box fish finder and the
36  // communication link. Nevertheless, before creating instances of
37  // ImageColumn, the user should request a sample resolution
38  // appropriate to the screen resolution of the display device by
39  // calling SetNumInputSamples().
40  //
41  /// @see GetImageColumn()
42  ///
43  class ImageColumn {
44 
45  public:
46 
47  ////////////////////////////////////////////////////////////////////
48  /// @fn ImageColumn (STFishFinder*)
49  ///
50  /// This is the first of two @ref ImageColumn class constructors.
51  /// The ImageColumn object created with this constructor
52  /// is empty, containing no image data.
53  ///
54  /// @param[in] pFF
55  /// pointer to the @ref STFishFinder instance with
56  /// which this ImageColumn object is associated
57  ///
58  /// @returns (not applicable)
59  ///
60  /// @see ImageColumn(STFishFinder*, FF_Frequency_t, FF_RangeSetting_t, uint16_t, uint16_t, uint8_t*, uint16_t)
61  ///
63 
64 
65  ////////////////////////////////////////////////////////////////////
66  /// @fn ImageColumn(STFishFinder*, FF_Frequency_t, FF_RangeSetting_t, uint16_t, uint16_t, uint8_t*, uint32_t)
67  ///
68  /// This is a secondary @ref ImageColumn class constructor.
69  /// The ImageColumn object created with this constructor
70  /// is populated with the data provided in the argument list.
71  ///
72  /// @param[in] pFF
73  /// pointer to the @ref STFishFinder instance with
74  /// which this ImageColumn object is associated
75  ///
76  /// @param[in] frequency
77  /// the frequency context of the sample data
78  ///
79  /// @param[in] inputRange
80  /// the shallow and deep Range bounds that define
81  /// the start and end of the sample data
82  ///
83  /// @param[in] numInputSamples
84  /// the number of data samples recorded
85  ///
86  /// @param[in] numDataBytes
87  /// the total number of contiguous bytes containing
88  /// the sample data
89  ///
90  /// @param[in] pInputData
91  /// pointer to the start of the data buffer containing
92  /// the sample data to be copied into the new
93  /// ImageColumn object being created
94  ///
95  /// @param[in] sequenceId
96  /// a unique number that increments with each
97  /// ImageColumn object created by the black box
98  ///
99  /// @returns (not applicable)
100  ///
101  /// @see ImageColumn(STFishFinder*)
102  ///
104  FF_Frequency_t frequency,
105  FF_RangeSetting_t inputRange,
106  uint16_t numInputSamples,
107  uint16_t numDataBytes,
108  uint8_t *pInputData,
109  uint32_t sequenceId);
110 
111 
112  ////////////////////////////////////////////////////////////////////
113  /// @fn ~ImageColumn ()
114  ///
115  /// This is the @ref ImageColumn destructor.
116  ///
117  /// @returns (not applicable)
118  ///
119  ~ImageColumn ();
120 
121 
122  ////////////////////////////////////////////////////////////////////
123  /// @fn ImageColumn (const ImageColumn &)
124  ///
125  /// This is the @ref ImageColumn copy constructor.
126  ///
127  /// @param const ImageColumn &
128  /// reference to an existing ImageColumn object
129  ///
130  /// @returns ImageColumn
131  /// a new ImageColumn object that is a copy of the
132  /// original
133  ///
134  ImageColumn (const ImageColumn &);
135 
136 
137  ////////////////////////////////////////////////////////////////////
138  /// @fn ImageColumn &operator= (const ImageColumn &)
139  ///
140  /// This is the @ref ImageColumn assignment operator.
141  ///
142  /// @param const ImageColumn &
143  /// reference to a first existing ImageColumn object
144  /// (right hand side of assignment)
145  ///
146  /// @returns const ImageColumn &
147  /// reference to a second existing ImageColumn object
148  /// (left hand side of assignment)
149  ///
150  const ImageColumn &operator= (const ImageColumn &);
151 
152 
153  ////////////////////////////////////////////////////////////////////
154  /// @fn Frequency
155  ///
156  /// Provides the sonar frequency context when the
157  /// ImageColumn sample data was collected.
158  ///
159  /// @returns the frequency of the sonar ping and of the
160  /// received data for the ImageColumn object.
161  /// If the object contains no valid data, then
162  /// this function will return ::FF_INVALID_FREQUENCY.
163  ///
164  FF_Frequency_t Frequency () const;
165 
166 
167  ////////////////////////////////////////////////////////////////////
168  /// @fn SequenceId
169  ///
170  /// Provides the Sequence ID for the ImageColumn.
171  /// The Sequence ID starts at 0 and increments by 1 for each
172  /// new ImageColumn transmitted by the black box.
173  /// Separate sequences are used for ImageColumns having different
174  /// frequencies.
175  ///
176  /// @returns the Sequence ID for the ImageColumn.
177  ///
178  uint32_t SequenceId () const;
179 
180 
181  ////////////////////////////////////////////////////////////////////
182  /// @fn GetImageData
183  ///
184  /// Fills a buffer provided by the caller with a single column
185  /// of sample data. The data is sample rate converted (i.e.
186  /// stretched or compressed) on the fly to fit into the
187  /// specified buffer.
188  ///
189  /// The produced image data is not packed (i.e. each uint8_t
190  /// value in the buffer contains one sample). With a bit depth
191  /// of 4 (i.e. 4 bits per sample), one of 16 colors can be
192  /// represented by each sample in the buffer.
193  ///
194  /// @param[in] pRangeSetting
195  /// pointer to a ::FF_RangeSetting_t struct
196  /// containing the shallow and deep range limits
197  /// (and associated depth units)
198  /// defining the depths of the first and last
199  /// samples in the @p pImageData buffer. The
200  /// @link FF_RangeSetting_t::rangeShallow
201  /// rangeShallow @endlink and
202  /// @link FF_RangeSetting_t::rangeDeep
203  /// rangeDeep @endlink members must be provided in
204  /// hundredths of the depth units specified in the
205  /// @link FF_RangeSetting_t::units units @endlink
206  /// member.
207  ///
208  /// @param[in] numSamples
209  /// the number of uint8_t samples to be copied
210  /// into the buffer
211  ///
212  /// @param[out] pImageData
213  /// pointer to the start of the output buffer.
214  ///
215  /// @param[out] pSimulated
216  /// pointer to a location that will be written with
217  /// the value @p true if the provided image data is
218  /// a simulation for demonstration purposes;
219  /// @p false otherwise
220  ///
221  /// @retval ::FF_ERR_NO_ERROR
222  /// if the operation completed successfully
223  ///
224  /// @retval ::FF_ERR_ARGUMENT_OUT_OF_RANGE
225  /// if any of the arguments, or any of the members
226  /// of the @p pRangeSetting parameter, are outside
227  /// the range of allowable values.
228  ///
229  /// @retval ::FF_ERR_INVALID_FREQUENCY
230  /// the ImageColumn object contains no valid
231  /// sample data
232  ///
233  FF_Error_t GetImageData (const FF_RangeSetting_t *pRangeSetting,
234  uint16_t numSamples,
235  uint8_t *pImageData,
236  bool *pSimulated) const;
237 
238  private:
239 
240  // Default constructor is private to prevent construction of
241  // ImageColumn class without parameters
242  ImageColumn () {}
243 
244  class impl;
245  impl *m_pimpl;
246 
247  }; // class ImageColumn
248 
249 } // namespace STFF
250 
251 #endif // defined (STFF_ImageColumn_h_)
252 
FF_Error_t GetImageData(const FF_RangeSetting_t *pRangeSetting, uint16_t numSamples, uint8_t *pImageData, bool *pSimulated) const
Fills a buffer provided by the caller with a single column of sample data.
Header file for the STFF::STFishFinder class.
FF_Frequency_t Frequency() const
Provides the sonar frequency context when the ImageColumn sample data was collected.
The ImageColumn class is a container for sample data retrieved from a single sonar ping...
uint32_t SequenceId() const
Provides the Sequence ID for the ImageColumn.
FF_Error_t
Error codes.
Definition: STFF-Types.h:50
This is the namespace containing the platform-independent STFishFinder API.
Range Setting structure.
Definition: STFF-Types.h:640
This is the main class for the STFishFinder API.
~ImageColumn()
This is the ImageColumn destructor.
FF_Frequency_t
Sonar Frequency options.
Definition: STFF-Types.h:77
const ImageColumn & operator=(const ImageColumn &)
This is the ImageColumn assignment operator.