This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| 批量将指定目录下的 PNG 文件转换为 BMP 格式 | |
| 依赖: Pillow (pip install pillow) | |
| 直接双击运行即可打开图形界面;也支持命令行: | |
| python png_to_bmp.py <目录路径> [--delete-source] | |
| """ | |
| import argparse | |
| import sys | |
| import threading |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ------------------------------------------------------- | |
| // SPSC 无锁环形队列(单生产者/单消费者)模型 | |
| // Capacity 必须是 2 的幂次 | |
| // ------------------------------------------------------- | |
| template<typename T, size_t Capacity> | |
| class SPSCQueue | |
| { | |
| static_assert(Capacity >= 2 && (Capacity & (Capacity - 1)) == 0, | |
| "SPSCQueue: Capacity must be a power of 2"); | |
| public: |