Skip to content

Commit

Permalink
Add missing symbol export to Slice::Make
Browse files Browse the repository at this point in the history
  • Loading branch information
meshula committed Aug 11, 2019
1 parent ee8830f commit efb5d10
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 93 deletions.
14 changes: 8 additions & 6 deletions OpenEXR/IlmImf/ImfFrameBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
//
// Copyright (c) 2002, Industrial Light & Magic, a division of Lucas
// Digital Ltd. LLC
//
//
// All rights reserved.
//
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
Expand All @@ -16,8 +16,8 @@
// distribution.
// * Neither the name of Industrial Light & Magic nor the names of
// its contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
Expand Down Expand Up @@ -101,7 +101,7 @@ struct Slice

//--------------------------------------------
// Subsampling: pixel (x, y) is present in the
// slice only if
// slice only if
//
// x % xSampling == 0 && y % ySampling == 0
//
Expand All @@ -117,7 +117,7 @@ struct Slice
//----------------------------------------------------------

double fillValue;


//-------------------------------------------------------
// For tiled files, the xTileCoords and yTileCoords flags
Expand Down Expand Up @@ -155,6 +155,7 @@ struct Slice
//
// if xStride == 0, assumes sizeof(pixeltype)
// if yStride == 0, assumes xStride * ( w / xSampling )
IMF_EXPORT
static Slice Make(PixelType type,
const void *ptr,
const IMATH_NAMESPACE::V2i &origin,
Expand All @@ -169,6 +170,7 @@ struct Slice
bool yTileCoords = false);
// same as above, just computes w and h for you
// from a data window
IMF_EXPORT
static Slice Make(PixelType type,
const void *ptr,
const IMATH_NAMESPACE::Box2i &dataWindow,
Expand Down
175 changes: 88 additions & 87 deletions OpenEXR/exrstdattr/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
//
// Copyright (c) 2004-2014, Industrial Light & Magic, a division of Lucas
// Digital Ltd. LLC
//
//
// All rights reserved.
//
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
Expand All @@ -16,8 +16,8 @@
// distribution.
// * Neither the name of Industrial Light & Magic nor the names of
// its contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
Expand Down Expand Up @@ -248,7 +248,7 @@ struct SetAttr
string name;
int part;
Attribute * attr;

SetAttr (const string &name, int part, Attribute *attr):
name (name), part (part), attr (attr) {}
};
Expand Down Expand Up @@ -361,20 +361,20 @@ isDate (const char attrName[], const char str[])

