#include <ImagePacker.h>
Public Types | |
| enum | { GAP_METHOD_EXTEND_RGB = 0x00000001 , GAP_METHOD_GUTTER = 0x00000002 } |
Public Member Functions | |
| ImagePacker (void) | |
| virtual | ~ImagePacker (void) |
| Bool | init (void) |
| initialize the system | |
| Bool | process (void) |
| run the process | |
| Bool | getSettingsFromDialog (HWND dialog) |
| get the options for exection | |
| void | setWindowHandle (HWND hWnd) |
| set window handle for 'dialog' app | |
| HWND | getWindowHandle (void) |
| get window handle for 'dialog' app | |
| ICoord2D * | getTargetSize (void) |
| get target size | |
| Int | getTargetWidth (void) |
| get target width | |
| Int | getTargetHeight (void) |
| bet target height | |
| void | statusMessage (char *message) |
| set a status message | |
| UnsignedInt | getImageCount (void) |
| get image count | |
| ImageInfo * | getImage (Int index) |
| get image | |
| TexturePage * | getFirstTexturePage (void) |
| get first texture page | |
| UnsignedInt | getPageCount (void) |
| get the count of texutre pages | |
| void | setTargetPreviewPage (Int page) |
| set the target preview page to view | |
| Int | getTargetPreviewPage (void) |
| get the target preview page to view | |
| void | setGutter (UnsignedInt size) |
| set gutter size in pixels | |
| UnsignedInt | getGutter (void) |
| get gutter size in pixels | |
| void | setGapMethod (UnsignedInt methodBit) |
| set gap method option | |
| void | clearGapMethod (UnsignedInt methodBit) |
| clear gap method option | |
| UnsignedInt | getGapMethod (void) |
| get gap method option | |
| void | setOutputAlpha (Bool outputAlpha) |
| set output alpha option | |
| Bool | getOutputAlpha (void) |
| get output alpha option | |
| void | setPreviewWindow (HWND window) |
| assign preview window handle | |
| HWND | getPreviewWindow (void) |
| get the preview window handle | |
| void | setUseTexturePreview (Bool use) |
| use the real image data in preview | |
| Bool | getUseTexturePreview (void) |
| get texture preview option | |
| void | setINICreate (Bool create) |
| set create INI file option | |
| Bool | createINIFile (void) |
| get create INI option | |
| char * | getOutputFile (void) |
| get output filename | |
| char * | getOutputDirectory (void) |
| get output directory | |
| void | setCompressTextures (Bool compress) |
| set compress textures option | |
| Bool | getCompressTextures (void) |
| get compress textures option | |
Protected Member Functions | |
| void | setTargetSize (Int width, Int height) |
| set the size of the output target image | |
| Bool | checkOutputDirectory (void) |
| verify output directory is OK | |
| void | resetImageDirectoryList (void) |
| clear the image directory list | |
| void | resetImageList (void) |
| clear the image list | |
| void | resetPageList (void) |
| clear the texture page list | |
| void | addDirectory (char *path, Bool subDirs) |
| add directory to directory list | |
| void | addImagesInDirectory (char *dir) |
| add all images from the specified directory | |
| void | addImage (char *path) |
| add image to image list | |
| Bool | validateImages (void) |
| validate that the loaded images can all be processed | |
| Bool | packImages (void) |
| do the packing | |
| void | writeFinalTextures (void) |
| write the packed textures | |
| Bool | generateINIFile (void) |
| generate the INI file for this image set | |
| TexturePage * | createNewTexturePage (void) |
| create a new texture page | |
| void | sortImageList (void) |
| sort the image list | |
Protected Attributes | |
| HWND | m_hWnd |
| window handle for app | |
| ICoord2D | m_targetSize |
| the target size | |
| Bool | m_useSubFolders |
| use subfolders option | |
| char | m_outputFile [MAX_OUTPUT_FILE_LEN] |
| output filename | |
| char | m_outputDirectory [_MAX_PATH] |
| destination for texture files | |
| ImageDirectory * | m_dirList |
| the directory list | |
| UnsignedInt | m_dirCount |
| length of dirList | |
| UnsignedInt | m_imagesInDirs |
| number of images in all directories | |
| ImageInfo ** | m_imageList |
| the image list | |
| UnsignedInt | m_imageCount |
| length of imageList | |
| char | m_statusBuffer [1024] |
| for printing status messages | |
| TexturePage * | m_pageTail |
| end of the texture page list | |
| TexturePage * | m_pageList |
| the final images generated from the packer | |
| UnsignedInt | m_pageCount |
| length of page list | |
| UnsignedInt | m_gapMethod |
| gap method option bits | |
| UnsignedInt | m_gutterSize |
| gutter gaps between images in pixels | |
| Bool | m_outputAlpha |
| final image files will have an alpha channel | |
| Bool | m_createINI |
| create the INI file from compressed image data | |
| Int | m_targetPreviewPage |
| preview page we're looking at | |
| HWND | m_hWndPreview |
| the preview window | |
| Bool | m_showTextureInPreview |
| show actual texture in preview window | |
| Targa * | m_targa |
| targa for loading file headers | |
| Bool | m_compressTextures |
| compress the final textures | |
Definition at line 66 of file ImagePacker.h.
| anonymous enum |
| Enumerator | |
|---|---|
| GAP_METHOD_EXTEND_RGB | extend RGB (no alpha) of image on all sides |
| GAP_METHOD_GUTTER | put transparent gutter on right and bottom side of image |
Definition at line 71 of file ImagePacker.h.
| ImagePacker::ImagePacker | ( | void | ) |
Definition at line 1097 of file ImagePacker.cpp.
|
virtual |
Definition at line 1132 of file ImagePacker.cpp.
|
protected |
add directory to directory list
Add the directory to the directory list, do not add it if it is already in the directory list. We want to have that sanity check so that we can be assured that each image being added to the image list from each directory will be unique and we therefore don't have to do any further checking for duplicates
Definition at line 622 of file ImagePacker.cpp.
|
protected |
add image to image list
Add the image to the image list
Definition at line 788 of file ImagePacker.cpp.
|
protected |
add all images from the specified directory
Add all the images in the specified directory
Definition at line 362 of file ImagePacker.cpp.
|
protected |
verify output directory is OK
Verify that there are no files in the output directory ... if there are give the user the option to delete them, cancel the operation, or proceed with possibly overwriting any files there
Returns TRUE to proceed with the process, FALSE if the user wants to cancel the process
Definition at line 453 of file ImagePacker.cpp.
|
inline |
clear gap method option
Definition at line 208 of file ImagePacker.h.
|
inline |
get create INI option
Definition at line 202 of file ImagePacker.h.
|
protected |
create a new texture page
Create a new texture page and add to the list
Definition at line 77 of file ImagePacker.cpp.
|
protected |
generate the INI file for this image set
Generate the INI image file definition for the final packed images
Definition at line 864 of file ImagePacker.cpp.
|
inline |
get compress textures option
Definition at line 206 of file ImagePacker.h.
|
inline |
get first texture page
Definition at line 198 of file ImagePacker.h.
|
inline |
get gap method option
Definition at line 209 of file ImagePacker.h.
|
inline |
get gutter size in pixels
Definition at line 195 of file ImagePacker.h.
get image
Definition at line 188 of file ImagePacker.h.
|
inline |
get image count
Definition at line 187 of file ImagePacker.h.
|
inline |
get output alpha option
Definition at line 197 of file ImagePacker.h.
|
inline |
get output directory
Definition at line 204 of file ImagePacker.h.
|
inline |
get output filename
Definition at line 203 of file ImagePacker.h.
|
inline |
get the count of texutre pages
Definition at line 191 of file ImagePacker.h.
|
inline |
get the preview window handle
Definition at line 193 of file ImagePacker.h.
| Bool ImagePacker::getSettingsFromDialog | ( | HWND | dialog | ) |
get the options for exection
Given the current state of the option dialog passed in, get all the settings we need for the image packer from the GUI and validate them
Definition at line 948 of file ImagePacker.cpp.
|
inline |
bet target height
Definition at line 184 of file ImagePacker.h.
|
inline |
get the target preview page to view
Definition at line 190 of file ImagePacker.h.
|
inline |
get target size
Definition at line 182 of file ImagePacker.h.
|
inline |
get target width
Definition at line 183 of file ImagePacker.h.
|
inline |
get texture preview option
Definition at line 200 of file ImagePacker.h.
|
inline |
get window handle for 'dialog' app
Definition at line 186 of file ImagePacker.h.
| Bool ImagePacker::init | ( | void | ) |
initialize the system
Initialize the image packer system
Definition at line 1149 of file ImagePacker.cpp.
|
protected |
do the packing
Pack all the images in the image list, starting from the top and working from there
Definition at line 195 of file ImagePacker.cpp.
| Bool ImagePacker::process | ( | void | ) |
|
protected |
clear the image directory list
Clear the image directory list
Definition at line 584 of file ImagePacker.cpp.
|
protected |
|
protected |
|
inline |
set compress textures option
Definition at line 205 of file ImagePacker.h.
|
inline |
set gap method option
Definition at line 207 of file ImagePacker.h.
|
inline |
set gutter size in pixels
Definition at line 194 of file ImagePacker.h.
|
inline |
set create INI file option
Definition at line 201 of file ImagePacker.h.
|
inline |
set output alpha option
Definition at line 196 of file ImagePacker.h.
|
inline |
assign preview window handle
Definition at line 192 of file ImagePacker.h.
|
inline |
set the target preview page to view
Definition at line 189 of file ImagePacker.h.
set the size of the output target image
Definition at line 181 of file ImagePacker.h.
|
inline |
use the real image data in preview
Definition at line 199 of file ImagePacker.h.
|
inline |
set window handle for 'dialog' app
Definition at line 185 of file ImagePacker.h.
|
protected |
| void ImagePacker::statusMessage | ( | char * | message | ) |
set a status message
Status message for the program
Definition at line 1171 of file ImagePacker.cpp.
|
protected |
validate that the loaded images can all be processed
Check all the images in the image list, if any of them cannot be processed we will flag them as so. If we have some images that can't be processed, we will warn the user of these images and ask them whether or not to proceed.
Returns TRUE to proceed Returns FALSE to cancel build
Definition at line 122 of file ImagePacker.cpp.
|
protected |
write the packed textures
Generate and write the final textures to the output directory of the packed images along with a definition file for which images are where on the page
Definition at line 273 of file ImagePacker.cpp.
|
protected |
compress the final textures
Definition at line 174 of file ImagePacker.h.
|
protected |
create the INI file from compressed image data
Definition at line 167 of file ImagePacker.h.
|
protected |
length of dirList
Definition at line 156 of file ImagePacker.h.
|
protected |
the directory list
Definition at line 155 of file ImagePacker.h.
|
protected |
gap method option bits
Definition at line 164 of file ImagePacker.h.
|
protected |
gutter gaps between images in pixels
Definition at line 165 of file ImagePacker.h.
|
protected |
window handle for app
Definition at line 149 of file ImagePacker.h.
|
protected |
the preview window
Definition at line 170 of file ImagePacker.h.
|
protected |
length of imageList
Definition at line 159 of file ImagePacker.h.
|
protected |
the image list
Definition at line 158 of file ImagePacker.h.
|
protected |
number of images in all directories
Definition at line 157 of file ImagePacker.h.
|
protected |
final image files will have an alpha channel
Definition at line 166 of file ImagePacker.h.
|
protected |
destination for texture files
Definition at line 153 of file ImagePacker.h.
|
protected |
output filename
Definition at line 152 of file ImagePacker.h.
|
protected |
length of page list
Definition at line 163 of file ImagePacker.h.
|
protected |
the final images generated from the packer
Definition at line 162 of file ImagePacker.h.
|
protected |
end of the texture page list
Definition at line 161 of file ImagePacker.h.
|
protected |
show actual texture in preview window
Definition at line 171 of file ImagePacker.h.
|
protected |
for printing status messages
Definition at line 160 of file ImagePacker.h.
|
protected |
targa for loading file headers
Definition at line 173 of file ImagePacker.h.
|
protected |
preview page we're looking at
Definition at line 169 of file ImagePacker.h.
|
protected |
the target size
Definition at line 150 of file ImagePacker.h.
|
protected |
use subfolders option
Definition at line 151 of file ImagePacker.h.