~alinuxninja/nginx-edge/trunk

« back to all changes in this revision

Viewing changes to debian/modules/ngx_pagespeed/psol/include/pagespeed/kernel/image/jpeg_optimizer_test_helper.h

  • Committer: Vivian
  • Date: 2015-12-04 18:20:11 UTC
  • Revision ID: git-v1:a36f2bc32e884f7473b3a47040e5411306144d7d
* Do not extract psol.tar.gz

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Copyright 2011 Google Inc.
2
 
//
3
 
// Licensed under the Apache License, Version 2.0 (the "License");
4
 
// you may not use this file except in compliance with the License.
5
 
// You may obtain a copy of the License at
6
 
//
7
 
//      http://www.apache.org/licenses/LICENSE-2.0
8
 
//
9
 
// Unless required by applicable law or agreed to in writing, software
10
 
// distributed under the License is distributed on an "AS IS" BASIS,
11
 
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
 
// See the License for the specific language governing permissions and
13
 
// limitations under the License.
14
 
//
15
 
// This header only exists to avoid including jpeglib.h, etc directly
16
 
// in jpeg_optimizer_test.cc, since doing so causes symbol collisions on
17
 
// Windows.
18
 
 
19
 
#ifndef PAGESPEED_KERNEL_IMAGE_JPEG_OPTIMIZER_TEST_HELPER_H_
20
 
#define PAGESPEED_KERNEL_IMAGE_JPEG_OPTIMIZER_TEST_HELPER_H_
21
 
 
22
 
#include "pagespeed/kernel/base/string.h"
23
 
 
24
 
namespace pagespeed_testing {
25
 
namespace image_compression {
26
 
 
27
 
// Helper that extracts the number of components and h/v sampling factors.
28
 
bool GetJpegNumComponentsAndSamplingFactors(
29
 
    const GoogleString& jpeg,
30
 
    int* out_num_components,
31
 
    int* out_h_samp_factor,
32
 
    int* out_v_samp_factor);
33
 
 
34
 
// Helper function to check present of given segment.
35
 
bool IsJpegSegmentPresent(const GoogleString& data, int segment);
36
 
 
37
 
// Helper function that returns num of progessive scans for the image.
38
 
int GetNumScansInJpeg(const GoogleString& data);
39
 
 
40
 
// Helper function to return the color profile segment marker.
41
 
int GetColorProfileMarker();
42
 
 
43
 
// Helper function to return the exif data segment marker.
44
 
int GetExifDataMarker();
45
 
 
46
 
}  // namespace image_compression
47
 
}  // namespace pagespeed_testing
48
 
 
49
 
#endif  // PAGESPEED_KERNEL_IMAGE_JPEG_OPTIMIZER_TEST_HELPER_H_