osg 이미지 저장 이미지 테스트

651 단어 OSG
// test for read image
osg::ref_ptr<:texture2d> texture2d = new osg::Texture2D;
osg::ref_ptr<:image> img = new osg::Image;
img=osgDB::readImageFile("C:\\Users\\Public\\Pictures\\Sample Pictures\\Tulips.jpg");
osg::ref_ptr<:image> img2 = new osg::Image;
img2->setImage(img->s(),img->t(),img->r(),img->getInternalTextureFormat(),img->getPixelFormat(),img->getDataType(),img->data(),img->getAllocationMode());
osgDB::writeImageFile(*img2,"img2.jpg");
osgDB::writeImageFile(*img,"abc.jpg");
texture2d->setImage(img);

좋은 웹페이지 즐겨찾기