int main() { loadImages(); setImageInfo(); initData(); initResults(); cross2DConv(); saveImages(); freeMem(); return 0; }
void CameraTab::updateImageInfo() { CleanupSettingsModel *model = CleanupSettingsModel::instance(); CleanupParameters *params = model->getCurrentParameters(); TDimension outRes(0, 0); TPointD outDpi; params->getOutputImageInfo(outRes, outDpi.x, outDpi.y); setImageInfo(outRes.lx, outRes.ly, outDpi.x, outDpi.y); TXshSimpleLevel *sl; TFrameId fid; model->getCleanupFrame(sl, fid); ToonzScene *scene = TApp::instance()->getCurrentScene()->getScene(); TFilePath outputPath(sl ? scene->decodeFilePath(model->getOutputPath(sl, params)) : TFilePath()); setImageInfo(outputPath); }
void CUDARenderer::keyPress(int key, int scancode, int action, int mods) { camera.keyPress(key, scancode, action, mods); if(key == GLFW_KEY_ENTER && action == GLFW_PRESS) { snapshot.renderToPPM(d_scene, camera.cam); setImageInfo(h_info); skipStep = true; } if(key == GLFW_KEY_F && action == GLFW_PRESS) physicsOn = !physicsOn; }
void ImageLoader::buildAllIconsAndPutInCache(TXshSimpleLevel *level, std::vector<TFrameId> fids, std::vector<std::string> iconIds, bool cacheImagesAsWell) { if (m_path.getType() != "tlv") return; if (fids.empty() || iconIds.empty()) return; /*- fidとアイコンidの数は同じはず -*/ if ((int)fids.size() != (int)iconIds.size()) return; try { TLevelReaderP lr(m_path); if (!lr) return; for (int i = 0; i < (int)fids.size(); i++) { lr->doReadPalette(false); TImageReaderP ir = lr->getFrameReader(fids[i]); lr->doReadPalette(true); TImageInfo info; TPalette *palette = level->getPalette(); std::string fullImgId = level->getImageId(fids[i]); /*- 画像データも一緒にキャッシュする場合 -*/ if (cacheImagesAsWell) { ir->enable16BitRead(m_64bitCompatible); ir->setShrink(1); TImageP fullImg = ir->load(); if (fullImg) { if (palette) fullImg->setPalette(palette); TImageCache::instance()->add(fullImgId, fullImg, true); setImageInfo(info, fullImg.getPointer()); } } /*- アイコンのロード -*/ TImageP img = ir->loadIcon(); ir->enable16BitRead(false); if (img) { if (palette) img->setPalette(palette); TImageCache::instance()->add(iconIds[i], img, true); } } } catch (...) { return; } }
void CUDARenderer::windowResize(int width, int height) { skipStep = true; h_info.setWidthHeight(width, height); camera.width = h_info.width; camera.height = h_info.height; setImageInfo(h_info); dimBlock = dim3(THREAD_DIM, THREAD_DIM, 1); dimGrid = dim3(h_info.width / dimBlock.x + (h_info.width % dimBlock.x > 0), h_info.height / dimBlock.y + (h_info.height % dimBlock.y > 0), 1); deleteTexture(); OGLtexture = Texture2D(GL_TEXTURE_2D); initTexture(); }
void CUDARenderer::initCUDA() { gpuErrchk(cudaSetDevice(0)); gpuErrchk(cudaGLSetGLDevice(0)); gpuErrchk(cudaMalloc((void **)&d_scene, sizeof(SlowScene))); gpuErrchk(cudaMemcpy(d_scene, &h_scene, sizeof(SlowScene), cudaMemcpyHostToDevice)); setImageInfo(h_info); gpuErrchk(cuCtxSetLimit(CU_LIMIT_STACK_SIZE, 1024 * 10)); dimBlock = dim3(THREAD_DIM, THREAD_DIM, 1); dimGrid = dim3(h_info.width / dimBlock.x + (h_info.width % dimBlock.x > 0), h_info.height / dimBlock.y + (h_info.height % dimBlock.y > 0), 1); snapshot.init(); }
djvFileBrowserItem::djvFileBrowserItem(const djvFileInfo & fileInfo) : _fileInfo (fileInfo), _imageInfoRequest(false), _thumbnailProxy (static_cast<djvPixelDataInfo::PROXY>(0)), _thumbnailRequest(false) { // Initialize the display role data. _displayRole[djvFileBrowserModel::NAME] = fileInfo.name(); _displayRole[djvFileBrowserModel::SIZE] = djvMemory::sizeLabel(fileInfo.size()); #if ! defined(DJV_WINDOWS) _displayRole[djvFileBrowserModel::USER] = djvUser::uidToString(fileInfo.user()); #endif // DJV_WINDOWS _displayRole[djvFileBrowserModel::PERMISSIONS] = djvFileInfo::permissionsLabel(fileInfo.permissions()); _displayRole[djvFileBrowserModel::TIME] = djvTime::timeToString(fileInfo.time()); // Initialize the edit role data. _editRole[djvFileBrowserModel::NAME].setValue<djvFileInfo>(fileInfo); _editRole[djvFileBrowserModel::SIZE] = fileInfo.size(); #if ! defined(DJV_WINDOWS) _editRole[djvFileBrowserModel::USER] = fileInfo.user(); #endif // DJV_WINDOWS _editRole[djvFileBrowserModel::PERMISSIONS] = fileInfo.permissions(); _editRole[djvFileBrowserModel::TIME] = QDateTime::fromTime_t(fileInfo.time()); // Check the cache to see if this item already exists. if (djvFileBrowserCacheItem * item = djvFileBrowserCache::global()->object(_fileInfo)) { setImageInfoRequest(); setImageInfo(item->imageInfo, item->thumbnailSize, item->thumbnailProxy); setThumbnailRequest(); setThumbnail(item->thumbnail); } }