File failed to load: https://isis.astrogeology.usgs.gov/6.0.0/Object/assets/jax/output/NativeMML/config.js
Isis 3 Programmer Reference
StreamExporter.cpp
1 
6 /* SPDX-License-Identifier: CC0-1.0 */
7 #include "StreamExporter.h"
8 
9 #include "Buffer.h"
10 #include "ExportDescription.h"
11 #include "ProcessExport.h"
12 
13 using namespace Isis;
14 using namespace std;
15 
16 
17 namespace Isis {
22  }
23 
24 
29  }
30 
31 
40  initialize(desc);
41  }
42 
43 
52  initialize(desc);
53  }
54 
55 
64  initialize(desc);
65  }
66 
67 
76  createBuffer();
77  }
78 
79 
85  void StreamExporter::writeGrayscale(vector<Buffer *> &in) const {
86  Buffer &grayLine = *in[0];
87 
88  int lineIndex = grayLine.Line() - 1;
89  for (int sampleIndex = 0; sampleIndex < grayLine.SampleDimension(); sampleIndex++) {
90  int pixelValue = outputPixelValue(grayLine[sampleIndex]);
91  setBuffer(sampleIndex, 0, pixelValue);
92  }
93 
94  writeLine(lineIndex);
95  }
96 
97 
103  void StreamExporter::writeRgb(vector<Buffer *> &in) const {
104  Buffer &redLine = *in[0];
105  Buffer &greenLine = *in[1];
106  Buffer &blueLine = *in[2];
107 
108  for (int i = 0; i < redLine.SampleDimension(); i++) {
109  int red = outputPixelValue(redLine[i]);
110  int green = outputPixelValue(greenLine[i]);
111  int blue = outputPixelValue(blueLine[i]);
112 
113  setBuffer(i, 0, red);
114  setBuffer(i, 1, green);
115  setBuffer(i, 2, blue);
116  }
117 
118  writeLine(redLine.Line() - 1);
119  }
120 
121 
127  void StreamExporter::writeRgba(vector<Buffer *> &in) const {
128  Buffer &redLine = *in[0];
129  Buffer &greenLine = *in[1];
130  Buffer &blueLine = *in[2];
131  Buffer &alphaLine = *in[3];
132 
133  for (int i = 0; i < redLine.SampleDimension(); i++) {
134  int red = outputPixelValue(redLine[i]);
135  int green = outputPixelValue(greenLine[i]);
136  int blue = outputPixelValue(blueLine[i]);
137  int alpha = outputPixelValue(alphaLine[i]);
138 
139  setBuffer(i, 0, red);
140  setBuffer(i, 1, green);
141  setBuffer(i, 2, blue);
142  setBuffer(i, 3, alpha);
143  }
144 
145  writeLine(redLine.Line() - 1);
146  }
147 };
148 
Isis::StreamExporter::setGrayscale
virtual void setGrayscale(ExportDescription &desc)
Generic initialization with the export description.
Definition: StreamExporter.cpp:39
Isis::Buffer::SampleDimension
int SampleDimension() const
Returns the number of samples in the shape buffer.
Definition: Buffer.h:70
Isis::StreamExporter::setBuffer
virtual void setBuffer(int s, int b, int dn) const =0
Pure virtual method for setting a particular index of the line buffer to the given DN.
Isis::StreamExporter::createBuffer
virtual void createBuffer()=0
Pure virtual method for creating the buffer to store a chunk of streamed line data with one or more b...
Isis::ExportDescription
Describes how a series of cubes should be exported.
Definition: ExportDescription.h:43
Isis::StreamExporter::setRgb
virtual void setRgb(ExportDescription &desc)
Generic initialization with the export description.
Definition: StreamExporter.cpp:51
Isis::StreamExporter::writeLine
virtual void writeLine(int l) const =0
Pure virtual method for writing a line of buffered data to the output image on disk.
Isis::Buffer
Buffer for reading and writing cube data.
Definition: Buffer.h:53
Isis::StreamExporter::initialize
virtual void initialize(ExportDescription &desc)
Generic initialization with the export description.
Definition: StreamExporter.cpp:74
Isis::StreamExporter::writeGrayscale
virtual void writeGrayscale(vector< Buffer * > &in) const
Write a line of grayscale data to the output image.
Definition: StreamExporter.cpp:85
Isis::ImageExporter::outputPixelValue
virtual int outputPixelValue(double dn) const
Return the output clamped integer pixel value from the input double-precision DN.
Definition: ImageExporter.cpp:325
Isis::ImageExporter
Export Isis cubes into standard formats.
Definition: ImageExporter.h:54
std
Namespace for the standard library.
Isis::StreamExporter::writeRgba
virtual void writeRgba(vector< Buffer * > &in) const
Write a line of RGBA data to the output image.
Definition: StreamExporter.cpp:127
Isis::StreamExporter::setRgba
virtual void setRgba(ExportDescription &desc)
Generic initialization with the export description.
Definition: StreamExporter.cpp:63
Isis::ImageExporter::initialize
virtual void initialize(ExportDescription &desc)=0
Generic initialization with the export description.
Definition: ImageExporter.cpp:58
Isis::StreamExporter::writeRgb
virtual void writeRgb(vector< Buffer * > &in) const
Write a line of RGB data to the output image.
Definition: StreamExporter.cpp:103
Isis::Buffer::Line
int Line(const int index=0) const
Returns the line position associated with a shape buffer index.
Definition: Buffer.cpp:145
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::StreamExporter::StreamExporter
StreamExporter()
Construct the stream exporter.
Definition: StreamExporter.cpp:21
Isis::StreamExporter::~StreamExporter
virtual ~StreamExporter()
Destruct the exporter.
Definition: StreamExporter.cpp:28

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the USGS Astrogeology Discussion Board
To report a bug, or suggest a feature go to: ISIS Github
File Modified: 07/13/2023 15:17:20