Grok 20.3.2
TileComponentWindow.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2016-2026 Grok Image Compression Inc.
3 *
4 * This source code is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Affero General Public License, version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This source code is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Affero General Public License for more details.
12 *
13 * You should have received a copy of the GNU Affero General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 */
17
18/*
19Various coordinate systems are used to describe regions in the tile component buffer.
20
211) Canvas coordinates: JPEG 2000 global image coordinates.
22
232) Tile component coordinates: canvas coordinates with sub-sampling applied
24
253) Band coordinates: coordinates relative to a specified sub-band's origin
26
274) Buffer coordinates: coordinate system where all resolutions are translated
28 to common origin (0,0). If each code block is translated relative to the origin of the
29resolution that **it belongs to**, the blocks are then all in buffer coordinate system
30
31Note: the name of any method or variable returning non canvas coordinates is appended
32with "REL", to signify relative coordinates.
33
34*/
35
36#pragma once
37
38#include <algorithm>
39#include <type_traits>
40
41#include "ResWindow.h"
42#include "ISparseCanvas.h"
43#include "PostDecodeFilters.h"
45
46namespace grk
47{
48
58{
59 virtual ~ITileComponentWindow() = default;
60
61 // Allocation
62 virtual bool alloc() = 0;
63
64 // Geometry
65 virtual Rect32 bounds() const = 0;
66 virtual Rect32 unreducedBounds() const = 0;
67 virtual const Rect32* getBandWindowPadded(uint8_t resno,
68 t1::eBandOrientation orientation) const = 0;
69 virtual void toRelativeCoordinates(uint8_t resno, t1::eBandOrientation orientation,
70 uint32_t& offsetx, uint32_t& offsety) const = 0;
71
72 // Data transfer (type-erased)
73 virtual void transferData(void** data, uint32_t* stride) = 0;
74 virtual void attachData(void* data, uint32_t stride) = 0;
75
76 // Buffer access (type-erased)
77 virtual uint32_t highestResStride() const = 0;
78 virtual uint64_t stridedArea() const = 0;
79
80 // Post-process: T1 always outputs int32_t.
81 // int32 window writes int32 to band buffers; int16 window narrows to int16.
82 virtual void postProcessBlock(int32_t* srcData, t1::DecompressBlockExec* block,
83 ISparseCanvas<int32_t>* regionWindow) = 0;
84 virtual void postProcessBlockHT(int32_t* srcData, t1::DecompressBlockExec* block, uint16_t stride,
85 ISparseCanvas<int32_t>* regionWindow) = 0;
86};
87
88template<class T>
89constexpr T getFilterPad(bool lossless)
90{
91 return lossless ? 1 : 2;
92}
93
94template<typename T>
96{
97 TileComponentWindowBase(bool isCompressor, bool lossless, bool wholeTileDecompress,
98 Rect32 unreducedTileComp, Rect32 reducedTileComp,
99 Rect32 unreducedImageCompWindow, uint8_t numresolutions,
100 uint8_t reducedNumResolutions)
101 : unreducedBounds_(unreducedTileComp), bounds_(reducedTileComp), compress_(isCompressor),
102 wholeTileDecompress_(wholeTileDecompress)
103 {
104 assert(reducedNumResolutions > 0);
105 auto currentRes = unreducedTileComp;
106 for(uint8_t i = 0; i < numresolutions; ++i)
107 {
108 bool finalResolution = i == numresolutions - 1;
109 ResSimple r(currentRes, finalResolution);
110 resolution_.push_back(r);
111 if(!finalResolution)
112 currentRes = ResSimple::getBandWindow(1, 0, currentRes);
113 }
114 std::reverse(resolution_.begin(), resolution_.end());
115
116 // generate bounds
117 unreducedBounds_ = unreducedImageCompWindow.intersection(unreducedBounds_);
118 assert(unreducedBounds_.valid());
119 bounds_ = unreducedImageCompWindow.scaleDownCeilPow2(
120 (uint8_t)(numresolutions - reducedNumResolutions));
121 bounds_ = bounds_.intersection(reducedTileComp);
122 assert(bounds_.valid());
123
124 // fill resolutions vector
125 auto tileCompAtRes = resolution_[reducedNumResolutions - 1];
126 auto tileCompAtLowerRes =
127 reducedNumResolutions > 1 ? resolution_[reducedNumResolutions - 2] : ResSimple();
128 // create resolution buffers
129 auto highestResWindow = new ResWindow<T>(
130 numresolutions, (uint8_t)(reducedNumResolutions - 1U), nullptr, tileCompAtRes,
131 tileCompAtLowerRes, bounds_, unreducedBounds_, unreducedTileComp,
132 wholeTileDecompress ? 0 : getFilterPad<uint32_t>(lossless));
133 // setting top level prevents allocation of tileCompBandWindows buffers
134 if(!useBandWindows())
135 highestResWindow->disableBandWindowAllocation();
136
137 // create windows for all resolutions except highest resolution
138 for(uint8_t resno = 0; resno < reducedNumResolutions - 1; ++resno)
139 {
140 // resolution window == LL band window of next highest resolution
141 auto resWindow =
142 ResSimple::getBandWindow((uint8_t)(numresolutions - 1 - resno), 0, unreducedBounds_);
143 resWindows.push_back(
144 new ResWindow<T>(numresolutions, resno,
145 useBandWindows() ? nullptr : highestResWindow->getResWindowBufferREL(),
146 resolution_[resno], resno > 0 ? resolution_[resno - 1] : ResSimple(),
147 resWindow, unreducedBounds_, unreducedTileComp,
148 wholeTileDecompress ? 0 : getFilterPad<uint32_t>(lossless)));
149 }
150 resWindows.push_back(highestResWindow);
151 }
153 {
154 for(auto& b : this->resWindows)
155 delete b;
156 }
157
162 Rect32 bounds() const override
163 {
164 return bounds_;
165 }
166 Rect32 unreducedBounds() const override
167 {
168 return unreducedBounds_;
169 }
170 bool alloc() override
171 {
172 return std::all_of(resWindows.begin(), resWindows.end(),
173 [this](const auto& b) { return b->alloc(!compress_); });
174 }
175
176protected:
177 bool useBandWindows() const
178 {
179 return !this->wholeTileDecompress_;
180 }
181 // windowed bounds for windowed decompress, otherwise full bounds
182 std::vector<ResWindow<T>*> resWindows;
183 /******************************************************/
184 // decompress: unreduced/reduced image component window
185 // compress: unreduced/reduced tile component
188 /******************************************************/
189
190 std::vector<ResSimple> resolution_;
193};
194
195template<typename T>
197{
199 TileComponentWindow(bool isCompressor, bool lossless, bool wholeTileDecompress,
200 Rect32 unreducedTileComp, Rect32 reducedTileComp,
201 Rect32 unreducedImageCompWindow, uint8_t numresolutions,
202 uint8_t reducedNumResolutions)
203 : TileComponentWindowBase<T>(isCompressor, lossless, wholeTileDecompress, unreducedTileComp,
204 reducedTileComp, unreducedImageCompWindow, numresolutions,
205 reducedNumResolutions)
206
207 {}
208 ~TileComponentWindow() override = default;
209
224 void toRelativeCoordinates(uint8_t resno, t1::eBandOrientation orientation, uint32_t& offsetx,
225 uint32_t& offsety) const override
226 {
227 assert(resno < this->resolution_.size());
228
229 auto res = this->resolution_[resno];
230 auto band = res.tileBand + getBandIndex(resno, orientation);
231
232 // get offset relative to band
233 assert(offsetx >= band->x0);
234 assert(offsety >= band->y0);
235 offsetx -= band->x0;
236 offsety -= band->y0;
237
238 if(useBufferCoordinatesForCodeblock() && resno > 0)
239 {
240 auto resLower = this->resolution_[resno - 1U];
241
242 if(orientation & 1)
243 offsetx += resLower.width();
244 if(orientation & 2)
245 offsety += resLower.height();
246 }
247 }
248 template<typename F>
249 void postProcess(Buf2dAligned& src, uint8_t resno, t1::eBandOrientation bandOrientation,
251 {
253 dst = getCodeBlockDestWindowREL(resno, bandOrientation);
254 dst.copyFrom<F>(src, F(block));
255 }
256
257 // Cross-type post-process: narrows wider source (e.g., int32_t) into T band buffer
258 template<typename SrcT, template<class> class SrcA, typename F>
259 void postProcessNarrow(Buffer2d<SrcT, SrcA>& src, uint8_t resno,
260 t1::eBandOrientation bandOrientation, t1::DecompressBlockExec* block)
261 {
262 Buf2dAligned dst;
263 dst = getCodeBlockDestWindowREL(resno, bandOrientation);
264 dst.template copyFromNarrow<SrcT, SrcA, F>(&src, F(block));
265 }
266
277 t1::eBandOrientation orientation) const
278 {
279 assert(resno < this->resolution_.size());
280 assert(resno > 0 || orientation == t1::BAND_ORIENT_LL);
281
282 if(resno == 0 && (this->compress_ || this->wholeTileDecompress_))
283 return this->resWindows[0]->getResWindowBufferREL();
284
285 return this->resWindows[resno]->getBandWindowBufferPaddedREL(orientation);
286 }
287
297 t1::eBandOrientation orientation) const
298 {
299 assert(resno < this->resolution_.size());
300 assert(resno > 0 || orientation == t1::BAND_ORIENT_LL);
301
302 if(resno == 0 && (this->compress_ || this->wholeTileDecompress_))
303 return this->resWindows[0]->getResWindowBufferSimple();
304
305 return this->resWindows[resno]->getBandWindowBufferPaddedSimple(orientation);
306 }
307
318 {
319 assert(resno < this->resolution_.size());
320 assert(resno > 0 || orientation == t1::BAND_ORIENT_LL);
321
322 if(resno == 0 && (this->compress_ || this->wholeTileDecompress_))
323 return this->resWindows[0]->getResWindowBufferSimpleF();
324
325 return this->resWindows[resno]->getBandWindowBufferPaddedSimpleF(orientation);
326 }
327
335 const Rect32* getBandWindowPadded(uint8_t resno, t1::eBandOrientation orientation) const override
336 {
337 return this->resWindows[resno]->getBandWindowPadded(orientation);
338 }
339 /*
340 * Get intermediate split window
341 *
342 * @param orientation 0 for upper split window, and 1 for lower split window
343 */
344 const Buf2dAligned* getResWindowBufferSplitREL(uint8_t resno, eSplitOrientation orientation) const
345 {
346 assert(resno > 0 && resno < this->resolution_.size());
347
348 return this->resWindows[resno]->getResWindowBufferSplitREL(orientation);
349 }
350 /*
351 * Get intermediate split window simple buffer
352 *
353 * @param orientation 0 for upper split window, and 1 for lower split window
354 */
356 eSplitOrientation orientation) const
357 {
358 return getResWindowBufferSplitREL(resno, orientation)->simple();
359 }
360
361 /*
362 * Get intermediate split window simpleF buffer
363 *
364 * @param orientation 0 for upper split window, and 1 for lower split window
365 */
367 eSplitOrientation orientation) const
368 {
369 return getResWindowBufferSplitREL(resno, orientation)->simpleF();
370 }
371
378 const Buf2dAligned* getResWindowBufferREL(uint8_t resno) const
379 {
380 return this->resWindows[resno]->getResWindowBufferREL();
381 }
382
389 {
390 return getResWindowBufferREL(resno)->simple();
391 }
392
399 {
400 return getResWindowBufferREL(resno)->simpleF();
401 }
402
409 {
411 }
412
422
431
432 // set data to buf without owning it
433 void attach(T* buffer, uint32_t stride)
434 {
435 getResWindowBufferHighestREL()->attach(buffer, stride);
436 }
437 // transfer data to buf, and cease owning it
438 void transfer(T** buffer, uint32_t* stride)
439 {
440 getResWindowBufferHighestREL()->transfer(buffer, stride);
441 }
442
443 // --- ITileComponentWindow virtual method overrides ---
444
445 void transferData(void** data, uint32_t* stride) override
446 {
447 T* typedData = nullptr;
448 transfer(&typedData, stride);
449 *data = typedData;
450 }
451 void attachData(void* data, uint32_t stride) override
452 {
453 attach(static_cast<T*>(data), stride);
454 }
455 uint32_t highestResStride() const override
456 {
458 }
459 uint64_t stridedArea() const override
460 {
461 auto win = getResWindowBufferHighestREL();
462 return (uint64_t)win->getStride() * win->height();
463 }
464 void postProcessBlock(int32_t* srcData, t1::DecompressBlockExec* block,
465 ISparseCanvas<int32_t>* regionWindow) override;
466 void postProcessBlockHT(int32_t* srcData, t1::DecompressBlockExec* block, uint16_t stride,
467 ISparseCanvas<int32_t>* regionWindow) override;
468
469private:
471 t1::eBandOrientation orientation) const
472 {
474 : getBandWindowBufferPaddedREL(resno, orientation);
475 }
477 {
478 return this->resWindows.back()->getResWindowBufferREL();
479 }
481 {
482 return this->compress_ || !this->wholeTileDecompress_;
483 }
484 uint8_t getBandIndex(uint8_t resno, t1::eBandOrientation orientation) const
485 {
486 return resno > 0 ? (uint8_t)orientation - 1 : 0;
487 }
488};
489
490// ---------- postProcessBlock / postProcessBlockHT out-of-class definitions ----------
491
492template<typename T>
494 ISparseCanvas<int32_t>* regionWindow)
495{
496 auto cblk = block->cblk;
497 bool empty = cblk->dataChunksEmpty();
498 uint32_t x = block->x;
499 uint32_t y = block->y;
500 toRelativeCoordinates(block->resno, block->bandOrientation, x, y);
501 auto blockBounds = Rect32(x, y, x + cblk->width(), y + cblk->height());
502
503 if constexpr(std::is_same_v<T, int16_t>)
504 {
505 // 16-bit narrowing path: int32 T1 output -> int16 band buffers
506 auto src = Buffer2d<int32_t, AllocatorAligned>(srcData, false, cblk->width(),
507 (uint16_t)cblk->width(), cblk->height());
508 if(!empty && !regionWindow)
509 {
510 src.setRect(blockBounds);
511 if(block->qmfbid == 0)
512 {
513 // Irreversible 9/7: dequantize and narrow to int16
514 if(block->roishift)
516 src, block->resno, block->bandOrientation, block);
517 else
519 src, block->resno, block->bandOrientation, block);
520 }
521 else
522 {
523 // Reversible 5/3: shift and narrow to int16
524 if(block->roishift)
526 src, block->resno, block->bandOrientation, block);
527 else
529 src, block->resno, block->bandOrientation, block);
530 }
531 }
532 }
533 else
534 {
535 // Standard int32 path
536 auto src = Buffer2d<T, AllocatorAligned>(srcData, false, cblk->width(), (uint16_t)cblk->width(),
537 cblk->height());
538 if(!empty)
539 {
540 if(regionWindow)
541 {
542 if(block->roishift)
543 {
544 if(block->qmfbid == 1)
545 src.template copyFrom<t1::RoiShiftFilter<T>>(src, t1::RoiShiftFilter<T>{block});
546 else
547 src.template copyFrom<t1::RoiScaleFilter<T>>(src, t1::RoiScaleFilter<T>{block});
548 }
549 else
550 {
551 if(block->qmfbid == 1)
552 src.template copyFrom<t1::ShiftFilter<T>>(src, t1::ShiftFilter<T>{block});
553 else
554 src.template copyFrom<t1::ScaleFilter<T>>(src, t1::ScaleFilter<T>{block});
555 }
556 }
557 else
558 {
559 src.setRect(blockBounds);
560 if(block->roishift)
561 {
562 if(block->qmfbid == 1)
563 postProcess<t1::RoiShiftFilter<T>>(src, block->resno, block->bandOrientation, block);
564 else
565 postProcess<t1::RoiScaleFilter<T>>(src, block->resno, block->bandOrientation, block);
566 }
567 else
568 {
569 if(block->qmfbid == 1)
570 postProcess<t1::ShiftFilter<T>>(src, block->resno, block->bandOrientation, block);
571 else
572 postProcess<t1::ScaleFilter<T>>(src, block->resno, block->bandOrientation, block);
573 }
574 }
575 }
576 if(regionWindow)
577 regionWindow->write(block->resno, blockBounds, empty ? nullptr : srcData, 1,
578 blockBounds.width());
579 }
580}
581
582template<typename T>
584 uint16_t stride,
585 ISparseCanvas<int32_t>* regionWindow)
586{
587 auto cblk = block->cblk;
588 bool empty = cblk->dataChunksEmpty();
589 uint32_t x = block->x;
590 uint32_t y = block->y;
591 toRelativeCoordinates(block->resno, block->bandOrientation, x, y);
592 auto blockBounds = Rect32(x, y, x + cblk->width(), y + cblk->height());
593
594 if constexpr(std::is_same_v<T, int16_t>)
595 {
596 // 16-bit narrowing path: int32 T1 output -> int16 band buffers
597 auto src =
598 Buffer2d<int32_t, AllocatorAligned>(srcData, false, cblk->width(), stride, cblk->height());
599 if(!empty && !regionWindow)
600 {
601 src.setRect(blockBounds);
602 if(block->qmfbid == 0)
603 {
604 // Irreversible 9/7: dequantize and narrow to int16 (OJPH sign-magnitude)
605 if(block->roishift)
606 this->template postProcessNarrow<int32_t, AllocatorAligned,
608 src, block->resno, block->bandOrientation, block);
609 else
610 this->template postProcessNarrow<int32_t, AllocatorAligned,
612 src, block->resno, block->bandOrientation, block);
613 }
614 else
615 {
616 // Reversible 5/3: shift and narrow to int16
617 if(block->roishift)
618 this->template postProcessNarrow<int32_t, AllocatorAligned,
620 src, block->resno, block->bandOrientation, block);
621 else
622 this->template postProcessNarrow<int32_t, AllocatorAligned,
624 src, block->resno, block->bandOrientation, block);
625 }
626 }
627 }
628 else
629 {
630 // Standard int32 path
631 auto src = Buffer2d<T, AllocatorAligned>(srcData, false, cblk->width(), stride, cblk->height());
632 if(!empty)
633 {
634 if(regionWindow)
635 {
636 if(block->roishift)
637 {
638 if(block->qmfbid == 1)
639 src.template copyFrom<t1::ojph::RoiShiftOJPHFilter<T>>(
641 else
642 src.template copyFrom<t1::ojph::RoiScaleOJPHFilter<T>>(
644 }
645 else
646 {
647 if(block->qmfbid == 1)
648 src.template copyFrom<t1::ojph::ShiftOJPHFilter<T>>(
649 src, t1::ojph::ShiftOJPHFilter<T>{block});
650 else
651 src.template copyFrom<t1::ojph::ScaleOJPHFilter<T>>(
652 src, t1::ojph::ScaleOJPHFilter<T>{block});
653 }
654 }
655 else
656 {
657 src.setRect(blockBounds);
658 if(block->roishift)
659 {
660 if(block->qmfbid == 1)
662 block);
663 else
665 block);
666 }
667 else
668 {
669 if(block->qmfbid == 1)
671 block);
672 else
674 block);
675 }
676 }
677 }
678 if(regionWindow)
679 regionWindow->write(block->resno, blockBounds, empty ? nullptr : srcData, 1,
680 blockBounds.width());
681 }
682}
683
684} // namespace grk
Definition ISparseCanvas.h:42
virtual bool write(uint8_t resno, Rect32 window, const T *src, const uint32_t srcChunkY, const uint32_t srcChunkX)=0
Write window of data from src buffer.
Definition PostDecodeFilters.h:63
Definition PostDecodeFilters.h:27
Definition PostDecodeFilters.h:90
Definition PostDecodeFilters.h:51
Definition PostDecodeFiltersOJPH.h:196
Definition PostDecodeFiltersOJPH.h:139
Definition PostDecodeFiltersOJPH.h:167
Definition PostDecodeFiltersOJPH.h:121
Definition PostDecodeFiltersOJPH.h:70
Definition PostDecodeFiltersOJPH.h:26
Definition PostDecodeFiltersOJPH.h:98
Definition PostDecodeFiltersOJPH.h:51
eBandOrientation
Definition t1_common.h:28
@ BAND_ORIENT_LL
Definition t1_common.h:29
ResWindow.
Definition CompressedChunkCache.h:36
eSplitOrientation
Definition ResWindow.h:57
constexpr T getFilterPad(bool lossless)
Definition TileComponentWindow.h:89
Rect< uint32_t > Rect32
Definition geometry.h:64
Definition buffer.h:41
Definition buffer.h:288
void attach(T *buffer, uint32_t strd)
Definition buffer.h:435
void copyFrom(const Buffer2d &src, F filter)
Definition buffer.h:477
uint32_t getStride()
Definition buffer.h:543
Buffer2dSimple< float > simpleF(void) const
Definition buffer.h:363
void transfer(T **buffer, uint32_t *strd)
Definition buffer.h:465
Buffer2dSimple< T > simple(void) const
Definition buffer.h:359
Definition buffer.h:262
Type-erased interface for tile component windows.
Definition TileComponentWindow.h:58
virtual void attachData(void *data, uint32_t stride)=0
virtual uint64_t stridedArea() const =0
virtual Rect32 unreducedBounds() const =0
virtual Rect32 bounds() const =0
virtual const Rect32 * getBandWindowPadded(uint8_t resno, t1::eBandOrientation orientation) const =0
virtual void postProcessBlockHT(int32_t *srcData, t1::DecompressBlockExec *block, uint16_t stride, ISparseCanvas< int32_t > *regionWindow)=0
virtual void transferData(void **data, uint32_t *stride)=0
virtual bool alloc()=0
virtual void postProcessBlock(int32_t *srcData, t1::DecompressBlockExec *block, ISparseCanvas< int32_t > *regionWindow)=0
virtual uint32_t highestResStride() const =0
virtual ~ITileComponentWindow()=default
virtual void toRelativeCoordinates(uint8_t resno, t1::eBandOrientation orientation, uint32_t &offsetx, uint32_t &offsety) const =0
Rect< T > intersection(const Rect< T > &rhs) const
Definition geometry.h:347
Rect< T > scaleDownCeilPow2(uint8_t power) const
Definition geometry.h:335
Definition ResSimple.h:26
static Rect32 getBandWindow(uint8_t numDecomps, uint8_t orientation, Rect32 tileCompWindowUnreduced)
Get band window (in tile component coordinates) for specified number of decompositions.
Definition ResSimple.h:60
Definition ResWindow.h:70
Rect32 unreducedBounds() const override
Definition TileComponentWindow.h:166
Rect32 unreducedBounds_
Definition TileComponentWindow.h:186
bool wholeTileDecompress_
Definition TileComponentWindow.h:192
bool compress_
Definition TileComponentWindow.h:191
TileComponentWindowBase(bool isCompressor, bool lossless, bool wholeTileDecompress, Rect32 unreducedTileComp, Rect32 reducedTileComp, Rect32 unreducedImageCompWindow, uint8_t numresolutions, uint8_t reducedNumResolutions)
Definition TileComponentWindow.h:97
Rect32 bounds_
Definition TileComponentWindow.h:187
Rect32 bounds() const override
Get bounds of tile component (canvas coordinates) decompress: reduced canvas coordinates of window co...
Definition TileComponentWindow.h:162
virtual ~TileComponentWindowBase()
Definition TileComponentWindow.h:152
bool alloc() override
Definition TileComponentWindow.h:170
std::vector< ResWindow< T > * > resWindows
Definition TileComponentWindow.h:182
std::vector< ResSimple > resolution_
Definition TileComponentWindow.h:190
bool useBandWindows() const
Definition TileComponentWindow.h:177
const Buffer2dSimple< T > getResWindowBufferSimple(uint8_t resno) const
Get resolution window.
Definition TileComponentWindow.h:388
Buffer2dSimple< float > getResWindowBufferHighestSimpleF(void) const
Get highest resolution window.
Definition TileComponentWindow.h:427
uint64_t stridedArea() const override
Definition TileComponentWindow.h:459
const Buffer2dSimple< T > getBandWindowBufferPaddedSimple(uint8_t resno, t1::eBandOrientation orientation) const
Get padded band window buffer.
Definition TileComponentWindow.h:296
~TileComponentWindow() override=default
const Rect32 * getBandWindowPadded(uint8_t resno, t1::eBandOrientation orientation) const override
Get padded band window.
Definition TileComponentWindow.h:335
Buf2dAligned * getResWindowBufferHighestREL(void) const
Definition TileComponentWindow.h:476
const Buffer2dSimple< float > getResWindowBufferSimpleF(uint8_t resno) const
Get resolution window.
Definition TileComponentWindow.h:398
Buffer2d< T, AllocatorAligned > Buf2dAligned
Definition TileComponentWindow.h:198
void toRelativeCoordinates(uint8_t resno, t1::eBandOrientation orientation, uint32_t &offsetx, uint32_t &offsety) const override
Transform code block offsets from canvas coordinates to either band coordinates (relative to sub band...
Definition TileComponentWindow.h:224
const Buf2dAligned * getResWindowBufferSplitREL(uint8_t resno, eSplitOrientation orientation) const
Definition TileComponentWindow.h:344
const Buf2dAligned * getBandWindowBufferPaddedREL(uint8_t resno, t1::eBandOrientation orientation) const
Get padded band window buffer.
Definition TileComponentWindow.h:276
void transfer(T **buffer, uint32_t *stride)
Definition TileComponentWindow.h:438
uint32_t highestResStride() const override
Definition TileComponentWindow.h:455
void transferData(void **data, uint32_t *stride) override
Definition TileComponentWindow.h:445
const Buf2dAligned * getResWindowBufferREL(uint8_t resno) const
Get resolution window.
Definition TileComponentWindow.h:378
TileComponentWindow(bool isCompressor, bool lossless, bool wholeTileDecompress, Rect32 unreducedTileComp, Rect32 reducedTileComp, Rect32 unreducedImageCompWindow, uint8_t numresolutions, uint8_t reducedNumResolutions)
Definition TileComponentWindow.h:199
const Buffer2dSimple< T > getResWindowBufferSplitSimple(uint8_t resno, eSplitOrientation orientation) const
Definition TileComponentWindow.h:355
const Buffer2dSimple< float > getBandWindowBufferPaddedSimpleF(uint8_t resno, t1::eBandOrientation orientation) const
Get padded band window buffer.
Definition TileComponentWindow.h:317
uint32_t getResWindowBufferHighestStride(void) const
Get highest resolution window.
Definition TileComponentWindow.h:408
const Buffer2dSimple< float > getResWindowBufferSplitSimpleF(uint8_t resno, eSplitOrientation orientation) const
Definition TileComponentWindow.h:366
uint8_t getBandIndex(uint8_t resno, t1::eBandOrientation orientation) const
Definition TileComponentWindow.h:484
bool useBufferCoordinatesForCodeblock() const
Definition TileComponentWindow.h:480
void postProcessBlockHT(int32_t *srcData, t1::DecompressBlockExec *block, uint16_t stride, ISparseCanvas< int32_t > *regionWindow) override
Definition TileComponentWindow.h:583
Buffer2dSimple< T > getResWindowBufferHighestSimple(void) const
Get highest resolution window.
Definition TileComponentWindow.h:418
void attach(T *buffer, uint32_t stride)
Definition TileComponentWindow.h:433
const Buf2dAligned * getCodeBlockDestWindowREL(uint8_t resno, t1::eBandOrientation orientation) const
Definition TileComponentWindow.h:470
void postProcessBlock(int32_t *srcData, t1::DecompressBlockExec *block, ISparseCanvas< int32_t > *regionWindow) override
Definition TileComponentWindow.h:493
void postProcess(Buf2dAligned &src, uint8_t resno, t1::eBandOrientation bandOrientation, t1::DecompressBlockExec *block)
Definition TileComponentWindow.h:249
void postProcessNarrow(Buffer2d< SrcT, SrcA > &src, uint8_t resno, t1::eBandOrientation bandOrientation, t1::DecompressBlockExec *block)
Definition TileComponentWindow.h:259
void attachData(void *data, uint32_t stride) override
Definition TileComponentWindow.h:451
uint32_t x
Definition BlockExec.h:45
uint8_t qmfbid
Definition BlockExec.h:43
uint32_t y
Definition BlockExec.h:46
eBandOrientation bandOrientation
Definition BlockExec.h:40
bool dataChunksEmpty()
Definition CodeblockDecompress.h:86
Definition BlockExec.h:64
uint8_t roishift
Definition BlockExec.h:116
uint8_t resno
Definition BlockExec.h:115
CodeblockDecompress * cblk
Definition BlockExec.h:114