@@ -118,10 +118,6 @@ class RawImageData : public ErrorLog {
118118 void blitFrom (RawImageData *src, const iPoint2D& srcPos,
119119 const iPoint2D& size, const iPoint2D& destPos);
120120 [[nodiscard]] rawspeed::RawImageType getDataType () const { return dataType; }
121- [[nodiscard]] Array2DRef<uint16_t >
122- getU16DataAsUncroppedArray2DRef () const noexcept ;
123- [[nodiscard]] CroppedArray2DRef<uint16_t >
124- getU16DataAsCroppedArray2DRef () const noexcept ;
125121 [[nodiscard]] uint8_t * getData () const ;
126122 uint8_t *
127123 getData (uint32_t x,
@@ -198,6 +194,10 @@ class RawImageDataU16 final : public RawImageData {
198194 void scaleBlackWhite () override ;
199195 void calculateBlackAreas () override ;
200196 void setWithLookUp (uint16_t value, uint8_t * dst, uint32_t * random) override ;
197+ [[nodiscard]] Array2DRef<uint16_t >
198+ getU16DataAsUncroppedArray2DRef () const noexcept ;
199+ [[nodiscard]] CroppedArray2DRef<uint16_t >
200+ getU16DataAsCroppedArray2DRef () const noexcept ;
201201
202202private:
203203 void scaleValues_plain (int start_y, int end_y);
@@ -226,25 +226,11 @@ class RawImageDataFloat final : public RawImageData {
226226 friend class RawImage ;
227227};
228228
229- inline Array2DRef<uint16_t >
230- RawImageData::getU16DataAsUncroppedArray2DRef () const noexcept {
231- assert (dataType == RawImageType::UINT16 &&
232- " Attempting to access floating-point buffer as uint16_t." );
233- assert (data && " Data not yet allocated." );
234- return {reinterpret_cast <uint16_t *>(data), cpp * uncropped_dim.x ,
235- uncropped_dim.y , static_cast <int >(pitch / sizeof (uint16_t ))};
236- }
237-
238- inline CroppedArray2DRef<uint16_t >
239- RawImageData::getU16DataAsCroppedArray2DRef () const noexcept {
240- return {getU16DataAsUncroppedArray2DRef (), cpp * mOffset .x , mOffset .y ,
241- cpp * dim.x , dim.y };
242- }
243-
244229// setWithLookUp will set a single pixel by using the lookup table if supplied,
245- // You must supply the destination where the value should be written, and a pointer to
246- // a value that will be used to store a random counter that can be reused between calls.
247- // this needs to be inline to speed up tight decompressor loops
230+ // You must supply the destination where the value should be written, and a
231+ // pointer to a value that will be used to store a random counter that can be
232+ // reused between calls. this needs to be inline to speed up tight decompressor
233+ // loops
248234inline void RawImageDataU16::setWithLookUp (uint16_t value, uint8_t * dst,
249235 uint32_t * random) {
250236 auto * dest = reinterpret_cast <uint16_t *>(dst);
@@ -267,6 +253,19 @@ inline void RawImageDataU16::setWithLookUp(uint16_t value, uint8_t* dst,
267253 *dest = table->tables [value];
268254}
269255
256+ inline Array2DRef<uint16_t >
257+ RawImageDataU16::getU16DataAsUncroppedArray2DRef () const noexcept {
258+ assert (data && " Data not yet allocated." );
259+ return {reinterpret_cast <uint16_t *>(data), cpp * uncropped_dim.x ,
260+ uncropped_dim.y , static_cast <int >(pitch / sizeof (uint16_t ))};
261+ }
262+
263+ inline CroppedArray2DRef<uint16_t >
264+ RawImageDataU16::getU16DataAsCroppedArray2DRef () const noexcept {
265+ return {getU16DataAsUncroppedArray2DRef (), cpp * mOffset .x , mOffset .y ,
266+ cpp * dim.x , dim.y };
267+ }
268+
270269class RawImageCurveGuard final {
271270 RawImageData* mRaw ;
272271 const std::vector<uint16_t >& curve;
0 commit comments