📄 mapsplitter.h
字号:
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation; either version 2 of the *
* License, or (at your option) any later version. *
* *
***************************************************************************/
/**
@file
MapSplitter.h
@brief
Utility that split big map in tiles, pre-calculate splatting by
pre-calculating coverage map and pre-calculate normals.
*/
#ifndef MapSplitter_H
#define MapSplitter_H
#include "Ogre.h"
#include "OgreImage.h"
#include "OgreString.h"
#include "OgreSingleton.h"
#include "OgrePagingLandScapeOptions.h"
#include "OgrePagingLandScapeData2D.h"
namespace Ogre
{
/**
* \ingroup Tool_MapSplitter
*
*
* \par untested on linux
*
* \version 0.2
* second version
*
* \date 06-07-2004
*
* \author tuan.kuranes@free.fr
*
* \todo
*
* \bug
*/
class MapSplitter
{
public :
MapSplitter();
~MapSplitter();
/*
* init parameters from option file
*/
void init ();
/**
*
* \param *newImage image to set as current
*/
void setCurrentMap (Image *newImage);
/**
*
* \param Filename of map to split and space
* \param tile_spacing Size of overlapping area of each splited tile
* \param tile_size Size of tiles once big map splited
*/
void SplitAndSpaceCurrentMap(String filename, int tile_spacing,
int tile_size);
/**
*
* \param Filename of map to split
* \param tile_size Size of tiles once big map splited
*/
void SplitCurrentMap(String filename, int tile_size);
/**
*
* \param Filename of map to split
* \param Image Image to split
*/
void saveAndSplitMap (String filename, Image *newImage);
/**
* Split and Space it
* \param Filename of map to split
* \param Image Image to split
*/
void saveAndSpaceAndSplitMap (String filename, Image *newImage);
/**
*
* \param filename Filename of currentMap to save as image
* \return
*/
const bool saveCurrentMap (String filename);
private :
/**
* make sure mTilesize is 2^n
*/
void ComputeTileSize();
/**
* copy a rect of source image into a new image.
* \param *BaseData image data source
* \param *OutData image data destination to copy data to
* \param x position in image data source width
* \param y position in image data source height
* \param tile_width width of image data destination
* \param tile_height height of image data destination
* \param tile_width_copy width of image data source being copied
* \param tile_height_copy height of image data source being copied
* \param base_width width of image data source
* \param bpp Number of Bytes Per Pixel of two image (must be the same)
*/
void BlitSubImage (uchar *BaseData, uchar *OutData, uint x, uint y,
uint tile_width, uint tile_height,
uint tile_width_copy, uint tile_height_copy,
uint base_width, uint bpp);
/**
*
* \param filename Filename of Map to save as image file
* \param data Pixel data to save
* \param width Final width of image
* \param height Final height of image
* \param NumBytesPP number of Bytes per pixel
* \return true if done.
*/
const bool save(String filename, uchar* data,
uint width, uint height,
uint NumBytesPP);
/**
*
* \param filename Filename of Map to save as image file
* \param data Pixel data to save
* \param width Final width of image
* \param height Final height of image
* \param NumBytesPP number of Bytes per pixel
* \return true if done.
*/
const bool saveExt(String filename, uchar* data,
uint width, uint height,
uint NumBytesPP);
/**
*
* \param filename Filename of currentMap to save as image
* \return
*/
const bool saveCurrentMapAsExt(String filename);
/**
*
* \param filename Filename of Map to save as image file
* \param data Pixel data to save
* \param width Final width of image
* \param height Final height of image
* \param NumBytesPP number of Bytes per pixel
* \return true if done.
*/
const bool saveRaw(String filename, uchar* data,
uint width, uint height,
uint NumBytesPP);
/**
*
* \param filename Filename of currentMap to save as image
* \return
*/
const bool saveCurrentMapAsRaw(String filename);
bool b_SaveAsRaw;
bool b_SaveAsExt;
bool b_SaveBigFile;
uint mTileSize;
uint mTileSpacing;
String OutDirectory;
Image *mCurrentMap;
};
}
#endif //MapSplitter_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -