00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef PNMBRUSH_H
00016 #define PNMBRUSH_H
00017
00018 #include "pandabase.h"
00019 #include "referenceCount.h"
00020 #include "pointerTo.h"
00021 #include "luse.h"
00022
00023 class PNMImage;
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 class EXPCL_PANDA_PNMIMAGE PNMBrush : public ReferenceCount {
00042 protected:
00043 INLINE PNMBrush(double xc, double yc);
00044
00045 PUBLISHED:
00046 virtual ~PNMBrush();
00047
00048 enum BrushEffect {
00049 BE_set,
00050 BE_blend,
00051 BE_darken,
00052 BE_lighten,
00053 };
00054
00055 static PT(PNMBrush) make_transparent();
00056 static PT(PNMBrush) make_pixel(const LColord &color, BrushEffect effect = BE_blend);
00057 static PT(PNMBrush) make_spot(const LColord &color, double radius, bool fuzzy,
00058 BrushEffect effect = BE_blend);
00059 static PT(PNMBrush) make_image(const PNMImage &image, double xc, double yc,
00060 BrushEffect effect = BE_blend);
00061
00062 public:
00063 INLINE double get_xc() const;
00064 INLINE double get_yc() const;
00065
00066 virtual void draw(PNMImage &image, int x, int y, double pixel_scale)=0;
00067 virtual void fill(PNMImage &image, int xfrom, int xto, int y,
00068 int xo, int yo)=0;
00069
00070 protected:
00071 double _xc, _yc;
00072 };
00073
00074 #include "pnmBrush.I"
00075
00076 #endif