Image.st
changeset 8230 3eeacf3dcff3
parent 8222 194b512106a2
child 8231 30e4e9fe2670
--- a/Image.st	Wed Nov 29 17:44:19 2017 +0100
+++ b/Image.st	Thu Dec 07 10:07:19 2017 +0100
@@ -14735,8 +14735,7 @@
      The implementation below is generic and slow
      - this method is typically redefined in subclasses."
 
-    |p maxPixel clr r g b c m y k a
-     numRedBits numGreenBits numBlueBits numAlphaBits|
+    |p maxPixel clr r g b c m y k a numRedBits numGreenBits numBlueBits numAlphaBits|
 
     p := photometric.
     p isNil ifTrue:[
@@ -14832,10 +14831,22 @@
         ^ Color cyan:c magenta:m yellow:y.
     ].
 
+"/    p == #YCbCr ifTrue:[
+"/        samplesPerPixel == 3 ifTrue:[
+"/            depth == 24 ifTrue:[
+"/                (#[8 8 8] isSameSequenceAs:bitsPerSample)ifTrue:[
+"/                    ^ Color yByte:((pixelValue rightShift:16) bitAnd:16rFF) 
+"/                            cbByte:((pixelValue rightShift:8) bitAnd:16rFF) 
+"/                            crByte:(pixelValue bitAnd:16rFF).
+"/                ].
+"/            ].
+"/        ].
+"/    ].
+
     self error:'invalid (unsupported) photometric'
 
     "Created: / 08-06-1996 / 08:46:18 / cg"
-    "Modified: / 22-08-2017 / 16:58:39 / cg"
+    "Modified: / 07-12-2017 / 10:06:20 / cg"
 !
 
 cyanComponentOfCMY:pixel