1. Jason McKesson
  2. gltut


gltut / glimg / include / glimg / ImageCreator.h


#include <string>
#include <vector>
#include <exception>
#include "ImageSet.h"
#include "ImageCreatorExceptions.h"

namespace glimg
	///\addtogroup module_glimg_creation
	namespace detail
		struct SimpleImage
			const void *pData;
			int arrayIx;
			int mipmapIx;
			int faceIx;

		struct FullLayerImage
			const void *pData;
			int mipmapIx;

	\brief Used to destroy all of the memory provided to the image creation routines.
	class MemoryObject
		virtual ~MemoryObject() {}

	///Do not use. Not mature enough yet.
	class ImageCreator
		ImageCreator(MemoryObject *pObject, Dimensions dimensions, int arrayCount, int mipmapCount,
			int faceCount, ImageFormat format);


		void AddImage(const void *pixelData, int arrayIx, int mipmapIx, int faceIx);

		//Adds an array of image data in a single go, specifying an entire mipmap layer.
		//The expected order of the image data is as follows. Each array in the image
		//contain X faces, where X is the faceCount.
		void AddImage(const void *pixelData, int mipmapIx);

		ImageSet *CreateImage();

		Dimensions m_dimensions;
		ImageFormat m_format;
		MemoryObject *m_pObject;
		int m_arrayCount;
		int m_mipmapCount;
		int m_faceCount;

		std::vector<detail::SimpleImage> m_simpleImages;
		std::vector<detail::FullLayerImage> m_fullLayerImages;