Go to the documentation of this file.
61 virtual void writeMeta(
const char* key,
const char* value);
62 virtual void writeMeta(
const char* key,
const int8_t* value,
int count);
63 virtual void writeMeta(
const char* key,
const int16_t* value,
int count);
64 virtual void writeMeta(
const char* key,
const int32_t* value,
int count);
65 virtual void writeMeta(
const char* key,
const float* value,
int count);
66 virtual void writeMeta(
const char* key,
const double* value,
int count);
92 int nchannels,
int alphachan,
int nfaces,
97 int writeBlock(FILE* fp,
const void* data,
int size);
99 int readBlock(FILE* fp,
void* data,
int size);
104 void writeFaceBlock(FILE* fp,
const void* data,
int stride, Res res,
106 void writeFaceData(FILE* fp,
const void* data,
int stride, Res res,
108 void writeReduction(FILE* fp,
const void* data,
int stride, Res res);
111 bool storeFaceInfo(
int faceid, FaceInfo& dest,
const FaceInfo& src,
int flags=0);
133 int nchannels,
int alphachan,
int nfaces,
bool genmipmaps);
136 virtual bool writeFace(
int faceid,
const FaceInfo& f,
const void* data,
int stride);
151 void storeConstValue(
int faceid,
const void* data,
int stride, Res res);
172 std::vector<FaceDataHeader>
fdh;
185 int nchannels,
int alphachan,
int nfaces);
188 virtual bool writeFace(
int faceid,
const FaceInfo& f,
const void* data,
int stride);
bool storeFaceInfo(int faceid, FaceInfo &dest, const FaceInfo &src, int flags=0)
Res calcTileRes(Res faceres)
virtual bool writeFace(int faceid, const FaceInfo &f, const void *data, int stride)
virtual void writeMeta(const char *key, const char *value)
Write a string as meta data.
std::map< std::string, int > _metamap
std::vector< LevelRec > _levels
virtual void addMetaData(const char *key, MetaDataType t, const void *value, int size)
void writeReduction(FILE *fp, const void *data, int stride, Res res)
void writeConstFaceBlock(FILE *fp, const void *data, FaceDataHeader &fdh)
#define PTEX_NAMESPACE_END
void getError(Ptex::String &error)
std::vector< uint32_t > _faceids_r
void ReduceFn(const void *src, int sstride, int ures, int vres, void *dst, int dstride, DataType dt, int nchannels)
virtual ~PtexWriterBase()
bool ok(Ptex::String &error)
int writeZipBlock(FILE *fp, const void *data, int size, bool finish=true)
int writeMetaDataBlock(FILE *fp, MetaEntry &val)
virtual bool close(Ptex::String &error)
Close the file.
virtual void setBorderModes(Ptex::BorderMode uBorderMode, Ptex::BorderMode vBorderMode)
Set border modes.
static const int MinReductionLog2
void writeFaceData(FILE *fp, const void *data, int stride, Res res, FaceDataHeader &fdh)
void generateReductions()
std::vector< FilePos > _rpos
DataType
Type of data stored in texture file.
void storeConstValue(int faceid, const void *data, int stride, Res res)
std::vector< FaceDataHeader > fdh
int copyBlock(FILE *dst, FILE *src, FilePos pos, int size)
std::vector< uint8_t > _constdata
virtual bool writeFace(int faceid, const FaceInfo &f, const void *data, int stride)
PtexMainWriter(const char *path, PtexTexture *tex, Ptex::MeshType mt, Ptex::DataType dt, int nchannels, int alphachan, int nfaces, bool genmipmaps)
virtual bool writeConstantFace(int faceid, const FaceInfo &f, const void *data)
virtual ~PtexIncrWriter()
PtexIncrWriter(const char *path, FILE *fp, Ptex::MeshType mt, Ptex::DataType dt, int nchannels, int alphachan, int nfaces)
void flagConstantNeighorhoods()
virtual ~PtexMainWriter()
Interface for writing data to a ptex file.
MetaDataType
Type of meta data entry.
int writeBlank(FILE *fp, int size)
DataType datatype() const
void setError(const std::string &error)
Interface for reading data from a ptex file.
virtual void setEdgeFilterMode(Ptex::EdgeFilterMode edgeFilterMode)
Set edge filter mode.
std::vector< MetaEntry > _metadata
EdgeFilterMode
How to handle transformation across edges when filtering.
virtual void addMetaData(const char *key, MetaDataType t, const void *value, int size)
void writeMetaData(FILE *fp)
std::vector< FilePos > pos
virtual bool close(Ptex::String &error)
Close the file.
std::vector< uint32_t > _rfaceids
int writeBlock(FILE *fp, const void *data, int size)
int readBlock(FILE *fp, void *data, int size)
std::vector< uint8_t > data
void writeFaceBlock(FILE *fp, const void *data, int stride, Res res, FaceDataHeader &fdh)
PtexUtils::ReduceFn * _reduceFn
Public API classes for reading, writing, caching, and filtering Ptex files.
BorderMode
How to handle mesh border when filtering.
PtexWriterBase(const char *path, Ptex::MeshType mt, Ptex::DataType dt, int nchannels, int alphachan, int nfaces, bool compress)
virtual bool writeConstantFace(int faceid, const FaceInfo &f, const void *data)
MeshType
Type of base mesh for which the textures are defined.
std::vector< FaceInfo > _faceinfo
virtual void release()
Release resources held by this pointer (pointer becomes invalid).
virtual bool close(Ptex::String &error)
Close the file.