| 1 | package Panotools::Script::Line::Panorama; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | use Panotools::Script::Line; | ||
| 6 | |||
| 7 | =head1 NAME | ||
| 8 | |||
| 9 | Panotools::Script::Line::Panorama - Panotools panorama parameters | ||
| 10 | |||
| 11 | =head1 SYNOPSIS | ||
| 12 | |||
| 13 | Panorama parameters are described by a 'p' line | ||
| 14 | |||
| 15 | =head1 DESCRIPTION | ||
| 16 | |||
| 17 | w1000 width in pixels | ||
| 18 | h600 height in pixels | ||
| 19 | f0 projection format, | ||
| 20 | 0 - rectilinear (for printing and viewing) | ||
| 21 | 1 - Cylindrical (for Printing and QTVR) | ||
| 22 | 2 - Equirectangular ( for Spherical panos), default | ||
| 23 | 3 - full-frame fisheye | ||
| 24 | 4 - stereographic | ||
| 25 | 5 - mercator | ||
| 26 | 6 - transverse mercator | ||
| 27 | 7 - sinusoidal | ||
| 28 | 8 - Lambert Equal Area Cylindrical | ||
| 29 | 9 - Lambert Azimuthal | ||
| 30 | 10 - Albers Equal Area Conical | ||
| 31 | 11 - Miller Cylindrical | ||
| 32 | 12 - Panini | ||
| 33 | 13 - Architectural | ||
| 34 | 14 - Orthographic | ||
| 35 | 15 - Equisolid | ||
| 36 | 16 - Equirectangular Panini | ||
| 37 | 17 - Biplane | ||
| 38 | 18 - Triplane | ||
| 39 | 19 - Panini_General | ||
| 40 | 20 - Thoby | ||
| 41 | 21 - Hammer | ||
| 42 | |||
| 43 | v360 horizontal field of view of panorama (default 360) | ||
| 44 | nPICT Panorama file format, one of: | ||
| 45 | PNG png-format, 8 & 16 bit supported | ||
| 46 | TIFF tiff-format, all tiff types supported (8,16,32 bit int, float, double) | ||
| 47 | TIFF_m tiff-format, multi-file, one image per file | ||
| 48 | alpha layer with non-feathered clip mask at image border | ||
| 49 | TIFF_multilayer tiff-format, multi-image-file, all files in one image | ||
| 50 | alpha layer with non-feathered clip mask at image border | ||
| 51 | This filetype is supported by The GIMP | ||
| 52 | JPEG Panoramic image in jpeg-format. | ||
| 53 | some more supported file formats (mostly only 8 bit support) | ||
| 54 | PNM, PGM, BMP, SUN, VIFF | ||
| 55 | |||
| 56 | Special options for TIFF output: | ||
| 57 | n"TIFF c:NONE" | ||
| 58 | c - select TIFF compression, possible options: NONE, LZW, DEFLATE | ||
| 59 | |||
| 60 | Special options for TIFF_m and TIFF_multilayer output: | ||
| 61 | n"TIFF c:NONE r:CROP" | ||
| 62 | c - TIFF compression, possible options NONE, LZW, DEFLATE | ||
| 63 | r - output only used image area (cropped output). The crop offsets | ||
| 64 | are stored in the POSITIONX and POSITONY tiff tags | ||
| 65 | p1 - save coordinate images (useful for further programs, like vignetting correction) | ||
| 66 | |||
| 67 | Special options for JPEG output: | ||
| 68 | n"JPEG q95" | ||
| 69 | q - jpeg quality | ||
| 70 | |||
| 71 | u10 width of feather for stitching all images. default:10 | ||
| 72 | k1 attempt color & brightness correction using image number as anchor | ||
| 73 | b1 attempt brightness correction with no color change using image number as anchor | ||
| 74 | d1 attempt color correction with no brightness change using image number as anchor | ||
| 75 | Do not use more than one of k, d, b.This is new method of correcting | ||
| 76 | |||
| 77 | E1 exposure value for final panorama | ||
| 78 | R1 stitching mode: 0: normal LDR mode, 1: HDR mode | ||
| 79 | T"UINT8" bitdepth of output images, possible values are | ||
| 80 | UINT8 - 8 bit unsigned | ||
| 81 | UINT16 - 16 bit unsigned | ||
| 82 | FLOAT - 32 bit floating point | ||
| 83 | By default the bit depth of the input images is used. | ||
| 84 | S100,600,100,800 Selection(left,right,top,bottom), Only pixels inside the rectangle | ||
| 85 | will be rendered. Images that do not contain pixels in this area | ||
| 86 | are not rendered/created. | ||
| 87 | P"0 60" Projection parameters. e.g. Albers Equal Area Conical requires extra parameters. | ||
| 88 | |||
| 89 | =cut | ||
| 90 | |||
| 91 | use vars qw /@ISA/; | ||
| 92 | @ISA = qw /Panotools::Script::Line/; | ||
| 93 | |||
| 94 | sub _defaults | ||
| 95 | { | ||
| 96 | my $self = shift; | ||
| 97 | $self->{w} = 1000; | ||
| 98 | $self->{h} = 500; | ||
| 99 | $self->{v} = 360.0; | ||
| 100 | $self->{n} = '"JPEG q100"'; | ||
| 101 | $self->{E} = 0; | ||
| 102 | $self->{f} = 2; | ||
| 103 | $self->{R} = 0; | ||
| 104 | } | ||
| 105 | |||
| 106 | sub _valid { '^([bdfhknuvwERTSP])(.*)' } | ||
| 107 | |||
| 108 | sub Identifier | ||
| 109 | { | ||
| 110 | my $self = shift; | ||
| 111 | return "p"; | ||
| 112 | } | ||
| 113 | |||
| 114 | sub Report | ||
| 115 | { | ||
| 116 | my $self = shift; | ||
| 117 | my @report; | ||
| 118 | |||
| 119 | my $format = 'UNKNOWN'; | ||
| 120 | $format = "Rectilinear" if $self->{f} == 0; | ||
| 121 | $format = "Cylindrical" if $self->{f} == 1; | ||
| 122 | $format = "Equirectangular" if $self->{f} == 2; | ||
| 123 | $format = "Fisheye" if $self->{f} == 3; | ||
| 124 | $format = "Stereographic" if $self->{f} == 4; | ||
| 125 | $format = "Mercator" if $self->{f} == 5; | ||
| 126 | $format = "Transverse mercator" if $self->{f} == 6; | ||
| 127 | $format = "Sinusoidal" if $self->{f} == 7; | ||
| 128 | $format = "Lambert Equal Area Cylindrical" if $self->{f} == 8; | ||
| 129 | $format = "Lambert Azimuthal" if $self->{f} == 9; | ||
| 130 | $format = "Albers Equal Area Conical" if $self->{f} == 10; | ||
| 131 | $format = "Miller Cylindrical" if $self->{f} == 11; | ||
| 132 | $format = "Panini" if $self->{f} == 12; | ||
| 133 | $format = "Architectural" if $self->{f} == 13; | ||
| 134 | $format = "Orthographic" if $self->{f} == 14; | ||
| 135 | $format = "Equisolid" if $self->{f} == 15; | ||
| 136 | $format = "Equirectangular Panini" if $self->{f} == 16; | ||
| 137 | $format = "Biplane" if $self->{f} == 17; | ||
| 138 | $format = "Triplane" if $self->{f} == 18; | ||
| 139 | |||
| 140 | my $mode = "LDR"; | ||
| 141 | $mode = "HDR" if defined $self->{R} and $self->{R} == 1; | ||
| 142 | |||
| 143 | push @report, ['Dimensions', $self->{w} .'x'. $self->{h}]; | ||
| 144 | push @report, ['Megapixels', int ($self->{w} * $self->{h} / 1024 / 1024 * 10) / 10]; | ||
| 145 | push @report, ['Format', $format]; | ||
| 146 | push @report, ['Horizontal Field of View', $self->{v}]; | ||
| 147 | push @report, ['File type', $self->{n}]; | ||
| 148 | push @report, ['Exposure Value', $self->{E}]; | ||
| 149 | push @report, ['Stitching mode', $mode] if defined $mode; | ||
| 150 | push @report, ['Bit depth', $self->{T}] if defined $self->{T}; | ||
| 151 | push @report, ['Selection area', $self->{S}] if defined $self->{S}; | ||
| 152 | [@report]; | ||
| 153 | } | ||
| 154 | |||
| 155 | 1; |