16 #include <osg/ref_ptr>
18 #include <osgDB/ReaderWriter>
48 bool createEncryptedImage(
const std::string&
filename,
49 const std::string& outputFile,
const osgDB::ReaderWriter::Options* options,
50 bool flipOutputImage,
bool normalMap,
bool verbose);
53 bool createCompressedImage( osg::ref_ptr<osg::Image> img,
54 const std::string &outputFile,
bool flipOutputImage,
bool normalMap,
55 bool generateMipMaps,
bool verbose );
58 bool compositeImages(
const ImageList& files,
59 const std::string& outputFile,
int outputWidth,
int outputHeight,
60 int cols,
int rows,
bool forceNoAlpha,
bool composeRowsTopToBottom,
64 static bool convertToRGBA( osg::ref_ptr<osg::Image> img,
65 unsigned char*& rgbaPixels,
bool& deletePixels,
bool verbose );
68 void resizeImagePow2(osg::Image* img);
71 bool createBinaryData(
unsigned int compressedFormat,
72 osg::ref_ptr<osg::Image> img,
bool mipMaps,
bool verbose,
73 unsigned int& blockDataSize,
unsigned char*& blockData,
74 bool& deleteBlockData );
77 inline static bool isPowerOf2(
unsigned int i)
79 return !( i & (i - 1)) && i;
83 inline static unsigned int nextPowerOf2(
unsigned int i)
95 inline static unsigned int logBase2(
unsigned int i)
97 static const int MultiplyDeBruijnBitPosition[32] =
99 0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30,
100 8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31
103 return MultiplyDeBruijnBitPosition[((nextPowerOf2(i + 1) - 1) * 0x07C4ACDDU) >> 27];