PandA-2024.02
Data Structures | Typedefs | Functions | Variables
simple_raytrace.c File Reference
#include <math.h>
Include dependency graph for simple_raytrace.c:

Go to the source code of this file.

Data Structures

struct  Node
 
struct  Intersection
 

Typedefs

typedef float float3 __attribute__((vector_size(16)))
 

Functions

void print (int x)
 
void print2 (int arg0, int arg1)
 
void print3 (int arg0, int arg1, int arg2)
 
float dot3f (float3 a, float3 b)
 
struct Intersection plane_intersect (struct Node *node, float3 start, float3 dir)
 
struct Intersection sphere_intersect (struct Node *node, float3 start, float3 dir)
 
struct Intersection node_intersect (struct Node *node, float3 start, float3 dir)
 
float3 raytrace_color (float3 start, float3 dir)
 
struct Intersection intersection (float dist, float3 color)
 
float3 get_color (float3 pos)
 
float3 view_vec (int x, int y)
 
int rgb (float r, float g, float b)
 
void raytrace (int x, int y)
 

Variables

struct Node nodes [7]
 

Typedef Documentation

◆ __attribute__

__attribute__

Definition at line 9 of file simple_raytrace.c.

Function Documentation

◆ dot3f()

float dot3f ( float3  a,
float3  b 
)

Definition at line 12 of file simple_raytrace.c.

Referenced by plane_intersect(), and sphere_intersect().

Here is the caller graph for this function:

◆ get_color()

float3 get_color ( float3  pos)

Definition at line 93 of file simple_raytrace.c.

Referenced by plane_intersect().

Here is the caller graph for this function:

◆ intersection()

struct Intersection intersection ( float  dist,
float3  color 
)

Definition at line 83 of file simple_raytrace.c.

References Node::color, Intersection::color, Intersection::dist, and result.

Referenced by LoadOpNode::opCtorGenerator(), plane_intersect(), and sphere_intersect().

Here is the caller graph for this function:

◆ node_intersect()

struct Intersection node_intersect ( struct Node node,
float3  start,
float3  dir 
)

Definition at line 184 of file simple_raytrace.c.

References Intersection::dist, Node::intersect, Node::left, and Node::right.

◆ plane_intersect()

struct Intersection plane_intersect ( struct Node node,
float3  start,
float3  dir 
)

Definition at line 106 of file simple_raytrace.c.

References dot3f(), get_color(), and intersection().

Here is the call graph for this function:

◆ print()

void print ( int  x)

Referenced by VarNode::getAbstractState(), Parameter::removeOption(), and Schedule::set_csteps().

Here is the caller graph for this function:

◆ print2()

void print2 ( int  arg0,
int  arg1 
)

◆ print3()

void print3 ( int  arg0,
int  arg1,
int  arg2 
)

Referenced by raytrace().

Here is the caller graph for this function:

◆ raytrace()

void raytrace ( int  x,
int  y 
)

Definition at line 239 of file simple_raytrace.c.

References Node::color, print3(), raytrace_color(), rgb(), and view_vec().

Here is the call graph for this function:

◆ raytrace_color()

float3 raytrace_color ( float3  start,
float3  dir 
)

Definition at line 227 of file simple_raytrace.c.

References Intersection::dist, and Node::intersect.

Referenced by raytrace(), and rgb().

Here is the caller graph for this function:

◆ rgb()

int rgb ( float  r,
float  g,
float  b 
)

Definition at line 216 of file simple_raytrace.c.

References raytrace_color().

Referenced by raytrace().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sphere_intersect()

struct Intersection sphere_intersect ( struct Node node,
float3  start,
float3  dir 
)

Definition at line 131 of file simple_raytrace.c.

References Intersection::color, Intersection::dist, dot3f(), intersection(), and Node::pos.

Here is the call graph for this function:

◆ view_vec()

float3 view_vec ( int  x,
int  y 
)

Definition at line 207 of file simple_raytrace.c.

Referenced by raytrace().

Here is the caller graph for this function:

Variable Documentation

◆ nodes

struct Node nodes[7]
Initial value:
=
{
{ (float4){0,1,0,0}, plane_intersect,
0, 0, (float3){1,0,0} },
{ (float4){0,1,2,1}, sphere_intersect,
0, 0, (float3){0,0,1} },
{ (float4){1,0,0,1}, node_intersect,
0, 1, (float3){1,1,1} },
{ (float4){-2,1,2,1}, sphere_intersect,
0, 0, (float3){0,1,0} },
{ (float4){1,0,0,1}, node_intersect,
3, 2, (float3){1,1,1} },
{ (float4){2,1,2,1}, sphere_intersect,
0, 0, (float3){0,1,1} },
{ (float4){1,0,0,1}, node_intersect,
4, 5, (float3){1,1,1} }
}
struct Intersection sphere_intersect(struct Node *node, float3 start, float3 dir)
struct Intersection plane_intersect(struct Node *node, float3 start, float3 dir)
struct Intersection node_intersect(struct Node *node, float3 start, float3 dir)

Definition at line 62 of file simple_raytrace.c.

Referenced by bfs(), data_to_input(), and input_to_data().


Generated on Mon Feb 12 2024 13:03:09 for PandA-2024.02 by doxygen 1.8.13