Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: src/core/SkColorSpace.cpp

Issue 1995233003: Test color correction in DM (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« dm/DMSrcSink.cpp ('K') | « resources/monitor_profiles/HP_ZR30w.icc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "SkAtomics.h" 8 #include "SkAtomics.h"
9 #include "SkColorSpace.h" 9 #include "SkColorSpace.h"
10 #include "SkColorSpacePriv.h" 10 #include "SkColorSpacePriv.h"
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 bool load_matrix(SkMatrix44* toXYZ, const uint8_t* src, size_t len) { 596 bool load_matrix(SkMatrix44* toXYZ, const uint8_t* src, size_t len) {
597 if (len < 48) { 597 if (len < 48) {
598 SkColorSpacePrintf("Matrix tag is too small (%d bytes).", len); 598 SkColorSpacePrintf("Matrix tag is too small (%d bytes).", len);
599 return false; 599 return false;
600 } 600 }
601 601
602 float array[16]; 602 float array[16];
603 array[ 0] = SkFixedToFloat(read_big_endian_int(src)); 603 array[ 0] = SkFixedToFloat(read_big_endian_int(src));
604 array[ 1] = SkFixedToFloat(read_big_endian_int(src + 4)); 604 array[ 1] = SkFixedToFloat(read_big_endian_int(src + 4));
605 array[ 2] = SkFixedToFloat(read_big_endian_int(src + 8)); 605 array[ 2] = SkFixedToFloat(read_big_endian_int(src + 8));
606 array[ 3] = 0; 606 array[ 3] = SkFixedToFloat(read_big_endian_int(src + 36)); // translate R
607 array[ 4] = SkFixedToFloat(read_big_endian_int(src + 12)); 607 array[ 4] = SkFixedToFloat(read_big_endian_int(src + 12));
608 array[ 5] = SkFixedToFloat(read_big_endian_int(src + 16)); 608 array[ 5] = SkFixedToFloat(read_big_endian_int(src + 16));
609 array[ 6] = SkFixedToFloat(read_big_endian_int(src + 20)); 609 array[ 6] = SkFixedToFloat(read_big_endian_int(src + 20));
610 array[ 7] = 0; 610 array[ 7] = SkFixedToFloat(read_big_endian_int(src + 40)); // translate G
611 array[ 8] = SkFixedToFloat(read_big_endian_int(src + 24)); 611 array[ 8] = SkFixedToFloat(read_big_endian_int(src + 24));
612 array[ 9] = SkFixedToFloat(read_big_endian_int(src + 28)); 612 array[ 9] = SkFixedToFloat(read_big_endian_int(src + 28));
613 array[10] = SkFixedToFloat(read_big_endian_int(src + 32)); 613 array[10] = SkFixedToFloat(read_big_endian_int(src + 32));
614 array[11] = 0; 614 array[11] = SkFixedToFloat(read_big_endian_int(src + 44)); // translate B
615 array[12] = SkFixedToFloat(read_big_endian_int(src + 36)); // translate R 615 array[12] = 0.0f;
616 array[13] = SkFixedToFloat(read_big_endian_int(src + 40)); // translate G 616 array[13] = 0.0f;
617 array[14] = SkFixedToFloat(read_big_endian_int(src + 44)); 617 array[14] = 0.0f;
618 array[15] = 1; 618 array[15] = 1.0f;
619 toXYZ->setColMajorf(array); 619 toXYZ->setColMajorf(array);
620 return true; 620 return true;
621 } 621 }
622 622
623 bool SkColorSpace::LoadA2B0(SkColorLookUpTable* colorLUT, SkGammaCurve* gammas, SkMatrix44* toXYZ, 623 bool SkColorSpace::LoadA2B0(SkColorLookUpTable* colorLUT, SkGammaCurve* gammas, SkMatrix44* toXYZ,
624 const uint8_t* src, size_t len) { 624 const uint8_t* src, size_t len) {
625 if (len < 32) { 625 if (len < 32) {
626 SkColorSpacePrintf("A to B tag is too small (%d bytes).", len); 626 SkColorSpacePrintf("A to B tag is too small (%d bytes).", len);
627 return false; 627 return false;
628 } 628 }
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 } 808 }
809 } 809 }
810 810
811 } 811 }
812 default: 812 default:
813 break; 813 break;
814 } 814 }
815 815
816 return_null("ICC profile contains unsupported colorspace"); 816 return_null("ICC profile contains unsupported colorspace");
817 } 817 }
OLDNEW
« dm/DMSrcSink.cpp ('K') | « resources/monitor_profiles/HP_ZR30w.icc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698