Skip to content

natfeats nfapi jpeg

Thorsten Otto edited this page Jun 19, 2019 · 3 revisions

"JPEG"

This is an extension that allows decoding of JPEG images. This extension is currently only supported by ARAnyM. The interface is implemented by a small, resident program (nfjpeg.prg) that must be run from the AUTO folder. The program installs a cookie with the name '_JPD' that points to a JPGDDRV_STRUCT

This interface is compatible to the one used by the Brainstorm DSP jpeg decoder.

  sub-ID 0 - user allowed
  unsigned long GetVersion(void);

Returns the interface version number, currently 0. (note: this is the version number of the NatFeat interface implemented by the emulator, not the version number from the cookie).

  sub-ID 1 - user allowed
  long OpenDriver(JPGD_STRUCT *jpgd_ptr);

Transparently calls the JPGDOpenDriver method from the cookie. The structure must be allocated by the application (use GetStructSize to obtain the required size). Since all functions are called in the context of the calling process, that memory can be just private if memory protection is in use. The call returns an error number as defined in jpgdh.h.

  sub-ID 2 - user allowed
  long CloseDriver(JPGD_STRUCT *jpgd_ptr);

Transparently calls the JPGDCloseDriver method from the cookie. The call returns an error number as defined in jpgdh.h.

  sub-ID 3 - user allowed
  long GetStructSize(void);

Transparently calls the JPGDGetStructSize method from the cookie. Return value is the size of the structure that the application should allocate.

  sub-ID 4 - user allowed
  long GetImageInfo(JPGD_STRUCT *jpgd_ptr);

Transparently calls the JPGDGetImageInfo method from the cookie. The call returns an error number as defined in jpgdh.h. Information about the image is returned in the structure.

  sub-ID 5 - user allowed
  long GetImageSize(JPGD_STRUCT *jpgd_ptr);

Transparently calls the JPGDGetImageSize method from the cookie. The call returns an error number as defined in jpgdh.h. On success, MFDBWordSize and OutSize of the driver structure will be updated.

  sub-ID 6 - user allowed
  long DecodeImage(JPGD_STRUCT *jpgd_ptr, long y);

This function is called from a subroutine that is part of the driver. That same subroutine will also call any user defined callbacks in the driver structure.

Clone this wiki locally