Fix bug ObjC/Swift Quicklook function; check only one channel when drawing Mat as matrix

This commit is contained in:
Giles Payne 2022-07-31 21:04:14 +09:00
parent ebaf8cc06c
commit 500e24d6cd
2 changed files with 2 additions and 2 deletions

View File

@ -62,7 +62,7 @@ typedef UIFont* (*FontGetter)();
}
- (id)debugQuickLookObject {
if ([self dims] == 2 && [self rows] <= 10 && [self cols] <= 10) {
if ([self dims] == 2 && [self rows] <= 10 && [self cols] <= 10 && [self channels] == 1) {
FontGetter fontGetters[] = { getCMU, getBodoni72, getAnySerif, getSystemFont };
UIFont* font = nil;
for (int fontGetterIndex = 0; font==nil && fontGetterIndex < (sizeof(fontGetters)) / (sizeof(fontGetters[0])); fontGetterIndex++) {

View File

@ -58,7 +58,7 @@ typedef NSFont* (*FontGetter)();
- (id)debugQuickLookObject {
// for smallish Mat objects display as a matrix
if ([self dims] == 2 && [self rows] <= 10 && [self cols] <= 10) {
if ([self dims] == 2 && [self rows] <= 10 && [self cols] <= 10 && [self channels] == 1) {
FontGetter fontGetters[] = { getCMU, getBodoni72, getAnySerif, getSystemFont };
NSFont* font = nil;
for (int fontGetterIndex = 0; font==nil && fontGetterIndex < (sizeof(fontGetters)) / (sizeof(fontGetters[0])); fontGetterIndex++) {