ermig1979 / Simd

C++ image processing and machine learning library with using of SIMD: SSE, AVX, AVX-512, AMX for x86/x64, VMX(Altivec) and VSX(Power7) for PowerPC, NEON for ARM.
http://ermig1979.github.io/Simd
MIT License
2.05k stars 409 forks source link

Opening a TIF image with this Framework #240

Closed crm-mtz closed 1 year ago

crm-mtz commented 1 year ago

Hi there -

Let's assume I have a *.tif file somewhere -> /mnt/test.tif on a Linux filesystem. I wrote the following code

include "iostream"

include "Simd/SimdLib.hpp"

using namespace Simd; using namespace std;

int main(int argc, char *argv[]) { View image; //compiler complains!

if(!image.Load("/mnt/test.tif", View<int16_t>::Int16)
{
   cerr << "Unable to read image" << endl;
   return -1;
}

cout << "Image successfully read - w=" << image.width << ", h=" << image.height << endl;
return 0;

}

I based my code on the Framework's Test/TestImageIO.cpp UT file However, I get this compiler error:

polarImageRead.cpp:9:17: error: type/value mismatch at argument 1 in template parameter list for ‘template<template class A> struct Simd::View’

So...what am I doing wrong here? Clearly, the example code I see does not align with the current high-level API.

Thanks in advance! Charles.

crm-mtz commented 1 year ago

Found out what I did wrong, by looking at the code snippet in the header file that contains this API-level template method. closing. Cheers, C.