diff options
Diffstat (limited to 'skia/ext/convolver.h')
-rw-r--r-- | skia/ext/convolver.h | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/skia/ext/convolver.h b/skia/ext/convolver.h index 3ae84cd..7e9749a 100644 --- a/skia/ext/convolver.h +++ b/skia/ext/convolver.h @@ -7,14 +7,12 @@ #include <vector> -#include "base/basictypes.h" - // avoid confusion with Mac OS X's math library (Carbon) #if defined(OS_MACOSX) #undef FloatToFixed #endif -namespace gfx { +namespace skia { // Represents a filter in one dimension. Each output pixel has one entry in this // object for the filter values contributing to it. You build up the filter @@ -33,10 +31,10 @@ class ConvolusionFilter1D { } // Convert between floating point and our fixed point representation. - static inline int16 FloatToFixed(float f) { - return static_cast<int16>(f * (1 << kShiftBits)); + static short FloatToFixed(float f) { + return static_cast<short>(f * (1 << kShiftBits)); } - static inline unsigned char FixedToChar(int16 x) { + static unsigned char FixedToChar(short x) { return static_cast<unsigned char>(x >> kShiftBits); } @@ -65,7 +63,7 @@ class ConvolusionFilter1D { // Same as the above version, but the input is already fixed point. void AddFilter(int filter_offset, - const int16* filter_values, + const short* filter_values, int filter_length); // Retrieves a filter for the given |value_offset|, a position in the output @@ -73,7 +71,7 @@ class ConvolusionFilter1D { // filter values are put into the corresponding out arguments (see AddFilter // above for what these mean), and a pointer to the first scaling factor is // returned. There will be |filter_length| values in this array. - inline const int16* FilterForValue(int value_offset, + inline const short* FilterForValue(int value_offset, int* filter_offset, int* filter_length) const { const FilterInstance& filter = filters_[value_offset]; @@ -100,7 +98,7 @@ class ConvolusionFilter1D { // We store all the filter values in this flat list, indexed by // |FilterInstance.data_location| to avoid the mallocs required for storing // each one separately. - std::vector<int16> filter_values_; + std::vector<short> filter_values_; // The maximum size of any filter we've added. int max_filter_; @@ -124,14 +122,14 @@ class ConvolusionFilter1D { // // The layout in memory is assumed to be 4-bytes per pixel in B-G-R-A order // (this is ARGB when loaded into 32-bit words on a little-endian machine). -void BGRAConvolve2D(const uint8* source_data, +void BGRAConvolve2D(const unsigned char* source_data, int source_byte_row_stride, bool source_has_alpha, const ConvolusionFilter1D& xfilter, const ConvolusionFilter1D& yfilter, - uint8* output); + unsigned char* output); -} // namespace gfx +} // namespace skia #endif // SKIA_EXT_CONVOLVER_H_ |