WPILibC++  unspecified
JpegUtil.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2016-2018 FIRST. All Rights Reserved. */
3 /* Open Source Software - may be modified and shared by FRC teams. The code */
4 /* must be accompanied by the FIRST BSD license file in the root directory of */
5 /* the project. */
6 /*----------------------------------------------------------------------------*/
7 
8 #ifndef CSCORE_JPEGUTIL_H_
9 #define CSCORE_JPEGUTIL_H_
10 
11 #include <string>
12 
13 #include <wpi/StringRef.h>
14 
15 namespace wpi {
16 class raw_istream;
17 } // namespace wpi
18 
19 namespace cs {
20 
21 bool IsJpeg(wpi::StringRef data);
22 
23 bool GetJpegSize(wpi::StringRef data, int* width, int* height);
24 
25 bool JpegNeedsDHT(const char* data, size_t* size, size_t* locSOF);
26 
27 wpi::StringRef JpegGetDHT();
28 
29 bool ReadJpeg(wpi::raw_istream& is, std::string& buf, int* width, int* height);
30 
31 } // namespace cs
32 
33 #endif // CSCORE_JPEGUTIL_H_
Definition: CvSourceImpl.h:19
namespace to hold default to_json function
Definition: json_binary_writer.cpp:39
Definition: raw_istream.h:26
auto size(R &&Range, typename std::enable_if< std::is_same< typename std::iterator_traits< decltype(Range.begin())>::iterator_category, std::random_access_iterator_tag >::value, void >::type *=nullptr) -> decltype(std::distance(Range.begin(), Range.end()))
Get the size of a range.
Definition: STLExtras.h:999
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49