Package edu.harvard.hul.ois.ots.schemas.XmlContent

Examples of edu.harvard.hul.ois.ots.schemas.XmlContent.Rational


        }
        YCbCrCoefficients ycbcrc = new YCbCrCoefficients ();
        try {
            ycbcr.setYCbCrCoefficients(ycbcrc);
            phi.setYCbCr (ycbcr);
            ycbcrc.setLumaRed(new Rational ((int) (red * 100), 100));
            ycbcrc.setLumaGreen(new Rational ((int) (green * 100), 100));
            ycbcrc.setLumaBlue(new Rational ((int) (blue * 100), 100));
        }
        catch (XmlContentException e) {}
    }
View Full Code Here


                    else
                        interp = "Cr";
                    break;
                }
                comp.setComponentPhotometricInterpretation(interp);
                comp.setHeadroom (new Rational ((int) (rbwVal[i] * 100), 100));
                comp.setFootroom (new Rational ((int) (rbwVal[i+1] * 100), 100));
            }
        }
        catch (XmlContentException e) {}
    }
View Full Code Here

            if (tok.hasMoreElements())
                min = Integer.parseInt (tok.nextToken ());
            if (tok.hasMoreElements())
                sec = Double.parseDouble (tok.nextToken ());
           
            elem.setDegrees (new Rational (deg, 1));
            elem.setMinutes (new Rational (min, 1));
            elem.setSeconds (new Rational ((int) (sec * 100), 100));
        }
        catch (Exception e) {
        }
    }
View Full Code Here

                    Double dblValue = null;
                    try {
                        dblValue = Double.parseDouble (dataValue);
                    }
                    catch (NumberFormatException e) {}
                    Rational ratValue = null;
                    if (intValue != null) {
                        ratValue = new Rational (intValue, 1);
                    }
                    else if (dblValue != null) {
                        ratValue = new Rational ((int) (dblValue * 100 + 0.5), 100);
                    }
                    else if(dataValue.contains("/")) {
                      try {
                        int num = Integer.parseInt(dataValue.substring(0,dataValue.indexOf("/")));
                        int den = Integer.parseInt(dataValue.substring(dataValue.indexOf("/")+1));
                        ratValue = new Rational(num,den);
                      }
                      catch (NumberFormatException e) {}
                    }
                   
                    // This is a very long switch, but I don't think much would be gained
View Full Code Here

TOP

Related Classes of edu.harvard.hul.ois.ots.schemas.XmlContent.Rational

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.