mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-20 16:15:43 +00:00
ObjCommon: WIP: ImageData
This commit is contained in:
parent
c67911bdbb
commit
dde77901a3
23
src/ObjCommon/Image/IImageData.h
Normal file
23
src/ObjCommon/Image/IImageData.h
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "ImageFormat.h"
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
class IImageData
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual ~IImageData() = default;
|
||||||
|
|
||||||
|
virtual unsigned GetWidth() = 0;
|
||||||
|
virtual unsigned GetHeight() = 0;
|
||||||
|
virtual unsigned GetDepth() = 0;
|
||||||
|
|
||||||
|
virtual ImageFormat* GetFormat() = 0;
|
||||||
|
|
||||||
|
virtual size_t GetSizeOfMipLevel(unsigned mipLevel) = 0;
|
||||||
|
virtual uint8_t* GetDataForMipLevel(unsigned mipLevel) = 0;
|
||||||
|
|
||||||
|
virtual bool HasMipMaps() = 0;
|
||||||
|
virtual int GetMipMapCount() = 0;
|
||||||
|
virtual void GenerateMipMaps() = 0;
|
||||||
|
virtual void DiscardMipMaps() = 0;
|
||||||
|
};
|
0
src/ObjCommon/Image/ImageDataIWI.cpp
Normal file
0
src/ObjCommon/Image/ImageDataIWI.cpp
Normal file
16
src/ObjCommon/Image/ImageDataIWI.h
Normal file
16
src/ObjCommon/Image/ImageDataIWI.h
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "IImageData.h"
|
||||||
|
|
||||||
|
class ImageDataIWI final : public IImageData
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ImageFormat* GetFormat() override;
|
||||||
|
|
||||||
|
size_t GetSizeOfMipLevel(unsigned mipLevel) override;
|
||||||
|
uint8_t* GetDataForMipLevel(unsigned mipLevel) override;
|
||||||
|
|
||||||
|
bool HasMipMaps() override;
|
||||||
|
int GetMipMapCount() override;
|
||||||
|
void GenerateMipMaps() override;
|
||||||
|
void DiscardMipMaps() override;
|
||||||
|
};
|
0
src/ObjCommon/Image/ImageFormat.cpp
Normal file
0
src/ObjCommon/Image/ImageFormat.cpp
Normal file
19
src/ObjCommon/Image/ImageFormat.h
Normal file
19
src/ObjCommon/Image/ImageFormat.h
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <dxgiformat.h>
|
||||||
|
|
||||||
|
class IImageFormat
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual DXGI_FORMAT GetDXGIFormat() = 0;
|
||||||
|
virtual size_t GetSizeForMipLevel(unsigned mipLevel, unsigned width, unsigned height, unsigned depth);
|
||||||
|
};
|
||||||
|
|
||||||
|
class ImageFormat
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ImageFormat(unsigned bitPerPixel, unsigned rOffset, unsigned rSize, unsigned gOffset, unsigned gSize, unsigned bOffset, unsigned bSize, unsigned aOffset, unsigned aSize);
|
||||||
|
|
||||||
|
DXGI_FORMAT GetDXGIFormat();
|
||||||
|
size_t GetSizeForMipLevel(unsigned mipLevel, unsigned width, unsigned height, unsigned depth);
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user