上一页 1 2 3 4 5 6 7 ··· 13 下一页
摘要: 今天在A电脑写好的程序放到B电脑测试,B电脑运行时报出应用程序无法正常启动(0xc000007b),看了网上一堆方法,没有一个帮到忙的,最后想到一个问题,我的程序是Debug版本发布的(为了测试用),说不定是因为这个问题导致的,改成release后,果然能正常打开了。小记一下,防止以后再次踩坑。 阅读全文
posted @ 2022-05-23 21:19 补码 阅读(485) 评论(0) 推荐(0) 编辑
摘要: 需要用到 while 来判断另一个线程中bool block 的值来做堵塞,代码如下: while(block); // 堵塞线程,直到block变为false // do something Debug版本下是堵塞成功的,Release版本就不行了,直接优化掉了,也不可能说直接把优化降级,最后发现 阅读全文
posted @ 2022-05-22 20:26 补码 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 在网上搜索RT,得到的是使用下面函数 于是为了达到效果,还使用了鼠标事件记录移动前点位,移动后点位,鼠标方向改变后重置移动前点。。。最终达到想要的效果。 今天翻看以前小白时候做的项目,发现有个函数。。。。 原来设置一下DragMode就可以了。/(ㄒoㄒ)/~~ 阅读全文
posted @ 2022-04-11 15:31 补码 阅读(334) 评论(0) 推荐(0) 编辑
摘要: 彩色图像由三通道像素组成,每个通道表示红、绿、蓝三原色中一种颜色的亮度值,每个数 值都是 8 位无符号字符类型,因此颜色总数为 256×256×256,即超过 1600 万种颜色。因此,为 了降低分析的复杂性,有时需要减少图像中颜色的数量。 void colorReduce(cv::Mat img, 阅读全文
posted @ 2022-03-01 20:19 补码 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 写入像素 if(img.channels() == 3) // 3通道图像 { img.at<cv::Vec3b>(0, 0)[0] = 255; img.at<cv::Vec3b>(0, 0)[1] = 255; img.at<cv::Vec3b>(0, 0)[2] = 255; } else i 阅读全文
posted @ 2022-02-28 21:29 补码 阅读(287) 评论(0) 推荐(0) 编辑
摘要: typedef enum memory_order { memory_order_relaxed, // 不对顺序做任何保证 memory_order_consume, // 标记读操作,本线程中,依赖于该值的读写不能重排到此操作前 memory_order_acquire, // 标记读操作,本线 阅读全文
posted @ 2022-02-26 14:56 补码 阅读(117) 评论(0) 推荐(0) 编辑
摘要: // 方法一template<typename T> int arr_length(T(&arr) ) { return sizeof(arr) / sizeof(arr[0]); } // 方法二 template<typenameT, int N> int arr_length(T(&arr)[ 阅读全文
posted @ 2022-02-23 12:48 补码 阅读(261) 评论(0) 推荐(0) 编辑
摘要: #include <chrono>#include <iomanip>#include <iostream> std::chrono::system_clock::time_point t = std::chrono::system_clock::now(); std::time_t c = std 阅读全文
posted @ 2022-02-22 20:51 补码 阅读(2381) 评论(0) 推荐(1) 编辑
摘要: std::counting_semaphore 具体内容看std::counting_semaphore, std::binary_semaphore - C++中文 - API参考文档 (apiref.com)。感觉使用方法和 std::condition_variable 差不多,有时间再看看源 阅读全文
posted @ 2022-02-22 12:36 补码 阅读(1183) 评论(1) 推荐(0) 编辑
摘要: 官方代码如下 #include <iostream> #include <chrono> #include <ratio> #include <thread> void f() { std::this_thread::sleep_for(std::chrono::seconds(1)); } int 阅读全文
posted @ 2022-02-16 17:05 补码 阅读(78) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 13 下一页