BRL-CAD

Extruded bitmap (EBM) images from database object, update data structure (task #1 of 5)

BRL-CAD's extruded bitmap object type (EBM) takes an image file and extrudes it into 3D geometry based on an input image. Traditionally, this image has lived in a black & white (.bw) image file that you have to remember to copy with your .g geometry file. You can read up on an example at https://brlcad.org/wiki/EBM

We'd like for EBM to read image data from another database object instead of from a file. This is similar to what we already do for DSP objects (see src/librt/primitives/dsp/dsp.c). This chain of tasks implements support for doing this.

For this first task, add a 'datasrc' and 'bip' field to the ebm data structure in include/rt/geom.h similar to what is already in place for the dsp data structure. The datasrc field will be used later to keep track of whether the data is in a file or object. The bip field is where the image data will be when the datasrc is an object . After modifying geom.h, modify the import5 and export5 routines in src/librt/primitives/ebm/ebm.c (similar to what you'll find in src/librt/primitives/dsp/dsp.c) so that the new datasrc and bip fields are read from and written to disk.

See https://brlcad.org/wiki/Patches for details on how to make a patch file.

SUBMIT a patch file with your source code changes.

Task tags

  • computer graphics
  • file i/o
  • c/c++

Students who completed this task

Jebbly

Task type

  • code Code
close

2019