Skip to content

shade_height_fieldShadeHeightFieldShadeHeightFieldshade_height_fieldshade_height_field🔗

Short description🔗

shade_height_fieldShadeHeightFieldShadeHeightFieldshade_height_fieldshade_height_field — Shade a height field.

Signature🔗

shade_height_field( image ImageHeight, out image ImageShade, angle.deg Slant, angle.deg Tilt, number Albedo, number Ambient, string Shadows )void ShadeHeightField( const HObject& ImageHeight, HObject* ImageShade, const HTuple& Slant, const HTuple& Tilt, const HTuple& Albedo, const HTuple& Ambient, const HTuple& Shadows )static void HOperatorSet.ShadeHeightField( HObject imageHeight, out HObject imageShade, HTuple slant, HTuple tilt, HTuple albedo, HTuple ambient, HTuple shadows )def shade_height_field( image_height: HObject, slant: Union[float, int], tilt: Union[float, int], albedo: Union[float, int], ambient: Union[float, int], shadows: str ) -> HObject

Herror shade_height_field( const Hobject ImageHeight, Hobject* ImageShade, double Slant, double Tilt, double Albedo, double Ambient, const char* Shadows )

Herror T_shade_height_field( const Hobject ImageHeight, Hobject* ImageShade, const Htuple Slant, const Htuple Tilt, const Htuple Albedo, const Htuple Ambient, const Htuple Shadows )

HImage HImage::ShadeHeightField( const HTuple& Slant, const HTuple& Tilt, const HTuple& Albedo, const HTuple& Ambient, const HString& Shadows ) const

HImage HImage::ShadeHeightField( double Slant, double Tilt, double Albedo, double Ambient, const HString& Shadows ) const

HImage HImage::ShadeHeightField( double Slant, double Tilt, double Albedo, double Ambient, const char* Shadows ) const

HImage HImage::ShadeHeightField( double Slant, double Tilt, double Albedo, double Ambient, const wchar_t* Shadows ) const (Windows only)

HImage HImage.ShadeHeightField( HTuple slant, HTuple tilt, HTuple albedo, HTuple ambient, string shadows )

HImage HImage.ShadeHeightField( double slant, double tilt, double albedo, double ambient, string shadows )

Description🔗

shade_height_fieldShadeHeightField computes a shaded image from the height field ImageHeightimageHeightimage_height as if the image were illuminated by an infinitely far away light source. It is assumed that the surface described by the height field has Lambertian reflection properties determined by Albedoalbedoalbedo and Ambientambientambient. The parameter Shadowsshadowsshadows determines whether shadows are to be calculated.

Attention🔗

shade_height_fieldShadeHeightField assumes that the heights are given on a lattice with step width 1. If this is not the case, the heights must be divided by the step width before the call to shade_height_fieldShadeHeightField. Otherwise, the derivatives used internally to compute the orientation of the surface will be estimated to steep or too flat. Example: The height field is given on 100100 points on the square [0,1][0,1]. Then the heights must be divided by 1/100 first. A Cartesian coordinate system with the origin in the lower left corner of the image is used internally.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Automatically parallelized on tuple level.

Parameters🔗

ImageHeightimageHeightimage_height (input_object) singlechannelimage(-array) → object (byte / int4 / real)HObject (byte / int4 / real)HImage (byte / int4 / real)HObject (byte / int4 / real)Hobject (byte / int4 / real)

Height field to be shaded.

ImageShadeimageShadeimage_shade (output_object) image(-array) → object (byte)HObject (byte)HImage (byte)HObject (byte)Hobject * (byte)

Shaded image.

Slantslantslant (input_control) angle.deg → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[float, int]Htuple (double / Hlong)

Angle between the light source and the positive z-axis (in degrees).

Default: 0.00.0
Suggested values: 1.0, 5.0, 10.0, 20.0, 40.0, 60.0, 90.01.0, 5.0, 10.0, 20.0, 40.0, 60.0, 90.0
Value range: 0.0 ≤ Slant ≤ 180.0 (lin)
Minimum increment: 0.01
Recommended increment: 10.0

Tilttilttilt (input_control) angle.deg → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[float, int]Htuple (double / Hlong)

Angle between the light source and the x-axis after projection into the xy-plane (in degrees).

Default: 0.00.0
Suggested values: 1.0, 5.0, 10.0, 20.0, 40.0, 60.0, 90.01.0, 5.0, 10.0, 20.0, 40.0, 60.0, 90.0
Value range: 0.0 ≤ Tilt ≤ 360.0 (lin)
Minimum increment: 0.01
Recommended increment: 10.0

Albedoalbedoalbedo (input_control) number → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[float, int]Htuple (double / Hlong)

Amount of light reflected by the surface.

Default: 1.01.0
Suggested values: 0.1, 0.5, 1.0, 5.00.1, 0.5, 1.0, 5.0
Value range: 0.0 ≤ Albedo ≤ 5.0 (lin)
Minimum increment: 0.01
Recommended increment: 0.1
Restriction: Albedo >= 0.0

Ambientambientambient (input_control) number → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[float, int]Htuple (double / Hlong)

Amount of ambient light.

Default: 0.00.0
Suggested values: 0.1, 0.5, 1.00.1, 0.5, 1.0
Value range: 0.0 ≤ Ambient ≤ 1.0 (lin)
Minimum increment: 0.01
Recommended increment: 0.1
Restriction: Ambient >= 0.0

Shadowsshadowsshadows (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

Should shadows be calculated?

Default: 'false'"false"
Suggested values: 'true', 'false'"true", "false"

Result🔗

If all parameters are correct shade_height_fieldShadeHeightField returns the value 2 (H_MSG_TRUE). Otherwise, an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

sfs_mod_lrSfsModLr, sfs_orig_lrSfsOrigLr, sfs_pentlandSfsPentland, photometric_stereoPhotometricStereo

Module🔗

Foundation