Pencil2D Animation
Download Community News Docs Contribute

BitmapBucket Class Reference

  • Main Page
  • Related Pages
  • Classes
  • Files
  •  
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
BitmapBucket Class Reference

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
 Based on the various factors dependant on which tool properties are set, the result will:
 
std::pair< Layer *, int > findBitmapLayerBelow (Layer *targetLayer, int layerIndex) const
 
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
 
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

◆ allowFill()

bool BitmapBucket::allowFill ( const QPoint &  checkPoint) 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 71 of file bitmapbucket.cpp.

◆ findBitmapLayerBelow()

std::pair< Layer *, int > BitmapBucket::findBitmapLayerBelow ( Layer *  targetLayer,
int  layerIndex 
) const
private

Definition at line 188 of file bitmapbucket.cpp.

◆ flattenBitmapLayersToImage()

BitmapImage BitmapBucket::flattenBitmapLayersToImage ( )
private

Definition at line 168 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 101 of file bitmapbucket.cpp.

Member Data Documentation

◆ mBucketColor

QRgb BitmapBucket::mBucketColor = 0
private

Definition at line 71 of file bitmapbucket.h.

◆ mEditor

Editor* BitmapBucket::mEditor = nullptr
private

Definition at line 65 of file bitmapbucket.h.

◆ mMaxFillRegion

QRect BitmapBucket::mMaxFillRegion
private

Definition at line 74 of file bitmapbucket.h.

◆ mPixelCache

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

Definition at line 68 of file bitmapbucket.h.

◆ mProperties

Properties BitmapBucket::mProperties
private

Definition at line 80 of file bitmapbucket.h.

◆ mReferenceImage

BitmapImage BitmapBucket::mReferenceImage
private

Definition at line 70 of file bitmapbucket.h.

◆ mStartReferenceColor

QRgb BitmapBucket::mStartReferenceColor = 0
private

Definition at line 72 of file bitmapbucket.h.

◆ mTargetFillToLayer

Layer* BitmapBucket::mTargetFillToLayer = nullptr
private

Definition at line 66 of file bitmapbucket.h.

◆ mTargetFillToLayerIndex

int BitmapBucket::mTargetFillToLayerIndex = -1
private

Definition at line 78 of file bitmapbucket.h.

◆ mTolerance

int BitmapBucket::mTolerance = 0
private

Definition at line 76 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 Sun Sep 24 2023 19:39:35 for Pencil2D by doxygen 1.9.6 based on revision 1395c86cb17dafbb32de44cbabe1f4c58636468d