CMSC23700 Common Code Library
Support code for CS23700 programming projects
|
#include <cs237-image.hpp>
Public Member Functions | |
Image1D (uint32_t wid, Channels chans, ChannelTy ty) | |
Image1D (std::string const &file) | |
size_t | width () const |
return the width of the image | |
bool | write (const char *file) |
Public Member Functions inherited from cs237::__detail::ImageBase | |
uint32_t | nDims () const |
the number of dimensions (1, 2, or 3) | |
Channels | channels () const |
return the format of the pixels. | |
ChannelTy | type () const |
returns the type of the channels | |
vk::Format | format () const |
return the vulkan format of the image data | |
void * | data () const |
the data pointer | |
size_t | nBytes () const |
the total number of bytes of image data | |
unsigned int | nChannels () const |
the number of channels (1, 2, 3, or 4) | |
size_t | nBytesPerPixel () const |
the number of bytes per pixel | |
void | addAlphaChannel () |
Additional Inherited Members | |
Protected Member Functions inherited from cs237::__detail::ImageBase | |
ImageBase () | |
ImageBase (uint32_t nd) | |
ImageBase (uint32_t nd, Channels chans, ChannelTy ty, size_t nPixels) | |
virtual | ~ImageBase () |
Protected Attributes inherited from cs237::__detail::ImageBase | |
uint32_t | _nDims |
the number of dimensions (1 or 2) | |
Channels | _chans |
the texture format | |
ChannelTy | _type |
the representation type of the data | |
bool | _sRGB |
should the image be interpreted as an sRGB encoded image? | |
size_t | _nBytes |
size in bytes of image data | |
void * | _data |
the raw image data | |
create and allocate space for an uninitialized image
wid | the width of the image |
chans | the image format |
ty | the type of the elements |
cs237::Image1D::Image1D | ( | std::string const & | file | ) |
create and initialize an image from a PNG file.
file | the name of the PNG file |
|
inline |
return the width of the image
bool cs237::Image1D::write | ( | const char * | file | ) |
write the texture to a file in PNG format
file | the name of the PNG file |