PuzzleSDK
TextureConvertI8类 参考

#include <Texture2dTest.h>

+ 类 TextureConvertI8 继承关系图:
+ TextureConvertI8 的协作图:

Public 成员函数

 CREATE_FUNC (TextureConvertI8)
 
virtual void onEnter () override
 
virtual std::string title () const override
 
virtual std::string subtitle () const override
 
- Public 成员函数 继承自 TextureDemo
virtual ~TextureDemo ()
 
- Public 成员函数 继承自 TestCase
 TestCase ()
 
 ~TestCase ()
 
virtual Type getTestType () const
 
virtual float getDuration () const
 
virtual std::string getExpectedOutput () const
 
virtual std::string getActualOutput () const
 
virtual void restartTestCallback (cocos2d::Ref *sender)
 
virtual void nextTestCallback (cocos2d::Ref *sender)
 
virtual void priorTestCallback (cocos2d::Ref *sender)
 
virtual void onBackCallback (cocos2d::Ref *sender)
 
void setTestSuite (TestSuite *testSuite)
 
TestSuitegetTestSuite () const
 
float getRunTime () const
 
void setTestCaseName (const std::string &name)
 
std::string getTestCaseName () const
 
const cocos2d::Label * getSubtitleLable () const
 
const cocos2d::MenuItemImage * getRestartTestItem () const
 

额外继承的成员函数

- Public 类型 继承自 TestCase
enum class  Type { ROBUSTNESS , UNIT , GRAPHICAL_STATIC , MANUAL }
 
- Public 属性 继承自 TestCase
CC_CONSTRUCTOR_ACCESS __pad0__: virtual bool init() override
 
- Protected 属性 继承自 TestCase
cocos2d::MenuItemImage * _priorTestItem
 
cocos2d::MenuItemImage * _restartTestItem
 
cocos2d::MenuItemImage * _nextTestItem
 
cocos2d::Label * _titleLabel
 
cocos2d::Label * _subtitleLabel
 

详细描述

在文件 Texture2dTest.h623 行定义.

成员函数说明

◆ CREATE_FUNC()

TextureConvertI8::CREATE_FUNC ( TextureConvertI8  )

◆ onEnter()

void TextureConvertI8::onEnter ( )
overridevirtual

重载 TextureDemo .

在文件 Texture2dTest.cpp2263 行定义.

2264{
2266
2267 auto s = Director::getInstance()->getWinSize();
2268
2269 auto background = LayerColor::create(Color4B(255,0,0,255), s.width, s.height);
2270 addChild(background, -1);
2271
2272 const char* img = "Images/test_image_i8.png";
2273 addImageToDemo(*this, 1*s.width/9, s.height/2+32, img, backend::PixelFormat::RGBA8888);
2274 addImageToDemo(*this, 2*s.width/9, s.height/2-32, img, backend::PixelFormat::RGB888);
2275 addImageToDemo(*this, 3*s.width/9, s.height/2+32, img, backend::PixelFormat::RGB565);
2276 addImageToDemo(*this, 4*s.width/9, s.height/2-32, img, backend::PixelFormat::A8);
2277 addImageToDemo(*this, 5*s.width/9, s.height/2+32, img, backend::PixelFormat::I8);
2278 addImageToDemo(*this, 6*s.width/9, s.height/2-32, img, backend::PixelFormat::AI88);
2279 addImageToDemo(*this, 7*s.width/9, s.height/2+32, img, backend::PixelFormat::RGBA4444);
2280 addImageToDemo(*this, 8*s.width/9, s.height/2-32, img, backend::PixelFormat::RGB5A1);
2281
2282 // restore default
2283 Texture2D::setDefaultAlphaPixelFormat(backend::PixelFormat::DEFAULT);
2284 log("%s\n", Director::getInstance()->getTextureCache()->getCachedTextureInfo().c_str());
2285}
static void addImageToDemo(TextureDemo &demo, float x, float y, const char *path, backend::PixelFormat format)
virtual void onEnter() override

引用了 addImageToDemo() , 以及 TextureDemo::onEnter().

+ 函数调用图:

◆ subtitle()

std::string TextureConvertI8::subtitle ( ) const
overridevirtual

重载 TestCase .

在文件 Texture2dTest.cpp2292 行定义.

2293{
2294 return "RGBA8888,RGB888,RGB565,A8,I8,AI88,RGBA4444,RGB5A1";
2295}

◆ title()

std::string TextureConvertI8::title ( ) const
overridevirtual

重载 TestCase .

在文件 Texture2dTest.cpp2287 行定义.

2288{
2289 return "I8 convert test";
2290}

该类的文档由以下文件生成: