* @brief Set output pixel bit type in Buffer * * This method specifies the type of pixel data that is going to be output. * Essentially, it is a convenience method that will automatically calculate * the necessary output range based on the minimum and maximum values of the * bit type that is specified. Currently, the method only supported data types * are Isis::UnsignedByte (Range of 0
| 606 | * @throws Isis::iException::Message |
| 607 | */ |
| 608 | void ProcessExport::SetOutputType(Isis::PixelType pixelIn) { |
| 609 | p_pixelType = pixelIn; |
| 610 | |
| 611 | if (p_format < 0 || p_format > 3) { |
| 612 | string message = |
| 613 | "Format of the output file must be set prior to calling this method [ProcessExport::SetOutputType]"; |
| 614 | throw IException(IException::Programmer, message, _FILEINFO_); |
| 615 | } |
| 616 | if (pixelIn == Isis::UnsignedByte) |
| 617 | SetOutputRange((double)VALID_MIN1, (double)VALID_MAX1); |
| 618 | else if (pixelIn == Isis::UnsignedWord) |
| 619 | SetOutputRange((double)VALID_MINU2, (double)VALID_MAXU2); |
| 620 | else if (pixelIn == Isis::SignedWord) |
| 621 | SetOutputRange((double)VALID_MIN2, (double)VALID_MAX2); |
| 622 | else if (pixelIn == Isis::Real) |
| 623 | if (p_format == JP2) { |
| 624 | string message = |
| 625 | "Unsupported bit type for JP2 formatted files [ProcessExport::SetOutputType]"; |
| 626 | throw IException(IException::Programmer, message, _FILEINFO_); |
| 627 | } |
| 628 | else { |
| 629 | SetOutputRange(-DBL_MAX, DBL_MAX); |
| 630 | } |
| 631 | else { |
| 632 | string message = |
| 633 | "Unsupported bit type [ProcessExport::SetOutputType]"; |
| 634 | throw IException(IException::Programmer, message, _FILEINFO_); |
| 635 | } |
| 636 | } |
| 637 | |
| 638 | |
| 639 | /** |