2020-12-26 14:12:05 -08:00
|
|
|
// 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
|
|
|
|
2017-08-25 17:48:06 -07:00
|
|
|
#ifndef CSCORE_JPEGUTIL_H_
|
|
|
|
|
#define CSCORE_JPEGUTIL_H_
|
2016-12-02 23:33:29 -08:00
|
|
|
|
2017-08-25 17:48:06 -07:00
|
|
|
#include <string>
|
|
|
|
|
|
2018-04-29 23:33:19 -07:00
|
|
|
#include <wpi/StringRef.h>
|
2016-12-02 23:33:29 -08:00
|
|
|
|
|
|
|
|
namespace wpi {
|
|
|
|
|
class raw_istream;
|
2017-10-15 10:01:17 -07:00
|
|
|
} // namespace wpi
|
2016-12-02 23:33:29 -08:00
|
|
|
|
|
|
|
|
namespace cs {
|
|
|
|
|
|
2018-04-29 23:33:19 -07:00
|
|
|
bool IsJpeg(wpi::StringRef data);
|
2016-12-02 23:33:29 -08:00
|
|
|
|
2018-04-29 23:33:19 -07:00
|
|
|
bool GetJpegSize(wpi::StringRef 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
|
|
|
|
2018-04-29 23:33:19 -07:00
|
|
|
wpi::StringRef JpegGetDHT();
|
2016-12-02 23:33:29 -08:00
|
|
|
|
|
|
|
|
bool ReadJpeg(wpi::raw_istream& is, std::string& buf, int* width, int* height);
|
|
|
|
|
|
|
|
|
|
} // namespace cs
|
|
|
|
|
|
2017-08-25 17:48:06 -07:00
|
|
|
#endif // CSCORE_JPEGUTIL_H_
|