{"id":18435914,"url":"https://github.com/parallel101/hw01","last_synced_at":"2025-07-30T08:07:22.558Z","repository":{"id":37936307,"uuid":"438090092","full_name":"parallel101/hw01","owner":"parallel101","description":"高性能并行编程与优化 - 第01讲回家作业","archived":false,"fork":false,"pushed_at":"2024-08-12T03:44:51.000Z","size":26,"stargazers_count":23,"open_issues_count":93,"forks_count":123,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-03T16:55:48.914Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/parallel101/course","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/parallel101.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-14T02:24:05.000Z","updated_at":"2024-11-06T05:04:31.000Z","dependencies_parsed_at":"2024-12-22T14:10:34.270Z","dependency_job_id":"dc5f8933-e629-4900-9d84-8dce9ba2b67f","html_url":"https://github.com/parallel101/hw01","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parallel101%2Fhw01","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parallel101%2Fhw01/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parallel101%2Fhw01/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parallel101%2Fhw01/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parallel101","download_url":"https://codeload.github.com/parallel101/hw01/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238188524,"owners_count":19430877,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T06:09:40.996Z","updated_at":"2025-02-10T21:12:52.495Z","avatar_url":"https://github.com/parallel101.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 高性能并行编程与优化 - 第01讲的回家作业\n\n通过 pull request 提交作业。会批分数，但是：\n\n没有结业证书，回家作业仅仅作为评估学习效果和巩固知识的手段，不必为分数感到紧张 :)\n量力而行，只要能在本课中，学到昨天的自己不懂的知识，就是胜利，没必要和别人攀比。\n\n- 课件：https://github.com/parallel101/course\n- 录播：https://space.bilibili.com/263032155\n\n作业提交时间不限 :) 即使完结了还想交的话我也会看的~ 不过最好在下一讲开播前完成。\n\n- 如何开 pull request：https://zhuanlan.zhihu.com/p/51199833\n- 如何设置 https 代理：https://www.jianshu.com/p/b481d2a42274\n\n## 作业要求\n\n在 main.cpp 中为了导出两个\"美好的图像\"，使用了 `stb_image_write.h` 这个头文件。\n他在 CMakeLists.txt 中也引用了 stbiw 这个库，然而这个库还没有被定义。\n\n你的任务就是 **定义 stbiw 这个库**，他的内容应该包含 `stbi_write_png()` 的实现，\n以及允许通过尖括号导入头文件 `\u003cstb_image_write.h\u003e`。\n\n运用上课所学知识，尽量不修改 main.cpp 的内容，只修改 stbiw 子目录下的内容，\n完成任务。最好以子模块 + 库的形式，实在不行的话直接改 main.cpp 也可以。\n\n运行成功后，应该会在主程序同目录发现两个\"美好的图像\"：mandel.png 和 rainbow.png\n\n## 参考信息\n\nstb_image_write.h 原仓库地址: https://github.com/nothings/stb\n\n你需要在一个且仅一个 .cpp 文件定义了 `STB_IMAGE_WRITE_IMPLEMENTATION` 这个宏，\n才能决定让 stbi 系列函数在这里实现。\n\n如果你不仅完成了作业，还能解释清楚为什么 stbi 必须要这样设计，可能会给你满分！\n\n## 采分点提示\n\n像这样：\n```cmake\ntarget_compile_definitions(stbiw PUBLIC -DSTB_IMAGE_WRITE_IMPLEMENTATION)\n```\n是不行的，因为 mandel.cpp 和 rainbow.cpp 两个文件都 include 了 stb_image_write.h，\n这样同一个函数会被定义两遍！\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparallel101%2Fhw01","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparallel101%2Fhw01","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparallel101%2Fhw01/lists"}