Loading...
Searching...
No Matches
CameraSample.h
Go to the documentation of this file.
//-*****************************************************************************
//
// Copyright (c) 2009-2011,
// Sony Pictures Imageworks, Inc. and
// Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd.
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Sony Pictures Imageworks, nor
// Industrial Light & Magic nor the names of their contributors may be used
// to endorse or promote products derived 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
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//-*****************************************************************************
#ifndef Alembic_AbcGeom_CameraSample_h
#define Alembic_AbcGeom_CameraSample_h
#include <Alembic/Util/Export.h>
#include <Alembic/AbcGeom/Foundation.h>
#include <Alembic/AbcGeom/FilmBackXformOp.h>
namespace Alembic {
namespace AbcGeom {
namespace ALEMBIC_VERSION_NS {
//-*****************************************************************************
class ALEMBIC_EXPORT CameraSample
{
public:
CameraSample() { reset(); }
CameraSample( double iTop, double iBottom, double iLeft, double iRight );
void getScreenWindow( double & oTop, double & oBottom, double & oLeft,
double & oRight );
double getFocalLength() const { return m_focalLength; }
void setFocalLength( double iVal ) { m_focalLength = iVal; }
double getHorizontalAperture() const { return m_horizontalAperture; }
void setHorizontalAperture( double iVal ) { m_horizontalAperture = iVal; }
double getHorizontalFilmOffset() const { return m_horizontalFilmOffset; }
void setHorizontalFilmOffset( double iVal )
{ m_horizontalFilmOffset = iVal; }
double getVerticalAperture() const { return m_verticalAperture; }
void setVerticalAperture( double iVal ) { m_verticalAperture = iVal; }
double getVerticalFilmOffset() const { return m_verticalFilmOffset; }
void setVerticalFilmOffset( double iVal ) { m_verticalFilmOffset = iVal; }
double getLensSqueezeRatio() const { return m_lensSqueezeRatio; }
void setLensSqueezeRatio( double iVal )
{ m_lensSqueezeRatio = iVal; }
double getOverScanLeft() { return m_overscanLeft; }
void setOverScanLeft( double iVal ) { m_overscanLeft = iVal; }
double getOverScanRight() const { return m_overscanRight; }
void setOverScanRight( double iVal ) { m_overscanRight = iVal; }
double getOverScanTop() const { return m_overscanTop; }
void setOverScanTop( double iVal ) { m_overscanTop = iVal; }
double getOverScanBottom() const { return m_overscanBottom; }
void setOverScanBottom( double iVal ) { m_overscanBottom = iVal; }
double getFStop() const { return m_fStop; }
void setFStop( double iVal ) { m_fStop = iVal; }
double getFocusDistance() const { return m_focusDistance; }
void setFocusDistance( double iVal ) { m_focusDistance = iVal; }
double getShutterOpen() const { return m_shutterOpen; }
void setShutterOpen( double iVal ) { m_shutterOpen = iVal; }
double getShutterClose() const { return m_shutterClose; }
void setShutterClose( double iVal ) { m_shutterClose = iVal; }
double getNearClippingPlane() const { return m_nearClippingPlane; }
void setNearClippingPlane( double iVal ) { m_nearClippingPlane = iVal; }
double getFarClippingPlane() const { return m_farClippingPlane; }
void setFarClippingPlane( double iVal ) { m_farClippingPlane = iVal; }
Abc::Box3d getChildBounds() const { return m_childBounds; }
void setChildBounds( const Abc::Box3d & iBounds )
{ m_childBounds = iBounds; }
// helper function for getting one of the 16 core, non film back xform op
// related values
double getCoreValue( std::size_t iIndex ) const;
// calculated the field of view in degrees
double getFieldOfView() const;;
// add an op and return the index of the op in its op-stack
std::size_t addOp( FilmBackXformOp iOp );
FilmBackXformOp getOp( std::size_t iIndex ) const;
FilmBackXformOp &operator[]( const std::size_t &iIndex );
const FilmBackXformOp &operator[]( const std::size_t &iIndex ) const;
Abc::M33d getFilmBackMatrix () const;
std::size_t getNumOps() const;
std::size_t getNumOpChannels() const;
void reset()
{
// in mm
m_focalLength = 35.0;
// in cm
m_horizontalAperture = 3.6;
m_horizontalFilmOffset = 0.0;
m_verticalAperture = 2.4;
m_verticalFilmOffset = 0.0;
// width/height lens aspect ratio
m_lensSqueezeRatio = 1.0;
m_overscanLeft = 0.0;
m_overscanRight = 0.0;
m_overscanTop = 0.0;
m_overscanBottom = 0.0;
// optical property of the lens, focal length divided by
// "effective" lens diameter
m_fStop = 5.6;
m_focusDistance = 5.0;
m_shutterOpen = 0.0;
m_shutterClose = 0.020833333333333332;
m_nearClippingPlane = 0.1;
m_farClippingPlane = 100000.0;
m_childBounds.makeEmpty();
m_ops.clear();
}
private:
double m_focalLength;
double m_horizontalAperture;
double m_horizontalFilmOffset;
double m_verticalAperture;
double m_verticalFilmOffset;
double m_lensSqueezeRatio;
double m_overscanLeft;
double m_overscanRight;
double m_overscanTop;
double m_overscanBottom;
double m_fStop;
double m_focusDistance;
double m_shutterOpen;
double m_shutterClose;
double m_nearClippingPlane;
double m_farClippingPlane;
Abc::Box3d m_childBounds;
std::vector<FilmBackXformOp> m_ops;
};
} // End namespace ALEMBIC_VERSION_NS
using namespace ALEMBIC_VERSION_NS;
} // End namespace AbcGeom
} // End namespace Alembic
#endif
Foundation.h
Export.h
ALEMBIC_EXPORT
#define ALEMBIC_EXPORT
Definition Export.h:51
FilmBackXformOp.h
ALEMBIC_VERSION_NS
#define ALEMBIC_VERSION_NS
Definition Foundation.h:105
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::getFocalLength
double getFocalLength() const
get the camera focal length in millimeters.
Definition CameraSample.h:64
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::getChildBounds
Abc::Box3d getChildBounds() const
Definition CameraSample.h:177
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::getFilmBackMatrix
Abc::M33d getFilmBackMatrix() const
Returns the concatenated 3x3 film back matrix.
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::setOverScanRight
void setOverScanRight(double iVal)
Definition CameraSample.h:117
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::getCoreValue
double getCoreValue(std::size_t iIndex) const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::getFocusDistance
double getFocusDistance() const
Definition CameraSample.h:143
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::getNumOpChannels
std::size_t getNumOpChannels() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::CameraSample
CameraSample(double iTop, double iBottom, double iLeft, double iRight)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::getVerticalFilmOffset
double getVerticalFilmOffset() const
get the vertical film back offset in centimeters
Definition CameraSample.h:89
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::setHorizontalAperture
void setHorizontalAperture(double iVal)
set the horizontal camera film back in centimeters
Definition CameraSample.h:73
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::getShutterOpen
double getShutterOpen() const
get the frame relative shutter open time in seconds.
Definition CameraSample.h:150
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::getLensSqueezeRatio
double getLensSqueezeRatio() const
Definition CameraSample.h:96
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::setOverScanBottom
void setOverScanBottom(double iVal)
Definition CameraSample.h:133
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::addOp
std::size_t addOp(FilmBackXformOp iOp)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::getFarClippingPlane
double getFarClippingPlane() const
Definition CameraSample.h:171
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::operator[]
const FilmBackXformOp & operator[](const std::size_t &iIndex) const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::getOverScanLeft
double getOverScanLeft()
Definition CameraSample.h:105
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::operator[]
FilmBackXformOp & operator[](const std::size_t &iIndex)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::CameraSample
CameraSample()
Creates a default sample with a bunch of defaults set.
Definition CameraSample.h:54
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::getShutterClose
double getShutterClose() const
get the frame relative shutter close time in seconds.
Definition CameraSample.h:156
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::getOp
FilmBackXformOp getOp(std::size_t iIndex) const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::setChildBounds
void setChildBounds(const Abc::Box3d &iBounds)
Definition CameraSample.h:178
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::getHorizontalAperture
double getHorizontalAperture() const
get the horizontal camera film back in centimeters
Definition CameraSample.h:70
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::getNearClippingPlane
double getNearClippingPlane() const
Definition CameraSample.h:163
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::setNearClippingPlane
void setNearClippingPlane(double iVal)
Definition CameraSample.h:167
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::setFarClippingPlane
void setFarClippingPlane(double iVal)
Definition CameraSample.h:175
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::getOverScanRight
double getOverScanRight() const
Definition CameraSample.h:113
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::setOverScanTop
void setOverScanTop(double iVal)
Definition CameraSample.h:125
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::getHorizontalFilmOffset
double getHorizontalFilmOffset() const
get the horizontal film back offset in centimeters
Definition CameraSample.h:76
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::setShutterClose
void setShutterClose(double iVal)
set the frame relative shutter open time in seconds.
Definition CameraSample.h:159
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::getScreenWindow
void getScreenWindow(double &oTop, double &oBottom, double &oLeft, double &oRight)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::setHorizontalFilmOffset
void setHorizontalFilmOffset(double iVal)
set the horizontal film back offset in centimeters
Definition CameraSample.h:79
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::setFStop
void setFStop(double iVal)
set the f-stop (focal length divided by "effective" lens diameter)
Definition CameraSample.h:139
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::reset
void reset()
Definition CameraSample.h:202
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::getOverScanTop
double getOverScanTop() const
Definition CameraSample.h:121
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::setFocalLength
void setFocalLength(double iVal)
set the camera focal length in millimeters.
Definition CameraSample.h:67
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::getFieldOfView
double getFieldOfView() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::setShutterOpen
void setShutterOpen(double iVal)
set the frame relative shutter open time in seconds.
Definition CameraSample.h:153
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::getNumOps
std::size_t getNumOps() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::setLensSqueezeRatio
void setLensSqueezeRatio(double iVal)
Definition CameraSample.h:100
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::setVerticalAperture
void setVerticalAperture(double iVal)
set the vertical camera film back in centimeters
Definition CameraSample.h:86
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::setFocusDistance
void setFocusDistance(double iVal)
Definition CameraSample.h:147
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::getFStop
double getFStop() const
get the f-stop (focal length divided by "effective" lens diameter)
Definition CameraSample.h:136
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::getVerticalAperture
double getVerticalAperture() const
get the vertical camera film back in centimeters
Definition CameraSample.h:83
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::getOverScanBottom
double getOverScanBottom() const
Definition CameraSample.h:129
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::setOverScanLeft
void setOverScanLeft(double iVal)
Definition CameraSample.h:109
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample::setVerticalFilmOffset
void setVerticalFilmOffset(double iVal)
set the vertical film back offset in centimeters
Definition CameraSample.h:92
Alembic::AbcGeom::ALEMBIC_VERSION_NS::FilmBackXformOp
FilmBack Xform Operation This class holds the data about a particular transform operation,...
Definition FilmBackXformOp.h:54
Alembic::AbcGeom::ALEMBIC_VERSION_NS
Definition ArchiveBounds.h:45
Alembic::AbcGeom
Definition ArchiveBounds.h:44
Alembic
Alembic namespace ...
Definition ArchiveInfo.h:46