Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LibLaserCut
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Elektronikföreningen Admittansen
LibLaserCut
Commits
d378ecd4
Commit
d378ecd4
authored
12 years ago
by
Max Gaukler
Browse files
Options
Downloads
Plain Diff
Merge remote branch 'upstream/develop' into develop
parents
4c16ac0c
f0d71bf3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/com/t_oster/liblasercut/dithering/DitheringAlgorithm.java
+37
-0
37 additions, 0 deletions
...com/t_oster/liblasercut/dithering/DitheringAlgorithm.java
src/com/t_oster/liblasercut/platform/Util.java
+10
-5
10 additions, 5 deletions
src/com/t_oster/liblasercut/platform/Util.java
with
47 additions
and
5 deletions
src/com/t_oster/liblasercut/dithering/DitheringAlgorithm.java
+
37
−
0
View file @
d378ecd4
...
...
@@ -22,6 +22,8 @@ import com.t_oster.liblasercut.BlackWhiteRaster;
import
com.t_oster.liblasercut.Customizable
;
import
com.t_oster.liblasercut.GreyscaleRaster
;
import
com.t_oster.liblasercut.TimeIntensiveOperation
;
import
com.t_oster.liblasercut.platform.Util
;
import
java.util.Arrays
;
/**
*
...
...
@@ -80,4 +82,39 @@ public abstract class DitheringAlgorithm extends TimeIntensiveOperation implemen
@Override
public
abstract
String
toString
();
@Override
public
boolean
equals
(
Object
o
)
{
if
(
o
==
null
||
!
getClass
().
equals
(
o
.
getClass
()))
{
return
false
;
}
final
DitheringAlgorithm
other
=
(
DitheringAlgorithm
)
o
;
String
[]
own
=
this
.
getPropertyKeys
();
String
[]
ot
=
other
.
getPropertyKeys
();
if
(!
Arrays
.
deepEquals
(
own
,
ot
))
{
return
false
;
}
for
(
int
i
=
0
;
i
<
own
.
length
;
i
++)
{
String
key
=
own
[
i
];
if
(!
Util
.
differ
(
getProperty
(
key
),
other
.
getProperty
(
key
)))
{
return
false
;
}
}
return
true
;
}
@Override
public
int
hashCode
()
{
int
hash
=
7
;
for
(
String
key
:
this
.
getPropertyKeys
())
{
hash
+=
this
.
getProperty
(
key
).
hashCode
();
}
return
hash
;
}
}
This diff is collapsed.
Click to expand it.
src/com/t_oster/liblasercut/platform/Util.java
+
10
−
5
View file @
d378ecd4
...
...
@@ -2,17 +2,17 @@
* This file is part of VisiCut.
* Copyright (C) 2012 Thomas Oster <thomas.oster@rwth-aachen.de>
* RWTH Aachen University - 52062 Aachen, Germany
*
*
* VisiCut is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* VisiCut is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with VisiCut. If not, see <http://www.gnu.org/licenses/>.
**/
...
...
@@ -33,7 +33,12 @@ public class Util {
//TODO: check
return
dpi
/
25.4
;
}
public
static
double
dpmm2dpi
(
double
dpmm
)
{
return
dpmm
*
25.4
;
}
public
static
double
inch2mm
(
double
inch
)
{
return
inch
*
25.4
;
}
...
...
@@ -55,7 +60,7 @@ public class Util {
* This method is used to avoid null checks
* @param a
* @param b
* @return
* @return
*/
public
static
boolean
differ
(
Object
a
,
Object
b
)
{
if
(
a
==
null
^
b
==
null
)
{
...
...
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