   __host__ __device__ CostEvaluator(int width, int height,
                                     Placement::CostFunctionWeights weights,
                                     unsigned char labelShadowValue,
-                                    unsigned int connectorShadowValue)
+                                    unsigned char connectorShadowValue,
+                                    unsigned char anchorConstraintValue)
     : width(width), height(height), weights(weights),
       labelShadowValue(labelShadowValue),
-      connectorShadowValue(connectorShadowValue)
+      connectorShadowValue(connectorShadowValue),
+      anchorConstraintValue(anchorConstraintValue)
   {
   }
 


  CostEvaluator costEvaluator(textureWidth, textureHeight, weights,
                              Placement::labelShadowValue,
                              Placement::connectorShadowValue);
  costEvaluator.anchorX = anchorX * widthFactor;
  costEvaluator.anchorY = anchorY * heightFactor;
  costEvaluator.occupancy =


    unsigned char labelShadow = constraintValue & labelShadowValue;
    unsigned char connectorShadow = constraintValue & connectorShadowValue;
    unsigned char anchorConstraint = constraintValue & anchorConstraintValue;

    float cost = weights.labelShadowConstraint * labelShadow +
                 weights.connectorShadowConstraint * connectorShadow +
                 weights.anchorConstraint * anchorConstraint +
                 weights.occupancy * occupancyForLabelArea(x, y) +
                 weights.distanceToAnchor * distanceToAnchor +
                 weights.favorHorizontalOrVerticalLines *
