Skip to content

Commit 1164fb3

Browse files
committed
Unify {PBM,LCD}DataArray types into PixelsData.
1 parent 0f95029 commit 1164fb3

14 files changed

+27
-28
lines changed

src/bin/daemon/LCDPlugins/LCDPlugin.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ void LCDPlugin::init(FontsManager* const pFonts, const std::string & product)
132132
_initialized = true;
133133
}
134134

135-
const PBMDataArray & LCDPlugin::getNextPBMFrame(
135+
const PixelsData & LCDPlugin::getNextPBMFrame(
136136
FontsManager* const pFonts,
137137
const std::string & LCDKey,
138138
const bool lockedPlugin)
@@ -197,7 +197,7 @@ const uint16_t LCDPlugin::getNextPBMFrameID(void) const
197197
return _PBMFrameIndex;
198198
}
199199

200-
PBMDataArray & LCDPlugin::getCurrentPBMFrame(void)
200+
PixelsData & LCDPlugin::getCurrentPBMFrame(void)
201201
{
202202
#if DEBUGGING_ON && DEBUG_LCD_PLUGINS
203203
LOG(DEBUG2) << this->getPluginName()
@@ -275,7 +275,7 @@ void LCDPlugin::drawProgressBarOnPBMFrame(
275275
}
276276

277277
try {
278-
PBMDataArray & frame = (*_itCurrentPBMFrame)._PBMData;
278+
PixelsData & frame = (*_itCurrentPBMFrame)._PBMData;
279279

280280
auto drawHorizontalLine = [&frame] (const uint16_t index) -> void
281281
{
@@ -372,7 +372,7 @@ void LCDPlugin::drawPadlockOnPBMFrame(
372372
const uint16_t xByte = PBMXPos / 8;
373373
const uint16_t index = (DEFAULT_PBM_WIDTH_IN_BYTES * PBMYPos) + xByte;
374374

375-
PBMDataArray & frame = (*_itCurrentPBMFrame)._PBMData;
375+
PixelsData & frame = (*_itCurrentPBMFrame)._PBMData;
376376

377377
if( lockedPlugin ) {
378378
_everLocked = true;

src/bin/daemon/LCDPlugins/LCDPlugin.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class PBMFrame
5555
PBMFrame(void) = delete;
5656
~PBMFrame() = default;
5757

58-
PBMDataArray _PBMData;
58+
PixelsData _PBMData;
5959

6060
const bool switchToNextFrame(const uint16_t currentFrameCounter);
6161

@@ -88,7 +88,7 @@ class LCDPlugin
8888
void resetPBMFrameIndex(void);
8989
void prepareNextPBMFrame(void);
9090

91-
virtual const PBMDataArray & getNextPBMFrame(
91+
virtual const PixelsData & getNextPBMFrame(
9292
FontsManager* const pFonts,
9393
const std::string & LCDKey,
9494
const bool lockedPlugin
@@ -111,7 +111,7 @@ class LCDPlugin
111111
);
112112

113113
const uint16_t getNextPBMFrameID(void) const;
114-
PBMDataArray & getCurrentPBMFrame(void);
114+
PixelsData & getCurrentPBMFrame(void);
115115

116116
void writeStringOnPBMFrame(
117117
FontsManager* const pFonts,

src/bin/daemon/LCDPlugins/PBM.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@
4545
namespace GLogiK
4646
{
4747

48-
typedef std::vector<unsigned char> PBMDataArray;
49-
typedef std::vector<unsigned char> LCDDataArray;
48+
typedef std::vector<unsigned char> PixelsData;
5049

5150
} // namespace GLogiK
5251

src/bin/daemon/LCDPlugins/PBMFile.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PBMFile::~PBMFile()
3838

3939
void PBMFile::readPBM(
4040
const std::string & PBMPath,
41-
PBMDataArray & PBMData,
41+
PixelsData & PBMData,
4242
const uint16_t PBMWidth,
4343
const uint16_t PBMHeight)
4444
{
@@ -129,7 +129,7 @@ void PBMFile::parsePBMHeader(
129129

130130
void PBMFile::extractPBMData(
131131
std::ifstream & pbm,
132-
PBMDataArray & PBMData)
132+
PixelsData & PBMData)
133133
{
134134
pbm.read(reinterpret_cast<char*>(&PBMData.front()), PBMData.size());
135135

@@ -138,7 +138,7 @@ void PBMFile::extractPBMData(
138138
<< " - expected: " << PBMData.size() << std::endl;
139139
#endif
140140

141-
if( PBMData.size() != static_cast<PBMDataArray::size_type>( pbm.gcount() ) )
141+
if( PBMData.size() != static_cast<PixelsData::size_type>( pbm.gcount() ) )
142142
throw GLogiKExcept("unexpected numbers of bytes read");
143143

144144
// checking that we really reached the EoF

src/bin/daemon/LCDPlugins/PBMFile.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class PBMFile
4242

4343
static void readPBM(
4444
const std::string & PBMPath,
45-
PBMDataArray & PBMData,
45+
PixelsData & PBMData,
4646
const uint16_t PBMWidth,
4747
const uint16_t PBMHeight);
4848

@@ -55,7 +55,7 @@ class PBMFile
5555

5656
static void extractPBMData(
5757
std::ifstream & pbm,
58-
PBMDataArray & PBMData);
58+
PixelsData & PBMData);
5959

6060
static void closePBM(std::ifstream & pbm);
6161

src/bin/daemon/LCDPlugins/PBMFont.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ const uint16_t PBMFont::getCenteredYPos(void)
133133
}
134134

135135
void PBMFont::printCharacterOnFrame(
136-
PBMDataArray & frame,
136+
PixelsData & frame,
137137
const std::string & character,
138138
uint16_t & PBMXPos,
139139
const uint16_t PBMYPos)

src/bin/daemon/LCDPlugins/PBMFont.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class PBMFont
4848
const uint16_t getCenteredYPos(void);
4949

5050
void printCharacterOnFrame(
51-
PBMDataArray & frame,
51+
PixelsData & frame,
5252
const std::string & character,
5353
uint16_t & PBMXPos,
5454
const uint16_t PBMYPos
@@ -67,7 +67,7 @@ class PBMFont
6767
);
6868

6969
private:
70-
PBMDataArray _PBMData;
70+
PixelsData _PBMData;
7171
const std::string _fontName;
7272
const uint16_t _PBMWidth;
7373
const uint16_t _PBMHeight;

src/bin/daemon/LCDPlugins/fontsManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const uint16_t FontsManager::getCenteredYPos(const FontID fontID)
6868

6969
void FontsManager::printCharacterOnFrame(
7070
const FontID fontID,
71-
PBMDataArray & frame,
71+
PixelsData & frame,
7272
const std::string & c,
7373
uint16_t & PBMXPos,
7474
const uint16_t PBMYPos)

src/bin/daemon/LCDPlugins/fontsManager.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class FontsManager
4848

4949
void printCharacterOnFrame(
5050
const FontID fontID,
51-
PBMDataArray & frame,
51+
PixelsData & frame,
5252
const std::string & c,
5353
uint16_t & PBMXPos,
5454
const uint16_t PBMYPos

src/bin/daemon/LCDPlugins/systemMonitor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ void SystemMonitor::init(FontsManager* const pFonts, const std::string & product
8080
LCDPlugin::init(pFonts, product);
8181
}
8282

83-
const PBMDataArray & SystemMonitor::getNextPBMFrame(
83+
const PixelsData & SystemMonitor::getNextPBMFrame(
8484
FontsManager* const pFonts,
8585
const std::string & LCDKey,
8686
const bool lockedPlugin

0 commit comments

Comments
 (0)