fabien van mook

all packages "fvm-*"

package "fvm-colourgrade"

function file "colourgrade_init_ngrade.m"

Function [cg,ngrade,ngradedefault] = colourgrade_init_ngrade(cg)

returns the input struct cg after instantiating
the fields:
  cg.gradevalues (column vector of reals;
                  [] at default)
  cg.gradeticks  (column vector of booleans;
                  [] at default)
  cg.gradetexts  (column cell-array of strings;
                  {} at default)
  cg.offset      (cg.icm_min + cg.offset is the
                  row index to the colourmap
                  where the second part starts;
                  0 at default)

The function also returns ngrade i.e. the number of
grades. It is obtained from:
  ngrade = length(cg.gradevalues) - 1; 
  ngrade = length(cg.gradeticks) - 1;
and/or 
  ngrade = length(cg.gradetexts) - 1;
If no grades are defined, ngrade holds an
empty matrix [].

The function also returns a default value (20)
for ngrade.

The function is called in:
  colourgrade_init.m
  colourgrade_bluered.m
  colourgrade_streaked.m


(c) 2026 fabien van mook

2026.08.20 release of this file within package "fvm-colourgrade" under GNU GPLv3+