void
getFloat (const char attrName[],
int argc,
char **argv,
int &i,
int argc,
char **argv,
int &i,
int part,
SetAttrVector &attrs,
void (*check) (const char attrName[], float f) = 0)
SetAttrVector &attrs,
void (*check) (const char attrName[], float f) = 0)
{
if (i > argc - 2)
usageMessage (argv[0]);
usageMessage (argv[0]);

float f = strtod (argv[i + 1], 0);
float f = static_cast<float>(strtod (argv[i + 1], 0));

if (check)
check (attrName, f);
check (attrName, f);

attrs.push_back (SetAttr (attrName, part, new FloatAttribute (f)));
i += 2;
Expand All @@ -383,31 +383,31 @@ getFloat (const char attrName[],

void
getPosFloatOrInf (const char attrName[],
int argc,
char **argv,
int &i,
int part,
SetAttrVector &attrs)
int argc,
char **argv,
int &i,
int part,
SetAttrVector &attrs)
{
if (i > argc - 2)
usageMessage (argv[0]);
usageMessage (argv[0]);

float f;

if (!strcmp (argv[i + 1], "inf") || !strcmp (argv[i + 1], "infinity"))
{
f = float (half::posInf());
f = float (half::posInf());
}
else
{
f = strtod (argv[i + 1], 0);
f = static_cast<float>(strtod (argv[i + 1], 0));

if (f <= 0)
{
cerr << "The value for the " << attrName << " attribute "
"must be greater than zero, or \"infinity\"." << endl;
exit (1);
}
if (f <= 0)
{
cerr << "The value for the " << attrName << " attribute "
"must be greater than zero, or \"infinity\"." << endl;
exit (1);
}
}

attrs.push_back (SetAttr (attrName, part, new FloatAttribute (f)));
Expand All @@ -417,20 +417,21 @@ getPosFloatOrInf (const char attrName[],

void
getV2f (const char attrName[],
int argc,
char **argv,
int &i,
int argc,
char **argv,
int &i,
int part,
SetAttrVector &attrs,
void (*check) (const char attrName[], const V2f &v) = 0)
SetAttrVector &attrs,
void (*check) (const char attrName[], const V2f &v) = 0)
{
if (i > argc - 3)
usageMessage (argv[0]);
usageMessage (argv[0]);

V2f v (strtod (argv[i + 1], 0), strtod (argv[i + 2], 0));
V2f v (static_cast<float>(strtod (argv[i + 1], 0)),
static_cast<float>(strtod (argv[i + 2], 0)));

if (check)
check (attrName, v);
check (attrName, v);

attrs.push_back (SetAttr (attrName, part, new V2fAttribute (v)));
i += 3;
Expand All @@ -439,20 +440,20 @@ getV2f (const char attrName[],

void
getRational (const char attrName[],
int argc,
char **argv,
int &i,
int part,
SetAttrVector &attrs,
void (*check) (const char attrName[], const Rational &r) = 0)
int argc,
char **argv,
int &i,
int part,
SetAttrVector &attrs,
void (*check) (const char attrName[], const Rational &r) = 0)
{
if (i > argc - 3)
usageMessage (argv[0]);
usageMessage (argv[0]);

Rational r (strtol (argv[i + 1], 0, 0), strtol (argv[i + 2], 0, 0));

if (check)
check (attrName, r);
check (attrName, r);

attrs.push_back (SetAttr (attrName, part, new RationalAttribute (r)));
i += 3;
Expand Down Expand Up @@ -500,27 +501,27 @@ getNameAndString (int argc,

void
getNameAndFloat (int argc,
char **argv,
int &i,
char **argv,
int &i,
int part,
SetAttrVector &attrs)
SetAttrVector &attrs)
{
if (i > argc - 3)
usageMessage (argv[0]);
usageMessage (argv[0]);

const char *attrName = argv[i + 1];
float f = strtod (argv[i + 2], 0);
float f = static_cast<float>(strtod (argv[i + 2], 0));
attrs.push_back (SetAttr (attrName, part, new FloatAttribute (f)));
i += 3;
}


void
getNameAndInt (int argc,
char **argv,
int &i,
char **argv,
int &i,
int part,
SetAttrVector &attrs)
SetAttrVector &attrs)
{
if (i > argc - 3)
usageMessage (argv[0]);
Expand All @@ -534,57 +535,57 @@ getNameAndInt (int argc,

void
getChromaticities (const char attrName[],
int argc,
char **argv,
int &i,
int argc,
char **argv,
int &i,
int part,
SetAttrVector &attrs)
SetAttrVector &attrs)
{
if (i > argc - 9)
usageMessage (argv[0]);
usageMessage (argv[0]);

ChromaticitiesAttribute *a = new ChromaticitiesAttribute;
attrs.push_back (SetAttr (attrName, part, a));

a->value().red.x = strtod (argv[i + 1], 0);
a->value().red.y = strtod (argv[i + 2], 0);
a->value().green.x = strtod (argv[i + 3], 0);
a->value().green.y = strtod (argv[i + 4], 0);
a->value().blue.x = strtod (argv[i + 5], 0);
a->value().blue.y = strtod (argv[i + 6], 0);
a->value().white.x = strtod (argv[i + 7], 0);
a->value().white.y = strtod (argv[i + 8], 0);
a->value().red.x = static_cast<float>(strtod (argv[i + 1], 0));
a->value().red.y = static_cast<float>(strtod (argv[i + 2], 0));
a->value().green.x = static_cast<float>(strtod (argv[i + 3], 0));
a->value().green.y = static_cast<float>(strtod (argv[i + 4], 0));
a->value().blue.x = static_cast<float>(strtod (argv[i + 5], 0));
a->value().blue.y = static_cast<float>(strtod (argv[i + 6], 0));
a->value().white.x = static_cast<float>(strtod (argv[i + 7], 0));
a->value().white.y = static_cast<float>(strtod (argv[i + 8], 0));
i += 9;
}


void
getEnvmap (const char attrName[],
int argc,
char **argv,
int &i,
int argc,
char **argv,
int &i,
int part,
SetAttrVector &attrs)
SetAttrVector &attrs)
{
if (i > argc - 2)
usageMessage (argv[0]);
usageMessage (argv[0]);

char *str = argv[i + 1];
Envmap type;

if (!strcmp (str, "latlong") || !strcmp (str, "LATLONG"))
{
type = ENVMAP_LATLONG;
type = ENVMAP_LATLONG;
}
else if (!strcmp (str, "cube") || !strcmp (str, "CUBE"))
{
type = ENVMAP_CUBE;
type = ENVMAP_CUBE;
}
else
{
cerr << "The value for the " << attrName << " attribute "
"must be either LATLONG or CUBE." << endl;
exit (1);
cerr << "The value for the " << attrName << " attribute "
"must be either LATLONG or CUBE." << endl;
exit (1);
}

attrs.push_back (SetAttr (attrName, part, new EnvmapAttribute (type)));
Expand All @@ -594,14 +595,14 @@ getEnvmap (const char attrName[],

void
getKeyCode (const char attrName[],
int argc,
char **argv,
int &i,
int argc,
char **argv,
int &i,
int part,
SetAttrVector &attrs)
SetAttrVector &attrs)
{
if (i > argc - 8)
usageMessage (argv[0]);
usageMessage (argv[0]);

KeyCodeAttribute *a = new KeyCodeAttribute;
attrs.push_back (SetAttr (attrName, part, a));
Expand Down Expand Up @@ -645,7 +646,7 @@ getPart (const char attrName[],
int &part)
{
if (i > argc - 2)
usageMessage (argv[0]);
usageMessage (argv[0]);

if (!strcmp (argv[i + 1], "any"))
part = -1;
Expand All @@ -664,18 +665,18 @@ main(int argc, char **argv)
//

if (argc < 2)
usageMessage (argv[0], true);
usageMessage (argv[0], true);

int exitStatus = 0;

try
{
const char *inFileName = 0;
const char *outFileName = 0;
const char *inFileName = 0;
const char *outFileName = 0;

SetAttrVector attrs;
int part = -1;
int i = 1;
SetAttrVector attrs;
int part = -1;
int i = 1;

while (i < argc)
{
Expand Down

0 comments on commit efb5d10

Please sign in to comment.