Pencil2D Animation
Download Community News Docs Contribute
  • Overview
  • Articles
  • Code
  •  
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • File List
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
BitmapBucket Class Reference
+ Collaboration diagram for BitmapBucket:
Collaboration graph
[legend]

Public Member Functions

 BitmapBucket (Editor *editor, QColor color, QRect maxFillRegion, QPointF fillPoint, Properties properties)
 
void paint (const QPointF &updatedPoint, std::function< void(BucketState, int, int)> progress)
 Will paint at the given point, given that it makes sense.
 

Private Member Functions

bool allowFill (const QPoint &checkPoint, const QRgb &checkColor) const
 Based on the various factors dependant on which tool properties are set, the result will:
 
bool allowContinuousFill (const QPoint &checkPoint, const QRgb &checkColor) const
 
bool canUseDragToFill (const QPoint &fillPoint, const QColor &bucketColor, const BitmapImage &referenceImage)
 Determines whether fill to drag feature can be used.
 
BitmapImage flattenBitmapLayersToImage ()
 

Private Attributes

Editor * mEditor = nullptr
 
Layer * mTargetFillToLayer = nullptr
 
QHash< QRgb, bool > * mPixelCache
 
BitmapImage mReferenceImage
 
QRgb mBucketColor = 0
 
QRgb mStartReferenceColor = 0
 
QRect mMaxFillRegion
 
int mTolerance = 0
 
int mTargetFillToLayerIndex = -1
 
bool mFilledOnce = false
 
bool mUseDragToFill = false
 
Properties mProperties
 

Detailed Description

Definition at line 34 of file bitmapbucket.h.

Constructor & Destructor Documentation

◆ BitmapBucket() [1/2]

BitmapBucket::BitmapBucket ( )
explicit

Definition at line 27 of file bitmapbucket.cpp.

◆ BitmapBucket() [2/2]

BitmapBucket::BitmapBucket ( Editor *  editor,
QColor  color,
QRect  maxFillRegion,
QPointF  fillPoint,
Properties  properties 
)
explicit

Definition at line 31 of file bitmapbucket.cpp.

Member Function Documentation

◆ allowContinuousFill()

bool BitmapBucket::allowContinuousFill ( const QPoint &  checkPoint,
const QRgb &  checkColor 
) const
private

Definition at line 95 of file bitmapbucket.cpp.

◆ allowFill()

bool BitmapBucket::allowFill ( const QPoint &  checkPoint,
const QRgb &  checkColor 
) const
private

Based on the various factors dependant on which tool properties are set, the result will:

BucketProgress: BeforeFill to allow filling

Parameters
checkPoint
Returns
True if you are allowed to fill, otherwise false

Definition at line 85 of file bitmapbucket.cpp.

◆ canUseDragToFill()

bool BitmapBucket::canUseDragToFill ( const QPoint &  fillPoint,
const QColor &  bucketColor,
const BitmapImage &  referenceImage 
)
private

Determines whether fill to drag feature can be used.

Definition at line 68 of file bitmapbucket.cpp.

◆ flattenBitmapLayersToImage()

BitmapImage BitmapBucket::flattenBitmapLayersToImage ( )
private

Definition at line 191 of file bitmapbucket.cpp.

◆ paint()

void BitmapBucket::paint ( const QPointF &  updatedPoint,
std::function< void(BucketState, int, int)>  progress 
)

Will paint at the given point, given that it makes sense.

. canUse is always called prior to painting

Parameters
updatedPoint- the point where to point
progress- a function that returns the progress of the paint operation, the layer and frame that was affected at the given point.

Definition at line 114 of file bitmapbucket.cpp.

Member Data Documentation

◆ mBucketColor

QRgb BitmapBucket::mBucketColor = 0
private

Definition at line 74 of file bitmapbucket.h.

◆ mEditor

Editor* BitmapBucket::mEditor = nullptr
private

Definition at line 68 of file bitmapbucket.h.

◆ mFilledOnce

bool BitmapBucket::mFilledOnce = false
private

Definition at line 82 of file bitmapbucket.h.

◆ mMaxFillRegion

QRect BitmapBucket::mMaxFillRegion
private

Definition at line 77 of file bitmapbucket.h.

◆ mPixelCache

QHash<QRgb, bool>* BitmapBucket::mPixelCache
private

Definition at line 71 of file bitmapbucket.h.

◆ mProperties

Properties BitmapBucket::mProperties
private

Definition at line 85 of file bitmapbucket.h.

◆ mReferenceImage

BitmapImage BitmapBucket::mReferenceImage
private

Definition at line 73 of file bitmapbucket.h.

◆ mStartReferenceColor

QRgb BitmapBucket::mStartReferenceColor = 0
private

Definition at line 75 of file bitmapbucket.h.

◆ mTargetFillToLayer

Layer* BitmapBucket::mTargetFillToLayer = nullptr
private

Definition at line 69 of file bitmapbucket.h.

◆ mTargetFillToLayerIndex

int BitmapBucket::mTargetFillToLayerIndex = -1
private

Definition at line 81 of file bitmapbucket.h.

◆ mTolerance

int BitmapBucket::mTolerance = 0
private

Definition at line 79 of file bitmapbucket.h.

◆ mUseDragToFill

bool BitmapBucket::mUseDragToFill = false
private

Definition at line 83 of file bitmapbucket.h.


The documentation for this class was generated from the following files:
  • core_lib/src/graphics/bitmap/bitmapbucket.h
  • core_lib/src/graphics/bitmap/bitmapbucket.cpp
Generated on Thu Jun 5 2025 14:06:43 for Pencil2D by doxygen 1.9.6 based on revision 4c63407997b2c03e5048716586dec6fbbb755173