Duff Goldman and his two Smurf cakes at the world premiere of “The Smurfs 2” in 2013. (Jordan Strauss/Invision/AP)

Duff Goldman knows cake art.

Since launching Charm City Cakes in 2002, the “Ace of Cakes” star has sold tens of thousands of fantastical, towering tiers of goodness: President Obama’s 2012 inauguration cake, a Hogwarts Harry Potter cake, a pair of Smurf cakes, even a life-size NASCAR cake.

By any conventional standard, Goldman is an artist when it comes to cake. And he's willing and able to make anything. Well, almost anything.

“There was one time someone wanted something really obscene,” says Goldman. “They wanted their wedding cake to include a sex toy.”

This posed a dilemma: Not a moral issue, per se, but one of good taste. “I sat them down and said, ‘Listen, it’s great you are who you are, but your grandma is going to be there,’ ” he says. The couple reconsidered, and the cake displayed at the wedding reception was more romantic than raunchy. “But if they had insisted, I would have made it for them,” Goldman says.

Is Goldman really an artist? Or is he just a really good baker?

That’s the question of the moment in the world of cake decorating, thanks to the Masterpiece Cakeshop case coming to the Supreme Court next week.

In 2012, Charlie Craig and David Mullins walked into the small bakery in Lakewood, Colo., looking for a wedding cake. Owner Jack Phillips, by all accounts a very talented cake decorator, told the gay couple that he couldn’t make it because it would violate his religious beliefs.

The couple filed a complaint, and the Colorado Civil Rights Commission found that Phillips had discriminated based on sexual orientation. Now lawyers will argue whether Phillips’s edible artistry is protected under the First Amendment — cakes as his form of free speech — or whether it’s just, well, cake.

An elaborate wedding cake featuring three-dimensional tulip decorations by Sylvia Weinstock. (Monika Graff/Getty Images)

Anyone who's spent any time around cake decorators or watched cake competitions on television knows the crazy amount of time, talent and detail that go into making some of these insanely creative confections. And the most spectacular are wedding cakes, the centerpiece of most bridal celebrations and the bread-and-butter, so to speak, of a thriving cake business.

Americans spent an average of $582 last year for a simple three-tiered wedding cake, but custom designer cakes by acclaimed decorators can be six-foot engineering marvels and run into thousands of dollars.

What separates the professionals from the amateurs is the dazzling designs. Cake legends such as Sylvia Weinstock or Ron Ben-Israel are renowned for their intricate sugar flowers — a single bloom can take an hour to produce. Washington decorator Maggie Austin handpaints her exquisite creations with food coloring. Goldman has created cakes in the shape of dogs, dragons, monsters and anything else you can imagine, replicating fur and glass in sugar and cake.

Ron Ben-Israel with a cake covered in his signature sugar flowers. (Jason Kempin/Getty Images for City Harvest)

As with any artists, their styles range from elegant to edgy to "how did they do that?" There's a global industry devoted to cake art — courses and schools, magazines, cake-decorating books and constantly evolving techniques and effects. Last year, brides went crazy for geode cakes, which had what looked like actual crystals cascading down the sides.

Rebekah Wilbur, managing editor of American Cake Decorating magazine and owner of a custom-cake business in Virginia, knows a lot of cake designers, including herself, who are "fiercely protective of the idea that they are artists," she says. "They are an artist first, and a cake designer or a baker second, because everything they do has their stamp on it." That original cake designs cannot be copyrighted is a source of real frustration for many decorators.

At the same time, many of these artists are also business owners and have strong feelings about turning away customers based on any personal beliefs.

“We all share a common passion, but behind that are so many divisions — both political and religious,” explains Wilbur, who says that the Masterpiece Cakeshop case has been “very divisive in the industry.”

“This is one of those areas that thrusts the underbelly to the fore,” she says, “and we’re all forced to deal with how we feel about things and take a side.”

And so the intersection of cake and art is complicated, to say the least.

