|
enum class | precision_semantic : uint32_t { byte_p
, half_p
, single_p
, double_p
} |
|
enum class | color_space : uint32_t { linear
, sRGB
} |
|
enum class | texture_format : uint32_t {
luminance = ((1) << 8) | 0x0
, luminance_alpha = ((2) << 8) | 0x1
, alpha_luminance = ((2) << 8) | 0x2
, rgb = ((3) << 8) | 0x4
,
bgr = ((3) << 8) | 0x8
, rgba = ((4) << 8) | 0x10
, argb = ((4) << 8) | 0x12
, bgra = ((4) << 8) | 0x14
,
max = ((4) << 8) | ((1 << 8) - 1)
} |
|
enum class | image_storage_format : uint32_t { first_pixel_row_at_bottom
, first_pixel_row_at_top
} |
| first_pixel_row_at_bottom: y is up (like OpenGL texcoords) first_pixel_row_at_top: y is down just like most image file formats More...
|
|
enum class | wrap_mode : uint32_t { repeat
, clamp
, mirror
} |
|
enum class | texture_filtering : uint32_t { nearest
, bilinear
} |
|
|
size_t | get_width () const |
|
size_t | get_height () const |
|
size_t | get_row_byte_stride () const |
|
precision_semantic | get_pixel_precision () const |
|
color_space | get_color_space () const |
|
texture_format | get_tex_format () const |
|
wrap_mode | get_wrap_u () const |
|
wrap_mode | get_wrap_v () const |
|
image_storage_format | get_storage_format () const |
|
size_t | get_size_precision () const |
|
size_t | get_num_channels () const |
|
size_t | get_size_pixel () const |
|
size_t | get_row_stride () const |
|
size_t | get_pixel_data_offset () const |
|
const void * | get_pixel_data () const |
|
void | set_width (size_t x) |
|
void | set_height (size_t x) |
|
void | set_row_byte_stride (size_t x) |
|
void | set_pixel_precision (precision_semantic x) |
|
void | set_color_space (color_space x) |
|
void | set_tex_format (texture_format x) |
|
void | set_wrap_u (wrap_mode x) |
|
void | set_wrap_v (wrap_mode x) |
|
void | set_storage_format (image_storage_format x) |
|
void | set_pixel_data (const void *pixel_data, const bool copy_to_local) |
| set_pixel_data must be called all other member variables are well set if copy_to_local == false: m_local_pixel_data empty m_pixel_data points to the external pixel_data else: external pixel_data are copied to m_local_pixel_data m_pixel_data is nullptr
|
|
void | set_pixel_data_buffer (std::vector< unsigned char > pixel_data_buffer) |
| m_local_pixel_data takes over pixel_data_buffer m_pixel_data is set to nullptr
|
|
bool | operator== (const RawInputImage &other) const |
|
bool | operator!= (const RawInputImage &other) const |
|
template<typename TexcoordScalar , typename Scalar , uint32_t NumChannels> |
PixelTraits< Scalar, NumChannels >::Pixel | sample (const TexcoordScalar u, const TexcoordScalar v, const texture_filtering filtering=texture_filtering::bilinear) const |
| Sample an image at a given location. More...
|
|
template<typename TexcoordScalar , typename Scalar , uint32_t NumChannels> |
PixelTraits< Scalar, NumChannels >::Pixel | sample_float (const TexcoordScalar u, const TexcoordScalar v, const texture_filtering filtering=texture_filtering::bilinear) const |
| Similar to sample, but remaps the output values from [0, 255] to [0, 1] if the pixel data is stored as 8-bit integers. More...
|
|
template<typename Archive > |
void | serialize_impl (Archive &ar) |
| Serialization. More...
|
|
RawInputImage holds the basic info and the raw pointer (without ownership) to the image pixels.
- there are not paddings inner or inter pixels
- there may be paddings between rows
- m_row_byte_stride can be zero, when there are not paddings between rows, the row stride can be calculated according to m_pixel_precision, m_tex_format and m_width
- the memory of pixels is always with the top-down layout if m_storage_format is image_storage_format::first_pixel_row_at_top get_pixel_data points to the beginning of the memory block if m_storage_format is image_storage_format::first_pixel_row_at_bottom get_pixel_data points to the beginning of the bottom row
- get_pixel_data can pointer to external memory without ownership, or inside m_local_pixel_data with ownership if set_pixel_data(*, false), m_pixel_data points to external memory, m_local_pixel_data is empty if set_pixel_data(*, true), m_pixel_data is nullptr, m_local_pixel_data holds the pixels