Skip to content

Commit b377819

Browse files
authored
Merge pull request #12 from ShawnHymel/main
Fixed bytesPerPixel/bitsPerPixel functions to return correct value for grayscale
2 parents 901de3e + 1b0a6f7 commit b377819

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/OV767X_TinyMLx.cpp

+10-2
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,20 @@ int OV767X::height() const
198198

199199
int OV767X::bitsPerPixel() const
200200
{
201-
return _bytesPerPixel * 8;
201+
if (_grayscale) {
202+
return 8;
203+
} else {
204+
return _bytesPerPixel * 8;
205+
}
202206
}
203207

204208
int OV767X::bytesPerPixel() const
205209
{
206-
return _bytesPerPixel;
210+
if (_grayscale) {
211+
return 1;
212+
} else {
213+
return _bytesPerPixel;
214+
}
207215
}
208216

209217
//

0 commit comments

Comments
 (0)