![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
#include <SourceDestBufferImpl.h>


Public Member Functions | |
| SourceDestBufferImpl (ImageFileImplWeakPtr destImageFile, const ustring &pathName, const size_t capacity, bool doConversion=false, bool doScaling=false) | |
| template<typename T > | |
| void | setTypeInfo (T *base, size_t stride=sizeof(T)) |
| SourceDestBufferImpl (ImageFileImplWeakPtr destImageFile, const ustring &pathName, StringList *b) | |
| ImageFileImplWeakPtr | destImageFile () const |
| ustring | pathName () const |
| MemoryRepresentation | memoryRepresentation () const |
| void * | base () const |
| StringList * | ustrings () const |
| bool | doConversion () const |
| bool | doScaling () const |
| size_t | stride () const |
| size_t | capacity () const |
| unsigned | nextIndex () const |
| void | rewind () |
| int64_t | getNextInt64 () |
| int64_t | getNextInt64 (double scale, double offset) |
| float | getNextFloat () |
| double | getNextDouble () |
| ustring | getNextString () |
| void | setNextInt64 (int64_t value) |
| void | setNextInt64 (int64_t value, double scale, double offset) |
| void | setNextFloat (float value) |
| void | setNextDouble (double value) |
| void | setNextString (const ustring &value) |
| void | checkCompatible (const std::shared_ptr< SourceDestBufferImpl > &newBuf) const |
| void | dump (int indent=0, std::ostream &os=std::cout) |
Definition at line 36 of file SourceDestBufferImpl.h.
| SourceDestBufferImpl::SourceDestBufferImpl | ( | ImageFileImplWeakPtr | destImageFile, |
| const ustring & | pathName, | ||
| const size_t | capacity, | ||
| bool | doConversion = false, |
||
| bool | doScaling = false |
||
| ) |
Definition at line 35 of file SourceDestBufferImpl.cpp.
| SourceDestBufferImpl::SourceDestBufferImpl | ( | ImageFileImplWeakPtr | destImageFile, |
| const ustring & | pathName, | ||
| StringList * | b | ||
| ) |
don't checkImageFileOpen, checkState_ will do it
Set capacity_ after testing that b is OK
Note that capacity_ is set to the size() of the vector<>, not its capacity(). The size() of *ustrings_ will not be changed as strings are stored in it.
Definition at line 107 of file SourceDestBufferImpl.cpp.
References e57::E57_ERROR_BAD_BUFFER, E57_EXCEPTION2, and pathName().
|
inline |
Definition at line 59 of file SourceDestBufferImpl.h.
Referenced by setTypeInfo().
|
inline |
Definition at line 79 of file SourceDestBufferImpl.h.
| void SourceDestBufferImpl::checkCompatible | ( | const std::shared_ptr< SourceDestBufferImpl > & | newBuf | ) | const |
Definition at line 959 of file SourceDestBufferImpl.cpp.
References e57::E57_ERROR_BUFFERS_NOT_COMPATIBLE, E57_EXCEPTION2, and e57::toString().
|
inline |
Definition at line 46 of file SourceDestBufferImpl.h.
|
inline |
Definition at line 67 of file SourceDestBufferImpl.h.
|
inline |
Definition at line 71 of file SourceDestBufferImpl.h.
| void SourceDestBufferImpl::dump | ( | int | indent = 0, |
| std::ostream & | os = std::cout |
||
| ) |
don't checkImageFileOpen
Definition at line 997 of file SourceDestBufferImpl.cpp.
References e57::E57_BOOL, e57::E57_INT16, e57::E57_INT32, e57::E57_INT64, e57::E57_INT8, e57::E57_REAL32, e57::E57_REAL64, e57::E57_UINT16, e57::E57_UINT32, e57::E57_UINT8, e57::E57_USTRING, QtCompat::endl(), and e57::space().
| double SourceDestBufferImpl::getNextDouble | ( | ) |
don't checkImageFileOpen
Verify index is within bounds
Fetch value from source buffer. Convert from other formats to floating point if requested
Convert bool to 0/1, all non-zero values map to 1.0
Definition at line 602 of file SourceDestBufferImpl.cpp.
References e57::E57_BOOL, e57::E57_ERROR_CONVERSION_REQUIRED, e57::E57_ERROR_EXPECTING_NUMERIC, e57::E57_ERROR_INTERNAL, E57_EXCEPTION2, e57::E57_INT16, e57::E57_INT32, e57::E57_INT64, e57::E57_INT8, e57::E57_REAL32, e57::E57_REAL64, e57::E57_UINT16, e57::E57_UINT32, e57::E57_UINT8, and e57::E57_USTRING.
| float SourceDestBufferImpl::getNextFloat | ( | ) |
don't checkImageFileOpen
Verify index is within bounds
Fetch value from source buffer. Convert from other formats to floating point if requested
Convert bool to 0/1, all non-zero values map to 1.0
Check that exponent of user's value is not too large for single precision number in file.
??? silently limit here?
Definition at line 502 of file SourceDestBufferImpl.cpp.
References e57::E57_BOOL, e57::E57_ERROR_CONVERSION_REQUIRED, e57::E57_ERROR_EXPECTING_NUMERIC, e57::E57_ERROR_INTERNAL, e57::E57_ERROR_REAL64_TOO_LARGE, E57_EXCEPTION2, e57::E57_INT16, e57::E57_INT32, e57::E57_INT64, e57::E57_INT8, e57::E57_REAL32, e57::E57_REAL64, e57::E57_UINT16, e57::E57_UINT32, e57::E57_UINT8, e57::E57_USTRING, and e57::toString().
| int64_t SourceDestBufferImpl::getNextInt64 | ( | ) |
don't checkImageFileOpen
Verify index is within bounds
Fetch value from source buffer. Convert from non-integer formats if requested.
Convert bool to 0/1, all non-zero values map to 1.0
Definition at line 313 of file SourceDestBufferImpl.cpp.
References e57::E57_BOOL, e57::E57_ERROR_CONVERSION_REQUIRED, e57::E57_ERROR_EXPECTING_NUMERIC, e57::E57_ERROR_INTERNAL, E57_EXCEPTION2, e57::E57_INT16, e57::E57_INT32, e57::E57_INT64, e57::E57_INT8, e57::E57_REAL32, e57::E57_REAL64, e57::E57_UINT16, e57::E57_UINT32, e57::E57_UINT8, and e57::E57_USTRING.
Referenced by getNextInt64().
| int64_t SourceDestBufferImpl::getNextInt64 | ( | double | scale, |
| double | offset | ||
| ) |
don't checkImageFileOpen
Reverse scale (undo scaling) of a user's number to get raw value to put in file.
Encorporating the scale is optional (requested by user when constructing the sdbuf). If the user did not request scaling, then we get raw values from user's buffer.
Just return raw value.
Double check non-zero scale. Going to divide by it below.
Verify index is within bounds
Fetch value from source buffer. Convert from non-integer formats if requested
Calc (x-offset)/scale rounded to nearest integer, but keep in floating point until sure is in bounds
Calc (x-offset)/scale rounded to nearest integer, but keep in floating point until sure is in bounds
Calc (x-offset)/scale rounded to nearest integer, but keep in floating point until sure is in bounds
Calc (x-offset)/scale rounded to nearest integer, but keep in floating point until sure is in bounds
Calc (x-offset)/scale rounded to nearest integer, but keep in floating point until sure is in bounds
Calc (x-offset)/scale rounded to nearest integer, but keep in floating point until sure is in bounds
Calc (x-offset)/scale rounded to nearest integer, but keep in floating point until sure is in bounds
Calc (x-offset)/scale rounded to nearest integer, but keep in floating point until sure is in bounds
Calc (x-offset)/scale rounded to nearest integer, but keep in floating point until sure is in bounds
Make sure that value is representable in an int64_t
Definition at line 383 of file SourceDestBufferImpl.cpp.
References e57::E57_BOOL, e57::E57_ERROR_CONVERSION_REQUIRED, e57::E57_ERROR_EXPECTING_NUMERIC, e57::E57_ERROR_INTERNAL, e57::E57_ERROR_SCALED_VALUE_NOT_REPRESENTABLE, E57_EXCEPTION2, e57::E57_INT16, e57::E57_INT32, e57::E57_INT64, e57::E57_INT8, e57::E57_REAL32, e57::E57_REAL64, e57::E57_UINT16, e57::E57_UINT32, e57::E57_UINT8, e57::E57_USTRING, cloudViewer::utility::floor(), getNextInt64(), offset, and e57::toString().
| ustring SourceDestBufferImpl::getNextString | ( | ) |
don't checkImageFileOpen
Check have correct type buffer
Verify index is within bounds
Get ustring from vector
Definition at line 690 of file SourceDestBufferImpl.cpp.
References e57::E57_ERROR_EXPECTING_USTRING, e57::E57_ERROR_INTERNAL, E57_EXCEPTION2, and e57::E57_USTRING.
|
inline |
Definition at line 55 of file SourceDestBufferImpl.h.
|
inline |
Definition at line 83 of file SourceDestBufferImpl.h.
|
inline |
Definition at line 51 of file SourceDestBufferImpl.h.
Referenced by SourceDestBufferImpl().
|
inline |
Definition at line 87 of file SourceDestBufferImpl.h.
| void SourceDestBufferImpl::setNextDouble | ( | double | value | ) |
Definition at line 934 of file SourceDestBufferImpl.cpp.
| void SourceDestBufferImpl::setNextFloat | ( | float | value | ) |
Definition at line 929 of file SourceDestBufferImpl.cpp.
| void SourceDestBufferImpl::setNextInt64 | ( | int64_t | value | ) |
don't checkImageFileOpen
Verify have room
Calc start of memory location, index into buffer using stride_ (the distance between elements).
Definition at line 710 of file SourceDestBufferImpl.cpp.
References e57::E57_BOOL, e57::E57_ERROR_CONVERSION_REQUIRED, e57::E57_ERROR_EXPECTING_NUMERIC, e57::E57_ERROR_INTERNAL, e57::E57_ERROR_VALUE_NOT_REPRESENTABLE, E57_EXCEPTION2, e57::E57_INT16, e57::E57_INT32, e57::E57_INT64, e57::E57_INT8, e57::E57_REAL32, e57::E57_REAL64, e57::E57_UINT16, e57::E57_UINT32, e57::E57_UINT8, e57::E57_USTRING, and e57::toString().
Referenced by setNextInt64().
| void SourceDestBufferImpl::setNextInt64 | ( | int64_t | value, |
| double | scale, | ||
| double | offset | ||
| ) |
don't checkImageFileOpen
Apply a scale and offset to numbers from file before puting in user's buffer.
Encorporating the scale is optional (requested by user when constructing the sdbuf). If the user did not request scaling, then we send raw values to user's buffer.
Use raw value routine, then bail out.
Verify have room
Calc start of memory location, index into buffer using stride_ (the distance between elements).
Calc x*scale+offset
Value will be stored in some floating point rep in user's buffer, so keep full resolution here.
Value will represented as some integer in user's buffer, so round to nearest integer here. But keep in floating point rep until we know that the value is representable in the user's buffer.
Check that exponent of result is not too big for single precision float
Definition at line 802 of file SourceDestBufferImpl.cpp.
References e57::E57_BOOL, e57::E57_ERROR_CONVERSION_REQUIRED, e57::E57_ERROR_EXPECTING_NUMERIC, e57::E57_ERROR_INTERNAL, e57::E57_ERROR_SCALED_VALUE_NOT_REPRESENTABLE, E57_EXCEPTION2, e57::E57_INT16, e57::E57_INT32, e57::E57_INT64, e57::E57_INT8, e57::E57_REAL32, e57::E57_REAL64, e57::E57_UINT16, e57::E57_UINT32, e57::E57_UINT8, e57::E57_USTRING, cloudViewer::utility::floor(), offset, setNextInt64(), and e57::toString().
| void SourceDestBufferImpl::setNextString | ( | const ustring & | value | ) |
don't checkImageFileOpen
Verify have room.
Assign to already initialized element in vector
Definition at line 939 of file SourceDestBufferImpl.cpp.
References e57::E57_ERROR_EXPECTING_USTRING, e57::E57_ERROR_INTERNAL, E57_EXCEPTION2, and e57::E57_USTRING.
| template void SourceDestBufferImpl::setTypeInfo< double > | ( | T * | base, |
| size_t | stride = sizeof(T) |
||
| ) |
Definition at line 42 of file SourceDestBufferImpl.cpp.
References base(), e57::E57_BOOL, e57::E57_INT16, e57::E57_INT32, e57::E57_INT64, e57::E57_INT8, e57::E57_REAL32, e57::E57_REAL64, e57::E57_UINT16, e57::E57_UINT32, e57::E57_UINT8, and stride().
|
inline |
Definition at line 75 of file SourceDestBufferImpl.h.
Referenced by setTypeInfo().
|
inline |
Definition at line 63 of file SourceDestBufferImpl.h.