Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2342)

Side by Side Diff: include/core/SkBitmap.h

Issue 19335002: Production quality fast image up/downsampler (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: clean up use of filter quality flags Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef SkBitmap_DEFINED 10 #ifndef SkBitmap_DEFINED
11 #define SkBitmap_DEFINED 11 #define SkBitmap_DEFINED
12 12
13 #include "Sk64.h" 13 #include "Sk64.h"
14 #include "SkColor.h" 14 #include "SkColor.h"
15 #include "SkColorTable.h" 15 #include "SkColorTable.h"
16 #include "SkPoint.h" 16 #include "SkPoint.h"
17 #include "SkRefCnt.h" 17 #include "SkRefCnt.h"
18 18
19 struct SkIRect; 19 struct SkIRect;
20 struct SkRect; 20 struct SkRect;
21 class SkPaint; 21 class SkPaint;
22 class SkPixelRef; 22 class SkPixelRef;
23 class SkRegion; 23 class SkRegion;
24 class SkString; 24 class SkString;
25 class SkBitmapFilter;
26 class SkConvolutionProcs;
25 27
26 class GrTexture; 28 class GrTexture;
27 29
28 /** \class SkBitmap 30 /** \class SkBitmap
29 31
30 The SkBitmap class specifies a raster bitmap. A bitmap has an integer width 32 The SkBitmap class specifies a raster bitmap. A bitmap has an integer width
31 and height, and a format (config), and a pointer to the actual pixels. 33 and height, and a format (config), and a pointer to the actual pixels.
32 Bitmaps can be drawn into a SkCanvas, but they are also used to specify the 34 Bitmaps can be drawn into a SkCanvas, but they are also used to specify the
33 target of a SkCanvas' drawing operations. 35 target of a SkCanvas' drawing operations.
34 A const SkBitmap exposes getAddr(), which lets a caller write its pixels; 36 A const SkBitmap exposes getAddr(), which lets a caller write its pixels;
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 697
696 static SkFixed ComputeMipLevel(SkFixed sx, SkFixed dy); 698 static SkFixed ComputeMipLevel(SkFixed sx, SkFixed dy);
697 699
698 /** Given scale factors sx, sy, determine the miplevel available in the 700 /** Given scale factors sx, sy, determine the miplevel available in the
699 bitmap, and return it (this is the amount to shift matrix iterators 701 bitmap, and return it (this is the amount to shift matrix iterators
700 by). If dst is not null, it is set to the correct level. 702 by). If dst is not null, it is set to the correct level.
701 */ 703 */
702 int extractMipLevel(SkBitmap* dst, SkFixed sx, SkFixed sy); 704 int extractMipLevel(SkBitmap* dst, SkFixed sx, SkFixed sy);
703 bool hasMipMap() const; 705 bool hasMipMap() const;
704 void freeMipMap(); 706 void freeMipMap();
705 707
706 /** Make a scaled copy of this bitmap into the provided destination. 708 static void scale( const SkBitmap *src, SkBitmap *dst );
reed1 2013/07/18 13:42:12 Static Methods Are Capitalized Should this guy ei
humper 2013/07/18 17:11:04 Sorry, this function should have been deleted from
707 * The caller is responsible for having set the width and height of the
708 * provided destination bitmap, and also having allocated its pixel
709 * memory.
710 *
711 * This function is temporary and for testing purposes only; it will
712 * likely move once it has been properly plumbed into the bitmap
713 * shader infrastructure.
714 */
715
716 void scale(SkBitmap *dst) const;
717 709
718 friend struct SkBitmapProcState; 710 friend struct SkBitmapProcState;
719 }; 711 };
720 712
721 class SkAutoLockPixels : public SkNoncopyable { 713 class SkAutoLockPixels : public SkNoncopyable {
722 public: 714 public:
723 SkAutoLockPixels(const SkBitmap& bm, bool doLock = true) : fBitmap(bm) { 715 SkAutoLockPixels(const SkBitmap& bm, bool doLock = true) : fBitmap(bm) {
724 fDidLock = doLock; 716 fDidLock = doLock;
725 if (doLock) { 717 if (doLock) {
726 bm.lockPixels(); 718 bm.lockPixels();
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
823 815
824 // returns the address of the byte that contains the x coordinate 816 // returns the address of the byte that contains the x coordinate
825 inline uint8_t* SkBitmap::getAddr1(int x, int y) const { 817 inline uint8_t* SkBitmap::getAddr1(int x, int y) const {
826 SkASSERT(fPixels); 818 SkASSERT(fPixels);
827 SkASSERT(fConfig == kA1_Config); 819 SkASSERT(fConfig == kA1_Config);
828 SkASSERT((unsigned)x < fWidth && (unsigned)y < fHeight); 820 SkASSERT((unsigned)x < fWidth && (unsigned)y < fHeight);
829 return (uint8_t*)fPixels + y * fRowBytes + (x >> 3); 821 return (uint8_t*)fPixels + y * fRowBytes + (x >> 3);
830 } 822 }
831 823
832 #endif 824 #endif
OLDNEW
« no previous file with comments | « gyp/opts.gyp ('k') | src/core/SkBitmapFilter.h » ('j') | src/core/SkBitmapFilter.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698