Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
IHM Retouche Photo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BATON Theau
IHM Retouche Photo
Commits
185e66ca
Commit
185e66ca
authored
1 year ago
by
BATON Theau
Browse files
Options
Downloads
Patches
Plain Diff
Amélioration de Pixeleraiser
parent
da1b6ce4
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
IHM_Retouche_Photo/tools/editable/pixelEraiser.cpp
+17
-1
17 additions, 1 deletion
IHM_Retouche_Photo/tools/editable/pixelEraiser.cpp
IHM_Retouche_Photo/tools/editable/pixelEraiser.h
+1
-0
1 addition, 0 deletions
IHM_Retouche_Photo/tools/editable/pixelEraiser.h
with
18 additions
and
1 deletion
IHM_Retouche_Photo/tools/editable/pixelEraiser.cpp
+
17
−
1
View file @
185e66ca
...
@@ -2,18 +2,26 @@
...
@@ -2,18 +2,26 @@
namespace
tool
{
namespace
tool
{
Pixeleraiser
::
Pixeleraiser
(
const
ColorPickerWidget
&
cp
)
Pixeleraiser
::
Pixeleraiser
(
const
ColorPickerWidget
&
cp
)
:
Editable
(
cp
,
"Gomme Pixel"
,
QIcon
(
":/oxygen/16x16/ressource/image/oxygen/icons/16x16/draw-eraser.png"
)),
_leftButton
(
false
)
{}
:
Editable
(
cp
,
"Gomme Pixel"
,
QIcon
(
":/oxygen/16x16/ressource/image/oxygen/icons/16x16/draw-eraser.png"
)),
_leftButton
(
false
)
,
_rightButton
(
false
)
{}
void
Pixeleraiser
::
onMousePressed
(
ui
::
ImageArea
&
,
QImage
&
,
const
QPoint
&
,
const
ui
::
Selection
&
,
const
QMouseEvent
&
e
,
const
ColorPickerWidget
&
)
{
void
Pixeleraiser
::
onMousePressed
(
ui
::
ImageArea
&
,
QImage
&
,
const
QPoint
&
,
const
ui
::
Selection
&
,
const
QMouseEvent
&
e
,
const
ColorPickerWidget
&
)
{
if
(
e
.
button
()
==
Qt
::
LeftButton
)
{
if
(
e
.
button
()
==
Qt
::
LeftButton
)
{
this
->
_leftButton
=
true
;
this
->
_leftButton
=
true
;
}
}
if
(
e
.
button
()
==
Qt
::
RightButton
)
{
this
->
_rightButton
=
true
;
}
}
}
void
Pixeleraiser
::
onMouseReleased
(
ui
::
ImageArea
&
,
QImage
&
,
const
QPoint
&
,
const
ui
::
Selection
&
,
const
QMouseEvent
&
e
,
const
ColorPickerWidget
&
)
{
void
Pixeleraiser
::
onMouseReleased
(
ui
::
ImageArea
&
,
QImage
&
,
const
QPoint
&
,
const
ui
::
Selection
&
,
const
QMouseEvent
&
e
,
const
ColorPickerWidget
&
)
{
if
(
e
.
button
()
==
Qt
::
LeftButton
)
{
if
(
e
.
button
()
==
Qt
::
LeftButton
)
{
this
->
_leftButton
=
false
;
this
->
_leftButton
=
false
;
}
}
if
(
e
.
button
()
==
Qt
::
RightButton
)
{
this
->
_rightButton
=
false
;
}
}
}
void
Pixeleraiser
::
onMouseMoved
(
ui
::
ImageArea
&
a
,
QImage
&
,
const
QPoint
&
p
,
const
ui
::
Selection
&
s
,
const
QMouseEvent
&
,
const
ColorPickerWidget
&
,
bool
hold
)
{
void
Pixeleraiser
::
onMouseMoved
(
ui
::
ImageArea
&
a
,
QImage
&
,
const
QPoint
&
p
,
const
ui
::
Selection
&
s
,
const
QMouseEvent
&
,
const
ColorPickerWidget
&
,
bool
hold
)
{
...
@@ -25,5 +33,13 @@ namespace tool {
...
@@ -25,5 +33,13 @@ namespace tool {
a
.
setColor
(
p
,
QColor
(
0
,
0
,
0
,
0
));
a
.
setColor
(
p
,
QColor
(
0
,
0
,
0
,
0
));
}
}
}
}
else
if
(
hold
&&
this
->
_rightButton
)
{
if
(
s
.
empty
())
{
a
.
setColor
(
p
,
QColorConstants
::
White
);
}
else
if
(
s
.
contain
(
p
))
{
a
.
setColor
(
p
,
QColorConstants
::
White
);
}
}
}
}
}
}
This diff is collapsed.
Click to expand it.
IHM_Retouche_Photo/tools/editable/pixelEraiser.h
+
1
−
0
View file @
185e66ca
...
@@ -6,6 +6,7 @@ namespace tool {
...
@@ -6,6 +6,7 @@ namespace tool {
class
Pixeleraiser
:
public
Editable
{
class
Pixeleraiser
:
public
Editable
{
private:
private:
bool
_leftButton
;
bool
_leftButton
;
bool
_rightButton
;
public:
public:
Pixeleraiser
(
const
ColorPickerWidget
&
);
Pixeleraiser
(
const
ColorPickerWidget
&
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment