diff options
| author | Dylan <boss@tehbox.org> | 2025-10-07 18:45:28 +1300 |
|---|---|---|
| committer | Dylan <boss@tehbox.org> | 2025-10-07 19:31:32 +1300 |
| commit | 328e2464c81b0dfce623d4fbe9617ef79d6ed3c1 (patch) | |
| tree | ecccb3c6583640af4792efa93ff280f17b4f707a /src/image.cpp | |
| parent | 308b65134bd9d185741a612bfad3cca80ddddc48 (diff) | |
| download | tehimage-328e2464c81b0dfce623d4fbe9617ef79d6ed3c1.tar.gz tehimage-328e2464c81b0dfce623d4fbe9617ef79d6ed3c1.zip | |
feat: Added cpp namespacev0.0.2
All functions and classes are now behind the cpp namespace `TehImage`
Diffstat (limited to 'src/image.cpp')
| -rw-r--r-- | src/image.cpp | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/src/image.cpp b/src/image.cpp index 77fe63c..e20b05e 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -2,24 +2,29 @@ #include <algorithm> #include <cstdint> -Image::Image(const Image& other) +namespace TehImage { - this->colorValues = other.colorValues; - this->bpp = other.bpp; + + Image::Image(const Image& other) + { + this->colorValues = other.colorValues; + this->bpp = other.bpp; - this->width = other.width; - this->height = other.height; - this->bitDepth = other.bitDepth; - this->colorType = other.colorType; - this->compressionMethod = other.compressionMethod; - this->filterMethod = other.filterMethod; - this->interlaceMethod = other.interlaceMethod; + this->width = other.width; + this->height = other.height; + this->bitDepth = other.bitDepth; + this->colorType = other.colorType; + this->compressionMethod = other.compressionMethod; + this->filterMethod = other.filterMethod; + this->interlaceMethod = other.interlaceMethod; - pixels = std::make_unique<Pixel[]>(width*height); - std::copy_n(other.pixels.get(), width*height, pixels.get()); -} + pixels = std::make_unique<Pixel[]>(width*height); + std::copy_n(other.pixels.get(), width*height, pixels.get()); + } -Pixel& Image::operator[](int x, int y) -{ - return pixels[x + y*width]; -}; + Pixel& Image::operator[](int x, int y) + { + return pixels[x + y*width]; + }; + +} |
