Re: TIFF Image Support Project GSOC
Markus Mützel <[email protected]> Mon, 29 Mar 2021 09:04:03 +0200
| Newsgroups | gmane.comp.gnu.octave.maintainers |
|---|---|
| Message-ID | <trinity-f0c0d864-b38e-4d72-8fc6-ac7cefe52639-1617001443250@3c-app-gmx-bs63> |
Am 29. März 2021 um 01:27 Uhr schrieb "Carnë Draug": > On Sun, 28 Mar 2021 at 12:00, Markus Mützel <[email protected]> wrote: > > Am 25. März 2021 um 19:01 Uhr schrieb "Carnë Draug": > > > On Wed, Mar 24, 2021 at 11:30 PM Nicholas Jankowski <[email protected]> wrote: > > > > [...] > > > > @David - are there any similar existing wrappers/class > > > > implementations worth pointing out in particular as a reference? > > > > > > Not really. The closest thing is the @ftp class which uses the old > > > style classes. Its methods are pretty much single lines that simply > > > call the corresponding __dunder__ method. > > > > A few months back I started implementing a classdef wrapper for > > RapidXML that also follows a similar approach as the old-style @ftp > > class. > > See: https://savannah.gnu.org/bugs/index.php?59245 > > > > I don't remember in which state it currently is. But I believe it > > was working more or less. That implementation also aimed to achieve > > some compatibility with Matlab's XML interface. IIUC, that isn't an > > issue for this project because the libtiff wrapper would be internal > > to Octave. > > Actually, the libtiff wrapper is supposed to implement the Tiff class > which exists in Matlab and is missing in Octave. So yeah, Matlab > compatibility is required. Having imread/imwrite/imfinfo make use > that Tiff class is something to do after. Thanks for clarifying. I didn't read that correctly before. > This whole having multiple __dunder__ functions which are then called > from almost single line m files seems a bit silly. I think it would > be cleaner to do it all in C++. Is there a way to add a class to > Octave from an oct file only? If you want to have something that looks a lot like a class from a user perspective, you could overload the "subsref" method of a octave_base_value class. You could use that subsref function to dispatch to the "actual" methods (see e.g. the octave_java class in libinterp/octave-value/ov-java.h and .cc). But IIUC, you won't have all of the classdef features with that approach (like access restrictions, inheritance(?), ...). I don't know if it is possible to implement a full-featured classdef class just in C++ code. (I would be interested as well if someone could show how to do that.) Markus