Skip to content

Commit

Permalink
filter comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Gin committed Nov 21, 2023
1 parent 9297cc8 commit 7266d5d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@
namespace PokemonAutomation{
namespace Kernels{


// Change certain color in `image_in` and save output to `image_out`.
// If `replace_color_within_range` is true, replace the color within range [mins, maxs] with the color `replacement`.
// If `replace_color_within_range` is false, replace the color outside of the range with the color `replacement`.
// Returns the # of pixels inside the range [mins, maxs].
size_t filter_rgb32_range(
const uint32_t* in, size_t in_bytes_per_row, size_t width, size_t height,
uint32_t* out, size_t out_bytes_per_row,
const uint32_t* image_in, size_t image_in_bytes_per_row, size_t width, size_t height,
uint32_t* image_out, size_t image_out_bytes_per_row,
uint32_t mins, uint32_t maxs,
uint32_t replacement, bool invert
uint32_t replacement, bool replace_color_within_range
);


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@
namespace PokemonAutomation{
namespace Kernels{


// Runner interface:
// - static size_t Runner::VECTOR_SIZE, how many uint32_t in an SIMD vector. Note one pixel is one uint32_t.
// - Runner::process_full(uint32_t* out, const uint32_t* in), process a full vector: replace pixels in
// or out of a specific color range with a particular color.
// - Runner::process_partial(uint32_t* out, const uint32_t* in, size_t left), process a partial vector:
// work only on the first `left` pixels.
template <typename Runner>
PA_FORCE_INLINE void filter_per_pixel(
const uint32_t* image, size_t in_bytes_per_row, size_t width, size_t height,
Expand Down

0 comments on commit 7266d5d

Please sign in to comment.