OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_GFX_CONVOLVER_H__ | 5 #ifndef SKIA_EXT_CONVOLVER_H_ |
6 #define BASE_GFX_CONVOLVER_H__ | 6 #define SKIA_EXT_CONVOLVER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 | 11 |
12 // avoid confusion with Mac OS X's math library (Carbon) | 12 // avoid confusion with Mac OS X's math library (Carbon) |
13 #if defined(OS_MACOSX) | 13 #if defined(OS_MACOSX) |
14 #undef FloatToFixed | 14 #undef FloatToFixed |
15 #endif | 15 #endif |
16 | 16 |
17 namespace gfx { | 17 namespace skia { |
18 | 18 |
19 // Represents a filter in one dimension. Each output pixel has one entry in this | 19 // Represents a filter in one dimension. Each output pixel has one entry in this |
20 // object for the filter values contributing to it. You build up the filter | 20 // object for the filter values contributing to it. You build up the filter |
21 // list by calling AddFilter for each output pixel (in order). | 21 // list by calling AddFilter for each output pixel (in order). |
22 // | 22 // |
23 // We do 2-dimensional convolusion by first convolving each row by one | 23 // We do 2-dimensional convolusion by first convolving each row by one |
24 // ConvolusionFilter1D, then convolving each column by another one. | 24 // ConvolusionFilter1D, then convolving each column by another one. |
25 // | 25 // |
26 // Entries are stored in fixed point, shifted left by kShiftBits. | 26 // Entries are stored in fixed point, shifted left by kShiftBits. |
27 class ConvolusionFilter1D { | 27 class ConvolusionFilter1D { |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 // | 124 // |
125 // The layout in memory is assumed to be 4-bytes per pixel in B-G-R-A order | 125 // The layout in memory is assumed to be 4-bytes per pixel in B-G-R-A order |
126 // (this is ARGB when loaded into 32-bit words on a little-endian machine). | 126 // (this is ARGB when loaded into 32-bit words on a little-endian machine). |
127 void BGRAConvolve2D(const uint8* source_data, | 127 void BGRAConvolve2D(const uint8* source_data, |
128 int source_byte_row_stride, | 128 int source_byte_row_stride, |
129 bool source_has_alpha, | 129 bool source_has_alpha, |
130 const ConvolusionFilter1D& xfilter, | 130 const ConvolusionFilter1D& xfilter, |
131 const ConvolusionFilter1D& yfilter, | 131 const ConvolusionFilter1D& yfilter, |
132 uint8* output); | 132 uint8* output); |
133 | 133 |
134 } // namespace gfx | 134 } // namespace skia |
135 | 135 |
136 #endif // BASE_GFX_CONVOLVER_H__ | 136 #endif // SKIA_EXT_CONVOLVER_H_ |
137 | 137 |
OLD | NEW |