+ make it compile on win32
This commit is contained in:
parent
9a9042ce84
commit
230f96b3cf
1 changed files with 20 additions and 17 deletions
|
@ -114,7 +114,8 @@ namespace mapnik {
|
|||
unsigned width = in.width();
|
||||
unsigned height = in.height();
|
||||
|
||||
unsigned alphaCount[alpha.size()];
|
||||
//unsigned alphaCount[alpha.size()];
|
||||
std::vector<unsigned> alphaCount(alpha.size());
|
||||
for(unsigned i=0; i<alpha.size(); i++)
|
||||
{
|
||||
alpha[i] = 0;
|
||||
|
@ -158,7 +159,8 @@ namespace mapnik {
|
|||
unsigned width = in.width();
|
||||
unsigned height = in.height();
|
||||
|
||||
unsigned alphaCount[alpha.size()];
|
||||
//unsigned alphaCount[alpha.size()];
|
||||
std::vector<unsigned> alphaCount(alpha.size());
|
||||
for(unsigned i=0; i<alpha.size(); i++)
|
||||
{
|
||||
alpha[i] = 0;
|
||||
|
@ -249,15 +251,16 @@ namespace mapnik {
|
|||
// make transparent lowest indexes, so tRNS is small
|
||||
if (alpha.size()>0)
|
||||
{
|
||||
png_byte trans[alpha.size()];
|
||||
std::vector<png_byte> trans(alpha.size());
|
||||
unsigned alphaSize=0;//truncate to nonopaque values
|
||||
for(unsigned i=0; i<alpha.size(); i++){
|
||||
for(unsigned i=0; i < alpha.size(); i++)
|
||||
{
|
||||
trans[i]=alpha[i];
|
||||
if (alpha[i]<255)
|
||||
alphaSize = i+1;
|
||||
}
|
||||
if (alphaSize>0)
|
||||
png_set_tRNS(png_ptr, info_ptr, (png_bytep)trans, alphaSize, NULL);
|
||||
png_set_tRNS(png_ptr, info_ptr, (png_bytep)&trans[0], alphaSize, 0);
|
||||
}
|
||||
|
||||
png_write_info(png_ptr, info_ptr);
|
||||
|
|
Loading…
Reference in a new issue