19 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_IMAGE_DATA_LOOKUP_H_
20 #define NET_INSTAWEB_REWRITER_PUBLIC_IMAGE_DATA_LOOKUP_H_
26 namespace net_instaweb {
34 uint8 uc =
static_cast<uint8
>(c);
35 return static_cast<int>(uc);
38 inline int JpegIntAtPosition(
const StringPiece& buf,
size_t pos) {
43 inline int GifIntAtPosition(
const StringPiece& buf,
size_t pos) {
48 inline int PngIntAtPosition(
const StringPiece& buf,
size_t pos) {
55 inline bool PngSectionIdIs(
const char* hdr,
56 const StringPiece& buf,
size_t pos) {
57 return ((buf[pos + 4] == hdr[0]) &&
58 (buf[pos + 5] == hdr[1]) &&
59 (buf[pos + 6] == hdr[2]) &&
60 (buf[pos + 7] == hdr[3]));
63 namespace ImageHeaders {
65 extern const char kPngHeader[];
66 extern const size_t kPngHeaderLength;
67 extern const char kPngIHDR[];
68 extern const size_t kPngIHDRLength;
69 extern const size_t kIHDRDataStart;
70 extern const size_t kPngIntSize;
72 extern const char kGifHeader[];
73 extern const size_t kGifHeaderLength;
74 extern const size_t kGifDimStart;
75 extern const size_t kGifIntSize;
77 extern const size_t kJpegIntSize;
int CharToInt(char c)
char to int without sign extension.
Definition: image_data_lookup.h:33