Masterpiece Cakeshop owner Jack Phillips decorates a simple single-tier cake in his store in Lakewood, Colo., in 2014. (Brennan Linsley/AP)

Everyone in the industry — bakers, decorators, wedding planners and more — has been following the case, and a number of amicus curiae briefs have been submitted to the court, supporting either Phillips or the couple.

One influential brief, signed by 222 celebrity bakers and chefs (including Goldman, Georgetown Cupcake’s Sophie LaMontagne and Katherine Berman, Momofuku’s Christina Tosi, José Andrés, Anthony Bourdain, Tom Colicchio, Carla Hall and Padma Lakshmi) maintains that no food, not even dishes prepared by a three-star chef, is art or protected by the First Amendment.

Goldman, maybe the most famous cake decorator in the country, wrote an essay in People magazine last month arguing that what he creates is not really art.

“It’s cake,” he reasserts in a phone interview. “I make art out of a cake, but at the end of the day it’s a cake. It’s dessert.”

Washington cake artist B. Keith Ryder made custom cakes for 17 years, including birthday cakes for Supreme Court Justices Ruth Bader Ginsburg and Antonin Scalia. (Hers was black with lace trim, his had camouflage and a duck decoy.) As a past president of the International Cake Exploration Societé, he knows the most talented cake decorators in the United States — and yes, some of them are real divas. But artists?

It’s a hard question, he acknowledges. The case has forced decorators to think about their craft in ways they never did before.

“My feeling is that there is a lot of artistry and artisanship that goes into making custom cakes, but I’m not sure that qualifies the final product as a piece of art,” Ryder says. “In the end, it’s still a commodity whose primary purpose is to be eaten.”

Other bakers disagree; a group of decorators in the South filed a brief supporting neither side but asserting that cake artists deserve as much protection for their work as artists using more traditional media.

The Trump administration, meanwhile, filed a brief in support of Phillips, saying that what the baker creates is art, and that art sends a message.

“Just as a painter does more than simply apply paint to a canvas, a baker of a custom wedding cake does more than simply mix together eggs, flour, and sugar: Both apply their artistic talents and viewpoints to the endeavor,” reads the brief. And anyone at the wedding, argues the Justice Department, could easily assume that Phillips approves of the union by agreeing to make the cake.

The arguments for both sides extend far beyond the cake world. A ruling in favor of Masterpiece Cakeshop, say Phillips’s supporters, would allow business owners to freely exercise their religious beliefs in the workplace. Critics claim that a ruling for the baker would open the door for any business — jewelers, florists, wedding photographers, etc. — to refuse service to gay couples and others, regardless of preexisting discrimination laws.

And then there are decorators who don’t want anything to do with the debate for fear of alienating potential customers. They just want to sell cakes.

Duff Goldman, right, with his NASCAR cake. Yes, the car is a cake.)

No baker, of course, can be forced to create anything a customer requests. Phillips says that he "honors God" with his cakes and doesn't sell any with alcohol, with a Halloween theme, or celebrating divorce.

And that’s okay, says Human Rights Campaign Legal Director Sarah Warbelow. “As long as Jack is refusing to provide a service to anyone who walks through the door, that’s fine,” she says. “That’s part of his artistic control over the products he makes.”

So any baker can refuse to make an erotic cake for a bachelorette party, or one with offensive symbols — say, a swastika — as long as he or she doesn’t sell them to any other customer.

Phillips, however, was selling wedding cakes to opposite-sex couples but not same-sex couples, which the state said violates public accommodation laws that prevent discrimination based on gender, race, religion and sexual orientation. Colorado officials gave Phillips a choice: treat all requests for wedding cakes equally, or stop selling them entirely.

Phillips decided to stop making custom wedding cakes, which he says cut his business by 40 percent. The case wound its way through state and federal courts, and the Supreme Court agreed to hear it in June.

Masterpiece Cakeshop v. Colorado Civil Rights Commission will be argued on Tuesday. The chambers are likely to be packed, and yes, it's a good bet that someone will show up with a cake for the occasion.