26 #ifndef DIGIKAM_EDITOR_RATIO_CROP_WIDGET_H
27 #define DIGIKAM_EDITOR_RATIO_CROP_WIDGET_H
97 RatioCropWidget(
int width,
int height, QWidget*
const parent =
nullptr);
98 RatioCropWidget(
int width,
int height,
bool initDrawing, QWidget*
const parent =
nullptr);
101 void setBackgroundColor(
const QColor& bg);
102 void setCenterSelection(
int centerType=CenterImage);
103 void setSelectionX(
int x);
104 void setSelectionY(
int y);
105 void setSelectionWidth(
int w);
106 void setSelectionHeight(
int h);
107 void setSelectionOrientation(
int orient);
108 void setIsDrawingSelection(
bool draw);
109 void setPreciseCrop(
bool precise);
110 void setAutoOrientation(
bool orientation);
111 void setSelectionAspectRatioType(
int aspectRatioType);
112 void setSelectionAspectRatioValue(
int widthRatioValue,
int heightRatioValue);
113 void setGoldenGuideTypes(
bool drawGoldenSection,
bool drawGoldenSpiralSection,
114 bool drawGoldenSpiral,
bool drawGoldenTriangle,
115 bool flipHorGoldenGuide,
bool flipVerGoldenGuide);
117 int getOriginalImageWidth()
const;
118 int getOriginalImageHeight()
const;
119 QRect getRegionSelection()
const;
121 int getMinWidthRange()
const;
122 int getMinHeightRange()
const;
123 int getMaxWidthRange()
const;
124 int getMaxHeightRange()
const;
125 int getWidthStep()
const;
126 int getHeightStep()
const;
128 bool preciseCropAvailable()
const;
130 void resetSelection();
131 void maxAspectSelection();
137 void slotGuideLines(
int guideLinesType);
138 void slotChangeGuideColor(
const QColor& color);
139 void slotChangeGuideSize(
int size);
149 void paintEvent(QPaintEvent*)
override;
150 void mousePressEvent(QMouseEvent*)
override;
151 void mouseReleaseEvent(QMouseEvent*)
override;
152 void mouseMoveEvent(QMouseEvent*)
override;
153 void resizeEvent(QResizeEvent*)
override;
158 void regionSelectionMoved();
159 void regionSelectionChanged();
161 QPoint convertPoint(
const QPoint& pm,
bool localToReal=
true)
const;
162 QPoint convertPoint(
int x,
int y,
bool localToReal=
true)
const;
163 QPoint opposite()
const;
165 void normalizeRegion();
166 void reverseRatioValues();
167 void applyAspectRatio(
bool useHeight,
bool repaintWidget=
true);
169 void placeSelection(
const QPoint& pm,
bool symmetric,
const QPoint& center);
170 void setCursorResizing();
172 float distance(
const QPoint& a,
const QPoint& b)
const;
173 int computePreciseSize(
int size,
int step)
const;
176 void drawRulesOfThirds(QPainter& p,
const int& xThird,
const int& yThird);
177 void drawDiagonalMethod(QPainter& p,
const int& w,
const int& h);
178 void drawHarmoniousTriangles(QPainter& p,
const int& dst);
179 void drawGoldenMean(QPainter& p,
const QRect& R1,
const QRect& R2,
180 const QRect& R3,
const QRect& R4,
const QRect& R5,
181 const QRect& R6,
const QRect& R7);
183 void setup(
int width,
int height,
184 int widthRatioValue = 1,
int heightRatioValue = 1,
185 int aspectRatio = RATIO01X01,
int orient = Landscape,
186 int guideLinesType = GuideNone);
Definition: imageiface.h:47
Definition: datefolderview.cpp:43