2010-08-02 10:58:00 +08:00
|
|
|
/****************************************************************************
|
2014-01-07 11:25:07 +08:00
|
|
|
Copyright (c) 2010-2012 cocos2d-x.org
|
2018-01-29 16:25:32 +08:00
|
|
|
Copyright (c) 2013-2016 Chukong Technologies Inc.
|
|
|
|
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
|
2010-08-02 10:58:00 +08:00
|
|
|
|
2022-10-01 16:24:52 +08:00
|
|
|
https://axmolengine.github.io/
|
2010-08-02 10:58:00 +08:00
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
THE SOFTWARE.
|
|
|
|
****************************************************************************/
|
2010-07-27 13:47:29 +08:00
|
|
|
|
2010-09-03 14:40:48 +08:00
|
|
|
#include <string.h>
|
2010-07-19 10:50:47 +08:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
2016-03-20 21:53:44 +08:00
|
|
|
#include "base/TGAlib.h"
|
2023-06-11 13:08:08 +08:00
|
|
|
#include "base/Data.h"
|
|
|
|
#include "platform/FileUtils.h"
|
2010-07-19 10:50:47 +08:00
|
|
|
|
2022-07-11 17:50:21 +08:00
|
|
|
NS_AX_BEGIN
|
2010-07-19 10:50:47 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
static bool tgaLoadRLEImageData(unsigned char* Buffer, uint32_t bufSize, tImageTGA* info);
|
|
|
|
void tgaFlipImage(tImageTGA* info);
|
2011-07-08 14:15:51 +08:00
|
|
|
|
2010-11-29 10:49:43 +08:00
|
|
|
// load the image header field from stream
|
2021-12-25 10:04:45 +08:00
|
|
|
bool tgaLoadHeader(unsigned char* buffer, uint32_t bufSize, tImageTGA* info)
|
2010-11-29 10:49:43 +08:00
|
|
|
{
|
2013-12-18 18:51:36 +08:00
|
|
|
bool ret = false;
|
2010-07-19 10:50:47 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
do
|
2010-11-29 10:49:43 +08:00
|
|
|
{
|
|
|
|
size_t step = sizeof(unsigned char) * 2;
|
2022-07-15 19:17:01 +08:00
|
|
|
AX_BREAK_IF((step + sizeof(unsigned char)) > bufSize);
|
2013-12-18 18:51:36 +08:00
|
|
|
memcpy(&info->type, buffer + step, sizeof(unsigned char));
|
2010-07-19 10:50:47 +08:00
|
|
|
|
2010-11-29 10:49:43 +08:00
|
|
|
step += sizeof(unsigned char) * 2;
|
|
|
|
step += sizeof(signed short) * 4;
|
2022-07-15 19:17:01 +08:00
|
|
|
AX_BREAK_IF((step + sizeof(signed short) * 2 + sizeof(unsigned char)) > bufSize);
|
2013-12-18 18:51:36 +08:00
|
|
|
memcpy(&info->width, buffer + step, sizeof(signed short));
|
|
|
|
memcpy(&info->height, buffer + step + sizeof(signed short), sizeof(signed short));
|
|
|
|
memcpy(&info->pixelDepth, buffer + step + sizeof(signed short) * 2, sizeof(unsigned char));
|
2010-07-19 10:50:47 +08:00
|
|
|
|
2010-11-29 10:49:43 +08:00
|
|
|
step += sizeof(unsigned char);
|
|
|
|
step += sizeof(signed short) * 2;
|
2022-07-15 19:17:01 +08:00
|
|
|
AX_BREAK_IF((step + sizeof(unsigned char)) > bufSize);
|
2010-11-29 10:49:43 +08:00
|
|
|
unsigned char cGarbage;
|
2013-12-18 18:51:36 +08:00
|
|
|
memcpy(&cGarbage, buffer + step, sizeof(unsigned char));
|
2010-07-19 10:50:47 +08:00
|
|
|
|
2013-12-18 18:51:36 +08:00
|
|
|
info->flipped = 0;
|
2021-12-25 10:04:45 +08:00
|
|
|
if (cGarbage & 0x20)
|
2010-11-29 10:49:43 +08:00
|
|
|
{
|
2013-12-18 18:51:36 +08:00
|
|
|
info->flipped = 1;
|
2010-11-29 10:49:43 +08:00
|
|
|
}
|
2013-12-18 18:51:36 +08:00
|
|
|
ret = true;
|
2010-11-29 10:49:43 +08:00
|
|
|
} while (0);
|
2010-07-19 10:50:47 +08:00
|
|
|
|
2013-12-18 18:51:36 +08:00
|
|
|
return ret;
|
2010-07-19 10:50:47 +08:00
|
|
|
}
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
bool tgaLoadImageData(unsigned char* Buffer, uint32_t bufSize, tImageTGA* info)
|
2010-11-29 10:49:43 +08:00
|
|
|
{
|
2013-12-18 18:51:36 +08:00
|
|
|
bool ret = false;
|
2010-11-29 10:49:43 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
do
|
2010-11-29 10:49:43 +08:00
|
|
|
{
|
2021-12-25 10:04:45 +08:00
|
|
|
int mode, total, i;
|
2010-11-29 10:49:43 +08:00
|
|
|
unsigned char aux;
|
|
|
|
size_t step = (sizeof(unsigned char) + sizeof(signed short)) * 6;
|
|
|
|
|
|
|
|
// mode equal the number of components for each pixel
|
2013-12-18 18:51:36 +08:00
|
|
|
mode = info->pixelDepth / 8;
|
2010-11-29 10:49:43 +08:00
|
|
|
// total is the number of unsigned chars we'll have to read
|
2013-12-18 18:51:36 +08:00
|
|
|
total = info->height * info->width * mode;
|
2010-11-29 10:49:43 +08:00
|
|
|
|
|
|
|
size_t dataSize = sizeof(unsigned char) * total;
|
2022-07-15 19:17:01 +08:00
|
|
|
AX_BREAK_IF((step + dataSize) > bufSize);
|
2013-12-18 18:51:36 +08:00
|
|
|
memcpy(info->imageData, Buffer + step, dataSize);
|
2010-11-29 10:49:43 +08:00
|
|
|
|
|
|
|
// mode=3 or 4 implies that the image is RGB(A). However TGA
|
|
|
|
// stores it as BGR(A) so we'll have to swap R and B.
|
|
|
|
if (mode >= 3)
|
|
|
|
{
|
2021-12-25 10:04:45 +08:00
|
|
|
for (i = 0; i < total; i += mode)
|
2010-11-29 10:49:43 +08:00
|
|
|
{
|
2021-12-25 10:04:45 +08:00
|
|
|
aux = info->imageData[i];
|
|
|
|
info->imageData[i] = info->imageData[i + 2];
|
|
|
|
info->imageData[i + 2] = aux;
|
2010-11-29 10:49:43 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-12-18 18:51:36 +08:00
|
|
|
ret = true;
|
2010-11-29 10:49:43 +08:00
|
|
|
} while (0);
|
|
|
|
|
2013-12-18 18:51:36 +08:00
|
|
|
return ret;
|
2010-07-19 10:50:47 +08:00
|
|
|
}
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
static bool tgaLoadRLEImageData(unsigned char* buffer, uint32_t bufSize, tImageTGA* info)
|
2010-07-19 10:50:47 +08:00
|
|
|
{
|
2021-12-25 10:04:45 +08:00
|
|
|
unsigned int mode, total, i, index = 0;
|
2010-11-29 10:49:43 +08:00
|
|
|
unsigned char aux[4], runlength = 0;
|
|
|
|
unsigned int skip = 0, flag = 0;
|
|
|
|
size_t step = (sizeof(unsigned char) + sizeof(signed short)) * 6;
|
|
|
|
|
|
|
|
// mode equal the number of components for each pixel
|
2013-12-18 18:51:36 +08:00
|
|
|
mode = info->pixelDepth / 8;
|
2010-11-29 10:49:43 +08:00
|
|
|
// total is the number of unsigned chars we'll have to read
|
2013-12-18 18:51:36 +08:00
|
|
|
total = info->height * info->width;
|
2010-11-29 10:49:43 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
for (i = 0; i < total; i++)
|
2010-11-29 10:49:43 +08:00
|
|
|
{
|
|
|
|
// if we have a run length pending, run it
|
2021-12-25 10:04:45 +08:00
|
|
|
if (runlength != 0)
|
2010-11-29 10:49:43 +08:00
|
|
|
{
|
|
|
|
// we do, update the run length count
|
|
|
|
runlength--;
|
|
|
|
skip = (flag != 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// otherwise, read in the run length token
|
2022-07-15 19:17:01 +08:00
|
|
|
AX_BREAK_IF((step + sizeof(unsigned char)) > bufSize);
|
2013-12-18 18:51:36 +08:00
|
|
|
memcpy(&runlength, buffer + step, sizeof(unsigned char));
|
2010-11-29 10:49:43 +08:00
|
|
|
step += sizeof(unsigned char);
|
|
|
|
|
|
|
|
// see if it's a RLE encoded sequence
|
|
|
|
flag = runlength & 0x80;
|
2021-12-25 10:04:45 +08:00
|
|
|
if (flag)
|
2010-11-29 10:49:43 +08:00
|
|
|
{
|
|
|
|
runlength -= 128;
|
|
|
|
}
|
|
|
|
skip = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// do we need to skip reading this pixel?
|
2021-12-25 10:04:45 +08:00
|
|
|
if (!skip)
|
2010-11-29 10:49:43 +08:00
|
|
|
{
|
|
|
|
// no, read in the pixel data
|
2022-07-15 19:17:01 +08:00
|
|
|
AX_BREAK_IF((step + sizeof(unsigned char) * mode) > bufSize);
|
2010-11-29 10:49:43 +08:00
|
|
|
|
2013-12-18 18:51:36 +08:00
|
|
|
memcpy(aux, buffer + step, sizeof(unsigned char) * mode);
|
2010-11-29 10:49:43 +08:00
|
|
|
step += sizeof(unsigned char) * mode;
|
|
|
|
|
|
|
|
// mode=3 or 4 implies that the image is RGB(A). However TGA
|
|
|
|
// stores it as BGR(A) so we'll have to swap R and B.
|
2021-12-25 10:04:45 +08:00
|
|
|
if (mode >= 3)
|
2010-11-29 10:49:43 +08:00
|
|
|
{
|
|
|
|
unsigned char tmp;
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
tmp = aux[0];
|
2010-11-29 10:49:43 +08:00
|
|
|
aux[0] = aux[2];
|
|
|
|
aux[2] = tmp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// add the pixel to our image
|
2013-12-18 18:51:36 +08:00
|
|
|
memcpy(&info->imageData[index], aux, mode);
|
2010-11-29 10:49:43 +08:00
|
|
|
index += mode;
|
|
|
|
}
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2010-11-29 10:49:43 +08:00
|
|
|
return true;
|
2010-07-19 10:50:47 +08:00
|
|
|
}
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
void tgaFlipImage(tImageTGA* info)
|
2010-07-19 10:50:47 +08:00
|
|
|
{
|
2012-04-19 14:35:52 +08:00
|
|
|
// mode equal the number of components for each pixel
|
2021-12-25 10:04:45 +08:00
|
|
|
int mode = info->pixelDepth / 8;
|
|
|
|
int rowbytes = info->width * mode;
|
|
|
|
unsigned char* row = (unsigned char*)malloc(rowbytes);
|
2012-04-19 14:35:52 +08:00
|
|
|
int y;
|
2021-12-25 10:04:45 +08:00
|
|
|
|
|
|
|
if (row == nullptr)
|
|
|
|
return;
|
|
|
|
|
|
|
|
for (y = 0; y < (info->height / 2); y++)
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2021-12-25 10:04:45 +08:00
|
|
|
memcpy(row, &info->imageData[y * rowbytes], rowbytes);
|
|
|
|
memcpy(&info->imageData[y * rowbytes], &info->imageData[(info->height - (y + 1)) * rowbytes], rowbytes);
|
|
|
|
memcpy(&info->imageData[(info->height - (y + 1)) * rowbytes], row, rowbytes);
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
free(row);
|
2013-12-18 18:51:36 +08:00
|
|
|
info->flipped = 0;
|
2010-07-19 10:50:47 +08:00
|
|
|
}
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2021-09-02 13:39:28 +08:00
|
|
|
tImageTGA* tgaLoadBuffer(unsigned char* buffer, int32_t size)
|
2010-11-29 10:49:43 +08:00
|
|
|
{
|
2021-12-25 10:04:45 +08:00
|
|
|
int mode, total;
|
|
|
|
tImageTGA* info = nullptr;
|
|
|
|
|
2010-11-29 10:49:43 +08:00
|
|
|
do
|
|
|
|
{
|
2022-07-15 19:17:01 +08:00
|
|
|
AX_BREAK_IF(!buffer);
|
2021-12-25 10:04:45 +08:00
|
|
|
info = (tImageTGA*)malloc(sizeof(tImageTGA));
|
2013-11-29 15:25:21 +08:00
|
|
|
|
2010-11-29 10:49:43 +08:00
|
|
|
// get the file header info
|
2021-12-25 10:04:45 +08:00
|
|
|
if (!tgaLoadHeader(buffer, size, info))
|
2010-11-29 10:49:43 +08:00
|
|
|
{
|
|
|
|
info->status = TGA_ERROR_MEMORY;
|
|
|
|
break;
|
|
|
|
}
|
2013-11-29 15:25:21 +08:00
|
|
|
|
2010-11-29 10:49:43 +08:00
|
|
|
// check if the image is color indexed
|
|
|
|
if (info->type == 1)
|
|
|
|
{
|
|
|
|
info->status = TGA_ERROR_INDEXED_COLOR;
|
|
|
|
break;
|
|
|
|
}
|
2013-11-29 15:25:21 +08:00
|
|
|
|
2010-11-29 10:49:43 +08:00
|
|
|
// check for other types (compressed images)
|
2021-12-25 10:04:45 +08:00
|
|
|
if ((info->type != 2) && (info->type != 3) && (info->type != 10))
|
2010-11-29 10:49:43 +08:00
|
|
|
{
|
|
|
|
info->status = TGA_ERROR_COMPRESSED_FILE;
|
|
|
|
break;
|
|
|
|
}
|
2013-11-29 15:25:21 +08:00
|
|
|
|
2010-11-29 10:49:43 +08:00
|
|
|
// mode equals the number of image components
|
|
|
|
mode = info->pixelDepth / 8;
|
|
|
|
// total is the number of unsigned chars to read
|
|
|
|
total = info->height * info->width * mode;
|
|
|
|
// allocate memory for image pixels
|
2021-12-25 10:04:45 +08:00
|
|
|
info->imageData = (unsigned char*)malloc(sizeof(unsigned char) * total);
|
2013-11-29 15:25:21 +08:00
|
|
|
|
2010-11-29 10:49:43 +08:00
|
|
|
// check to make sure we have the memory required
|
2014-07-10 00:45:27 +08:00
|
|
|
if (info->imageData == nullptr)
|
2010-11-29 10:49:43 +08:00
|
|
|
{
|
|
|
|
info->status = TGA_ERROR_MEMORY;
|
|
|
|
break;
|
|
|
|
}
|
2013-11-29 15:25:21 +08:00
|
|
|
|
2010-11-29 10:49:43 +08:00
|
|
|
bool bLoadImage = false;
|
|
|
|
// finally load the image pixels
|
2021-12-25 10:04:45 +08:00
|
|
|
if (info->type == 10)
|
2010-11-29 10:49:43 +08:00
|
|
|
{
|
2013-11-29 14:31:42 +08:00
|
|
|
bLoadImage = tgaLoadRLEImageData(buffer, size, info);
|
2010-11-29 10:49:43 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-11-29 14:31:42 +08:00
|
|
|
bLoadImage = tgaLoadImageData(buffer, size, info);
|
2010-11-29 10:49:43 +08:00
|
|
|
}
|
2013-11-29 15:25:21 +08:00
|
|
|
|
2010-11-29 10:49:43 +08:00
|
|
|
// check for errors when reading the pixels
|
2021-12-25 10:04:45 +08:00
|
|
|
if (!bLoadImage)
|
2010-11-29 10:49:43 +08:00
|
|
|
{
|
|
|
|
info->status = TGA_ERROR_READING_FILE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
info->status = TGA_OK;
|
2013-11-29 15:25:21 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
if (info->flipped)
|
2010-11-29 10:49:43 +08:00
|
|
|
{
|
2021-12-25 10:04:45 +08:00
|
|
|
tgaFlipImage(info);
|
|
|
|
if (info->flipped)
|
2010-11-29 10:49:43 +08:00
|
|
|
{
|
|
|
|
info->status = TGA_ERROR_MEMORY;
|
|
|
|
}
|
|
|
|
}
|
2021-12-25 10:04:45 +08:00
|
|
|
} while (0);
|
2013-11-29 15:25:21 +08:00
|
|
|
|
2013-11-29 14:31:42 +08:00
|
|
|
return info;
|
|
|
|
}
|
2010-11-29 10:49:43 +08:00
|
|
|
|
2013-11-29 14:31:42 +08:00
|
|
|
// this is the function to call when we want to load an image
|
2021-12-25 10:04:45 +08:00
|
|
|
tImageTGA* tgaLoad(const char* filename)
|
2013-11-29 14:31:42 +08:00
|
|
|
{
|
2013-12-18 14:58:17 +08:00
|
|
|
Data data = FileUtils::getInstance()->getDataFromFile(filename);
|
2012-06-19 16:31:26 +08:00
|
|
|
|
2013-12-18 14:58:17 +08:00
|
|
|
if (!data.isNull())
|
2013-11-29 14:31:42 +08:00
|
|
|
{
|
2022-11-20 08:58:34 +08:00
|
|
|
return tgaLoadBuffer(data.getBytes(), static_cast<int32_t>(data.getSize()));
|
2013-11-29 14:31:42 +08:00
|
|
|
}
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2013-11-29 14:31:42 +08:00
|
|
|
return nullptr;
|
2010-07-19 10:50:47 +08:00
|
|
|
}
|
|
|
|
|
2012-09-17 15:02:24 +08:00
|
|
|
// converts RGB to grayscale
|
2021-12-25 10:04:45 +08:00
|
|
|
void tgaRGBtogreyscale(tImageTGA* info)
|
|
|
|
{
|
|
|
|
|
|
|
|
int mode, i, j;
|
|
|
|
|
|
|
|
unsigned char* newImageData;
|
|
|
|
|
2012-09-17 15:02:24 +08:00
|
|
|
// if the image is already grayscale do nothing
|
2013-12-18 18:51:36 +08:00
|
|
|
if (info->pixelDepth == 8)
|
2012-04-19 14:35:52 +08:00
|
|
|
return;
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
// compute the number of actual components
|
2013-12-18 18:51:36 +08:00
|
|
|
mode = info->pixelDepth / 8;
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
// allocate an array for the new image data
|
2021-12-25 10:04:45 +08:00
|
|
|
newImageData = (unsigned char*)malloc(sizeof(unsigned char) * info->height * info->width);
|
|
|
|
if (newImageData == nullptr)
|
|
|
|
{
|
2012-04-19 14:35:52 +08:00
|
|
|
return;
|
|
|
|
}
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2012-09-17 15:02:24 +08:00
|
|
|
// convert pixels: grayscale = o.30 * R + 0.59 * G + 0.11 * B
|
2021-12-25 10:04:45 +08:00
|
|
|
for (i = 0, j = 0; j < info->width * info->height; i += mode, j++)
|
|
|
|
newImageData[j] =
|
|
|
|
(unsigned char)(0.30 * info->imageData[i] + 0.59 * info->imageData[i + 1] + 0.11 * info->imageData[i + 2]);
|
|
|
|
|
|
|
|
// free old image data
|
2013-12-18 18:51:36 +08:00
|
|
|
free(info->imageData);
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
// reassign pixelDepth and type according to the new image type
|
2013-12-18 18:51:36 +08:00
|
|
|
info->pixelDepth = 8;
|
2021-12-25 10:04:45 +08:00
|
|
|
info->type = 3;
|
2012-09-17 15:02:24 +08:00
|
|
|
// reassigning imageData to the new array.
|
2013-12-18 18:51:36 +08:00
|
|
|
info->imageData = newImageData;
|
2010-07-19 10:50:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// releases the memory used for the image
|
2021-12-25 10:04:45 +08:00
|
|
|
void tgaDestroy(tImageTGA* info)
|
|
|
|
{
|
|
|
|
|
|
|
|
if (info != nullptr)
|
|
|
|
{
|
2013-12-18 18:51:36 +08:00
|
|
|
if (info->imageData != nullptr)
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-12-18 18:51:36 +08:00
|
|
|
free(info->imageData);
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
|
2013-12-18 18:51:36 +08:00
|
|
|
free(info);
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
2010-07-19 10:50:47 +08:00
|
|
|
}
|
2022-07-11 17:50:21 +08:00
|
|
|
NS_AX_END
|