Developer Application Interface (ARC API) v4.5.8
ARC, Inc. GenIV Application Interface
CArcImageAssembler.h
1// +------------------------------------------------------------------------------------------------------------------+
2// | FILE: CArcImageAssembler.h ( GenIV ) |
3// +------------------------------------------------------------------------------------------------------------------+
4// | PURPOSE: This file defines the ARC image assembler, which can be used to reassemble a final image from a |
5// | series of CArcImagePacket objects. |
6// | |
7// | AUTHOR: Scott Streit DATE: Oct 31, 2016 |
8// | |
9// | Copyright 2014 Astronomical Research Cameras, Inc. All rights reserved. |
10// +------------------------------------------------------------------------------------------------------------------+
13#pragma once
14
15#include <fstream>
16#include <cstdint>
17#include <thread>
18#include <memory>
19#include <queue>
20#include <mutex>
21
22#include <CArcBase.h>
23#include <CArcImagePacket.h>
24#include <ArcSysState.h>
25
26
27
28namespace arc
29{
30 namespace gen4
31 {
32
40 enum class packetFileType_e : std::uint32_t
41 {
42 text,
43 binary
44 };
45
46
54 using savePacketsTuple_t = std::tuple<bool, const std::string, arc::gen4::packetFileType_e>;
55
56
59 {
60 std::uint16_t* pStart;
61 std::uint16_t* pEnd;
62 std::uint16_t* pInserter;
63 };
64
65
66 // +-------------------------------------------------------------------------------------------------------+
67 // | CArcImageAssembler Class |
68 // +-------------------------------------------------------------------------------------------------------+
69
74 class GEN4_CARCDEVICE_API CArcImageAssembler final : public arc::gen4::CArcBase
75 {
76
77 public:
78
82
85 ~CArcImageAssembler( void ) = default;
86
94 auto run( std::queue<arc::gen4::CArcImagePacket*>* pQueue, std::uint16_t* pImageBuffer, pSysState_t pSysState ) -> std::uint32_t;
95
99 auto errorList( void ) noexcept -> std::shared_ptr<CArcStringList>;
100
105 void enableChannelPixelCounts( const bool bEnable = true );
106
110 auto channelPixelCountsEnabled( void ) const noexcept -> bool;
111
118 auto getChannelPixelCounts( void ) const noexcept -> const std::uint32_t*;
119
123
132 void enableImagePacketSave( bool bEnable, const std::string& sFileName = "", arc::gen4::packetFileType_e eFileType = arc::gen4::packetFileType_e::text );
133
137 void disable( const bool bDisable = true ) noexcept;
138
141 bool isDisabled( void ) noexcept;
142
144 static constexpr std::int32_t CHANNEL_COUNT = 64;
145
146 private:
147
151 std::unique_ptr<imageAssemblerChannels_t[]> m_pChannels;
152
155 std::unique_ptr<std::uint32_t[]> m_pChannelPixelCount;
156
159 std::shared_ptr<CArcStringList> m_pErrorList;
160
163 std::unique_ptr<savePacketsTuple_t> m_pSavePacketOption;
164
167 std::ofstream m_savePacketOFS;
168
171 bool m_bEnableChannelPixelCount;
172
175 bool m_bDisable;
176 };
177
178
181 using pImageAssembler_t = std::shared_ptr<arc::gen4::CArcImageAssembler>;
182
183
184 } // end namespace gen4
185} // end namespace arc
void enableImagePacketSave(bool bEnable, const std::string &sFileName="", arc::gen4::packetFileType_e eFileType=arc::gen4::packetFileType_e::text)
void disable(const bool bDisable=true) noexcept
auto run(std::queue< arc::gen4::CArcImagePacket * > *pQueue, std::uint16_t *pImageBuffer, pSysState_t pSysState) -> std::uint32_t
void enableChannelPixelCounts(const bool bEnable=true)
auto errorList(void) noexcept -> std::shared_ptr< CArcStringList >
auto channelPixelCountsEnabled(void) const noexcept -> bool
auto getChannelPixelCounts(void) const noexcept -> const std::uint32_t *
std::tuple< bool, const std::string, arc::gen4::packetFileType_e > savePacketsTuple_t
std::shared_ptr< arc::gen4::CArcImageAssembler > pImageAssembler_t
std::shared_ptr< sysState_t > pSysState_t
Definition: ArcSysState.h:28
Definition: CArcBase.h:50