24 #ifndef HDST_PTEX_MIPMAP_TEXTURE_LOADER_H
25 #define HDST_PTEX_MIPMAP_TEXTURE_LOADER_H
44 size_t targetMemory = 0,
45 bool seamlessMipmap =
true);
57 return (
int)_blocks.size();
60 return (
int)_pages.size();
109 uint16_t adjSizeDiffs;
112 void Generate(HdStPtexMipmapTextureLoader *loader, PtexTexture *ptex,
113 unsigned char *destination,
114 int bpp,
int width,
int maxLevels);
116 void SetSize(
unsigned char ulog2_,
unsigned char vlog2_,
bool mipmap);
118 int GetNumTexels()
const {
122 void guttering(HdStPtexMipmapTextureLoader *loader, PtexTexture *ptex,
124 unsigned char *pptr,
int bpp,
int stride);
126 static bool sort(
const Block *
a,
const Block *
b) {
127 return (a->height > b->height) ||
128 ((a->height == b->height) && (a->width > b->width));
131 static bool sortByArea(
const Block *a,
const Block *b) {
132 return (a->GetNumTexels() > b->GetNumTexels());
137 class CornerIterator;
139 void generateBuffers();
140 void optimizePacking(
int maxNumPages,
size_t targetMemory);
141 int getLevelDiff(
int face,
int edge);
142 bool getCornerPixel(
float *resultPixel,
int numchannels,
143 int face,
int edge, int8_t
res);
144 void sampleNeighbor(
unsigned char *
border,
146 int resampleBorder(
int face,
int edgeId,
unsigned char *
result,
147 int dstLength,
int bpp,
148 float srcStart = 0.0
f,
float srcEnd = 1.0
f);
150 std::vector<Block> _blocks;
151 std::vector<Page *> _pages;
156 int _pageWidth, _pageHeight;
158 unsigned char *_texelBuffer;
159 unsigned char *_layoutBuffer;
167 #endif // HDST_PTEX_MIPMAP_TEXTURE_LOADER_H
GLboolean GLboolean GLboolean b
GLint GLint GLsizei GLint border
size_t GetMemoryUsage() const
const unsigned char * GetLayoutBuffer() const
GLboolean GLboolean GLboolean GLboolean a
GLint GLsizei GLsizei height
GLuint GLsizei GLsizei * length
int GetPageHeight() const
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
#define PXR_NAMESPACE_CLOSE_SCOPE
HDST_API HdStPtexMipmapTextureLoader(PtexTexture *ptex, int maxNumPages, int maxLevels=-1, size_t targetMemory=0, bool seamlessMipmap=true)
GLint GLenum GLboolean GLsizei stride
const unsigned char * GetTexelBuffer() const
HDST_API ~HdStPtexMipmapTextureLoader()
void sort(I begin, I end, const Pred &pred)
GLenum GLuint GLint GLenum face