VR-Forces 4.7 Class Documentation
 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
makVrv::DtMeifConverter Class Reference

Class responsible for converting images into MAK encrypted image files. More...

Classes

struct  CompositeImage

Public Types

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

Public Member Functions

 DtMeifConverter ()
 CTOR.
virtual ~DtMeifConverter ()
 DTOR.
bool 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.
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)
 Create a compressed 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)
 Composite images together, the list of files is in row major order.
EffectTextureType effectTextureType (const std::string &filename) const
 Return type of effect texture from filename.
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)
 Resizes the image to the next power of 2.
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)
 Create the raw binary data to write out.

Static Public Member Functions

static bool convertToRGBA (osg::ref_ptr< osg::Image > img, unsigned char *&rgbaPixels, bool &deletePixels, bool verbose)
 Convert an image to a buffer of RGBA pixels.
static bool isPowerOf2 (unsigned int i)
static unsigned int nextPowerOf2 (unsigned int i)
static unsigned int logBase2 (unsigned int i)

Detailed Description

Class responsible for converting images into MAK encrypted image files.

Member Typedef Documentation

Member Enumeration Documentation

Enumerator:
None 
NormalMap 
Emissive 

Constructor & Destructor Documentation

makVrv::DtMeifConverter::DtMeifConverter ( )

CTOR.

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

DTOR.

Member Function Documentation

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.

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 Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)