summaryrefslogtreecommitdiff
path: root/python/openvino/runtime/streaming/image_streaming_app/bmp_file.h
diff options
context:
space:
mode:
Diffstat (limited to 'python/openvino/runtime/streaming/image_streaming_app/bmp_file.h')
-rw-r--r--python/openvino/runtime/streaming/image_streaming_app/bmp_file.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/python/openvino/runtime/streaming/image_streaming_app/bmp_file.h b/python/openvino/runtime/streaming/image_streaming_app/bmp_file.h
new file mode 100644
index 0000000..95ab306
--- /dev/null
+++ b/python/openvino/runtime/streaming/image_streaming_app/bmp_file.h
@@ -0,0 +1,47 @@
+// Copyright 2023 Intel Corporation.
+//
+// This software and the related documents are Intel copyrighted materials,
+// and your use of them is governed by the express license under which they
+// were provided to you ("License"). Unless the License provides otherwise,
+// you may not use, modify, copy, publish, distribute, disclose or transmit
+// this software or the related documents without Intel's prior written
+// permission.
+//
+// This software and the related documents are provided as is, with no express
+// or implied warranties, other than those that are expressly stated in the
+// License.
+
+#pragma once
+#include <cstdint>
+#include <string>
+#include <vector>
+
+struct BitmapHeader {
+ uint32_t _size;
+ int32_t _width;
+ int32_t _height;
+ uint16_t _planes;
+ uint16_t _bitCount;
+ uint32_t _compression;
+ uint32_t _sizeImage;
+ int32_t _xPixelsPerMeter;
+ int32_t _yPixelsPerMeter;
+ uint32_t _colorUsed;
+ uint32_t _colorImportant;
+};
+
+class BmpFile {
+ public:
+ BmpFile(const std::string& filename, bool planarBGR);
+ std::vector<uint8_t>& GetData() { return _data; }
+ uint32_t GetNumPixels() { return (_width * _height); }
+
+ private:
+ bool LoadFile(const std::string& filename, bool planarBGR);
+ std::vector<uint8_t> _data;
+ uint32_t _width = 0;
+ uint32_t _height = 0;
+ uint32_t _bitsPerPixel = 0;
+ uint32_t _stride = 0;
+ bool _upsideDown = false;
+};