VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions
makVrv::DtMeifConverter Class Reference

Class responsible for converting images into MAK encrypted image files.

Classes

struct  CompositeImage
 

Public Types

enum  EffectTextureType { None, NormalMap, Emissive }
 
typedef std::vector
< CompositeImage
ImageList
 

Public Member Functions

 DtMeifConverter ()
 
virtual ~DtMeifConverter ()
 
bool createEncryptedImage (const std::string &filename, const std::string &outputFile, const osgDB::ReaderWriter::Options *options, bool flipOutputImage, EffectTextureType textureType, bool verbose, bool generate_dds)
 
bool createCompressedImage (osg::ref_ptr< osg::Image > &img, const std::string &inputFilename, const std::string &outputFile, bool flipOutputImage, EffectTextureType textureType, bool generateMipMaps, int qualityLevel, bool verbose, bool generate_dds)
 
bool startTBBCompressionTaskIfPossible (osg::Image *image)
 
void resizeImageIfNeeded (osg::ref_ptr< osg::Image > &img)
 
void write_and_compress_dds_data (FILE *file, const struct DDS_HEADER &ddsHeader, unsigned int blockDataSize, unsigned char *blockData)
 
bool compositeImages (const ImageList &files, const std::string &outputFile, int outputWidth, int outputHeight, int cols, int rows, bool forceNoAlpha, bool composeRowsTopToBottom, bool verbose)
 
EffectTextureType effectTextureType (const std::string &filename) const
 
virtual void setupCompressionFormat (osg::ref_ptr< osg::Image > &img, DtMeifConverter::EffectTextureType textureType, osg::ref_ptr< osg::Texture > &texture)
 
void resizeImagePow2 (osg::Image *img, int newW, int newH)
 
bool createBinaryData (unsigned int compressedFormat, osg::ref_ptr< osg::Image > &img, bool mipMaps, int qualityLevel, bool verbose, unsigned int &blockDataSize, unsigned char *&blockData, bool &deleteBlockData, osg::Image::MipmapDataType &mipOffsets)
 

Static Public Member Functions

static bool convertToRGBA (osg::ref_ptr< osg::Image > &img, unsigned char *&rgbaPixels, bool &deletePixels, bool verbose)
 
static bool isPowerOf2 (unsigned int i)
 
static unsigned int nextPowerOf2 (unsigned int i)
 
static unsigned int logBase2 (unsigned int i)
 

Private Member Functions

 DtMeifConverter (const DtMeifConverter &other)
 
DtMeifConverteroperator= (const DtMeifConverter &other)
 

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
None 
NormalMap 
Emissive 

Constructor & Destructor Documentation

makVrv::DtMeifConverter::DtMeifConverter ( )

CTOR.

virtual makVrv::DtMeifConverter::~DtMeifConverter ( )
virtual

DTOR.

makVrv::DtMeifConverter::DtMeifConverter ( const DtMeifConverter other)
private

Copy Constructor not implemented – Copy Not Allowed.

Member Function Documentation

DtMeifConverter& makVrv::DtMeifConverter::operator= ( const DtMeifConverter other)
private

Assignment Operator Not implemented – Assignment Not Allowed.

bool makVrv::DtMeifConverter::createEncryptedImage ( const std::string &  filename,
const std::string &  outputFile,
const osgDB::ReaderWriter::Options *  options,
bool  flipOutputImage,
EffectTextureType  textureType,
bool  verbose,
bool  generate_dds 
)

Encrypt a image from a file. options = null means use default behavior (ex. for medftool)

bool makVrv::DtMeifConverter::createCompressedImage ( osg::ref_ptr< osg::Image > &  img,
const std::string &  inputFilename,
const std::string &  outputFile,
bool  flipOutputImage,
EffectTextureType  textureType,
bool  generateMipMaps,
int  qualityLevel,
bool  verbose,
bool  generate_dds 
)

Create a compressed image.

bool makVrv::DtMeifConverter::startTBBCompressionTaskIfPossible ( osg::Image *  image)

checks to see if there is a thread available for starting a compression task and starts the task if there is

void makVrv::DtMeifConverter::resizeImageIfNeeded ( osg::ref_ptr< osg::Image > &  img)
void makVrv::DtMeifConverter::write_and_compress_dds_data ( FILE *  file,
const struct DDS_HEADER &  ddsHeader,
unsigned int  blockDataSize,
unsigned char blockData 
)
bool makVrv::DtMeifConverter::compositeImages ( const ImageList files,
const std::string &  outputFile,
int  outputWidth,
int  outputHeight,
int  cols,
int  rows,
bool  forceNoAlpha,
bool  composeRowsTopToBottom,
bool  verbose 
)

Composite images together, the list of files is in row major order.

static bool makVrv::DtMeifConverter::convertToRGBA ( osg::ref_ptr< osg::Image > &  img,
unsigned char *&  rgbaPixels,
bool deletePixels,
bool  verbose 
)
static

Convert an image to a buffer of RGBA pixels.

EffectTextureType makVrv::DtMeifConverter::effectTextureType ( const std::string &  filename) const

Return type of effect texture from filename.

virtual void makVrv::DtMeifConverter::setupCompressionFormat ( osg::ref_ptr< osg::Image > &  img,
DtMeifConverter::EffectTextureType  textureType,
osg::ref_ptr< osg::Texture > &  texture 
)
virtual
void makVrv::DtMeifConverter::resizeImagePow2 ( osg::Image *  img,
int  newW,
int  newH 
)

Resizes the image to the next power of 2.

bool makVrv::DtMeifConverter::createBinaryData ( unsigned int  compressedFormat,
osg::ref_ptr< osg::Image > &  img,
bool  mipMaps,
int  qualityLevel,
bool  verbose,
unsigned int blockDataSize,
unsigned char *&  blockData,
bool deleteBlockData,
osg::Image::MipmapDataType &  mipOffsets 
)

Create the raw binary data to write out.

static bool makVrv::DtMeifConverter::isPowerOf2 ( unsigned int  i)
inlinestatic
static unsigned int makVrv::DtMeifConverter::nextPowerOf2 ( unsigned int  i)
inlinestatic
static unsigned int makVrv::DtMeifConverter::logBase2 ( unsigned int  i)
inlinestatic

The documentation for this class was generated from the following file:

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)