ICF 3.1.1.10
Technical documentation of ICF Libraries
CFileAcquisitionComp.h
Go to the documentation of this file.
1/********************************************************************************
2** This file is part of the ICF Framework. Copyright (C) Witold Gantzke & Kirill Lepskiy
3** ICF Framework may be used under the terms of the LGPL License v. 2.1 by the Free Software Foundation.
4********************************************************************************/
5
6#pragma once
7
8
9// Qt includes
10#include <QtCore/QDir>
11#include <QtCore/QStringList>
12#include <QtCore/QMutex>
13
14// ICF includes
20
21#include <icamgui/icamgui.h>
22
23
24namespace icamgui
25{
26
27
33 virtual public icam::IBitmapAcquisition
34{
35public:
37
38 I_BEGIN_COMPONENT(CFileAcquisitionComp);
39 I_REGISTER_INTERFACE(iproc::IProcessor);
40 I_REGISTER_INTERFACE(icam::IBitmapAcquisition);
41 I_ASSIGN(m_bitmapLoaderCompPtr, "BitmapLoader", "Load bitmap from file", true, "BitmapLoader");
42 I_ASSIGN(m_defaultDirAttrPtr, "DefaultDir", "Default directory or image file path, that will be used if no parameters are specified", true, ".");
43 I_ASSIGN(m_defaultPathParamCompPtr, "DefaultPathParam", "Path of file or directory will be used if no parameters are specified in paramter set", false, "DefaultDirParam");
44 I_ASSIGN(m_pathParamIdAttrPtr, "DirParamId", "Id used to get directory parameter (ifile::IFileNameParam)", true, "FileBitmapAcquisition");
45 I_ASSIGN(m_maxCachedDirectoriesAttrPtr, "MaxCachedDirs", "Maximum number of cached directories", true, 10);
46 I_ASSIGN(m_lastFileNameCompPtr, "LastFileName", "Stores last processed file name here if set", false, "LastFileName");
47 I_ASSIGN(m_acceptedFileNamePatternAttrPtr, "AcceptedFileNamePattern", "Text pattern to be matched for file acceptance", false, "");
48 I_END_COMPONENT;
49
51
52 // reimplemented (iproc::IProcessor)
53 int GetProcessorState(const iprm::IParamsSet* paramsPtr) const override;
55 const iprm::IParamsSet* paramsPtr,
56 const istd::IPolymorphic* inputPtr,
57 const istd::IChangeable* outputPtr) const override;
58 void InitProcessor(const iprm::IParamsSet* paramsPtr, bool doReset) override;
60 const iprm::IParamsSet* paramsPtr,
61 const istd::IPolymorphic* inputPtr,
62 istd::IChangeable* outputPtr,
63 bool allowAsync = false,
64 iproc::IProgressManager* progressManagerPtr = nullptr) override;
65
66 // reimplemented (icam::IBitmapAcquisition)
67 istd::CIndex2d GetBitmapSize(const iprm::IParamsSet* paramsPtr) const override;
68
69 // reimplemented (ilog::CLoggerComponentBase)
70 void OnComponentCreated() override;
71
72protected:
74 {
76
77 QStringList files;
78 QStringList::iterator filesIter;
79 quint32 idStamp;
80 };
81
82 typedef QMap<QString, ParamsInfo> DirInfos;
84
86
88
89 mutable QMutex m_lock;
90
91private:
92 I_REF(ifile::IFilePersistence, m_bitmapLoaderCompPtr);
93 I_REF(ifile::IFileNameParam, m_defaultPathParamCompPtr);
94 I_REF(ifile::IFileNameParam, m_lastFileNameCompPtr);
95 I_ATTR(QString, m_defaultDirAttrPtr);
96 I_ATTR(QByteArray, m_pathParamIdAttrPtr);
97 I_ATTR(int, m_maxCachedDirectoriesAttrPtr);
98 I_ATTR(QString, m_acceptedFileNamePatternAttrPtr);
99};
100
101
102} // namespace icamgui
103
104
Bitmap acquisition processor.
Bitmap loader component implementing interface icam::IBitmapAcquisition over ifile::IFilePersistence.
void InitProcessor(const iprm::IParamsSet *paramsPtr, bool doReset) override
Init processor and give him all or part of parameters.
iproc::CTaskState DoProcessing(const iprm::IParamsSet *paramsPtr, const istd::IPolymorphic *inputPtr, istd::IChangeable *outputPtr, bool allowAsync=false, iproc::IProgressManager *progressManagerPtr=nullptr) override
Do synchronized processing.
istd::CIndex2d GetBitmapSize(const iprm::IParamsSet *paramsPtr) const override
Get size of acquired bitmap for specified parameters.
int GetProcessorState(const iprm::IParamsSet *paramsPtr) const override
Get state of this processor for processing of specified parameters.
QMap< QString, ParamsInfo > DirInfos
ilog::CLoggerComponentBase BaseClass
bool AreParamsAccepted(const iprm::IParamsSet *paramsPtr, const istd::IPolymorphic *inputPtr, const istd::IChangeable *outputPtr) const override
Check if specified parameter set is accepted for this processor.
void OnComponentCreated() override
Common interface for any file system item name (e.g directory, file or URL path)
Interface providing loading and saving of data objects.
Wrapper provider of log-functionality for component based implementations.
Set of general parameters.
Definition IParamsSet.h:29
Represent state of asynchronous operation.
Definition CTaskState.h:28
Interface for all synchrone and asynchrone processors with "push data" model.
Definition IProcessor.h:26
Consume information about progress of some process.
Index implementation for addressing elements in 2D-space.
Definition CIndex2d.h:25
Common interface for data model objects, which can be changed.
Definition IChangeable.h:32
This package contains Qt based camera implementations.

© Witold Gantzke and Kirill Lepskiy