Skip to content

Commit

Permalink
refactor(lib/bayerize): rm useless misleading op
Browse files Browse the repository at this point in the history
Thanks to funky for reporting this.

Update copyright.

v0.5.1
  • Loading branch information
dbohdan committed Jan 2, 2024
1 parent ab6fb3b commit f6cf049
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2021, 2023 D. Bohdan and contributors listed in AUTHORS
Copyright (c) 2021, 2023-2024 D. Bohdan and contributors listed in AUTHORS

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 3 additions & 3 deletions hicolor.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* HiColor image file format encoder/decoder library.
*
* Copyright (c) 2021, 2023 D. Bohdan and contributors listed in AUTHORS.
* Copyright (c) 2021, 2023-2024 D. Bohdan and contributors listed in AUTHORS.
* License: MIT.
*
* This header file contains both the interface and the implementation for
Expand All @@ -19,7 +19,7 @@
#include <stdio.h>

#define HICOLOR_BAYER_SIZE 8
#define HICOLOR_LIBRARY_VERSION 500
#define HICOLOR_LIBRARY_VERSION 501

/* Types. */

Expand Down Expand Up @@ -378,7 +378,7 @@ uint8_t hicolor_bayerize_channel(
double step
)
{
double dithered = ((double) intensity) / 255 + step / 256 * (factor - 63/64);
double dithered = ((double) intensity) / 255 + step / 256 * factor;

double levels = 128.0 / step;
return (uint8_t) (round(dithered * levels) / levels * 255);
Expand Down

0 comments on commit f6cf049

Please sign in to comment.