16 #include <osg/ref_ptr>
46 bool createEncryptedImage(
const std::string& filename,
47 const std::string& outputFile,
bool flipOutputImage,
bool normalMap,
51 bool createCompressedImage( osg::ref_ptr<osg::Image> img,
52 const std::string &outputFile,
bool flipOutputImage,
bool normalMap,
53 bool generateMipMaps,
bool verbose );
56 bool compositeImages(
const ImageList& files,
57 const std::string& outputFile,
int outputWidth,
int outputHeight,
58 int cols,
int rows,
bool forceNoAlpha,
bool composeRowsTopToBottom,
62 static bool convertToRGBA( osg::ref_ptr<osg::Image> img,
63 unsigned char*& rgbaPixels,
bool& deletePixels,
bool verbose );
66 void resizeImagePow2(osg::Image* img);
69 bool createBinaryData(
unsigned int compressedFormat,
70 osg::ref_ptr<osg::Image> img,
bool mipMaps,
bool verbose,
71 unsigned int& blockDataSize,
unsigned char*& blockData,
72 bool& deleteBlockData );
75 inline static bool isPowerOf2(
unsigned int i)
77 return !( i & (i - 1)) && i;
81 inline static unsigned int nextPowerOf2(
unsigned int i)
93 inline static unsigned int logBase2(
unsigned int i)
95 static const int MultiplyDeBruijnBitPosition[32] =
97 0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30,
98 8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31
101 return MultiplyDeBruijnBitPosition[((nextPowerOf2(i + 1) - 1) * 0x07C4ACDDU) >> 27];