Files
allwpilib/cscore/src/main/native/cpp/JpegUtil.hpp

30 lines
732 B
C++
Raw Normal View History

// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
2016-12-02 23:33:29 -08:00
2025-11-07 19:57:55 -05:00
#ifndef CSCORE_JPEGUTIL_HPP_
#define CSCORE_JPEGUTIL_HPP_
2016-12-02 23:33:29 -08:00
2017-08-25 17:48:06 -07:00
#include <string>
#include <string_view>
2016-12-02 23:33:29 -08:00
2025-11-07 20:00:05 -05:00
namespace wpi::util {
2016-12-02 23:33:29 -08:00
class raw_istream;
} // namespace wpi
2016-12-02 23:33:29 -08:00
2025-11-07 20:00:05 -05:00
namespace wpi::cs {
2016-12-02 23:33:29 -08:00
bool IsJpeg(std::string_view data);
2016-12-02 23:33:29 -08:00
bool GetJpegSize(std::string_view data, int* width, int* height);
2016-12-02 23:33:29 -08:00
2017-08-25 17:48:06 -07:00
bool JpegNeedsDHT(const char* data, size_t* size, size_t* locSOF);
2016-12-02 23:33:29 -08:00
std::string_view JpegGetDHT();
2016-12-02 23:33:29 -08:00
2025-11-07 20:00:05 -05:00
bool ReadJpeg(wpi::util::raw_istream& is, std::string& buf, int* width, int* height);
2016-12-02 23:33:29 -08:00
2025-11-07 20:00:05 -05:00
} // namespace wpi::cs
2016-12-02 23:33:29 -08:00
2025-11-07 19:57:55 -05:00
#endif // CSCORE_JPEGUTIL_HPP_