L3DT documentation
Large 3D terrain generator

format_IsNative

Description

Determine whether a file format has full 'native' support. Please see comments for the distinction between native and non-native support.

Function prototype

bool CExtAPI::format_IsNative(ZFORMAT hFormat);

Arguments

Name Type Comment
hFormat ZFORMAT A handle to a format variable, the native support (or otherwise) of which is to be ascertained.

Return value

False if:

  • The format is non-native, or;
  • An error occurred.

True otherwise.

Comments

A format is considered native if:

  1. It can both load and save maps.
  2. The load/save operation is lossless, or minimally lossy.
  3. The files contain sufficient information to load the maps, without human intervention (i.e. no import interface required.)

Here are some examples:

  • RAW is non-native for heightfields because the format does not encode width/height, nor data type. Human intervention is always required to open RAW files.
  • JPEG is non-native for heightfields, because the format has only 8-bit precision (which is too lossy for elevation data), and also discards the actual elevation data by clamping values between 0 and 255.
  • JPEG is native for texture maps, because it supports 24bit colour, and with suitable compression, provides minimal loss.
 
zeolite/functions/format_isnative.txt · Last modified: 2017/08/31 06:57 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki