Skip to content

Commit 8eeb090

Browse files
authored
Merge pull request #2 from sbscholz/master
changed from Color8:color to Color8:Color8
2 parents 4f11802 + 757b2f9 commit 8eeb090

6 files changed

Lines changed: 15 additions & 16 deletions

File tree

L08_case-study_mandelbrot/Fractal_tier1.sac

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,20 +65,18 @@ int[n:shp] escapeTime( complex[n:shp] plane, int depth)
6565

6666
/** <!--*******************************************************************-->
6767
*
68-
* @fn color[.,.] intArrayToMonochrome( int[.,.] a)
68+
* @fn Color8[.,.] intArrayToMonochrome( int[.,.] a)
6969
*
7070
* @brief converts non-negative integer values into color values using
7171
* a logarithmic 256 element clut from black to red.
7272
*****************************************************************************/
7373
inline
74-
Color8::color[.,.] intArrayToMonochrome( int[.,.] a)
74+
Color8::Color8[.,.] intArrayToMonochrome( int[.,.] a)
7575
{
7676
clut = genLogarithmicClut( 0.4d, 0.9d, Color8::black(), Color8::red());
7777

7878
a = (a * 255) / maxval(a);
7979

80-
return { iv -> clut[ a[ iv]] };
81-
82-
return( d);
80+
return { iv -> clut[ a[ iv] ] };
8381
}
8482

L08_case-study_mandelbrot/Fractal_tier1_empty.sac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ int[n:shp] escapeTime( complex[n:shp] plane, int depth)
6262

6363
/** <!--*******************************************************************-->
6464
*
65-
* @fn color[.,.] intArrayToMonochrome( int[.,.] a)
65+
* @fn Color8[.,.] intArrayToMonochrome( int[.,.] a)
6666
*
6767
* @brief converts non-negative integer values into color values using
6868
* a logarithmic 256 element clut from black to red.
6969
*****************************************************************************/
7070
inline
71-
Color8::color[.,.] intArrayToMonochrome( int[.,.] a)
71+
Color8::Color8[.,.] intArrayToMonochrome( int[.,.] a)
7272
{
7373
clut = genLogarithmicClut( 0.4d, 0.9d, Color8::black(), Color8::red());
7474

L08_case-study_mandelbrot/Fractal_tier2.sac

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ int, complex escapeTimeAndValue (complex z, int depth)
3737
inline
3838
int[m,n], complex[m,n] escapeTimeAndValue ( complex[m,n] plane, int depth)
3939
{
40-
return { iv -> escapeTimeAndValue (plane[iv]) };
40+
its, image = { iv -> escapeTimeAndValue (plane[iv], depth) };
41+
return (its, image);
4142
}
4243

4344

@@ -62,7 +63,7 @@ double[d:shp] normalizedIterationCount(int[d:shp] n, complex[d:shp] zn)
6263

6364
/** <!--*******************************************************************-->
6465
*
65-
* @fn color[d:shp] doubleArrayToRGB( double[d:shp] a)
66+
* @fn Color8[d:shp] doubleArrayToRGB( double[d:shp] a)
6667
*
6768
* @brief transforms an array of doubles into RGB values, by
6869
* FIRST scaling them into values between 0.0 and 360.0, and
@@ -73,7 +74,7 @@ double[d:shp] normalizedIterationCount(int[d:shp] n, complex[d:shp] zn)
7374
* @return RGB values
7475
*****************************************************************************/
7576
inline
76-
Color8::color[d:shp] doubleArrayToRGB( double[d:shp] a)
77+
Color8::Color8[d:shp] doubleArrayToRGB( double[d:shp] a)
7778
{
7879
max = maxval( a);
7980
min = minval( a);

L08_case-study_mandelbrot/Fractal_tier2_empty.sac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ double[d:shp] normalizedIterationCount(int[d:shp] n, complex[d:shp] zn)
6464

6565
/** <!--*******************************************************************-->
6666
*
67-
* @fn color[d:shp] doubleArrayToRGB( double[d:shp] a)
67+
* @fn Color8[d:shp] doubleArrayToRGB( double[d:shp] a)
6868
*
6969
* @brief transforms an array of doubles into RGB values, by
7070
* FIRST scaling them into values between 0.0 and 360.0, and
@@ -75,7 +75,7 @@ double[d:shp] normalizedIterationCount(int[d:shp] n, complex[d:shp] zn)
7575
* @return RGB values
7676
*****************************************************************************/
7777
inline
78-
Color8::color[d:shp] doubleArrayToRGB( double[d:shp] a)
78+
Color8::Color8[d:shp] doubleArrayToRGB( double[d:shp] a)
7979
{
8080
/**
8181
* fill in here...

L08_case-study_mandelbrot/Stencil_tier3.sac

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ int[.,.] sobelEdges( int[.,.] img)
9090
}
9191

9292
inline
93-
Color8::color[.,.] sobelEdges( Color8::color[.,.] img)
93+
Color8::Color8[.,.] sobelEdges( Color8::Color8[.,.] img)
9494
{
9595
int_res = { [.,.,i] -> sobelEdges( (Color8::toi( img)[.,.,i])) };
9696
res = { [x,y] -> Color8::newColor( int_res[x,y]) };
@@ -112,7 +112,7 @@ int[.,.] gaussBlur( int[.,.] img)
112112
}
113113

114114
inline
115-
Color8::color[.,.] gaussBlur( Color8::color[.,.] img)
115+
Color8::Color8[.,.] gaussBlur( Color8::Color8[.,.] img)
116116
{
117117
int_res = { [.,.,i] -> gaussBlur( (Color8::toi( img)[.,.,i])) };
118118
res = { [x,y] -> Color8::newColor( int_res[x,y]) };
@@ -133,7 +133,7 @@ int[.,.] gaussBlur25( int[.,.] img)
133133
}
134134

135135
inline
136-
Color8::color[.,.] gaussBlur25( Color8::color[.,.] img)
136+
Color8::Color8[.,.] gaussBlur25( Color8::Color8[.,.] img)
137137
{
138138
int_res = { [.,.,i] -> gaussBlur25( (Color8::toi( img)[.,.,i])) };
139139
res = { [x,y] -> Color8::newColor( int_res[x,y]) };

L08_case-study_mandelbrot/mandelbrot.sac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use Fractal_tier2 : all;
1717
use Stencil_tier3 : all;
1818

1919
inline
20-
color[ms,ns] stretchRgb( color[m,n] pic, int stretch)
20+
Color8[ms,ns] stretchRgb( Color8[m,n] pic, int stretch)
2121
{
2222
return { iv -> pic[ iv / stretch] | iv < shape(pic) * stretch };
2323
}

0 commit comments

Comments
 (0)