Files
Renderive/Core/render/Image.h
T
2026-08-02 03:43:39 +08:00

34 lines
898 B
C++

#pragma once
#include "../base/Color.h"
#include "../base/Geometry.h"
#include "Image_View.h"
#include <cstddef>
#include <cstdint>
#include <memory>
namespace renderive {
class Image {
public:
Image();
Image(int width, int height);
~Image();
Image(const Image& other);
Image(Image&& other) noexcept;
Image& operator=(const Image& other);
Image& operator=(Image&& other) noexcept;
[[nodiscard]] int width() const;
[[nodiscard]] int height() const;
[[nodiscard]] Size size() const;
[[nodiscard]] bool empty() const;
[[nodiscard]] std::size_t byte_size() const;
void clear();
void resize(int width, int height);
void fill(Color color);
Pixel* row(int y);
const Pixel* row(int y) const;
[[nodiscard]] Image_View view() const;
struct Impl;
std::unique_ptr<Impl> impl_;
friend class Canvas;
};
} // namespace renderive