This module is responsible for decoding files such as PNG, GIF, JPEG into raw pixel data, as well as parsing compressed formats which are designed to be uploaded to the GPU and rendered without being un-compressed. This module does not know how to draw images on screen; only love.graphics knows that. 更多...
#include <Image.h>
Public 类型 | |
| using | FormatHandler = medialoader::FormatHandler |
Public 成员函数 | |
| Module_REG (Image) | |
| Image () | |
| Image. | |
| virtual | ~Image () |
| Image. | |
| ImageData * | newImageData (Data *data) |
| Creates new ImageData from FileData. | |
| ImageData * | newImageDataFromFile (std::string path) |
| Loads an image from a VFS path through the unified resource cache. Repeated loads of one path share a single decoded ImageData; a file change refreshes it in place (see ResourceManager). | |
| ImageData * | newImageData (int width, int height, std::string format="RGBA8") |
| Creates empty ImageData with the given size. | |
| ImageData * | newImageData (int width, int height, std::string format, void *data, bool own=false) |
| Creates empty ImageData with the given size. | |
| bool | isCompressed (Data *data) |
| Creates new CompressedImageData from FileData. | |
| std::vector< script::Owned< ImageData > > | newCubeFaces (ImageData *src) |
| Creates a cube faces. @ownership Caller deletes unless documented otherwise. | |
| std::vector< script::Owned< ImageData > > | newVolumeLayers (ImageData *src) |
| Creates a volume layers. @ownership Caller deletes unless documented otherwise. | |
| const std::list< FormatHandler * > & | getFormatHandlers () const |
| Returns the format handlers. | |
Public 成员函数 继承自 eve::Module | |
| virtual | ~Module () |
| Module. | |
| virtual std::string | getName () const =0 |
| Returns the name. | |
详细描述
This module is responsible for decoding files such as PNG, GIF, JPEG into raw pixel data, as well as parsing compressed formats which are designed to be uploaded to the GPU and rendered without being un-compressed. This module does not know how to draw images on screen; only love.graphics knows that.
成员类型定义说明
◆ FormatHandler
| using eve::image::Image::FormatHandler = medialoader::FormatHandler |
构造及析构函数说明
◆ Image()
◆ ~Image()
成员函数说明
◆ getFormatHandlers()
| const std::list< medialoader::FormatHandler * > & eve::image::Image::getFormatHandlers | ( | ) | const |
◆ isCompressed()
| bool eve::image::Image::isCompressed | ( | Data * | data | ) |
◆ Module_REG()
| eve::image::Image::Module_REG | ( | Image | ) |
◆ newCubeFaces()
| std::vector< eve::script::Owned< ImageData > > eve::image::Image::newCubeFaces | ( | ImageData * | src | ) |
Creates a cube faces. @ownership Caller deletes unless documented otherwise.
引用了 eve::image::ImageData::getHeight(), eve::image::ImageData::getWidth(), h , 以及 w.
◆ newImageData() [1/3]
Creates new ImageData from FileData.
- 参数
-
data The FileData containing the encoded image data.
- 返回
- The new ImageData.
被这些函数引用 eve::animation::Animation::newSpriteSheetFromSequence().
◆ newImageData() [2/3]
| ImageData * eve::image::Image::newImageData | ( | int | width, |
| int | height, | ||
| std::string | format, | ||
| void * | data, | ||
| bool | own = false |
||
| ) |
◆ newImageData() [3/3]
| ImageData * eve::image::Image::newImageData | ( | int | width, |
| int | height, | ||
| std::string | format = "RGBA8" |
||
| ) |
◆ newImageDataFromFile()
| ImageData * eve::image::Image::newImageDataFromFile | ( | std::string | path | ) |
Loads an image from a VFS path through the unified resource cache. Repeated loads of one path share a single decoded ImageData; a file change refreshes it in place (see ResourceManager).
- 参数
-
path The VFS path of the image file.
- 返回
- The cached ImageData.
- 异常
-
eve::Exception when the file cannot be read or decoded.
引用了 eve::ResourceManager::get(), eve::ResourceManager::getInstance(), path , 以及 resource.
被这些函数引用 eve::animation::Animation::newSpriteSheetFromSequence().
◆ newVolumeLayers()
| std::vector< eve::script::Owned< ImageData > > eve::image::Image::newVolumeLayers | ( | ImageData * | src | ) |
Creates a volume layers. @ownership Caller deletes unless documented otherwise.
引用了 eve::image::ImageData::getHeight() , 以及 eve::image::ImageData::getWidth().
该类的文档由以下文件生成:
Public 成员函数 继承自