Blender V4.3
blender::ed::image_trace Namespace Reference

Classes

struct  TraceParams
 

Enumerations

enum class  TurnPolicy : int8_t {
  Foreground = 0 , Background = 1 , Left = 2 , Right = 3 ,
  Minority = 4 , Majority = 5 , Random = 6
}
 

Functions

Bitmap * create_bitmap (const int2 &size)
 
void free_bitmap (Bitmap *bm)
 
template<typename ThresholdFn >
Bitmap * image_to_bitmap (const ImBuf &ibuf, ThresholdFn fn)
 
ImBufbitmap_to_image (const Bitmap &bm)
 
Trace * trace_bitmap (const TraceParams &params, Bitmap &bm)
 
void free_trace (Trace *trace)
 
bke::CurvesGeometry trace_to_curves (const Trace &trace, StringRef hole_attribute_id, const float4x4 &transform)
 
bke::CurvesGeometry trace_to_curves (const Trace &trace, StringRef hole_attribute_id, FunctionRef< float3(const int2 &)> pixel_to_position)
 

Enumeration Type Documentation

◆ TurnPolicy

Enumerator
Foreground 
Background 
Left 
Right 
Minority 
Majority 
Random 

Definition at line 48 of file grease_pencil_trace_util.hh.

Function Documentation

◆ bitmap_to_image()

ImBuf * blender::ed::image_trace::bitmap_to_image ( const Bitmap & bm)

◆ create_bitmap()

Bitmap * blender::ed::image_trace::create_bitmap ( const int2 & size)

Referenced by image_to_bitmap().

◆ free_bitmap()

void blender::ed::image_trace::free_bitmap ( Bitmap * bm)

◆ free_trace()

void blender::ed::image_trace::free_trace ( Trace * trace)

◆ image_to_bitmap()

template<typename ThresholdFn >
Bitmap * blender::ed::image_trace::image_to_bitmap ( const ImBuf & ibuf,
ThresholdFn fn )

ThresholdFn separates foreground/background pixels by turning a color value into a bool. Must accept either a ColorGeometry4f or a ColorGeometry4b. bool fn(const ColorGeometry4f &color); bool fn(const ColorGeometry4b &color);

Definition at line 101 of file grease_pencil_trace_util.hh.

References bm, create_bitmap(), ImBufFloatBuffer::data, ImBuf::float_buffer, int, blender::threading::parallel_for(), ImBuf::x, and ImBuf::y.

◆ trace_bitmap()

Trace * blender::ed::image_trace::trace_bitmap ( const TraceParams & params,
Bitmap & bm )

Trace boundaries in the bitmap.

◆ trace_to_curves() [1/2]

bke::CurvesGeometry blender::ed::image_trace::trace_to_curves ( const Trace & trace,
StringRef hole_attribute_id,
const float4x4 & transform )

Create curves from trace data. Pixels are interpreted as (x, y, 0) coordinates and transformed.

◆ trace_to_curves() [2/2]

bke::CurvesGeometry blender::ed::image_trace::trace_to_curves ( const Trace & trace,
StringRef hole_attribute_id,
FunctionRef< float3(const int2 &)> pixel_to_position )

Create curves from trace data. Pixels are transformed by the pixel_to_position function.