Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Crunch
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Microhacks
Crunch
Commits
0777566b
Verified
Commit
0777566b
authored
2 years ago
by
Louis
Browse files
Options
Downloads
Patches
Plain Diff
Fix clippy warnings
parent
728f2fe8
No related branches found
No related tags found
No related merge requests found
Pipeline
#329
passed with stages
in 1 minute and 36 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/commands/reduce.rs
+6
-6
6 additions, 6 deletions
src/commands/reduce.rs
src/commands/split.rs
+8
-8
8 additions, 8 deletions
src/commands/split.rs
with
14 additions
and
14 deletions
src/commands/reduce.rs
+
6
−
6
View file @
0777566b
use
crate
::
commands
::
palette
::
ColourMapping
;
use
crate
::
commands
::
Palette
;
use
crate
::
utils
::{
RgbaOutputFormat
,
TypedOutputFormat
};
use
crate
::
utils
::{
RgbaOutputFormat
};
use
anyhow
::
Error
;
use
anyhow
::
Error
;
use
clap
::
Parser
;
use
clap
::
Parser
;
use
image
::{
GenericImage
,
ImageBuffer
,
Rgba
,
RgbaImage
};
use
image
::{
GenericImage
};
use
serde
::{
Deserialize
,
Serialize
};
use
serde
::{
Deserialize
,
Serialize
};
use
std
::
collections
::
HashMap
;
/// Limit the number of colours by quantity or threshold
/// Limit the number of colours by quantity or threshold
#[derive(Debug,
Clone,
Parser,
Serialize,
Deserialize)]
#[derive(Debug,
Clone,
Parser,
Serialize,
Deserialize)]
...
@@ -27,7 +27,7 @@ pub struct Reduce {
...
@@ -27,7 +27,7 @@ pub struct Reduce {
}
}
impl
Reduce
{
impl
Reduce
{
pub
fn
run
<
T
:
GenericImage
>
(
&
self
,
mut
image
:
&
T
)
->
anyhow
::
Result
<
RgbaOutputFormat
>
{
pub
fn
run
<
T
:
GenericImage
>
(
&
self
,
_
image
:
&
T
)
->
anyhow
::
Result
<
RgbaOutputFormat
>
{
Err
(
Error
::
msg
(
"Reduce is not implemented"
))
Err
(
Error
::
msg
(
"Reduce is not implemented"
))
// TODO: Reduce impl
// TODO: Reduce impl
...
...
This diff is collapsed.
Click to expand it.
src/commands/split.rs
+
8
−
8
View file @
0777566b
use
crate
::
utils
::{
RgbaOutputFormat
,
SpriteData
};
use
anyhow
::
Error
;
use
clap
::
Parser
;
use
clap
::
Parser
;
use
image
::
imageops
::
tile
;
use
image
::{
use
image
::{
save_buffer
,
save_buffer_with_format
,
GenericImage
,
GenericImageView
,
ImageBuffer
,
ImageFormat
,
GenericImageView
,
ImageFormat
,
Pixel
,
Rgba
,
RgbaImage
,
Pixel
,
RgbaImage
,
};
};
use
num_traits
::
cast
::
ToPrimitive
;
use
num_traits
::
AsPrimitive
;
use
num_traits
::
AsPrimitive
;
use
rayon
::
prelude
::{
IntoParallelIterator
,
IntoParallelRefIterator
};
use
serde
::{
Deserialize
,
Serialize
};
use
serde
::{
Deserialize
,
Serialize
};
use
std
::
io
::
Read
;
use
std
::
path
::
PathBuf
;
use
std
::
path
::
PathBuf
;
#[inline(always)]
#[inline(always)]
...
...
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