FaceGen 3 SDKs Reference
Loading...
Searching...
No Matches
fimCoord.hpp
1//
2// Copyright (c) Singular Inversions Inc. 2002.
3//
4// Authors: Andrew Beatty
5// Created: January 31, 2002.
6//
7// RCS := Raster CS, (0,0) at centre of top left pixel, each pixel of
8// size one.
9//
10
11#ifndef FIM_COORD_HPP
12#define FIM_COORD_HPP
13
14#include "vect2.hpp"
15#include "FgSerial.hpp"
16
17namespace Fg {
18
19inline
20FutVect2FC
21fimRcsToOics(
22 FutVect2FC rcs, // Input
23 uint wid, // Image width
24 uint hgt) // Image height
25{
26 FGASSERT(wid > 0);
27 FGASSERT(hgt > 0);
28
29 FutVect2FC oics;
30
31 oics.x1 = (rcs.x1 + 0.5f) * 2.0f / (float)wid - 1.0f;
32 oics.x2 = 1.0f - (rcs.x2 + 0.5f) * 2.0f / (float)hgt;
33
34 return oics;
35}
36
37}
38
39#endif