genesys: Add wrapper to retrieve raw channel value from image

merge-requests/194/head
Povilas Kanapickas 2019-09-17 17:21:01 +03:00
rodzic 4f74dceaba
commit 93395bd24e
2 zmienionych plików z 7 dodań i 0 usunięć

Wyświetl plik

@ -83,6 +83,11 @@ RawPixel Image::get_raw_pixel(std::size_t x, std::size_t y) const
return get_raw_pixel_from_row(get_row_ptr(y), x, format_);
}
std::uint16_t Image::get_raw_channel(std::size_t x, std::size_t y, unsigned channel) const
{
return get_raw_channel_from_row(get_row_ptr(y), x, channel, format_);
}
void Image::set_raw_pixel(std::size_t x, std::size_t y, const RawPixel& pixel)
{
set_raw_pixel_to_row(get_row_ptr(y), x, pixel, format_);
@ -93,6 +98,7 @@ void Image::resize(std::size_t width, std::size_t height, PixelFormat format)
width_ = width;
height_ = height;
format_ = format;
row_bytes_ = get_pixel_row_bytes(format_, width_);
data_.resize(get_row_bytes() * height);
}

Wyświetl plik

@ -65,6 +65,7 @@ public:
void set_pixel(std::size_t x, std::size_t y, const Pixel& pixel);
RawPixel get_raw_pixel(std::size_t x, std::size_t y) const;
std::uint16_t get_raw_channel(std::size_t x, std::size_t y, unsigned channel) const;
void set_raw_pixel(std::size_t x, std::size_t y, const RawPixel& pixel);
void resize(std::size_t width, std::size_t height, PixelFormat format);