1 /* 2 * Simd Library (http://ermig1979.github.io/Simd). 3 * 4 * Copyright (c) 2011-2019 Yermalayeu Ihar. 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights 9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 * copies of the Software, and to permit persons to whom the Software is 11 * furnished to do so, subject to the following conditions: 12 * 13 * The above copyright notice and this permission notice shall be included in 14 * all copies or substantial portions of the Software. 15 * 16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 * SOFTWARE. 23 */ 24 #ifndef __SimdPixel_hpp__ 25 #define __SimdPixel_hpp__ 26 27 #include "Simd/SimdView.hpp" 28 29 namespace Simd 30 { 31 /*! @ingroup cpp_pixels 32 33 \short Contains various pixel structures. 34 35 Contains various pixel structures useful for work with Simd::View structure. 36 */ 37 namespace Pixel 38 { 39 struct Bgr24; 40 struct Bgra32; 41 struct Hsv24; 42 struct Hsl24; 43 struct Rgb24; 44 45 //------------------------------------------------------------------------- 46 47 /*! @ingroup cpp_pixels 48 49 \short 24-bit BGR pixel. 50 51 Provides manipulation of 24-bit BGR (Blue, Green, Red) pixels of the View struct. 52 */ 53 struct Bgr24 54 { 55 uint8_t blue; /*!< \brief 8-bit blue channel 24-bit BGR pixel. */ 56 uint8_t green; /*!< \brief 8-bit green channel 24-bit BGR pixel. */ 57 uint8_t red; /*!< \brief 8-bit red channel 24-bit BGR pixel. */ 58 59 /*! 60 Creates a new 24-bit BGR pixel structure with specified channel values. 61 62 \param [in] gray - initial value for all channels. It is equal to 0 by default. 63 */ 64 Bgr24(const uint8_t & gray = uint8_t(0)); 65 66 /*! 67 Creates a new 24-bit BGR pixel structure with specified channel values. 68 69 \param [in] b - initial value for blue channel. 70 \param [in] g - initial value for green channel. 71 \param [in] r - initial value for red channel. 72 */ 73 Bgr24(const uint8_t & b, const uint8_t & g, const uint8_t & r); 74 75 /*! 76 Creates a new 24-bit BGR pixel structure on the base of 32-bit BGRA pixel. 77 78 \param [in] p - 32-bit BGRA pixel. 79 */ 80 Bgr24(const Bgra32 & p); 81 82 /*! 83 Creates a new 24-bit BGR pixel structure on the base of 24-bit RGB pixel. 84 85 \param [in] p - 24-bit RGB pixel. 86 */ 87 Bgr24(const Rgb24 & p); 88 89 /*! 90 Creates a copy of 24-bit BGR pixel structure. 91 92 \param [in] p - 24-bit BGR pixel. 93 */ 94 Bgr24(const Bgr24 & p); 95 96 /*! 97 \fn template <template<class> class A> static const Bgr24 & At(const View<A> & view, ptrdiff_t col, ptrdiff_t row); 98 99 Gets constant reference to the pixel with specific coordinates at the image view. 100 101 \param [in] view - an image view of 24-bit BGR pixel format. 102 \param [in] col - x-coordinate of the pixel. 103 \param [in] row - y-coordinate of the pixel. 104 \return a constant reference to the pixel. 105 */ 106 template <template<class> class A> static const Bgr24 & At(const View<A> & view, ptrdiff_t col, ptrdiff_t row); 107 108 /*! 109 \fn template <template<class> class A> static Bgr24 & At(View<A> & view, ptrdiff_t col, ptrdiff_t row); 110 111 Gets reference to the pixel with specific coordinates at the image view. 112 113 \param [in] view - an image view of 24-bit BGR pixel format. 114 \param [in] col - x-coordinate of the pixel. 115 \param [in] row - y-coordinate of the pixel. 116 \return a reference to the pixel. 117 */ 118 template <template<class> class A> static Bgr24 & At(View<A> & view, ptrdiff_t col, ptrdiff_t row); 119 }; 120 121 /*! @ingroup cpp_pixels 122 123 \short 32-bit BGRA pixel. 124 125 Provides manipulation of 32-bit BGRA (Blue, Green, Red, Alpha) pixels of the View struct. 126 */ 127 struct Bgra32 128 { 129 uint8_t blue; /*!< \brief 8-bit blue channel 32-bit BGRA pixel. */ 130 uint8_t green; /*!< \brief 8-bit green channel 32-bit BGRA pixel. */ 131 uint8_t red; /*!< \brief 8-bit red channel 32-bit BGRA pixel. */ 132 uint8_t alpha; /*!< \brief 8-bit alpha channel 32-bit BGRA pixel. */ 133 134 /*! 135 Creates a new 32-bit BGRA pixel structure with specified channel values. 136 137 \param [in] gray - initial value for blue, green and red channels. It is equal to 0 by default. 138 \param [in] a - initial value for alpha channel. It is equal to 255 by default. 139 */ 140 Bgra32(const uint8_t & gray = uint8_t(0), const uint8_t & a = uint8_t(255)); 141 142 /*! 143 Creates a new 32-bit BGRA pixel structure with specified channel values. 144 145 \param [in] b - initial value for blue channel. 146 \param [in] g - initial value for green channel. 147 \param [in] r - initial value for red channel. 148 \param [in] a - initial value for alpha channel. It is equal to 255 by default. 149 */ 150 Bgra32(const uint8_t & b, const uint8_t & g, const uint8_t & r, const uint8_t & a = uint8_t(255)); 151 152 /*! 153 Creates a new 32-bit BGRA pixel structure on the base of 24-bit BGR pixel. 154 155 \param [in] p - 24-bit BGR pixel. 156 \param [in] a - initial value for alpha channel. It is equal to 255 by default. 157 */ 158 Bgra32(const Bgr24 & p, const uint8_t & a = uint8_t(255)); 159 160 /*! 161 Creates a new 32-bit BGRA pixel structure on the base of 24-bit RGB pixel. 162 163 \param [in] p - 24-bit RGB pixel. 164 \param [in] a - initial value for alpha channel. It is equal to 255 by default. 165 */ 166 Bgra32(const Rgb24 & p, const uint8_t & a = uint8_t(255)); 167 168 /*! 169 Creates a copy of 32-bit BGRA pixel structure. 170 171 \param [in] p - 32-bit BGRA pixel. 172 */ 173 Bgra32(const Bgra32 & p); 174 175 /*! 176 \fn template <template<class> class A> static const Bgr32 & At(const View<A> & view, ptrdiff_t col, ptrdiff_t row); 177 178 Gets constant reference to the pixel with specific coordinates at the image view. 179 180 \param [in] view - an image view of 32-bit BGRA pixel format. 181 \param [in] col - x-coordinate of the pixel. 182 \param [in] row - y-coordinate of the pixel. 183 \return a constant reference to the pixel. 184 */ 185 template <template<class> class A> static const Bgra32 & At(const View<A> & view, ptrdiff_t col, ptrdiff_t row); 186 187 /*! 188 \fn template <template<class> class A> static Bgr32 & At(View<A> & view, ptrdiff_t col, ptrdiff_t row); 189 190 Gets reference to the pixel with specific coordinates at the image view. 191 192 \param [in] view - an image view of 32-bit BGRA pixel format. 193 \param [in] col - x-coordinate of the pixel. 194 \param [in] row - y-coordinate of the pixel. 195 \return a reference to the pixel. 196 */ 197 template <template<class> class A> static Bgra32 & At(View<A> & view, ptrdiff_t col, ptrdiff_t row); 198 }; 199 200 /*! @ingroup cpp_pixels 201 202 \short 24-bit HSV pixel. 203 204 Provides manipulation of 24-bit HSV (Hue, Saturation, Value) pixels of the View struct. 205 */ 206 struct Hsv24 207 { 208 uint8_t hue; /*!< \brief 8-bit hue channel 24-bit HSV pixel. */ 209 uint8_t saturation; /*!< \brief 8-bit saturation channel 24-bit HSV pixel. */ 210 uint8_t value; /*!< \brief 8-bit value channel 24-bit HSV pixel. */ 211 212 /*! 213 Creates a new 24-bit HSV pixel structure with specified channel values. 214 215 \param [in] gray - initial value for value channel. It is equal to 0 by default. 216 */ 217 Hsv24(const uint8_t & gray = uint8_t(0)); 218 219 /*! 220 Creates a new 24-bit HSV pixel structure with specified channel values. 221 222 \param [in] h - initial value for hue channel. 223 \param [in] s - initial value for saturation channel. 224 \param [in] v - initial value for value channel. 225 */ 226 Hsv24(const uint8_t & h, const uint8_t & s, const uint8_t & v); 227 228 /*! 229 Creates a copy of 24-bit HSV pixel structure. 230 231 \param [in] p - 24-bit HSV pixel. 232 */ 233 Hsv24(const Hsv24 & p); 234 235 /*! 236 \fn template <template<class> class A> static const Hsv24 & At(const View<A> & view, ptrdiff_t col, ptrdiff_t row); 237 238 Gets constant reference to the pixel with specific coordinates at the image view. 239 240 \param [in] view - an image view of 24-bit HSV pixel format. 241 \param [in] col - x-coordinate of the pixel. 242 \param [in] row - y-coordinate of the pixel. 243 \return a constant reference to the pixel. 244 */ 245 template <template<class> class A> static const Hsv24 & At(const View<A> & view, ptrdiff_t col, ptrdiff_t row); 246 247 /*! 248 \fn template <template<class> class A> static Hsv24 & At(View<A> & view, ptrdiff_t col, ptrdiff_t row); 249 250 Gets reference to the pixel with specific coordinates at the image view. 251 252 \param [in] view - an image view of 24-bit HSV pixel format. 253 \param [in] col - x-coordinate of the pixel. 254 \param [in] row - y-coordinate of the pixel. 255 \return a reference to the pixel. 256 */ 257 template <template<class> class A> static Hsv24 & At(View<A> & view, ptrdiff_t col, ptrdiff_t row); 258 }; 259 260 /*! @ingroup cpp_pixels 261 262 \short 24-bit HSL pixel. 263 264 Provides manipulation of 24-bit HSL (Hue, Saturation, Lightness) pixels of the View struct. 265 */ 266 struct Hsl24 267 { 268 uint8_t hue; /*!< \brief 8-bit hue channel 24-bit HSL pixel. */ 269 uint8_t saturation; /*!< \brief 8-bit saturation channel 24-bit HSL pixel. */ 270 uint8_t lightness; /*!< \brief 8-bit lightness channel 24-bit HSL pixel. */ 271 272 /*! 273 Creates a new 24-bit HSL pixel structure with specified channel values. 274 275 \param [in] gray - initial value for value channel. It is equal to 0 by default. 276 */ 277 Hsl24(const uint8_t & gray = uint8_t(0)); 278 279 /*! 280 Creates a new 24-bit HSL pixel structure with specified channel values. 281 282 \param [in] h - initial value for hue channel. 283 \param [in] s - initial value for saturation channel. 284 \param [in] l - initial value for lightness channel. 285 */ 286 Hsl24(const uint8_t & h, const uint8_t & s, const uint8_t & l); 287 288 /*! 289 Creates a copy of 24-bit HSL pixel structure. 290 291 \param [in] p - 24-bit HSL pixel. 292 */ 293 Hsl24(const Hsl24 & p); 294 295 296 /*! 297 \fn template <template<class> class A> static const Hsl24 & At(const View<A> & view, ptrdiff_t col, ptrdiff_t row); 298 299 Gets constant reference to the pixel with specific coordinates at the image view. 300 301 \param [in] view - an image view of 24-bit HSL pixel format. 302 \param [in] col - x-coordinate of the pixel. 303 \param [in] row - y-coordinate of the pixel. 304 \return a constant reference to the pixel. 305 */ 306 template <template<class> class A> static const Hsl24 & At(const View<A> & view, ptrdiff_t col, ptrdiff_t row); 307 308 /*! 309 \fn template <template<class> class A> static Hsl24 & At(View<A> & view, ptrdiff_t col, ptrdiff_t row); 310 311 Gets reference to the pixel with specific coordinates at the image view. 312 313 \param [in] view - an image view of 24-bit HSL pixel format. 314 \param [in] col - x-coordinate of the pixel. 315 \param [in] row - y-coordinate of the pixel. 316 \return a reference to the pixel. 317 */ 318 template <template<class> class A> static Hsl24 & At(View<A> & view, ptrdiff_t col, ptrdiff_t row); 319 }; 320 321 /*! @ingroup cpp_pixels 322 323 \short 24-bit RGB pixel. 324 325 Provides manipulation of 24-bit RGB (Red, Blue, Green) pixels of the View struct. 326 */ 327 struct Rgb24 328 { 329 uint8_t red; /*!< \brief 8-bit red channel 24-bit BGR pixel. */ 330 uint8_t green; /*!< \brief 8-bit green channel 24-bit BGR pixel. */ 331 uint8_t blue; /*!< \brief 8-bit blue channel 24-bit BGR pixel. */ 332 333 /*! 334 Creates a new 24-bit RGB pixel structure with specified channel values. 335 336 \param [in] gray - initial value for all channels. It is equal to 0 by default. 337 */ 338 Rgb24(const uint8_t & gray = uint8_t(0)); 339 340 /*! 341 Creates a new 24-bit RGB pixel structure with specified channel values. 342 343 \param [in] r - initial value for red channel. 344 \param [in] g - initial value for green channel. 345 \param [in] b - initial value for blue channel. 346 */ 347 Rgb24(const uint8_t & r, const uint8_t & g, const uint8_t & b); 348 349 /*! 350 Creates a new 24-bit RGB pixel structure on the base of 32-bit BGRA pixel. 351 352 \param [in] p - 32-bit BGRA pixel. 353 */ 354 Rgb24(const Bgra32 & p); 355 356 /*! 357 Creates a new 24-bit RGB pixel structure on the base of 24-bit BGR pixel. 358 359 \param [in] p - 24-bit BGR pixel. 360 */ 361 Rgb24(const Bgr24 & p); 362 363 /*! 364 Creates a copy of 24-bit RGB pixel structure. 365 366 \param [in] p - 24-bit RGB pixel. 367 */ 368 Rgb24(const Rgb24 & p); 369 370 /*! 371 \fn template <template<class> class A> static const Rgb24 & At(const View<A> & view, ptrdiff_t col, ptrdiff_t row); 372 373 Gets constant reference to the pixel with specific coordinates at the image view. 374 375 \param [in] view - an image view of 24-bit RGB pixel format. 376 \param [in] col - x-coordinate of the pixel. 377 \param [in] row - y-coordinate of the pixel. 378 \return a constant reference to the pixel. 379 */ 380 template <template<class> class A> static const Rgb24 & At(const View<A> & view, ptrdiff_t col, ptrdiff_t row); 381 382 /*! 383 \fn template <template<class> class A> static Rgb24 & At(View<A> & view, ptrdiff_t col, ptrdiff_t row); 384 385 Gets reference to the pixel with specific coordinates at the image view. 386 387 \param [in] view - an image view of 24-bit RGB pixel format. 388 \param [in] col - x-coordinate of the pixel. 389 \param [in] row - y-coordinate of the pixel. 390 \return a reference to the pixel. 391 */ 392 template <template<class> class A> static Rgb24 & At(View<A> & view, ptrdiff_t col, ptrdiff_t row); 393 }; 394 395 //------------------------------------------------------------------------- 396 397 // struct Bgr24 implementation: 398 Bgr24(const uint8_t & gray)399 SIMD_INLINE Bgr24::Bgr24(const uint8_t & gray) 400 : blue(gray) 401 , green(gray) 402 , red(gray) 403 { 404 } 405 Bgr24(const uint8_t & b,const uint8_t & g,const uint8_t & r)406 SIMD_INLINE Bgr24::Bgr24(const uint8_t & b, const uint8_t & g, const uint8_t & r) 407 : blue(b) 408 , green(g) 409 , red(r) 410 { 411 } 412 Bgr24(const Bgra32 & p)413 SIMD_INLINE Bgr24::Bgr24(const Bgra32 & p) 414 : blue(p.blue) 415 , green(p.green) 416 , red(p.red) 417 { 418 } 419 Bgr24(const Bgr24 & p)420 SIMD_INLINE Bgr24::Bgr24(const Bgr24 & p) 421 : blue(p.blue) 422 , green(p.green) 423 , red(p.red) 424 { 425 } 426 Bgr24(const Rgb24 & p)427 SIMD_INLINE Bgr24::Bgr24(const Rgb24 & p) 428 : blue(p.blue) 429 , green(p.green) 430 , red(p.red) 431 { 432 } 433 At(const View<A> & view,ptrdiff_t col,ptrdiff_t row)434 template <template<class> class A> SIMD_INLINE const Bgr24 & Bgr24::At(const View<A> & view, ptrdiff_t col, ptrdiff_t row) 435 { 436 assert(view.format == View<A>::Bgr24); 437 438 return Simd::At<A, Bgr24>(view, col, row); 439 } 440 At(View<A> & view,ptrdiff_t col,ptrdiff_t row)441 template <template<class> class A> SIMD_INLINE Bgr24 & Bgr24::At(View<A> & view, ptrdiff_t col, ptrdiff_t row) 442 { 443 assert(view.format == View<A>::Bgr24); 444 445 return Simd::At<A, Bgr24>(view, col, row); 446 } 447 448 // struct Bgra32 implementation: 449 Bgra32(const uint8_t & gray,const uint8_t & a)450 SIMD_INLINE Bgra32::Bgra32(const uint8_t & gray, const uint8_t & a) 451 : blue(gray) 452 , green(gray) 453 , red(gray) 454 , alpha(a) 455 { 456 } 457 Bgra32(const uint8_t & b,const uint8_t & g,const uint8_t & r,const uint8_t & a)458 SIMD_INLINE Bgra32::Bgra32(const uint8_t & b, const uint8_t & g, const uint8_t & r, const uint8_t & a) 459 : blue(b) 460 , green(g) 461 , red(r) 462 , alpha(a) 463 { 464 } 465 Bgra32(const Bgr24 & p,const uint8_t & a)466 SIMD_INLINE Bgra32::Bgra32(const Bgr24 & p, const uint8_t & a) 467 : blue(p.blue) 468 , green(p.green) 469 , red(p.red) 470 , alpha(a) 471 { 472 } 473 Bgra32(const Rgb24 & p,const uint8_t & a)474 SIMD_INLINE Bgra32::Bgra32(const Rgb24 & p, const uint8_t & a) 475 : blue(p.blue) 476 , green(p.green) 477 , red(p.red) 478 , alpha(a) 479 { 480 } 481 Bgra32(const Bgra32 & p)482 SIMD_INLINE Bgra32::Bgra32(const Bgra32 & p) 483 : blue(p.blue) 484 , green(p.green) 485 , red(p.red) 486 , alpha(p.alpha) 487 { 488 } 489 At(const View<A> & view,ptrdiff_t col,ptrdiff_t row)490 template <template<class> class A> SIMD_INLINE const Bgra32 & Bgra32::At(const View<A> & view, ptrdiff_t col, ptrdiff_t row) 491 { 492 assert(view.format == View<A>::Bgra32); 493 494 return Simd::At<A, Bgra32>(view, col, row); 495 } 496 At(View<A> & view,ptrdiff_t col,ptrdiff_t row)497 template <template<class> class A> SIMD_INLINE Bgra32 & Bgra32::At(View<A> & view, ptrdiff_t col, ptrdiff_t row) 498 { 499 assert(view.format == View<A>::Bgra32); 500 501 return Simd::At<A, Bgra32>(view, col, row); 502 } 503 504 // struct Hsv24 implementation: 505 Hsv24(const uint8_t & gray)506 SIMD_INLINE Hsv24::Hsv24(const uint8_t & gray) 507 : hue(0) 508 , saturation(0) 509 , value(gray) 510 { 511 } 512 Hsv24(const uint8_t & h,const uint8_t & s,const uint8_t & v)513 SIMD_INLINE Hsv24::Hsv24(const uint8_t & h, const uint8_t & s, const uint8_t & v) 514 : hue(h) 515 , saturation(s) 516 , value(v) 517 { 518 } 519 Hsv24(const Hsv24 & p)520 SIMD_INLINE Hsv24::Hsv24(const Hsv24 & p) 521 : hue(p.hue) 522 , saturation(p.saturation) 523 , value(p.value) 524 { 525 } 526 At(const View<A> & view,ptrdiff_t col,ptrdiff_t row)527 template <template<class> class A> SIMD_INLINE const Hsv24 & Hsv24::At(const View<A> & view, ptrdiff_t col, ptrdiff_t row) 528 { 529 assert(view.format == View<A>::Hsv24); 530 531 return Simd::At<A, Hsv24>(view, col, row); 532 } 533 At(View<A> & view,ptrdiff_t col,ptrdiff_t row)534 template <template<class> class A> SIMD_INLINE Hsv24 & Hsv24::At(View<A> & view, ptrdiff_t col, ptrdiff_t row) 535 { 536 assert(view.format == View<A>::Hsv24); 537 538 return Simd::At<A, Hsv24>(view, col, row); 539 } 540 541 // struct Hsl24 implementation: 542 Hsl24(const uint8_t & gray)543 SIMD_INLINE Hsl24::Hsl24(const uint8_t & gray) 544 : hue(0) 545 , saturation(0) 546 , lightness(gray) 547 { 548 } 549 Hsl24(const uint8_t & h,const uint8_t & s,const uint8_t & l)550 SIMD_INLINE Hsl24::Hsl24(const uint8_t & h, const uint8_t & s, const uint8_t & l) 551 : hue(h) 552 , saturation(s) 553 , lightness(l) 554 { 555 } 556 Hsl24(const Hsl24 & p)557 SIMD_INLINE Hsl24::Hsl24(const Hsl24 & p) 558 : hue(p.hue) 559 , saturation(p.saturation) 560 , lightness(p.lightness) 561 { 562 } 563 At(const View<A> & view,ptrdiff_t col,ptrdiff_t row)564 template <template<class> class A> SIMD_INLINE const Hsl24 & Hsl24::At(const View<A> & view, ptrdiff_t col, ptrdiff_t row) 565 { 566 assert(view.format == View<A>::Hsl24); 567 568 return Simd::At<A, Hsl24>(view, col, row); 569 } 570 At(View<A> & view,ptrdiff_t col,ptrdiff_t row)571 template <template<class> class A> SIMD_INLINE Hsl24 & Hsl24::At(View<A> & view, ptrdiff_t col, ptrdiff_t row) 572 { 573 assert(view.format == View<A>::Hsl24); 574 575 return Simd::At<A, Hsl24>(view, col, row); 576 } 577 578 // struct Rgb24 implementation: 579 Rgb24(const uint8_t & gray)580 SIMD_INLINE Rgb24::Rgb24(const uint8_t & gray) 581 : red(gray) 582 , green(gray) 583 , blue(gray) 584 { 585 } 586 Rgb24(const uint8_t & r,const uint8_t & g,const uint8_t & b)587 SIMD_INLINE Rgb24::Rgb24(const uint8_t & r, const uint8_t & g, const uint8_t & b) 588 : red(r) 589 , green(g) 590 , blue(b) 591 { 592 } 593 Rgb24(const Bgra32 & p)594 SIMD_INLINE Rgb24::Rgb24(const Bgra32 & p) 595 : red(p.red) 596 , green(p.green) 597 , blue(p.blue) 598 { 599 } 600 Rgb24(const Bgr24 & p)601 SIMD_INLINE Rgb24::Rgb24(const Bgr24 & p) 602 : red(p.red) 603 , green(p.green) 604 , blue(p.blue) 605 { 606 } 607 Rgb24(const Rgb24 & p)608 SIMD_INLINE Rgb24::Rgb24(const Rgb24 & p) 609 : red(p.red) 610 , green(p.green) 611 , blue(p.blue) 612 { 613 } 614 At(const View<A> & view,ptrdiff_t col,ptrdiff_t row)615 template <template<class> class A> SIMD_INLINE const Rgb24 & Rgb24::At(const View<A> & view, ptrdiff_t col, ptrdiff_t row) 616 { 617 assert(view.format == View<A>::Rgb24); 618 619 return Simd::At<A, Rgb24>(view, col, row); 620 } 621 At(View<A> & view,ptrdiff_t col,ptrdiff_t row)622 template <template<class> class A> SIMD_INLINE Rgb24 & Rgb24::At(View<A> & view, ptrdiff_t col, ptrdiff_t row) 623 { 624 assert(view.format == View<A>::Rgb24); 625 626 return Simd::At<A, Rgb24>(view, col, row); 627 } 628 } 629 } 630 631 #endif//__SimdPixel_hpp__ 632