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);
102 virtual void addMetaData(
const char* key, MetaDataType t,
const void* value,
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);
141 virtual void addMetaData(
const char* key, MetaDataType t,
const void* value,
int size)
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);
#define PTEX_NAMESPACE_END
Public API classes for reading, writing, caching, and filtering Ptex files.
virtual bool close(Ptex::String &error)
Close the file.
virtual bool writeConstantFace(int faceid, const FaceInfo &f, const void *data)
virtual ~PtexIncrWriter()
virtual bool writeFace(int faceid, const FaceInfo &f, const void *data, int stride)
void generateReductions()
std::vector< uint8_t > _constdata
std::vector< uint32_t > _rfaceids
virtual bool close(Ptex::String &error)
Close the file.
virtual bool writeConstantFace(int faceid, const FaceInfo &f, const void *data)
std::vector< uint32_t > _faceids_r
void storeConstValue(int faceid, const void *data, int stride, Res res)
std::vector< FaceInfo > _faceinfo
virtual void addMetaData(const char *key, MetaDataType t, const void *value, int size)
void writeMetaData(FILE *fp)
virtual ~PtexMainWriter()
static const int MinReductionLog2
virtual bool writeFace(int faceid, const FaceInfo &f, const void *data, int stride)
std::vector< FilePos > _rpos
std::vector< LevelRec > _levels
void flagConstantNeighorhoods()
Interface for reading data from a ptex file.
std::map< std::string, int > _metamap
DataType datatype() const
int writeBlank(FILE *fp, int size)
virtual void setEdgeFilterMode(Ptex::EdgeFilterMode edgeFilterMode)
Set edge filter mode.
int copyBlock(FILE *dst, FILE *src, FilePos pos, int size)
void setError(const std::string &error)
int writeZipBlock(FILE *fp, const void *data, int size, bool finish=true)
virtual void writeMeta(const char *key, const char *value)
Write a string as meta data.
virtual void addMetaData(const char *key, MetaDataType t, const void *value, int size)
virtual void release()
Release resources held by this pointer (pointer becomes invalid).
int writeBlock(FILE *fp, const void *data, int size)
virtual bool close(Ptex::String &error)
Close the file.
void writeFaceData(FILE *fp, const void *data, int stride, Res res, FaceDataHeader &fdh)
int readBlock(FILE *fp, void *data, int size)
std::vector< MetaEntry > _metadata
void writeConstFaceBlock(FILE *fp, const void *data, FaceDataHeader &fdh)
int writeMetaDataBlock(FILE *fp, MetaEntry &val)
PtexUtils::ReduceFn * _reduceFn
void writeReduction(FILE *fp, const void *data, int stride, Res res)
bool storeFaceInfo(int faceid, FaceInfo &dest, const FaceInfo &src, int flags=0)
virtual void setBorderModes(Ptex::BorderMode uBorderMode, Ptex::BorderMode vBorderMode)
Set border modes.
virtual ~PtexWriterBase()
void getError(Ptex::String &error)
bool ok(Ptex::String &error)
void writeFaceBlock(FILE *fp, const void *data, int stride, Res res, FaceDataHeader &fdh)
Res calcTileRes(Res faceres)
Interface for writing data to a ptex file.
void ReduceFn(const void *src, int sstride, int ures, int vres, void *dst, int dstride, DataType dt, int nchannels)
DataType
Type of data stored in texture file.
MeshType
Type of base mesh for which the textures are defined.
BorderMode
How to handle mesh border when filtering.
EdgeFilterMode
How to handle transformation across edges when filtering.
std::vector< FilePos > pos
std::vector< FaceDataHeader > fdh
std::vector< uint8_t > data