DeMar DeRozan plans to opt out of his $10 million contract next season with the Toronto Raptors, according to a source.

The Brooklyn Nets figure to pursue DeRozan in free agency.

“I can tell you he’ll opt out. But how he feels about Brooklyn — or anybody else — I can’t say. Only he can answer that,’’ said the source, who added that DeRozan feels he’s been treated well by the Raptors and “has a trait that’s been lost by so many players. It’s called loyalty.”

DeRozan is averaging 22.9 points per game.