kopia lustrzana https://gitlab.com/sane-project/backends
genesys: Add wrapper to retrieve raw channel value from image
rodzic
4f74dceaba
commit
93395bd24e
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Ładowanie…
Reference in New Issue