OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkCodec.h" | 8 #include "SkCodec.h" |
9 #include "SkCodecPriv.h" | 9 #include "SkCodecPriv.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 SkAutoTMalloc<uint8_t> srcRow(width * 3); | 501 SkAutoTMalloc<uint8_t> srcRow(width * 3); |
502 | 502 |
503 dng_pixel_buffer buffer; | 503 dng_pixel_buffer buffer; |
504 buffer.fData = &srcRow[0]; | 504 buffer.fData = &srcRow[0]; |
505 buffer.fPlane = 0; | 505 buffer.fPlane = 0; |
506 buffer.fPlanes = 3; | 506 buffer.fPlanes = 3; |
507 buffer.fColStep = buffer.fPlanes; | 507 buffer.fColStep = buffer.fPlanes; |
508 buffer.fPlaneStep = 1; | 508 buffer.fPlaneStep = 1; |
509 buffer.fPixelType = ttByte; | 509 buffer.fPixelType = ttByte; |
510 buffer.fPixelSize = sizeof(uint8_t); | 510 buffer.fPixelSize = sizeof(uint8_t); |
511 buffer.fRowStep = sizeof(srcRow); | 511 buffer.fRowStep = width * 3; |
512 | 512 |
513 for (int i = 0; i < height; ++i) { | 513 for (int i = 0; i < height; ++i) { |
514 buffer.fArea = dng_rect(i, 0, i + 1, width); | 514 buffer.fArea = dng_rect(i, 0, i + 1, width); |
515 | 515 |
516 try { | 516 try { |
517 image->Get(buffer, dng_image::edge_zero); | 517 image->Get(buffer, dng_image::edge_zero); |
518 } catch (...) { | 518 } catch (...) { |
519 *rowsDecoded = i; | 519 *rowsDecoded = i; |
520 return kIncompleteInput; | 520 return kIncompleteInput; |
521 } | 521 } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 SkISize sizeFloor = this->onGetScaledDimensions(1.f / std::floor(fullShortEd
ge / shortEdge)); | 559 SkISize sizeFloor = this->onGetScaledDimensions(1.f / std::floor(fullShortEd
ge / shortEdge)); |
560 SkISize sizeCeil = this->onGetScaledDimensions(1.f / std::ceil(fullShortEdge
/ shortEdge)); | 560 SkISize sizeCeil = this->onGetScaledDimensions(1.f / std::ceil(fullShortEdge
/ shortEdge)); |
561 return sizeFloor == dim || sizeCeil == dim; | 561 return sizeFloor == dim || sizeCeil == dim; |
562 } | 562 } |
563 | 563 |
564 SkRawCodec::~SkRawCodec() {} | 564 SkRawCodec::~SkRawCodec() {} |
565 | 565 |
566 SkRawCodec::SkRawCodec(SkDngImage* dngImage) | 566 SkRawCodec::SkRawCodec(SkDngImage* dngImage) |
567 : INHERITED(dngImage->getImageInfo(), nullptr) | 567 : INHERITED(dngImage->getImageInfo(), nullptr) |
568 , fDngImage(dngImage) {} | 568 , fDngImage(dngImage) {} |
OLD | NEW |