|
Ream v0.1.0-1
C++ graphics library for Linux
|
Raster (software) implementation of RImage. More...
#include <RRSImage.h>
Inheritance diagram for RRSImage:Public Member Functions | |
| std::shared_ptr< RGBMBo > | gbmBo (RDevice *device=nullptr) const noexcept override |
| Always returns an empty pointer. | |
| std::shared_ptr< RDRMFramebuffer > | drmFb (RDevice *device=nullptr) const noexcept override |
| Always returns an empty pointer. | |
| sk_sp< SkImage > | skImage (RDevice *device=nullptr) const noexcept override |
| Returns the SkImage wrapping the shared-memory pixels. | |
| sk_sp< SkSurface > | skSurface (RDevice *device=nullptr) const noexcept override |
| Returns the SkSurface wrapping the shared-memory pixels. | |
| CZBitset< RImageCap > | checkDeviceCaps (CZBitset< RImageCap > caps, RDevice *device=nullptr) const noexcept override |
| Reports which of the requested capabilities are supported. | |
| bool | writePixels (const RPixelBufferRegion ®ion) noexcept override |
| Uploads pixels into the image via a CPU memcpy. | |
| bool | readPixels (const RPixelBufferRegion ®ion) noexcept override |
| Downloads pixels from the image via a CPU memcpy. | |
| RRSDevice * | allocator () const noexcept |
| Returns the allocator device downcast to the Raster backend type. | |
| size_t | stride () const noexcept |
| Returns the row stride of the pixel buffer, in bytes. | |
| std::shared_ptr< CZSharedMemory > | shm () const noexcept |
| Returns the shared memory backing the image pixels. | |
| int | resize (SkISize size) noexcept |
| Resizes the image in place, reallocating the backing SkImage/SkSurface. | |
Public Member Functions inherited from RImage | |
| SkISize | size () const noexcept |
| Returns the image size in pixels. | |
| const RFormatInfo & | formatInfo () const noexcept |
| Returns information about the image's pixel format. | |
| const std::unordered_set< RFormat > & | readFormats () const noexcept |
| Returns the set of formats the image can be read/sampled as. | |
| const std::unordered_set< RFormat > & | writeFormats () const noexcept |
| Returns the set of formats the image can be written to. | |
| SkAlphaType | alphaType () const noexcept |
| Returns the image's alpha type. | |
| RModifier | modifier () const noexcept |
| Returns the DRM format modifier of the image's storage. | |
| RDevice * | allocator () const noexcept |
| Returns the device that allocated this image. | |
| std::shared_ptr< RCore > | core () const noexcept |
| Returns the RCore instance that owns this image. | |
| std::shared_ptr< RSync > | readSync () noexcept |
| Returns the read sync fence. | |
| void | setReadSync (std::shared_ptr< RSync > sync) noexcept |
| Sets the read sync fence. | |
| std::shared_ptr< RSync > | writeSync () noexcept |
| Returns the write sync fence. | |
| void | setWriteSync (std::shared_ptr< RSync > sync) noexcept |
| Sets the write sync fence. | |
| UInt32 | writeSerial () const noexcept |
| Returns the write serial. | |
| std::shared_ptr< RGLImage > | asGL () const noexcept |
| Attempts to cast this image to an RGLImage. | |
| std::shared_ptr< RRSImage > | asRS () const noexcept |
| Attempts to cast this image to an RRSImage. | |
| std::shared_ptr< RVKImage > | asVK () const noexcept |
| Attempts to cast this image to an RVKImage. | |
| ~RImage () noexcept | |
| Destructor. | |
Public Member Functions inherited from RObject | |
| RObject ()=default | |
| Constructs a default RObject. | |
Static Public Member Functions | |
| static std::shared_ptr< RRSImage > | Make (SkISize size, const RDRMFormat &format, const RImageConstraints *constraints=nullptr) noexcept |
| Creates a Raster image. | |
Static Public Member Functions inherited from RImage | |
| static std::shared_ptr< RImage > | Make (SkISize size, const RDRMFormat &format, const RImageConstraints *constraints=nullptr) noexcept |
| Allocates a new empty image. | |
| static std::shared_ptr< RImage > | MakeFromPixels (const RPixelBufferInfo &info, const RDRMFormat &format, const RImageConstraints *constraints=nullptr) noexcept |
| Allocates a new image and uploads pixel data into it. | |
| static std::shared_ptr< RImage > | LoadFile (const std::filesystem::path &path, const RDRMFormat &format, SkISize size={0, 0}, const RImageConstraints *constraints=nullptr) noexcept |
| Loads an image from a file. | |
| static std::shared_ptr< RImage > | FromDMA (const RDMABufferInfo &info, CZOwn ownership, const RImageConstraints *constraints=nullptr) noexcept |
| Imports an image from a DMA-buf. | |
Raster (software) implementation of RImage.
RRSImage backs its pixels with host-visible shared memory (CZSharedMemory) using a linear layout, and wraps that memory in both an SkImage (for sampling) and an SkSurface (for rendering). It can be obtained from an RImage via asRS().
Because it is a CPU buffer, it never exposes GBM buffer objects or DRM framebuffers. The shared memory can be shared with a Wayland compositor (see RRSSwapchainWL) as a wl_shm buffer.
|
staticnoexcept |
Creates a Raster image.
Allocates shared memory sized for size and format (which must be a linear-modifier format supported by the allocator device) and wraps it in an SkImage and SkSurface.
| size | Image size in pixels. Must not be empty. |
| format | DRM format and modifiers. Must resolve to a supported Skia color type and allow the linear (or invalid) modifier. |
| constraints | Optional constraints. Note that the DRMFb and GBMBo capabilities are not supported and requesting them fails. |
Always returns an empty pointer.
Raster images are CPU buffers and have no GBM backing.
Implements RImage.
|
inlineoverridevirtualnoexcept |
Always returns an empty pointer.
Raster images cannot be used as DRM framebuffers.
Implements RImage.
|
inlineoverridevirtualnoexcept |
Returns the SkImage wrapping the shared-memory pixels.
The device argument is ignored; the same object is returned regardless of device.
Implements RImage.
|
inlineoverridevirtualnoexcept |
Returns the SkSurface wrapping the shared-memory pixels.
The device argument is ignored; the same object is returned regardless of device.
Implements RImage.
|
overridevirtualnoexcept |
|
overridevirtualnoexcept |
Uploads pixels into the image via a CPU memcpy.
The region's format must match the image format. Implements the RImage writePixels() contract.
Implements RImage.
|
overridevirtualnoexcept |
Downloads pixels from the image via a CPU memcpy.
The region's format must match the image format. Implements the RImage readPixels() contract.
Implements RImage.
|
inlinenoexcept |
Returns the allocator device downcast to the Raster backend type.
|
inlinenoexcept |
Returns the row stride of the pixel buffer, in bytes.
|
inlinenoexcept |
Returns the shared memory backing the image pixels.
|
noexcept |
Resizes the image in place, reallocating the backing SkImage/SkSurface.
The underlying shared memory is grown only when the new size needs more bytes than currently allocated; it is never shrunk. Used by RRSSwapchainWL to recycle buffers.
| size | The new image size in pixels. Must not be empty. |