<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Hello again,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">I have gotten <a name="_MailEndCompose">
some of the things I want done somewhat working.<o:p></o:p></a></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">I am now having an issue attempting to get a layer to update within a system thread I made.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">First off I built all this using the Simple Ocean plugin code as my base line. I then added a way to get a simple yellow box to show where I wanted programically with osgEarth. I do have shader code working
but what I need help with now is updating my layer ever so often with new data for my shaders to run on.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Below is my simple function that my thread runs, layer is a valid layer that is displayed named “newlayer”.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">The code runs and ramps up the alpha channel for a while (sometimes few seconds, sometimes minutes) and starts the ramp again with almost transparent, but eventually I get a read access violation in osg/NodeVisitor.cpp
line 107.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Can anyone look and hint to what might be causing this issue?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">It is almost as if my code and osg code are conflicting with some pointer somewhere and I am not sure how to mutex my code correctly. Maybe it is my thread? I am using a std::thread to run this function on.
Am I updating my layer wrong completely by removing and adding a new one?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Thanks in advance.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:blue">void</span><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">mysimpleocean</span><span style="font-size:8.0pt;font-family:Consolas;color:black">::mylayer_redraw(osg::</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">ref_ptr</span><span style="font-size:8.0pt;font-family:Consolas;color:black"><osgEarth::</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">ImageLayer</span><span style="font-size:8.0pt;font-family:Consolas;color:black">>
</span><span style="font-size:8.0pt;font-family:Consolas;color:gray">layer</span><span style="font-size:8.0pt;font-family:Consolas;color:black">) {<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:blue">int</span><span style="font-size:8.0pt;font-family:Consolas;color:black"> width = 200;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:blue">int</span><span style="font-size:8.0pt;font-family:Consolas;color:black"> height = 200;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:blue">double</span><span style="font-size:8.0pt;font-family:Consolas;color:black"> wlon = -104.00;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:blue">double</span><span style="font-size:8.0pt;font-family:Consolas;color:black"> nlat = 49.00;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:blue">double</span><span style="font-size:8.0pt;font-family:Consolas;color:black"> elon = -96.00;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:blue">double</span><span style="font-size:8.0pt;font-family:Consolas;color:black"> slat = 45.00;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:blue">int</span><span style="font-size:8.0pt;font-family:Consolas;color:black"> target_height = 200;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:blue">int</span><span style="font-size:8.0pt;font-family:Consolas;color:black"> target_width = 200;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:blue">double</span><span style="font-size:8.0pt;font-family:Consolas;color:black"> geoTransform[6];<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> geoTransform[0] = wlon;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> geoTransform[1] = (elon - wlon) / width;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> geoTransform[2] = 0.00;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> geoTransform[3] = nlat;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> geoTransform[4] = 0.00;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> geoTransform[5] = (slat - nlat) / height;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> GDALAllRegister();<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">GDALDataset</span><span style="font-size:8.0pt;font-family:Consolas;color:black">* nmemDS;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> osgEarth::</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">SpatialReference</span><span style="font-size:8.0pt;font-family:Consolas;color:black">*
srs = </span><span style="font-size:8.0pt;font-family:Consolas;color:blue">const_cast</span><span style="font-size:8.0pt;font-family:Consolas;color:black"><osgEarth::</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">SpatialReference</span><span style="font-size:8.0pt;font-family:Consolas;color:black">*>(_map->getProfile()->getSRS());<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">GDALRasterBand</span><span style="font-size:8.0pt;font-family:Consolas;color:black">* bandRed;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">GDALRasterBand</span><span style="font-size:8.0pt;font-family:Consolas;color:black">* bandGreen;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">GDALRasterBand</span><span style="font-size:8.0pt;font-family:Consolas;color:black">* bandBlue;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">GDALRasterBand</span><span style="font-size:8.0pt;font-family:Consolas;color:black">* bandAlpha;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> osgEarth::Drivers::</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">GDALOptions</span><span style="font-size:8.0pt;font-family:Consolas;color:black">
gdaloptions;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> osg::</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">ref_ptr</span><span style="font-size:8.0pt;font-family:Consolas;color:black"><osgEarth::Drivers::</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">GDALOptions</span><span style="font-size:8.0pt;font-family:Consolas;color:black">::</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">ExternalDataset</span><span style="font-size:8.0pt;font-family:Consolas;color:black">>
eds;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> Threading::</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">Mutex</span><span style="font-size:8.0pt;font-family:Consolas;color:black">
_mutex;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> osg::</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">ref_ptr</span><span style="font-size:8.0pt;font-family:Consolas;color:black"><osgEarth::</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">ImageLayer</span><span style="font-size:8.0pt;font-family:Consolas;color:black">>
tlayer;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:blue">int</span><span style="font-size:8.0pt;font-family:Consolas;color:black"> alpha = 143;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:blue">while</span><span style="font-size:8.0pt;font-family:Consolas;color:black"> (</span><span style="font-size:8.0pt;font-family:Consolas;color:blue">true</span><span style="font-size:8.0pt;font-family:Consolas;color:black">)
{<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> nmemDS = (</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">GDALDataset</span><span style="font-size:8.0pt;font-family:Consolas;color:black">*)GDALCreate(GDALGetDriverByName(</span><span style="font-size:8.0pt;font-family:Consolas;color:#A31515">"MEM"</span><span style="font-size:8.0pt;font-family:Consolas;color:black">),
</span><span style="font-size:8.0pt;font-family:Consolas;color:#A31515">""</span><span style="font-size:8.0pt;font-family:Consolas;color:black">, 200, 200, 0,
</span><span style="font-size:8.0pt;font-family:Consolas;color:darkslategray">GDT_Byte</span><span style="font-size:8.0pt;font-family:Consolas;color:black">,
</span><span style="font-size:8.0pt;font-family:Consolas;color:blue">nullptr</span><span style="font-size:8.0pt;font-family:Consolas;color:black">);
<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> GDALSetProjection(nmemDS, srs->getWKT().c_str());<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> GDALSetGeoTransform(nmemDS, geoTransform);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> nmemDS->AddBand(</span><span style="font-size:8.0pt;font-family:Consolas;color:darkslategray">GDT_Byte</span><span style="font-size:8.0pt;font-family:Consolas;color:black">,
</span><span style="font-size:8.0pt;font-family:Consolas;color:blue">nullptr</span><span style="font-size:8.0pt;font-family:Consolas;color:black">);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> nmemDS->AddBand(</span><span style="font-size:8.0pt;font-family:Consolas;color:darkslategray">GDT_Byte</span><span style="font-size:8.0pt;font-family:Consolas;color:black">,
</span><span style="font-size:8.0pt;font-family:Consolas;color:blue">nullptr</span><span style="font-size:8.0pt;font-family:Consolas;color:black">);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> nmemDS->AddBand(</span><span style="font-size:8.0pt;font-family:Consolas;color:darkslategray">GDT_Byte</span><span style="font-size:8.0pt;font-family:Consolas;color:black">,
</span><span style="font-size:8.0pt;font-family:Consolas;color:blue">nullptr</span><span style="font-size:8.0pt;font-family:Consolas;color:black">);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> nmemDS->AddBand(</span><span style="font-size:8.0pt;font-family:Consolas;color:darkslategray">GDT_Byte</span><span style="font-size:8.0pt;font-family:Consolas;color:black">,
</span><span style="font-size:8.0pt;font-family:Consolas;color:blue">nullptr</span><span style="font-size:8.0pt;font-family:Consolas;color:black">);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> bandRed = nmemDS->GetRasterBand(1);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> bandGreen = nmemDS->GetRasterBand(2);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> bandBlue = nmemDS->GetRasterBand(3);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> bandAlpha = nmemDS->GetRasterBand(4);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">BYTE</span><span style="font-size:8.0pt;font-family:Consolas;color:black">* rrowbuff =
</span><span style="font-size:8.0pt;font-family:Consolas;color:blue">new</span><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">BYTE</span><span style="font-size:8.0pt;font-family:Consolas;color:black">[width];<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">BYTE</span><span style="font-size:8.0pt;font-family:Consolas;color:black">* growbuff =
</span><span style="font-size:8.0pt;font-family:Consolas;color:blue">new</span><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">BYTE</span><span style="font-size:8.0pt;font-family:Consolas;color:black">[width];<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">BYTE</span><span style="font-size:8.0pt;font-family:Consolas;color:black">* browbuff =
</span><span style="font-size:8.0pt;font-family:Consolas;color:blue">new</span><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">BYTE</span><span style="font-size:8.0pt;font-family:Consolas;color:black">[width];<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">BYTE</span><span style="font-size:8.0pt;font-family:Consolas;color:black">* arowbuff =
</span><span style="font-size:8.0pt;font-family:Consolas;color:blue">new</span><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">BYTE</span><span style="font-size:8.0pt;font-family:Consolas;color:black">[width];<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:blue">for</span><span style="font-size:8.0pt;font-family:Consolas;color:black"> (</span><span style="font-size:8.0pt;font-family:Consolas;color:blue">int</span><span style="font-size:8.0pt;font-family:Consolas;color:black">
y = 0; y < height; y++) {<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:blue">for</span><span style="font-size:8.0pt;font-family:Consolas;color:black"> (</span><span style="font-size:8.0pt;font-family:Consolas;color:blue">int</span><span style="font-size:8.0pt;font-family:Consolas;color:black">
x = 0; x < width; x++) {<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> rrowbuff[x] = (</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">BYTE</span><span style="font-size:8.0pt;font-family:Consolas;color:black">)255;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> growbuff[x] = (</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">BYTE</span><span style="font-size:8.0pt;font-family:Consolas;color:black">)253;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> browbuff[x] = (</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">BYTE</span><span style="font-size:8.0pt;font-family:Consolas;color:black">)143;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> arowbuff[x] = (</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">BYTE</span><span style="font-size:8.0pt;font-family:Consolas;color:black">)alpha;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> }<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">CPLErr</span><span style="font-size:8.0pt;font-family:Consolas;color:black"> rerr = bandRed->RasterIO(</span><span style="font-size:8.0pt;font-family:Consolas;color:darkslategray">GF_Write</span><span style="font-size:8.0pt;font-family:Consolas;color:black">,
0, 0, target_width, target_height, rrowbuff, target_width * ((elon - wlon) / target_width), target_height * abs((slat - nlat) / target_height),
</span><span style="font-size:8.0pt;font-family:Consolas;color:darkslategray">GDT_Byte</span><span style="font-size:8.0pt;font-family:Consolas;color:black">, 4, 0);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">CPLErr</span><span style="font-size:8.0pt;font-family:Consolas;color:black"> gerr = bandGreen->RasterIO(</span><span style="font-size:8.0pt;font-family:Consolas;color:darkslategray">GF_Write</span><span style="font-size:8.0pt;font-family:Consolas;color:black">,
0, 0, target_width, target_height, growbuff, target_width * ((elon - wlon) / target_width), target_height * abs((slat - nlat) / target_height),
</span><span style="font-size:8.0pt;font-family:Consolas;color:darkslategray">GDT_Byte</span><span style="font-size:8.0pt;font-family:Consolas;color:black">, 4, 0);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">CPLErr</span><span style="font-size:8.0pt;font-family:Consolas;color:black"> berr = bandBlue->RasterIO(</span><span style="font-size:8.0pt;font-family:Consolas;color:darkslategray">GF_Write</span><span style="font-size:8.0pt;font-family:Consolas;color:black">,
0, 0, target_width, target_height, browbuff, target_width * ((elon - wlon) / target_width), target_height * abs((slat - nlat) / target_height),
</span><span style="font-size:8.0pt;font-family:Consolas;color:darkslategray">GDT_Byte</span><span style="font-size:8.0pt;font-family:Consolas;color:black">, 4, 0);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">CPLErr</span><span style="font-size:8.0pt;font-family:Consolas;color:black"> aerr = bandAlpha->RasterIO(</span><span style="font-size:8.0pt;font-family:Consolas;color:darkslategray">GF_Write</span><span style="font-size:8.0pt;font-family:Consolas;color:black">,
0, 0, target_width, target_height, arowbuff, target_width * ((elon - wlon) / target_width), target_height * abs((slat - nlat) / target_height),
</span><span style="font-size:8.0pt;font-family:Consolas;color:darkslategray">GDT_Byte</span><span style="font-size:8.0pt;font-family:Consolas;color:black">, 4, 0);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> }<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> alpha = alpha + 10;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:blue">if</span><span style="font-size:8.0pt;font-family:Consolas;color:black"> (alpha > 255)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> alpha = alpha - 255;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> eds
</span><span style="font-size:8.0pt;font-family:Consolas;color:teal">=</span><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:blue">new</span><span style="font-size:8.0pt;font-family:Consolas;color:black"> osgEarth::Drivers::</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">GDALOptions</span><span style="font-size:8.0pt;font-family:Consolas;color:black">::</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">ExternalDataset</span><span style="font-size:8.0pt;font-family:Consolas;color:black">(nmemDS,
</span><span style="font-size:8.0pt;font-family:Consolas;color:blue">true</span><span style="font-size:8.0pt;font-family:Consolas;color:black">);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> gdaloptions.externalDataset()
</span><span style="font-size:8.0pt;font-family:Consolas;color:teal">=</span><span style="font-size:8.0pt;font-family:Consolas;color:black"> eds;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> tlayer
</span><span style="font-size:8.0pt;font-family:Consolas;color:teal">=</span><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:blue">dynamic_cast</span><span style="font-size:8.0pt;font-family:Consolas;color:black"><osgEarth::</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">ImageLayer</span><span style="font-size:8.0pt;font-family:Consolas;color:black">*>(_map->getLayerByName(</span><span style="font-size:8.0pt;font-family:Consolas;color:#A31515">"newlayer"</span><span style="font-size:8.0pt;font-family:Consolas;color:black">));<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> tlayer</span><span style="font-size:8.0pt;font-family:Consolas;color:teal">-></span><span style="font-size:8.0pt;font-family:Consolas;color:black">setDataVariance(osg::</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">Object</span><span style="font-size:8.0pt;font-family:Consolas;color:black">::</span><span style="font-size:8.0pt;font-family:Consolas;color:darkslategray">DYNAMIC</span><span style="font-size:8.0pt;font-family:Consolas;color:black">);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> tlayer</span><span style="font-size:8.0pt;font-family:Consolas;color:teal">-></span><span style="font-size:8.0pt;font-family:Consolas;color:black">getOrCreateStateSet()->setDataVariance(osg::</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">Object</span><span style="font-size:8.0pt;font-family:Consolas;color:black">::</span><span style="font-size:8.0pt;font-family:Consolas;color:darkslategray">DYNAMIC</span><span style="font-size:8.0pt;font-family:Consolas;color:black">);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> // tlayer</span><span style="font-size:8.0pt;font-family:Consolas;color:teal">-></span><span style="font-size:8.0pt;font-family:Consolas;color:black">disable(</span><span style="font-size:8.0pt;font-family:Consolas;color:#A31515">""</span><span style="font-size:8.0pt;font-family:Consolas;color:black">);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> Threading::</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">ScopedMutexLock</span><span style="font-size:8.0pt;font-family:Consolas;color:black">
exclusiveLock(_mutex);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> _map->removeLayer(tlayer);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:gray">layer</span><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:teal">=</span><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:blue">new</span><span style="font-size:8.0pt;font-family:Consolas;color:black"> osgEarth::</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">ImageLayer</span><span style="font-size:8.0pt;font-family:Consolas;color:black">(</span><span style="font-size:8.0pt;font-family:Consolas;color:#A31515">"newlayer"</span><span style="font-size:8.0pt;font-family:Consolas;color:black">,
gdaloptions);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:gray">layer</span><span style="font-size:8.0pt;font-family:Consolas;color:teal">-></span><span style="font-size:8.0pt;font-family:Consolas;color:black">setDataVariance(osg::</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">Object</span><span style="font-size:8.0pt;font-family:Consolas;color:black">::</span><span style="font-size:8.0pt;font-family:Consolas;color:darkslategray">DYNAMIC</span><span style="font-size:8.0pt;font-family:Consolas;color:black">);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:gray">layer</span><span style="font-size:8.0pt;font-family:Consolas;color:teal">-></span><span style="font-size:8.0pt;font-family:Consolas;color:black">getOrCreateStateSet()->setDataVariance(osg::</span><span style="font-size:8.0pt;font-family:Consolas;color:#2B91AF">Object</span><span style="font-size:8.0pt;font-family:Consolas;color:black">::</span><span style="font-size:8.0pt;font-family:Consolas;color:darkslategray">DYNAMIC</span><span style="font-size:8.0pt;font-family:Consolas;color:black">);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> _map->addLayer(</span><span style="font-size:8.0pt;font-family:Consolas;color:gray">layer</span><span style="font-size:8.0pt;font-family:Consolas;color:black">);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:blue">delete</span><span style="font-size:8.0pt;font-family:Consolas;color:black"> rrowbuff;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:blue">delete</span><span style="font-size:8.0pt;font-family:Consolas;color:black"> growbuff;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:blue">delete</span><span style="font-size:8.0pt;font-family:Consolas;color:black"> browbuff;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
</span><span style="font-size:8.0pt;font-family:Consolas;color:blue">delete</span><span style="font-size:8.0pt;font-family:Consolas;color:black"> arowbuff;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> Sleep(2000);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black">
<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:Consolas;color:black"> }<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:Consolas;color:black">}</span><span style="font-size:8.0pt;color:#1F497D"><o:p></o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Shannon Peterson <br>
<b>Sent:</b> Friday, August 30, 2019 3:27 PM<br>
<b>To:</b> 'osg-users@lists.openscenegraph.org' <osg-users@lists.openscenegraph.org><br>
<b>Subject:</b> questions about developing drivers for osg/osgEarth<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I have a few questions about how to build a driver to do some specific tasks in osgEarth.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Simple example. <o:p></o:p></p>
<p class="MsoNormal">Using simple ocean as an example replace the texture piece with geo-spacial image and then build a shader to add effect to the image.<o:p></o:p></p>
<p class="MsoNormal">Ie. Arrowed line that changes color in towards the direction a path should be followed start to end.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The shader piece can be figured out by us working with the shader code.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The part I am having issues with is adding an arrow image or geometry polygon of an arrow to the map at the position I need it at to run the shader effect on.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Is this the correct place to aske this sort of question or is there a different mailing list or thread I should use to get help with getting this designed.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thank you in advance<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Shannon Peterson<o:p></o:p></p>
<p class="MsoNormal"><a href="mailto:speterson@idealaero.com">speterson@idealaero.com</a><o:p></o:p></p>
</div>
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:6.0pt;font-family:"Tahoma","sans-serif";color:#1F497D;text-transform:uppercase">The information contained in this email and any attachments is intended only for the personal and confidential use of the intended recipients.
This email message may be or may contain privileged and confidential communications. If the reader of this e-mail is not an intended recipient, you are hereby notified that you have received this communication in error and that any retention, review, use,
dissemination, distribution or copying of this communication or the information contained herein is strictly prohibited. If you have received this communication in error, please notify the sender immediately and delete the original message and all attachments
from your system. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused, directly or indirectly, by any virus transmitted in this email. This communication may also contain
data subject to U.S. export laws. If so, that data subject to the International Traffic in Arms Regulation (ITAR) cannot be disseminated, distributed or copied to foreign nationals, residing in the U.S. or abroad, absent the express prior approval of the U.S.
Department of State. If you have received this communication in error, please notify the sender by reply e-mail and destroy the e-mail message and any physical copies made of the communication. Thank you.</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:#1F497D"><o:p></o:p></span></p>
</div>
</body>
</html>